From 98ae768ef064c9d90c98954d71db7123bad66223 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Mon, 25 Sep 2023 14:50:49 -0500 Subject: [PATCH 01/84] Revert "core/services/chainlink: log warn instead of error if CSA key not available for feeds service (#10543)" (#10782) This reverts commit 73966ef5dd383aca7e97747d75f6c58a20f84cce. --- core/services/chainlink/application.go | 42 ++++++++++++-------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index 7b4a4eac774..814c8a1c10b 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -421,30 +421,26 @@ func NewApplication(opts ApplicationOpts) (Application, error) { } } - var feedsService feeds.Service = &feeds.NullService{} + var feedsService feeds.Service if cfg.Feature().FeedsManager() { - if keys, err := opts.KeyStore.CSA().GetAll(); err != nil { - globalLogger.Warn("[Feeds Service] Unable to start without CSA key", "err", err) - } else if len(keys) == 0 { - globalLogger.Warn("[Feeds Service] Unable to start without CSA key") - } else { - feedsORM := feeds.NewORM(db, opts.Logger, cfg.Database()) - feedsService = feeds.NewService( - feedsORM, - jobORM, - db, - jobSpawner, - keyStore, - cfg.Insecure(), - cfg.JobPipeline(), - cfg.OCR(), - cfg.OCR2(), - cfg.Database(), - legacyEVMChains, - globalLogger, - opts.Version, - ) - } + feedsORM := feeds.NewORM(db, opts.Logger, cfg.Database()) + feedsService = feeds.NewService( + feedsORM, + jobORM, + db, + jobSpawner, + keyStore, + cfg.Insecure(), + cfg.JobPipeline(), + cfg.OCR(), + cfg.OCR2(), + cfg.Database(), + legacyEVMChains, + globalLogger, + opts.Version, + ) + } else { + feedsService = &feeds.NullService{} } for _, s := range srvcs { From 6dc2b6d94ef009e60ef93a560a373b743b175cd6 Mon Sep 17 00:00:00 2001 From: chudilka1 Date: Mon, 25 Sep 2023 22:51:43 +0300 Subject: [PATCH 02/84] Fix, move version 2.5.0 in changelog from unreleased (#10738) --- docs/CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f0b83bf7574..6836e168543 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -33,9 +33,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `chainlink txs evm create` returns a transaction hash for the attempted transaction in the CLI. Previously only the sender, recipient and `unstarted` state were returned. - Fixed a bug where `evmChainId` is requested instead of `id` or `evm-chain-id` in CLI error verbatim - Fixed a bug that would cause the node to shut down while performing backup -- Fixed health checker to include more services in the prometheus `health` metric and HTTP `/health` endpoint +- Fixed health checker to include more services in the prometheus `health` metric and HTTP `/health` endpoint -## 2.5.0 - UNRELEASED + + +## 2.5.0 - 2023-09-13 - Unauthenticated users executing CLI commands previously generated a confusing error log, which is now removed: ``` @@ -51,8 +53,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `mercury_price_feed_errors` Nops may wish to add alerting on these. - - ### Upcoming Required Configuration Change - Starting in 2.6.0, chainlink nodes will no longer allow insecure configuration for production builds. Any TOML configuration that sets the following line will fail validation checks in `node start` or `node validate`: From 13f4986fd17674a48df108c7fe19e00801640743 Mon Sep 17 00:00:00 2001 From: krehermann Date: Mon, 25 Sep 2023 13:53:31 -0600 Subject: [PATCH 03/84] BCF-2508: cleanup evm config for chain, relayer, and relayer factory (#10767) * BCF-2508: cleanup evm config for chain, relayer, and relayer factory * address comments - simplify validation and error creation --- core/chains/evm/chain.go | 61 ++++++++++----- core/chains/evm/chain_test.go | 51 +++++++++++++ core/cmd/shell.go | 4 +- core/cmd/shell_local_test.go | 15 ++-- core/cmd/shell_test.go | 4 - core/internal/cltest/cltest.go | 7 +- core/internal/testutils/evmtest/evmtest.go | 4 +- .../chainlink/relayer_chain_interoperators.go | 6 +- .../relayer_chain_interoperators_test.go | 14 ++-- core/services/chainlink/relayer_factory.go | 72 ++++++++++++++---- core/services/feeds/service_test.go | 2 +- core/services/job/spawner_test.go | 11 ++- core/services/relay/evm/evm.go | 75 +++++++++++++------ core/services/relay/evm/evm_test.go | 68 +++++++++++++++++ core/services/relay/evm/relayer_extender.go | 14 ++-- 15 files changed, 315 insertions(+), 93 deletions(-) create mode 100644 core/services/relay/evm/evm_test.go diff --git a/core/chains/evm/chain.go b/core/chains/evm/chain.go index 6a948a4cdd0..8704d0c1fc8 100644 --- a/core/chains/evm/chain.go +++ b/core/chains/evm/chain.go @@ -142,22 +142,34 @@ type AppConfig interface { type ChainRelayExtenderConfig struct { Logger logger.Logger - DB *sqlx.DB KeyStore keystore.Eth - *RelayerConfig + ChainOpts } -// options for the relayer factory. -// TODO BCF-2508 clean up configuration of chain and relayer after BCF-2440 -// the factory wants to own the logger and db -// the factory creates extenders, which need the same and more opts -type RelayerConfig struct { +func (c ChainRelayExtenderConfig) Validate() error { + err := c.ChainOpts.Validate() + if c.Logger == nil { + err = errors.Join(err, errors.New("nil Logger")) + } + if c.KeyStore == nil { + err = errors.Join(err, errors.New("nil Keystore")) + } + + if err != nil { + err = fmt.Errorf("invalid ChainRelayerExtenderConfig: %w", err) + } + return err +} + +type ChainOpts struct { AppConfig AppConfig EventBroadcaster pg.EventBroadcaster MailMon *utils.MailboxMonitor GasEstimator gas.EvmFeeEstimator + *sqlx.DB + // TODO BCF-2513 remove test code from the API // Gen-functions are useful for dependency injection by tests GenEthClient func(*big.Int) client.Client @@ -168,7 +180,31 @@ type RelayerConfig struct { GenGasEstimator func(*big.Int) gas.EvmFeeEstimator } +func (o ChainOpts) Validate() error { + var err error + if o.AppConfig == nil { + err = errors.Join(err, errors.New("nil AppConfig")) + } + if o.EventBroadcaster == nil { + err = errors.Join(err, errors.New("nil EventBroadcaster")) + } + if o.MailMon == nil { + err = errors.Join(err, errors.New("nil MailMon")) + } + if o.DB == nil { + err = errors.Join(err, errors.New("nil DB")) + } + if err != nil { + err = fmt.Errorf("invalid ChainOpts: %w", err) + } + return err +} + func NewTOMLChain(ctx context.Context, chain *toml.EVMConfig, opts ChainRelayExtenderConfig) (Chain, error) { + err := opts.Validate() + if err != nil { + return nil, err + } chainID := chain.ChainID l := opts.Logger.With("evmChainID", chainID.String()) if !chain.IsEnabled() { @@ -458,14 +494,3 @@ func newPrimary(cfg evmconfig.NodePool, noNewHeadsThreshold time.Duration, lggr return evmclient.NewNode(cfg, noNewHeadsThreshold, lggr, (url.URL)(*n.WSURL), (*url.URL)(n.HTTPURL), *n.Name, id, chainID, *n.Order), nil } - -func (opts *ChainRelayExtenderConfig) Check() error { - if opts.Logger == nil { - return errors.New("logger must be non-nil") - } - if opts.AppConfig == nil { - return errors.New("config must be non-nil") - } - - return nil -} diff --git a/core/chains/evm/chain_test.go b/core/chains/evm/chain_test.go index 41f498b3e76..09395ff4c97 100644 --- a/core/chains/evm/chain_test.go +++ b/core/chains/evm/chain_test.go @@ -4,11 +4,15 @@ import ( "math/big" "testing" + "github.com/smartcontractkit/sqlx" "github.com/stretchr/testify/assert" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/mocks" configtest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest/v2" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/services/pg" + "github.com/smartcontractkit/chainlink/v2/core/utils" ) func TestLegacyChains(t *testing.T) { @@ -25,3 +29,50 @@ func TestLegacyChains(t *testing.T) { assert.Equal(t, c, got) } + +func TestChainOpts_Validate(t *testing.T) { + type fields struct { + AppConfig evm.AppConfig + EventBroadcaster pg.EventBroadcaster + MailMon *utils.MailboxMonitor + DB *sqlx.DB + } + tests := []struct { + name string + fields fields + wantErr bool + }{ + { + name: "valid", + fields: fields{ + AppConfig: configtest.NewTestGeneralConfig(t), + EventBroadcaster: pg.NewNullEventBroadcaster(), + MailMon: &utils.MailboxMonitor{}, + DB: pgtest.NewSqlxDB(t), + }, + }, + { + name: "invalid", + fields: fields{ + AppConfig: nil, + EventBroadcaster: nil, + MailMon: nil, + DB: nil, + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + o := evm.ChainOpts{ + AppConfig: tt.fields.AppConfig, + EventBroadcaster: tt.fields.EventBroadcaster, + MailMon: tt.fields.MailMon, + DB: tt.fields.DB, + } + if err := o.Validate(); (err != nil) != tt.wantErr { + t.Errorf("ChainOpts.Validate() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/core/cmd/shell.go b/core/cmd/shell.go index 2a771a83587..20ad3dec107 100644 --- a/core/cmd/shell.go +++ b/core/cmd/shell.go @@ -153,15 +153,13 @@ func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.G // create the relayer-chain interoperators from application configuration relayerFactory := chainlink.RelayerFactory{ Logger: appLggr, - DB: db, - QConfig: cfg.Database(), LoopRegistry: loopRegistry, GRPCOpts: grpcOpts, } evmFactoryCfg := chainlink.EVMFactoryConfig{ CSAETHKeystore: keyStore, - RelayerConfig: &evm.RelayerConfig{AppConfig: cfg, EventBroadcaster: eventBroadcaster, MailMon: mailMon}, + ChainOpts: evm.ChainOpts{AppConfig: cfg, EventBroadcaster: eventBroadcaster, MailMon: mailMon, DB: db}, } // evm always enabled for backward compatibility // TODO BCF-2510 this needs to change in order to clear the path for EVM extraction diff --git a/core/cmd/shell_local_test.go b/core/cmd/shell_local_test.go index 8d2b5f1fabf..691e5faa923 100644 --- a/core/cmd/shell_local_test.go +++ b/core/cmd/shell_local_test.go @@ -42,13 +42,11 @@ import ( func genTestEVMRelayers(t *testing.T, opts evm.ChainRelayExtenderConfig, ks evmrelayer.CSAETHKeystore) *chainlink.CoreRelayerChainInteroperators { f := chainlink.RelayerFactory{ Logger: opts.Logger, - DB: opts.DB, - QConfig: opts.AppConfig.Database(), LoopRegistry: plugins.NewLoopRegistry(opts.Logger), } relayers, err := chainlink.NewCoreRelayerChainInteroperators(chainlink.InitEVM(testutils.Context(t), f, chainlink.EVMFactoryConfig{ - RelayerConfig: opts.RelayerConfig, + ChainOpts: opts.ChainOpts, CSAETHKeystore: ks, })) if err != nil { @@ -87,12 +85,12 @@ func TestShell_RunNodeWithPasswords(t *testing.T) { opts := evm.ChainRelayExtenderConfig{ Logger: lggr, - DB: db, KeyStore: keyStore.Eth(), - RelayerConfig: &evm.RelayerConfig{ + ChainOpts: evm.ChainOpts{ AppConfig: cfg, EventBroadcaster: pg.NewNullEventBroadcaster(), MailMon: &utils.MailboxMonitor{}, + DB: db, }, } testRelayers := genTestEVMRelayers(t, opts, keyStore) @@ -191,13 +189,12 @@ func TestShell_RunNodeWithAPICredentialsFile(t *testing.T) { lggr := logger.TestLogger(t) opts := evm.ChainRelayExtenderConfig{ Logger: lggr, - DB: db, KeyStore: keyStore.Eth(), - RelayerConfig: &evm.RelayerConfig{ + ChainOpts: evm.ChainOpts{ AppConfig: cfg, EventBroadcaster: pg.NewNullEventBroadcaster(), - - MailMon: &utils.MailboxMonitor{}, + MailMon: &utils.MailboxMonitor{}, + DB: db, }, } testRelayers := genTestEVMRelayers(t, opts, keyStore) diff --git a/core/cmd/shell_test.go b/core/cmd/shell_test.go index 45192392f6d..c74a0067a68 100644 --- a/core/cmd/shell_test.go +++ b/core/cmd/shell_test.go @@ -370,8 +370,6 @@ func TestSetupSolanaRelayer(t *testing.T) { rf := chainlink.RelayerFactory{ Logger: lggr, - DB: pgtest.NewSqlxDB(t), - QConfig: tConfig.Database(), LoopRegistry: reg, } @@ -457,8 +455,6 @@ func TestSetupStarkNetRelayer(t *testing.T) { }) rf := chainlink.RelayerFactory{ Logger: lggr, - DB: pgtest.NewSqlxDB(t), - QConfig: tConfig.Database(), LoopRegistry: reg, } diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index 1c5d1ed5bbb..671d4072816 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -386,17 +386,16 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn relayerFactory := chainlink.RelayerFactory{ Logger: lggr, - DB: db, - QConfig: cfg.Database(), LoopRegistry: loopRegistry, GRPCOpts: loop.GRPCOpts{}, } evmOpts := chainlink.EVMFactoryConfig{ - RelayerConfig: &evm.RelayerConfig{ + ChainOpts: evm.ChainOpts{ AppConfig: cfg, EventBroadcaster: eventBroadcaster, MailMon: mailMon, + DB: db, }, CSAETHKeystore: keyStore, } @@ -423,6 +422,8 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn Keystore: keyStore.Cosmos(), CosmosConfigs: cfg.CosmosConfigs(), EventBroadcaster: eventBroadcaster, + DB: db, + QConfig: cfg.Database(), } initOps = append(initOps, chainlink.InitCosmos(testCtx, relayerFactory, cosmosCfg)) } diff --git a/core/internal/testutils/evmtest/evmtest.go b/core/internal/testutils/evmtest/evmtest.go index 62696f75d96..2a86101d0d8 100644 --- a/core/internal/testutils/evmtest/evmtest.go +++ b/core/internal/testutils/evmtest/evmtest.go @@ -82,13 +82,13 @@ func NewChainRelayExtOpts(t testing.TB, testopts TestChainOpts) evm.ChainRelayEx require.NotNil(t, testopts.KeyStore) opts := evm.ChainRelayExtenderConfig{ Logger: logger.TestLogger(t), - DB: testopts.DB, KeyStore: testopts.KeyStore, - RelayerConfig: &evm.RelayerConfig{ + ChainOpts: evm.ChainOpts{ AppConfig: testopts.GeneralConfig, EventBroadcaster: pg.NewNullEventBroadcaster(), MailMon: testopts.MailMon, GasEstimator: testopts.GasEstimator, + DB: testopts.DB, }, } opts.GenEthClient = func(*big.Int) evmclient.Client { diff --git a/core/services/chainlink/relayer_chain_interoperators.go b/core/services/chainlink/relayer_chain_interoperators.go index 1a0dbadd266..6513184d9ec 100644 --- a/core/services/chainlink/relayer_chain_interoperators.go +++ b/core/services/chainlink/relayer_chain_interoperators.go @@ -90,9 +90,9 @@ func NewCoreRelayerChainInteroperators(initFuncs ...CoreRelayerChainInitFunc) (* srvs: make([]services.ServiceCtx, 0), } for _, initFn := range initFuncs { - err2 := initFn(cr) - if err2 != nil { - return nil, err2 + err := initFn(cr) + if err != nil { + return nil, err } } return cr, nil diff --git a/core/services/chainlink/relayer_chain_interoperators_test.go b/core/services/chainlink/relayer_chain_interoperators_test.go index 9cfe354fe91..527dacd56d8 100644 --- a/core/services/chainlink/relayer_chain_interoperators_test.go +++ b/core/services/chainlink/relayer_chain_interoperators_test.go @@ -174,8 +174,6 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { factory := chainlink.RelayerFactory{ Logger: lggr, - DB: db, - QConfig: cfg.Database(), LoopRegistry: plugins.NewLoopRegistry(lggr), GRPCOpts: loop.GRPCOpts{}, } @@ -207,10 +205,11 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { {name: "2 evm chains with 3 nodes", initFuncs: []chainlink.CoreRelayerChainInitFunc{ chainlink.InitEVM(testctx, factory, chainlink.EVMFactoryConfig{ - RelayerConfig: &evm.RelayerConfig{ + ChainOpts: evm.ChainOpts{ AppConfig: cfg, EventBroadcaster: pg.NewNullEventBroadcaster(), MailMon: &utils.MailboxMonitor{}, + DB: db, }, CSAETHKeystore: keyStore, }), @@ -262,7 +261,9 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { chainlink.InitCosmos(testctx, factory, chainlink.CosmosFactoryConfig{ Keystore: keyStore.Cosmos(), CosmosConfigs: cfg.CosmosConfigs(), - EventBroadcaster: pg.NewNullEventBroadcaster()}), + EventBroadcaster: pg.NewNullEventBroadcaster(), + DB: db, + QConfig: cfg.Database()}), }, expectedCosmosChainCnt: 2, expectedCosmosNodeCnt: 2, @@ -279,10 +280,11 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Keystore: keyStore.Solana(), SolanaConfigs: cfg.SolanaConfigs()}), chainlink.InitEVM(testctx, factory, chainlink.EVMFactoryConfig{ - RelayerConfig: &evm.RelayerConfig{ + ChainOpts: evm.ChainOpts{ AppConfig: cfg, EventBroadcaster: pg.NewNullEventBroadcaster(), MailMon: &utils.MailboxMonitor{}, + DB: db, }, CSAETHKeystore: keyStore, }), @@ -293,6 +295,8 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Keystore: keyStore.Cosmos(), CosmosConfigs: cfg.CosmosConfigs(), EventBroadcaster: pg.NewNullEventBroadcaster(), + DB: db, + QConfig: cfg.Database(), }), }, expectedEVMChainCnt: 2, diff --git a/core/services/chainlink/relayer_factory.go b/core/services/chainlink/relayer_factory.go index 0a0d653f5fc..c0541f4384d 100644 --- a/core/services/chainlink/relayer_factory.go +++ b/core/services/chainlink/relayer_factory.go @@ -2,9 +2,11 @@ package chainlink import ( "context" + "errors" "fmt" "github.com/pelletier/go-toml/v2" + "github.com/smartcontractkit/sqlx" pkgcosmos "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos" @@ -27,14 +29,12 @@ import ( type RelayerFactory struct { logger.Logger - *sqlx.DB - pg.QConfig *plugins.LoopRegistry loop.GRPCOpts } type EVMFactoryConfig struct { - *evm.RelayerConfig + evm.ChainOpts evmrelay.CSAETHKeystore } @@ -45,10 +45,9 @@ func (r *RelayerFactory) NewEVM(ctx context.Context, config EVMFactoryConfig) (m // override some common opts with the factory values. this seems weird... maybe other signatures should change, or this should take a different type... ccOpts := evm.ChainRelayExtenderConfig{ - Logger: r.Logger.Named("EVM"), - DB: r.DB, - KeyStore: config.CSAETHKeystore.Eth(), - RelayerConfig: config.RelayerConfig, + Logger: r.Logger.Named("EVM"), + KeyStore: config.CSAETHKeystore.Eth(), + ChainOpts: config.ChainOpts, } evmRelayExtenders, err := evmrelay.NewChainRelayerExtenders(ctx, ccOpts) @@ -58,15 +57,28 @@ func (r *RelayerFactory) NewEVM(ctx context.Context, config EVMFactoryConfig) (m legacyChains := evmrelay.NewLegacyChainsFromRelayerExtenders(evmRelayExtenders) for _, ext := range evmRelayExtenders.Slice() { relayID := relay.ID{Network: relay.EVM, ChainID: relay.ChainID(ext.Chain().ID().String())} - chain, err := legacyChains.Get(relayID.ChainID) - if err != nil { - return nil, err + chain, err2 := legacyChains.Get(relayID.ChainID) + if err2 != nil { + return nil, err2 + } + + relayerOpts := evmrelay.RelayerOpts{ + DB: ccOpts.DB, + QConfig: ccOpts.AppConfig.Database(), + CSAETHKeystore: config.CSAETHKeystore, + EventBroadcaster: ccOpts.EventBroadcaster, } - relayer := evmrelay.NewLoopRelayServerAdapter(evmrelay.NewRelayer(ccOpts.DB, chain, r.QConfig, ccOpts.Logger, config.CSAETHKeystore, ccOpts.EventBroadcaster), ext) - relayers[relayID] = relayer + relayer, err2 := evmrelay.NewRelayer(ccOpts.Logger, chain, relayerOpts) + if err2 != nil { + err = errors.Join(err, err2) + continue + } + + relayers[relayID] = evmrelay.NewLoopRelayServerAdapter(relayer, ext) } - return relayers, nil + // always return err because it is accumulating individual errors + return relayers, err } type SolanaFactoryConfig struct { @@ -209,9 +221,39 @@ type CosmosFactoryConfig struct { Keystore keystore.Cosmos cosmos.CosmosConfigs EventBroadcaster pg.EventBroadcaster + *sqlx.DB + pg.QConfig +} + +func (c CosmosFactoryConfig) Validate() error { + var err error + if c.Keystore == nil { + err = errors.Join(err, fmt.Errorf("nil Keystore")) + } + if len(c.CosmosConfigs) == 0 { + err = errors.Join(err, fmt.Errorf("no CosmosConfigs provided")) + } + if c.EventBroadcaster == nil { + err = errors.Join(err, fmt.Errorf("nil EventBroadcaster")) + } + if c.DB == nil { + err = errors.Join(err, fmt.Errorf("nil DB")) + } + if c.QConfig == nil { + err = errors.Join(err, fmt.Errorf("nil QConfig")) + } + + if err != nil { + err = fmt.Errorf("invalid CosmosFactoryConfig: %w", err) + } + return err } func (r *RelayerFactory) NewCosmos(ctx context.Context, config CosmosFactoryConfig) (map[relay.ID]cosmos.LoopRelayerChainer, error) { + err := config.Validate() + if err != nil { + return nil, fmt.Errorf("cannot create Cosmos relayer: %w", err) + } relayers := make(map[relay.ID]cosmos.LoopRelayerChainer) var ( @@ -224,9 +266,9 @@ func (r *RelayerFactory) NewCosmos(ctx context.Context, config CosmosFactoryConf relayId := relay.ID{Network: relay.Cosmos, ChainID: relay.ChainID(*chainCfg.ChainID)} opts := cosmos.ChainOpts{ - QueryConfig: r.QConfig, + QueryConfig: config.QConfig, Logger: lggr.Named(relayId.ChainID), - DB: r.DB, + DB: config.DB, KeyStore: loopKs, EventBroadcaster: config.EventBroadcaster, } diff --git a/core/services/feeds/service_test.go b/core/services/feeds/service_test.go index db6497d11f6..85f14e407f8 100644 --- a/core/services/feeds/service_test.go +++ b/core/services/feeds/service_test.go @@ -180,7 +180,7 @@ func setupTestServiceCfg(t *testing.T, overrideCfg func(c *chainlink.Config, s * keyStore := new(ksmocks.Master) scopedConfig := evmtest.NewChainScopedConfig(t, gcfg) ethKeyStore := cltest.NewKeyStore(t, db, gcfg.Database()).Eth() - relayExtenders := evmtest.NewChainRelayExtenders(t, evmtest.TestChainOpts{GeneralConfig: gcfg, + relayExtenders := evmtest.NewChainRelayExtenders(t, evmtest.TestChainOpts{DB: db, GeneralConfig: gcfg, HeadTracker: headtracker.NullTracker, KeyStore: ethKeyStore}) legacyChains := evmrelay.NewLegacyChainsFromRelayerExtenders(relayExtenders) keyStore.On("Eth").Return(ethKeyStore) diff --git a/core/services/job/spawner_test.go b/core/services/job/spawner_test.go index 631f7ebfee9..7dbf811f783 100644 --- a/core/services/job/spawner_test.go +++ b/core/services/job/spawner_test.go @@ -284,7 +284,14 @@ func TestSpawner_CreateJobDeleteJob(t *testing.T) { legacyChains := evmrelay.NewLegacyChainsFromRelayerExtenders(relayExtenders) chain := evmtest.MustGetDefaultChain(t, legacyChains) - evmRelayer := evmrelayer.NewRelayer(testopts.DB, chain, testopts.GeneralConfig.Database(), lggr, keyStore, pg.NewNullEventBroadcaster()) + evmRelayer, err := evmrelayer.NewRelayer(lggr, chain, evmrelayer.RelayerOpts{ + DB: db, + QConfig: testopts.GeneralConfig.Database(), + CSAETHKeystore: keyStore, + EventBroadcaster: pg.NewNullEventBroadcaster(), + }) + assert.NoError(t, err) + testRelayGetter := &relayGetter{ e: relayExtenders.Slice()[0], r: evmRelayer, @@ -306,7 +313,7 @@ func TestSpawner_CreateJobDeleteJob(t *testing.T) { jobOCR2VRF.Type: delegateOCR2, }, db, lggr, nil) - err := spawner.CreateJob(jobOCR2VRF) + err = spawner.CreateJob(jobOCR2VRF) require.NoError(t, err) jobSpecID := jobOCR2VRF.ID delegateOCR2.jobID = jobOCR2VRF.ID diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index f1731b9c438..6ae2052c408 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -3,13 +3,14 @@ package evm import ( "context" "encoding/json" + "errors" "fmt" "strings" "sync" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" + pkgerrors "github.com/pkg/errors" "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median/evmreportcodec" @@ -61,17 +62,49 @@ type CSAETHKeystore interface { Eth() keystore.Eth } -func NewRelayer(db *sqlx.DB, chain evm.Chain, cfg pg.QConfig, lggr logger.Logger, ks CSAETHKeystore, eventBroadcaster pg.EventBroadcaster) *Relayer { +type RelayerOpts struct { + *sqlx.DB + pg.QConfig + CSAETHKeystore + pg.EventBroadcaster +} + +func (c RelayerOpts) Validate() error { + var err error + if c.DB == nil { + err = errors.Join(err, errors.New("nil DB")) + } + if c.QConfig == nil { + err = errors.Join(err, errors.New("nil QConfig")) + } + if c.CSAETHKeystore == nil { + err = errors.Join(err, errors.New("nil Keystore")) + } + if c.EventBroadcaster == nil { + err = errors.Join(err, errors.New("nil Eventbroadcaster")) + } + + if err != nil { + err = fmt.Errorf("invalid RelayerOpts: %w", err) + } + return err +} + +func NewRelayer(lggr logger.Logger, chain evm.Chain, opts RelayerOpts) (*Relayer, error) { + err := opts.Validate() + if err != nil { + return nil, fmt.Errorf("cannot create evm relayer: %w", err) + } lggr = lggr.Named("Relayer") return &Relayer{ - db: db, + db: opts.DB, chain: chain, lggr: lggr, - ks: ks, + ks: opts.CSAETHKeystore, mercuryPool: wsrpc.NewPool(lggr), - eventBroadcaster: eventBroadcaster, - pgCfg: cfg, - } + eventBroadcaster: opts.EventBroadcaster, + pgCfg: opts.QConfig, + }, nil } func (r *Relayer) Name() string { @@ -107,11 +140,11 @@ func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytype var mercuryConfig mercuryconfig.PluginConfig if err := json.Unmarshal(pargs.PluginConfig, &mercuryConfig); err != nil { - return nil, errors.WithStack(err) + return nil, pkgerrors.WithStack(err) } if relayConfig.FeedID == nil { - return nil, errors.New("FeedID must be specified") + return nil, pkgerrors.New("FeedID must be specified") } feedID := mercuryutils.FeedID(*relayConfig.FeedID) @@ -120,15 +153,15 @@ func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytype } configWatcher, err := newConfigProvider(r.lggr, r.chain, relayOpts, r.eventBroadcaster) if err != nil { - return nil, errors.WithStack(err) + return nil, pkgerrors.WithStack(err) } if !relayConfig.EffectiveTransmitterID.Valid { - return nil, errors.New("EffectiveTransmitterID must be specified") + return nil, pkgerrors.New("EffectiveTransmitterID must be specified") } privKey, err := r.ks.CSA().Get(relayConfig.EffectiveTransmitterID.String) if err != nil { - return nil, errors.Wrap(err, "failed to get CSA key for mercury connection") + return nil, pkgerrors.Wrap(err, "failed to get CSA key for mercury connection") } client, err := r.mercuryPool.Checkout(context.Background(), privKey, mercuryConfig.ServerPubKey, mercuryConfig.ServerURL()) @@ -190,7 +223,7 @@ func FilterNamesFromRelayArgs(args relaytypes.RelayArgs) (filterNames []string, } var relayConfig types.RelayConfig if err = json.Unmarshal(args.RelayConfig, &relayConfig); err != nil { - return nil, errors.WithStack(err) + return nil, pkgerrors.WithStack(err) } if relayConfig.FeedID != nil { @@ -289,13 +322,13 @@ func (c *configWatcher) ContractConfigTracker() ocrtypes.ContractConfigTracker { func newConfigProvider(lggr logger.Logger, chain evm.Chain, opts *types.RelayOpts, eventBroadcaster pg.EventBroadcaster) (*configWatcher, error) { if !common.IsHexAddress(opts.ContractID) { - return nil, errors.Errorf("invalid contractID, expected hex address") + return nil, pkgerrors.Errorf("invalid contractID, expected hex address") } aggregatorAddress := common.HexToAddress(opts.ContractID) contractABI, err := abi.JSON(strings.NewReader(ocr2aggregator.OCR2AggregatorMetaData.ABI)) if err != nil { - return nil, errors.Wrap(err, "could not get contract ABI JSON") + return nil, pkgerrors.Wrap(err, "could not get contract ABI JSON") } var cp types.ConfigPoller @@ -347,23 +380,23 @@ func newContractTransmitter(lggr logger.Logger, rargs relaytypes.RelayArgs, tran var fromAddresses []common.Address sendingKeys := relayConfig.SendingKeys if !relayConfig.EffectiveTransmitterID.Valid { - return nil, errors.New("EffectiveTransmitterID must be specified") + return nil, pkgerrors.New("EffectiveTransmitterID must be specified") } effectiveTransmitterAddress := common.HexToAddress(relayConfig.EffectiveTransmitterID.String) sendingKeysLength := len(sendingKeys) if sendingKeysLength == 0 { - return nil, errors.New("no sending keys provided") + return nil, pkgerrors.New("no sending keys provided") } // If we are using multiple sending keys, then a forwarder is needed to rotate transmissions. // Ensure that this forwarder is not set to a local sending key, and ensure our sending keys are enabled. for _, s := range sendingKeys { if sendingKeysLength > 1 && s == effectiveTransmitterAddress.String() { - return nil, errors.New("the transmitter is a local sending key with transaction forwarding enabled") + return nil, pkgerrors.New("the transmitter is a local sending key with transaction forwarding enabled") } if err := ethKeystore.CheckEnabled(common.HexToAddress(s), configWatcher.chain.Config().EVM().ChainID()); err != nil { - return nil, errors.Wrap(err, "one of the sending keys given is not enabled") + return nil, pkgerrors.Wrap(err, "one of the sending keys given is not enabled") } fromAddresses = append(fromAddresses, common.HexToAddress(s)) } @@ -394,7 +427,7 @@ func newContractTransmitter(lggr logger.Logger, rargs relaytypes.RelayArgs, tran ) if err != nil { - return nil, errors.Wrap(err, "failed to create transmitter") + return nil, pkgerrors.Wrap(err, "failed to create transmitter") } return NewOCRContractTransmitter( @@ -415,7 +448,7 @@ func newPipelineContractTransmitter(lggr logger.Logger, rargs relaytypes.RelayAr } if !relayConfig.EffectiveTransmitterID.Valid { - return nil, errors.New("EffectiveTransmitterID must be specified") + return nil, pkgerrors.New("EffectiveTransmitterID must be specified") } effectiveTransmitterAddress := common.HexToAddress(relayConfig.EffectiveTransmitterID.String) transmitterAddress := common.HexToAddress(transmitterID) diff --git a/core/services/relay/evm/evm_test.go b/core/services/relay/evm/evm_test.go new file mode 100644 index 00000000000..df7cd8eb818 --- /dev/null +++ b/core/services/relay/evm/evm_test.go @@ -0,0 +1,68 @@ +package evm_test + +import ( + "testing" + + "github.com/smartcontractkit/sqlx" + "github.com/stretchr/testify/assert" + + configtest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest/v2" + "github.com/smartcontractkit/chainlink/v2/core/services/pg" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" +) + +func TestRelayerOpts_Validate(t *testing.T) { + cfg := configtest.NewTestGeneralConfig(t) + type fields struct { + DB *sqlx.DB + QConfig pg.QConfig + CSAETHKeystore evm.CSAETHKeystore + EventBroadcaster pg.EventBroadcaster + } + tests := []struct { + name string + fields fields + wantErrContains string + }{ + { + name: "all invalid", + fields: fields{ + DB: nil, + QConfig: nil, + CSAETHKeystore: nil, + EventBroadcaster: nil, + }, + wantErrContains: `nil DB +nil QConfig +nil Keystore +nil Eventbroadcaster`, + }, + { + name: "missing db, keystore", + fields: fields{ + DB: nil, + QConfig: cfg.Database(), + CSAETHKeystore: nil, + EventBroadcaster: pg.NewNullEventBroadcaster(), + }, + wantErrContains: `nil DB +nil Keystore`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := evm.RelayerOpts{ + DB: tt.fields.DB, + QConfig: tt.fields.QConfig, + CSAETHKeystore: tt.fields.CSAETHKeystore, + EventBroadcaster: tt.fields.EventBroadcaster, + } + err := c.Validate() + if tt.wantErrContains != "" { + assert.Contains(t, err.Error(), tt.wantErrContains) + } else { + assert.NoError(t, err) + } + }) + } +} diff --git a/core/services/relay/evm/relayer_extender.go b/core/services/relay/evm/relayer_extender.go index 592c9bacee2..ce638d10cf9 100644 --- a/core/services/relay/evm/relayer_extender.go +++ b/core/services/relay/evm/relayer_extender.go @@ -118,7 +118,7 @@ func (s *ChainRelayerExt) Ready() (err error) { } func NewChainRelayerExtenders(ctx context.Context, opts evmchain.ChainRelayExtenderConfig) (*ChainRelayerExtenders, error) { - if err := opts.Check(); err != nil { + if err := opts.Validate(); err != nil { return nil, err } @@ -143,16 +143,15 @@ func NewChainRelayerExtenders(ctx context.Context, opts evmchain.ChainRelayExten cid := enabled[i].ChainID.String() privOpts := evmchain.ChainRelayExtenderConfig{ - Logger: opts.Logger.Named(cid), - RelayerConfig: opts.RelayerConfig, - DB: opts.DB, - KeyStore: opts.KeyStore, + Logger: opts.Logger.Named(cid), + ChainOpts: opts.ChainOpts, + KeyStore: opts.KeyStore, } privOpts.Logger.Infow(fmt.Sprintf("Loading chain %s", cid), "evmChainID", cid) chain, err2 := evmchain.NewTOMLChain(ctx, enabled[i], privOpts) if err2 != nil { - err = multierr.Combine(err, err2) + err = multierr.Combine(err, fmt.Errorf("failed to create chain %s: %w", cid, err2)) continue } @@ -161,5 +160,6 @@ func NewChainRelayerExtenders(ctx context.Context, opts evmchain.ChainRelayExten } result = append(result, s) } - return newChainRelayerExtsFromSlice(result, opts.AppConfig), nil + // always return because it's accumulating errors + return newChainRelayerExtsFromSlice(result, opts.AppConfig), err } From a9a51205068e07cb7a7e76bfcd4e95063ac0857e Mon Sep 17 00:00:00 2001 From: jinhoonbang Date: Mon, 25 Sep 2023 16:55:21 -0700 Subject: [PATCH 04/84] rename VRF V2 plus to V2_5. rename eth to native (#10656) * rename vrf coordinator v2plus contract to v2_5. introduce internal v2plus interface that is used offchain * add more comments for internal v2plus interface. golang ci lint. make activeSubscriptionIDs() part of interface * run prettier * fix forge error * run prettier and fix smoke test v2plus * fix failing feeder test --- contracts/scripts/native_solc_compile_all_vrf | 3 +- .../dev/interfaces/IVRFCoordinatorV2Plus.sol | 89 +- .../IVRFCoordinatorV2PlusInternal.sol | 59 + .../IVRFMigratableCoordinatorV2Plus.sol | 35 - .../dev/interfaces/IVRFSubscriptionV2Plus.sol | 23 +- .../src/v0.8/dev/vrf/SubscriptionAPI.sol | 92 +- .../v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol | 8 +- ...natorV2Plus.sol => VRFCoordinatorV2_5.sol} | 54 +- .../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol | 26 +- ...Plus.sol => ExposedVRFCoordinatorV2_5.sol} | 18 +- .../VRFCoordinatorV2PlusUpgradedVersion.sol | 44 +- .../VRFCoordinatorV2Plus_V2Example.sol | 46 +- .../testhelpers/VRFV2PlusConsumerExample.sol | 4 +- .../VRFV2PlusMaliciousMigrator.sol | 6 +- .../foundry/vrf/VRFCoordinatorV2Mock.t.sol | 1 - .../vrf/VRFCoordinatorV2Plus_Migration.t.sol | 56 +- .../test/v0.8/foundry/vrf/VRFV2Plus.t.sol | 52 +- .../vrf/VRFV2PlusSubscriptionAPI.t.sol | 132 +- .../test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol | 36 +- core/chains/evm/txmgr/transmitchecker.go | 4 +- .../vrf_coordinator_v2_5.go | 3950 +++++++++++++++++ .../vrf_coordinator_v2_plus_v2_example.go | 42 +- .../vrf_coordinator_v2plus.go | 3950 ----------------- .../vrf_coordinator_v2plus_interface.go | 788 ++++ .../vrf_malicious_consumer_v2_plus.go | 2 +- .../vrf_v2plus_load_test_with_metrics.go | 2 +- .../vrf_v2plus_single_consumer.go | 2 +- .../vrf_v2plus_sub_owner.go | 2 +- .../vrf_v2plus_upgraded_version.go | 336 +- .../vrfv2plus_consumer_example.go | 4 +- .../vrfv2plus_reverting_example.go | 2 +- .../vrfv2plus_wrapper/vrfv2plus_wrapper.go | 36 +- ...rapper-dependency-versions-do-not-edit.txt | 20 +- core/gethwrappers/go_generate.go | 3 +- core/scripts/vrfv2plus/testnet/main.go | 59 +- .../vrfv2plus/testnet/super_scripts.go | 24 +- core/scripts/vrfv2plus/testnet/util.go | 24 +- core/services/blockhashstore/coordinators.go | 18 +- core/services/blockhashstore/delegate.go | 6 +- core/services/blockhashstore/feeder_test.go | 18 +- core/services/blockheaderfeeder/delegate.go | 6 +- core/services/pipeline/task.vrfv2plus.go | 4 +- core/services/vrf/delegate.go | 12 +- core/services/vrf/proof/proof_response.go | 18 +- .../vrf/v2/coordinator_v2x_interface.go | 263 +- .../vrf/v2/integration_v2_plus_test.go | 39 +- core/services/vrf/v2/integration_v2_test.go | 2 +- core/services/vrf/v2/listener_v2.go | 10 +- core/services/vrf/v2/listener_v2_test.go | 4 +- .../services/vrf/v2/listener_v2_types_test.go | 6 +- .../vrfv2plus_constants/constants.go | 19 +- .../actions/vrfv2plus/vrfv2plus_models.go | 4 +- .../actions/vrfv2plus/vrfv2plus_steps.go | 95 +- .../contracts/contract_deployer.go | 2 +- .../contracts/contract_vrf_models.go | 32 +- .../contracts/ethereum_vrfv2plus_contracts.go | 85 +- integration-tests/smoke/vrfv2plus_test.go | 47 +- 57 files changed, 5743 insertions(+), 4981 deletions(-) create mode 100644 contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol delete mode 100644 contracts/src/v0.8/dev/interfaces/IVRFMigratableCoordinatorV2Plus.sol rename contracts/src/v0.8/dev/vrf/{VRFCoordinatorV2Plus.sol => VRFCoordinatorV2_5.sol} (93%) rename contracts/src/v0.8/dev/vrf/testhelpers/{ExposedVRFCoordinatorV2Plus.sol => ExposedVRFCoordinatorV2_5.sol} (72%) create mode 100644 core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go delete mode 100644 core/gethwrappers/generated/vrf_coordinator_v2plus/vrf_coordinator_v2plus.go create mode 100644 core/gethwrappers/generated/vrf_coordinator_v2plus_interface/vrf_coordinator_v2plus_interface.go diff --git a/contracts/scripts/native_solc_compile_all_vrf b/contracts/scripts/native_solc_compile_all_vrf index c662bc55abd..0a3b1367bdf 100755 --- a/contracts/scripts/native_solc_compile_all_vrf +++ b/contracts/scripts/native_solc_compile_all_vrf @@ -55,8 +55,9 @@ compileContract mocks/VRFCoordinatorV2Mock.sol compileContract vrf/VRFOwner.sol # VRF V2Plus +compileContract dev/interfaces/IVRFCoordinatorV2PlusInternal.sol compileContract dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol -compileContractAltOpts dev/vrf/VRFCoordinatorV2Plus.sol 500 +compileContractAltOpts dev/vrf/VRFCoordinatorV2_5.sol 500 compileContract dev/vrf/BatchVRFCoordinatorV2Plus.sol compileContract dev/vrf/VRFV2PlusWrapper.sol compileContract dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol diff --git a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol b/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol index ea37fb83875..0608340e674 100644 --- a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol +++ b/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol @@ -2,19 +2,11 @@ pragma solidity ^0.8.0; import "../vrf/libraries/VRFV2PlusClient.sol"; +import "./IVRFSubscriptionV2Plus.sol"; -// Interface for initial version of VRFCoordinatorV2Plus -// Functions in this interface may not be supported when VRFCoordinatorV2Plus is upgraded to a new version -// TODO: Revisit these functions and decide which functions need to be backwards compatible -interface IVRFCoordinatorV2Plus { - /** - * @notice Get configuration relevant for making requests - * @return minimumRequestConfirmations global min for request confirmations - * @return maxGasLimit global max for request gas limit - * @return s_provingKeyHashes list of registered key hashes - */ - function getRequestConfig() external view returns (uint16, uint32, bytes32[] memory); - +// Interface that enables consumers of VRFCoordinatorV2Plus to be future-proof for upgrades +// This interface is supported by subsequent versions of VRFCoordinatorV2Plus +interface IVRFCoordinatorV2Plus is IVRFSubscriptionV2Plus { /** * @notice Request a set of random words. * @param req - a struct containing following fiels for randomness request: @@ -23,7 +15,7 @@ interface IVRFCoordinatorV2Plus { * ceilings, so you can select a specific one to bound your maximum per request cost. * subId - The ID of the VRF subscription. Must be funded * with the minimum subscription balance required for the selected keyHash. - * minimumRequestConfirmations - How many blocks you'd like the + * requestConfirmations - How many blocks you'd like the * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS * for why you may want to request more. The acceptable range is * [minimumRequestBlockConfirmations, 200]. @@ -41,75 +33,4 @@ interface IVRFCoordinatorV2Plus { * a request to a response in fulfillRandomWords. */ function requestRandomWords(VRFV2PlusClient.RandomWordsRequest calldata req) external returns (uint256 requestId); - - /** - * @notice Create a VRF subscription. - * @return subId - A unique subscription id. - * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer. - * @dev Note to fund the subscription, use transferAndCall. For example - * @dev LINKTOKEN.transferAndCall( - * @dev address(COORDINATOR), - * @dev amount, - * @dev abi.encode(subId)); - */ - function createSubscription() external returns (uint256 subId); - - /** - * @notice Get a VRF subscription. - * @param subId - ID of the subscription - * @return balance - LINK balance of the subscription in juels. - * @return ethBalance - ETH balance of the subscription in wei. - * @return owner - owner of the subscription. - * @return consumers - list of consumer address which are able to use this subscription. - */ - function getSubscription( - uint256 subId - ) external view returns (uint96 balance, uint96 ethBalance, address owner, address[] memory consumers); - - /** - * @notice Request subscription owner transfer. - * @param subId - ID of the subscription - * @param newOwner - proposed new owner of the subscription - */ - function requestSubscriptionOwnerTransfer(uint256 subId, address newOwner) external; - - /** - * @notice Request subscription owner transfer. - * @param subId - ID of the subscription - * @dev will revert if original owner of subId has - * not requested that msg.sender become the new owner. - */ - function acceptSubscriptionOwnerTransfer(uint256 subId) external; - - /** - * @notice Add a consumer to a VRF subscription. - * @param subId - ID of the subscription - * @param consumer - New consumer which can use the subscription - */ - function addConsumer(uint256 subId, address consumer) external; - - /** - * @notice Remove a consumer from a VRF subscription. - * @param subId - ID of the subscription - * @param consumer - Consumer to remove from the subscription - */ - function removeConsumer(uint256 subId, address consumer) external; - - /** - * @notice Cancel a subscription - * @param subId - ID of the subscription - * @param to - Where to send the remaining LINK to - */ - function cancelSubscription(uint256 subId, address to) external; - - /* - * @notice Check to see if there exists a request commitment consumers - * for all consumers and keyhashes for a given sub. - * @param subId - ID of the subscription - * @return true if there exists at least one unfulfilled request for the subscription, false - * otherwise. - */ - function pendingRequestExists(uint256 subId) external view returns (bool); - - function fundSubscriptionWithEth(uint256 subId) external payable; } diff --git a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol b/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol new file mode 100644 index 00000000000..9892b88e691 --- /dev/null +++ b/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import "./IVRFCoordinatorV2Plus.sol"; + +// IVRFCoordinatorV2PlusInternal is the interface used by chainlink core and should +// not be used by consumer conracts +// Future versions of VRF V2plus must conform to this interface +// VRF coordinator doesn't directly inherit from this interface because solidity +// imposes interface methods be external, whereas methods implementated VRF coordinator +// are public. This is OK because IVRFCoordinatorV2PlusInternal doesn't have any solidity +// use case. It is only used to generate gethwrappers +interface IVRFCoordinatorV2PlusInternal is IVRFCoordinatorV2Plus { + event RandomWordsRequested( + bytes32 indexed keyHash, + uint256 requestId, + uint256 preSeed, + uint256 indexed subId, + uint16 minimumRequestConfirmations, + uint32 callbackGasLimit, + uint32 numWords, + bytes extraArgs, + address indexed sender + ); + + event RandomWordsFulfilled( + uint256 indexed requestId, + uint256 outputSeed, + uint256 indexed subId, + uint96 payment, + bool success + ); + + struct RequestCommitment { + uint64 blockNum; + uint256 subId; + uint32 callbackGasLimit; + uint32 numWords; + address sender; + bytes extraArgs; + } + + struct Proof { + uint256[2] pk; + uint256[2] gamma; + uint256 c; + uint256 s; + uint256 seed; + address uWitness; + uint256[2] cGammaWitness; + uint256[2] sHashWitness; + uint256 zInv; + } + + function s_requestCommitments(uint256 requestID) external view returns (bytes32); + + function fulfillRandomWords(Proof memory proof, RequestCommitment memory rc) external returns (uint96); + + function LINK_NATIVE_FEED() external view returns (address); +} diff --git a/contracts/src/v0.8/dev/interfaces/IVRFMigratableCoordinatorV2Plus.sol b/contracts/src/v0.8/dev/interfaces/IVRFMigratableCoordinatorV2Plus.sol deleted file mode 100644 index 687ff9790f3..00000000000 --- a/contracts/src/v0.8/dev/interfaces/IVRFMigratableCoordinatorV2Plus.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -import "../vrf/libraries/VRFV2PlusClient.sol"; - -// Interface that enables consumers of VRFCoordinatorV2Plus to be future-proof for upgrades -// This interface is supported by subsequent versions of VRFCoordinatorV2Plus -interface IVRFMigratableCoordinatorV2Plus { - /** - * @notice Request a set of random words. - * @param req - a struct containing following fiels for randomness request: - * keyHash - Corresponds to a particular oracle job which uses - * that key for generating the VRF proof. Different keyHash's have different gas price - * ceilings, so you can select a specific one to bound your maximum per request cost. - * subId - The ID of the VRF subscription. Must be funded - * with the minimum subscription balance required for the selected keyHash. - * minimumRequestConfirmations - How many blocks you'd like the - * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS - * for why you may want to request more. The acceptable range is - * [minimumRequestBlockConfirmations, 200]. - * callbackGasLimit - How much gas you'd like to receive in your - * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords - * may be slightly less than this amount because of gas used calling the function - * (argument decoding etc.), so you may need to request slightly more than you expect - * to have inside fulfillRandomWords. The acceptable range is - * [0, maxGasLimit] - * numWords - The number of uint256 random values you'd like to receive - * in your fulfillRandomWords callback. Note these numbers are expanded in a - * secure way by the VRFCoordinator from a single random value supplied by the oracle. - * nativePayment - Whether payment should be made in ETH or LINK. - * @return requestId - A unique identifier of the request. Can be used to match - * a request to a response in fulfillRandomWords. - */ - function requestRandomWords(VRFV2PlusClient.RandomWordsRequest calldata req) external returns (uint256 requestId); -} diff --git a/contracts/src/v0.8/dev/interfaces/IVRFSubscriptionV2Plus.sol b/contracts/src/v0.8/dev/interfaces/IVRFSubscriptionV2Plus.sol index 47b31d98bd1..49c131988a6 100644 --- a/contracts/src/v0.8/dev/interfaces/IVRFSubscriptionV2Plus.sol +++ b/contracts/src/v0.8/dev/interfaces/IVRFSubscriptionV2Plus.sol @@ -49,9 +49,9 @@ interface IVRFSubscriptionV2Plus { * @dev address(COORDINATOR), * @dev amount, * @dev abi.encode(subId)); - * @dev Note to fund the subscription with ETH, use fundSubscriptionWithEth. Be sure - * @dev to send ETH with the call, for example: - * @dev COORDINATOR.fundSubscriptionWithEth{value: amount}(subId); + * @dev Note to fund the subscription with Native, use fundSubscriptionWithNative. Be sure + * @dev to send Native with the call, for example: + * @dev COORDINATOR.fundSubscriptionWithNative{value: amount}(subId); */ function createSubscription() external returns (uint256 subId); @@ -59,7 +59,7 @@ interface IVRFSubscriptionV2Plus { * @notice Get a VRF subscription. * @param subId - ID of the subscription * @return balance - LINK balance of the subscription in juels. - * @return ethBalance - ETH balance of the subscription in wei. + * @return nativeBalance - native balance of the subscription in wei. * @return reqCount - Requests count of subscription. * @return owner - owner of the subscription. * @return consumers - list of consumer address which are able to use this subscription. @@ -69,7 +69,16 @@ interface IVRFSubscriptionV2Plus { ) external view - returns (uint96 balance, uint96 ethBalance, uint64 reqCount, address owner, address[] memory consumers); + returns (uint96 balance, uint96 nativeBalance, uint64 reqCount, address owner, address[] memory consumers); + + /* + * @notice Check to see if there exists a request commitment consumers + * for all consumers and keyhashes for a given sub. + * @param subId - ID of the subscription + * @return true if there exists at least one unfulfilled request for the subscription, false + * otherwise. + */ + function pendingRequestExists(uint256 subId) external view returns (bool); /** * @notice Paginate through all active VRF subscriptions. @@ -81,9 +90,9 @@ interface IVRFSubscriptionV2Plus { function getActiveSubscriptionIds(uint256 startIndex, uint256 maxCount) external view returns (uint256[] memory); /** - * @notice Fund a subscription with ETH. + * @notice Fund a subscription with native. * @param subId - ID of the subscription * @notice This method expects msg.value to be greater than 0. */ - function fundSubscriptionWithEth(uint256 subId) external payable; + function fundSubscriptionWithNative(uint256 subId) external payable; } diff --git a/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol b/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol index 9e3181978f5..c4781cbde8c 100644 --- a/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol +++ b/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol @@ -14,7 +14,7 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr /// @dev may not be provided upon construction on some chains due to lack of availability LinkTokenInterface public LINK; /// @dev may not be provided upon construction on some chains due to lack of availability - AggregatorV3Interface public LINK_ETH_FEED; + AggregatorV3Interface public LINK_NATIVE_FEED; // We need to maintain a list of consuming addresses. // This bound ensures we are able to loop over them as needed. @@ -31,9 +31,9 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr error MustBeRequestedOwner(address proposedOwner); error BalanceInvariantViolated(uint256 internalBalance, uint256 externalBalance); // Should never happen event FundsRecovered(address to, uint256 amount); - event EthFundsRecovered(address to, uint256 amount); + event NativeFundsRecovered(address to, uint256 amount); error LinkAlreadySet(); - error FailedToSendEther(); + error FailedToSendNative(); error FailedToTransferLink(); error IndexOutOfRange(); error LinkNotSet(); @@ -45,7 +45,7 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr uint96 balance; // Common link balance used for all consumer requests. // a uint96 is large enough to hold around ~8e28 wei, or 80 billion ether. // That should be enough to cover most (if not all) subscriptions. - uint96 ethBalance; // Common eth balance used for all consumer requests. + uint96 nativeBalance; // Common native balance used for all consumer requests. uint64 reqCount; } // We use the config for the mgmt APIs @@ -64,7 +64,7 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr mapping(address => mapping(uint256 => uint64)) /* consumer */ /* subId */ /* nonce */ internal s_consumers; mapping(uint256 => SubscriptionConfig) /* subId */ /* subscriptionConfig */ internal s_subscriptionConfigs; mapping(uint256 => Subscription) /* subId */ /* subscription */ internal s_subscriptions; - // subscription nonce used to construct subID. Rises monotonically + // subscription nonce used to construct subId. Rises monotonically uint64 public s_currentSubNonce; // track all subscription id's that were created by this contract // note: access should be through the getActiveSubscriptionIds() view function @@ -78,20 +78,20 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr // A discrepancy with this contract's link balance indicates someone // sent tokens using transfer and so we may need to use recoverFunds. uint96 public s_totalBalance; - // s_totalEthBalance tracks the total eth sent to/from - // this contract through fundSubscription, cancelSubscription and oracleWithdrawEth. - // A discrepancy with this contract's eth balance indicates someone - // sent eth using transfer and so we may need to use recoverEthFunds. - uint96 public s_totalEthBalance; + // s_totalNativeBalance tracks the total native sent to/from + // this contract through fundSubscription, cancelSubscription and oracleWithdrawNative. + // A discrepancy with this contract's native balance indicates someone + // sent native using transfer and so we may need to use recoverNativeFunds. + uint96 public s_totalNativeBalance; mapping(address => uint96) /* oracle */ /* LINK balance */ internal s_withdrawableTokens; - mapping(address => uint96) /* oracle */ /* ETH balance */ internal s_withdrawableEth; + mapping(address => uint96) /* oracle */ /* native balance */ internal s_withdrawableNative; event SubscriptionCreated(uint256 indexed subId, address owner); event SubscriptionFunded(uint256 indexed subId, uint256 oldBalance, uint256 newBalance); - event SubscriptionFundedWithEth(uint256 indexed subId, uint256 oldEthBalance, uint256 newEthBalance); + event SubscriptionFundedWithNative(uint256 indexed subId, uint256 oldNativeBalance, uint256 newNativeBalance); event SubscriptionConsumerAdded(uint256 indexed subId, address consumer); event SubscriptionConsumerRemoved(uint256 indexed subId, address consumer); - event SubscriptionCanceled(uint256 indexed subId, address to, uint256 amountLink, uint256 amountEth); + event SubscriptionCanceled(uint256 indexed subId, address to, uint256 amountLink, uint256 amountNative); event SubscriptionOwnerTransferRequested(uint256 indexed subId, address from, address to); event SubscriptionOwnerTransferred(uint256 indexed subId, address from, address to); @@ -128,18 +128,18 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr constructor() ConfirmedOwner(msg.sender) {} /** - * @notice set the LINK token contract and link eth feed to be + * @notice set the LINK token contract and link native feed to be * used by this coordinator * @param link - address of link token - * @param linkEthFeed address of the link eth feed + * @param linkNativeFeed address of the link native feed */ - function setLINKAndLINKETHFeed(address link, address linkEthFeed) external onlyOwner { + function setLINKAndLINKNativeFeed(address link, address linkNativeFeed) external onlyOwner { // Disallow re-setting link token because the logic wouldn't really make sense if (address(LINK) != address(0)) { revert LinkAlreadySet(); } LINK = LinkTokenInterface(link); - LINK_ETH_FEED = AggregatorV3Interface(linkEthFeed); + LINK_NATIVE_FEED = AggregatorV3Interface(linkNativeFeed); } /** @@ -183,12 +183,12 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr } /** - * @notice Recover eth sent with transfer/call/send instead of fundSubscription. - * @param to address to send eth to + * @notice Recover native sent with transfer/call/send instead of fundSubscription. + * @param to address to send native to */ - function recoverEthFunds(address payable to) external onlyOwner { + function recoverNativeFunds(address payable to) external onlyOwner { uint256 externalBalance = address(this).balance; - uint256 internalBalance = uint256(s_totalEthBalance); + uint256 internalBalance = uint256(s_totalNativeBalance); if (internalBalance > externalBalance) { revert BalanceInvariantViolated(internalBalance, externalBalance); } @@ -196,9 +196,9 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr uint256 amount = externalBalance - internalBalance; (bool sent, ) = to.call{value: amount}(""); if (!sent) { - revert FailedToSendEther(); + revert FailedToSendNative(); } - emit EthFundsRecovered(to, amount); + emit NativeFundsRecovered(to, amount); } // If the balances are equal, nothing to be done. } @@ -223,20 +223,20 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr } /* - * @notice Oracle withdraw ETH earned through fulfilling requests + * @notice Oracle withdraw native earned through fulfilling requests * @param recipient where to send the funds * @param amount amount to withdraw */ - function oracleWithdrawEth(address payable recipient, uint96 amount) external nonReentrant { - if (s_withdrawableEth[msg.sender] < amount) { + function oracleWithdrawNative(address payable recipient, uint96 amount) external nonReentrant { + if (s_withdrawableNative[msg.sender] < amount) { revert InsufficientBalance(); } // Prevent re-entrancy by updating state before transfer. - s_withdrawableEth[msg.sender] -= amount; - s_totalEthBalance -= amount; + s_withdrawableNative[msg.sender] -= amount; + s_totalNativeBalance -= amount; (bool sent, ) = recipient.call{value: amount}(""); if (!sent) { - revert FailedToSendEther(); + revert FailedToSendNative(); } } @@ -262,7 +262,7 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr /** * @inheritdoc IVRFSubscriptionV2Plus */ - function fundSubscriptionWithEth(uint256 subId) external payable override nonReentrant { + function fundSubscriptionWithNative(uint256 subId) external payable override nonReentrant { if (s_subscriptionConfigs[subId].owner == address(0)) { revert InvalidSubscription(); } @@ -270,10 +270,10 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr // anyone can fund a subscription. // We also do not check that msg.value > 0, since that's just a no-op // and would be a waste of gas on the caller's part. - uint256 oldEthBalance = s_subscriptions[subId].ethBalance; - s_subscriptions[subId].ethBalance += uint96(msg.value); - s_totalEthBalance += uint96(msg.value); - emit SubscriptionFundedWithEth(subId, oldEthBalance, oldEthBalance + msg.value); + uint256 oldNativeBalance = s_subscriptions[subId].nativeBalance; + s_subscriptions[subId].nativeBalance += uint96(msg.value); + s_totalNativeBalance += uint96(msg.value); + emit SubscriptionFundedWithNative(subId, oldNativeBalance, oldNativeBalance + msg.value); } /** @@ -285,14 +285,14 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr public view override - returns (uint96 balance, uint96 ethBalance, uint64 reqCount, address owner, address[] memory consumers) + returns (uint96 balance, uint96 nativeBalance, uint64 reqCount, address owner, address[] memory consumers) { if (s_subscriptionConfigs[subId].owner == address(0)) { revert InvalidSubscription(); } return ( s_subscriptions[subId].balance, - s_subscriptions[subId].ethBalance, + s_subscriptions[subId].nativeBalance, s_subscriptions[subId].reqCount, s_subscriptionConfigs[subId].owner, s_subscriptionConfigs[subId].consumers @@ -329,7 +329,7 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr s_currentSubNonce++; // Initialize storage variables. address[] memory consumers = new address[](0); - s_subscriptions[subId] = Subscription({balance: 0, ethBalance: 0, reqCount: 0}); + s_subscriptions[subId] = Subscription({balance: 0, nativeBalance: 0, reqCount: 0}); s_subscriptionConfigs[subId] = SubscriptionConfig({ owner: msg.sender, requestedOwner: address(0), @@ -392,11 +392,11 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr emit SubscriptionConsumerAdded(subId, consumer); } - function deleteSubscription(uint256 subId) internal returns (uint96 balance, uint96 ethBalance) { + function deleteSubscription(uint256 subId) internal returns (uint96 balance, uint96 nativeBalance) { SubscriptionConfig memory subConfig = s_subscriptionConfigs[subId]; Subscription memory sub = s_subscriptions[subId]; balance = sub.balance; - ethBalance = sub.ethBalance; + nativeBalance = sub.nativeBalance; // Note bounded by MAX_CONSUMERS; // If no consumers, does nothing. for (uint256 i = 0; i < subConfig.consumers.length; i++) { @@ -406,12 +406,12 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr delete s_subscriptions[subId]; s_subIds.remove(subId); s_totalBalance -= balance; - s_totalEthBalance -= ethBalance; - return (balance, ethBalance); + s_totalNativeBalance -= nativeBalance; + return (balance, nativeBalance); } function cancelSubscriptionHelper(uint256 subId, address to) internal { - (uint96 balance, uint96 ethBalance) = deleteSubscription(subId); + (uint96 balance, uint96 nativeBalance) = deleteSubscription(subId); // Only withdraw LINK if the token is active and there is a balance. if (address(LINK) != address(0) && balance != 0) { @@ -420,12 +420,12 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr } } - // send eth to the "to" address using call - (bool success, ) = to.call{value: uint256(ethBalance)}(""); + // send native to the "to" address using call + (bool success, ) = to.call{value: uint256(nativeBalance)}(""); if (!success) { - revert FailedToSendEther(); + revert FailedToSendNative(); } - emit SubscriptionCanceled(subId, to, balance, ethBalance); + emit SubscriptionCanceled(subId, to, balance, nativeBalance); } modifier onlySubOwner(uint256 subId) { diff --git a/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol b/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol index 5220f1c1516..0e6e2b22016 100644 --- a/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol +++ b/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import "../interfaces/IVRFMigratableCoordinatorV2Plus.sol"; +import "../interfaces/IVRFCoordinatorV2Plus.sol"; import "../interfaces/IVRFMigratableConsumerV2Plus.sol"; import "../../shared/access/ConfirmedOwner.sol"; @@ -103,13 +103,13 @@ abstract contract VRFConsumerBaseV2Plus is IVRFMigratableConsumerV2Plus, Confirm error OnlyOwnerOrCoordinator(address have, address owner, address coordinator); error ZeroAddress(); - IVRFMigratableCoordinatorV2Plus public s_vrfCoordinator; + IVRFCoordinatorV2Plus public s_vrfCoordinator; /** * @param _vrfCoordinator address of VRFCoordinator contract */ constructor(address _vrfCoordinator) ConfirmedOwner(msg.sender) { - s_vrfCoordinator = IVRFMigratableCoordinatorV2Plus(_vrfCoordinator); + s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator); } /** @@ -142,7 +142,7 @@ abstract contract VRFConsumerBaseV2Plus is IVRFMigratableConsumerV2Plus, Confirm * @inheritdoc IVRFMigratableConsumerV2Plus */ function setCoordinator(address _vrfCoordinator) public override onlyOwnerOrCoordinator { - s_vrfCoordinator = IVRFMigratableCoordinatorV2Plus(_vrfCoordinator); + s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator); } modifier onlyOwnerOrCoordinator() { diff --git a/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2Plus.sol b/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol similarity index 93% rename from contracts/src/v0.8/dev/vrf/VRFCoordinatorV2Plus.sol rename to contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol index 50abefc3ff8..113f098614d 100644 --- a/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2Plus.sol +++ b/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol @@ -10,8 +10,9 @@ import "../../ChainSpecificUtil.sol"; import "./SubscriptionAPI.sol"; import "./libraries/VRFV2PlusClient.sol"; import "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; +import "../interfaces/IVRFCoordinatorV2Plus.sol"; -contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { +contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { /// @dev should always be available BlockhashStoreInterface public immutable BLOCKHASH_STORE; @@ -58,10 +59,11 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { bytes extraArgs, address indexed sender ); + event RandomWordsFulfilled( uint256 indexed requestId, uint256 outputSeed, - uint256 indexed subID, + uint256 indexed subId, uint96 payment, bool success ); @@ -73,9 +75,9 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { // Flat fee charged per fulfillment in millionths of link // So fee range is [0, 2^32/10^6]. uint32 fulfillmentFlatFeeLinkPPM; - // Flat fee charged per fulfillment in millionths of eth. + // Flat fee charged per fulfillment in millionths of native. // So fee range is [0, 2^32/10^6]. - uint32 fulfillmentFlatFeeEthPPM; + uint32 fulfillmentFlatFeeNativePPM; } event ConfigSet( uint16 minimumRequestConfirmations, @@ -139,9 +141,9 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { * @notice Sets the configuration of the vrfv2 coordinator * @param minimumRequestConfirmations global min for request confirmations * @param maxGasLimit global max for request gas limit - * @param stalenessSeconds if the eth/link feed is more stale then this, use the fallback price + * @param stalenessSeconds if the native/link feed is more stale then this, use the fallback price * @param gasAfterPaymentCalculation gas used in doing accounting after completing the gas measurement - * @param fallbackWeiPerUnitLink fallback eth/link price in the case of a stale feed + * @param fallbackWeiPerUnitLink fallback native/link price in the case of a stale feed * @param feeConfig fee configuration */ function setConfig( @@ -224,11 +226,13 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { * in your fulfillRandomWords callback. Note these numbers are expanded in a * secure way by the VRFCoordinator from a single random value supplied by the oracle. * extraArgs - Encoded extra arguments that has a boolean flag for whether payment - * should be made in ETH or LINK. Payment in LINK is only available if the LINK token is available to this contract. + * should be made in native or LINK. Payment in LINK is only available if the LINK token is available to this contract. * @return requestId - A unique identifier of the request. Can be used to match * a request to a response in fulfillRandomWords. */ - function requestRandomWords(VRFV2PlusClient.RandomWordsRequest calldata req) external nonReentrant returns (uint256) { + function requestRandomWords( + VRFV2PlusClient.RandomWordsRequest calldata req + ) external override nonReentrant returns (uint256) { // Input validation using the subscription storage. if (s_subscriptionConfigs[req.subId].owner == address(0)) { revert InvalidSubscription(); @@ -427,11 +431,11 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { nativePayment ); if (nativePayment) { - if (s_subscriptions[rc.subId].ethBalance < payment) { + if (s_subscriptions[rc.subId].nativeBalance < payment) { revert InsufficientBalance(); } - s_subscriptions[rc.subId].ethBalance -= payment; - s_withdrawableEth[s_provingKeys[output.keyHash]] += payment; + s_subscriptions[rc.subId].nativeBalance -= payment; + s_withdrawableNative[s_provingKeys[output.keyHash]] += payment; } else { if (s_subscriptions[rc.subId].balance < payment) { revert InsufficientBalance(); @@ -456,10 +460,10 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { ) internal view returns (uint96) { if (nativePayment) { return - calculatePaymentAmountEth( + calculatePaymentAmountNative( startGas, gasAfterPaymentCalculation, - s_feeConfig.fulfillmentFlatFeeEthPPM, + s_feeConfig.fulfillmentFlatFeeNativePPM, weiPerUnitGas ); } @@ -472,7 +476,7 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { ); } - function calculatePaymentAmountEth( + function calculatePaymentAmountNative( uint256 startGas, uint256 gasAfterPaymentCalculation, uint32 fulfillmentFlatFeePPM, @@ -517,7 +521,7 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { bool staleFallback = stalenessSeconds > 0; uint256 timestamp; int256 weiPerUnitLink; - (, weiPerUnitLink, , timestamp, ) = LINK_ETH_FEED.latestRoundData(); + (, weiPerUnitLink, , timestamp, ) = LINK_NATIVE_FEED.latestRoundData(); // solhint-disable-next-line not-rely-on-time if (staleFallback && stalenessSeconds < block.timestamp - timestamp) { weiPerUnitLink = s_fallbackWeiPerUnitLink; @@ -525,16 +529,10 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { return weiPerUnitLink; } - /* - * @notice Check to see if there exists a request commitment consumers - * for all consumers and keyhashes for a given sub. - * @param subId - ID of the subscription - * @return true if there exists at least one unfulfilled request for the subscription, false - * otherwise. - * @dev Looping is bounded to MAX_CONSUMERS*(number of keyhashes). - * @dev Used to disable subscription canceling while outstanding request are present. + /** + * @inheritdoc IVRFSubscriptionV2Plus */ - function pendingRequestExists(uint256 subId) public view returns (bool) { + function pendingRequestExists(uint256 subId) public view override returns (bool) { SubscriptionConfig memory subConfig = s_subscriptionConfigs[subId]; for (uint256 i = 0; i < subConfig.consumers.length; i++) { for (uint256 j = 0; j < s_provingKeyHashes.length; j++) { @@ -619,7 +617,7 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { address subOwner; address[] consumers; uint96 linkBalance; - uint96 ethBalance; + uint96 nativeBalance; } function isTargetRegistered(address target) internal view returns (bool) { @@ -657,7 +655,7 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { if (!isTargetRegistered(newCoordinator)) { revert CoordinatorNotRegistered(newCoordinator); } - (uint96 balance, uint96 ethBalance, , address owner, address[] memory consumers) = getSubscription(subId); + (uint96 balance, uint96 nativeBalance, , address owner, address[] memory consumers) = getSubscription(subId); require(owner == msg.sender, "Not subscription owner"); require(!pendingRequestExists(subId), "Pending request exists"); @@ -667,11 +665,11 @@ contract VRFCoordinatorV2Plus is VRF, SubscriptionAPI { subOwner: owner, consumers: consumers, linkBalance: balance, - ethBalance: ethBalance + nativeBalance: nativeBalance }); bytes memory encodedData = abi.encode(migrationData); deleteSubscription(subId); - IVRFCoordinatorV2PlusMigration(newCoordinator).onMigration{value: ethBalance}(encodedData); + IVRFCoordinatorV2PlusMigration(newCoordinator).onMigration{value: nativeBalance}(encodedData); // Only transfer LINK if the token is active and there is a balance. if (address(LINK) != address(0) && balance != 0) { diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol index ed4679b7d6b..edab249b3c6 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol @@ -22,7 +22,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume error FailedToTransferLink(); LinkTokenInterface public s_link; - AggregatorV3Interface public s_linkEthFeed; + AggregatorV3Interface public s_linkNativeFeed; ExtendedVRFCoordinatorV2PlusInterface public immutable COORDINATOR; uint256 public immutable SUBSCRIPTION_ID; /// @dev this is the size of a VRF v2 fulfillment's calldata abi-encoded in bytes. @@ -65,7 +65,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume // s_fulfillmentFlatFeeLinkPPM is the flat fee in millionths of LINK that VRFCoordinatorV2 // charges. - uint32 private s_fulfillmentFlatFeeEthPPM; + uint32 private s_fulfillmentFlatFeeNativePPM; // Other configuration @@ -97,12 +97,12 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume } mapping(uint256 => Callback) /* requestID */ /* callback */ public s_callbacks; - constructor(address _link, address _linkEthFeed, address _coordinator) VRFConsumerBaseV2Plus(_coordinator) { + constructor(address _link, address _linkNativeFeed, address _coordinator) VRFConsumerBaseV2Plus(_coordinator) { if (_link != address(0)) { s_link = LinkTokenInterface(_link); } - if (_linkEthFeed != address(0)) { - s_linkEthFeed = AggregatorV3Interface(_linkEthFeed); + if (_linkNativeFeed != address(0)) { + s_linkNativeFeed = AggregatorV3Interface(_linkNativeFeed); } COORDINATOR = ExtendedVRFCoordinatorV2PlusInterface(_coordinator); @@ -125,11 +125,11 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume } /** - * @notice set the link eth feed to be used by this wrapper - * @param linkEthFeed address of the link eth feed + * @notice set the link native feed to be used by this wrapper + * @param linkNativeFeed address of the link native feed */ - function setLinkEthFeed(address linkEthFeed) external onlyOwner { - s_linkEthFeed = AggregatorV3Interface(linkEthFeed); + function setLinkNativeFeed(address linkNativeFeed) external onlyOwner { + s_linkNativeFeed = AggregatorV3Interface(linkNativeFeed); } /** @@ -173,7 +173,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume // Get other configuration from coordinator (, , s_stalenessSeconds, ) = COORDINATOR.s_config(); s_fallbackWeiPerUnitLink = COORDINATOR.s_fallbackWeiPerUnitLink(); - (s_fulfillmentFlatFeeLinkPPM, s_fulfillmentFlatFeeEthPPM) = COORDINATOR.s_feeConfig(); + (s_fulfillmentFlatFeeLinkPPM, s_fulfillmentFlatFeeNativePPM) = COORDINATOR.s_feeConfig(); } /** @@ -288,7 +288,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume // feeWithPremium is the fee after the percentage premium is applied uint256 feeWithPremium = (baseFee * (s_wrapperPremiumPercentage + 100)) / 100; // feeWithFlatFee is the fee after the flat fee is applied on top of the premium - uint256 feeWithFlatFee = feeWithPremium + (1e12 * uint256(s_fulfillmentFlatFeeEthPPM)); + uint256 feeWithFlatFee = feeWithPremium + (1e12 * uint256(s_fulfillmentFlatFeeNativePPM)); return feeWithFlatFee; } @@ -442,7 +442,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume bool staleFallback = s_stalenessSeconds > 0; uint256 timestamp; int256 weiPerUnitLink; - (, weiPerUnitLink, , timestamp, ) = s_linkEthFeed.latestRoundData(); + (, weiPerUnitLink, , timestamp, ) = s_linkNativeFeed.latestRoundData(); // solhint-disable-next-line not-rely-on-time if (staleFallback && s_stalenessSeconds < block.timestamp - timestamp) { weiPerUnitLink = s_fallbackWeiPerUnitLink; @@ -516,5 +516,5 @@ interface ExtendedVRFCoordinatorV2PlusInterface is IVRFCoordinatorV2Plus { function s_fallbackWeiPerUnitLink() external view returns (int256); - function s_feeConfig() external view returns (uint32 fulfillmentFlatFeeLinkPPM, uint32 fulfillmentFlatFeeEthPPM); + function s_feeConfig() external view returns (uint32 fulfillmentFlatFeeLinkPPM, uint32 fulfillmentFlatFeeNativePPM); } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2Plus.sol b/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol similarity index 72% rename from contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2Plus.sol rename to contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol index 0d493867370..5e54636bb17 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2Plus.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol @@ -2,13 +2,13 @@ pragma solidity ^0.8.4; import "../../../vrf/VRF.sol"; -import {VRFCoordinatorV2Plus} from "../VRFCoordinatorV2Plus.sol"; +import {VRFCoordinatorV2_5} from "../VRFCoordinatorV2_5.sol"; import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; -contract ExposedVRFCoordinatorV2Plus is VRFCoordinatorV2Plus { +contract ExposedVRFCoordinatorV2_5 is VRFCoordinatorV2_5 { using EnumerableSet for EnumerableSet.UintSet; - constructor(address blockhashStore) VRFCoordinatorV2Plus(blockhashStore) {} + constructor(address blockhashStore) VRFCoordinatorV2_5(blockhashStore) {} function computeRequestIdExternal( bytes32 keyHash, @@ -46,8 +46,8 @@ contract ExposedVRFCoordinatorV2Plus is VRFCoordinatorV2Plus { s_totalBalance = newBalance; } - function setTotalEthBalanceTestingOnlyXXX(uint96 newBalance) external { - s_totalEthBalance = newBalance; + function setTotalNativeBalanceTestingOnlyXXX(uint96 newBalance) external { + s_totalNativeBalance = newBalance; } function setWithdrawableTokensTestingOnlyXXX(address oracle, uint96 newBalance) external { @@ -58,11 +58,11 @@ contract ExposedVRFCoordinatorV2Plus is VRFCoordinatorV2Plus { return s_withdrawableTokens[oracle]; } - function setWithdrawableEthTestingOnlyXXX(address oracle, uint96 newBalance) external { - s_withdrawableEth[oracle] = newBalance; + function setWithdrawableNativeTestingOnlyXXX(address oracle, uint96 newBalance) external { + s_withdrawableNative[oracle] = newBalance; } - function getWithdrawableEthTestingOnlyXXX(address oracle) external view returns (uint96) { - return s_withdrawableEth[oracle]; + function getWithdrawableNativeTestingOnlyXXX(address oracle) external view returns (uint96) { + return s_withdrawableNative[oracle]; } } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol index 5e059a067a9..a8d2abfc4bc 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol @@ -17,7 +17,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is VRF, SubscriptionAPI, IVRFCoordinatorV2PlusMigration, - IVRFMigratableCoordinatorV2Plus + IVRFCoordinatorV2Plus { using EnumerableSet for EnumerableSet.UintSet; /// @dev should always be available @@ -89,9 +89,9 @@ contract VRFCoordinatorV2PlusUpgradedVersion is // Flat fee charged per fulfillment in millionths of link // So fee range is [0, 2^32/10^6]. uint32 fulfillmentFlatFeeLinkPPM; - // Flat fee charged per fulfillment in millionths of eth. + // Flat fee charged per fulfillment in millionths of native. // So fee range is [0, 2^32/10^6]. - uint32 fulfillmentFlatFeeEthPPM; + uint32 fulfillmentFlatFeeNativePPM; } event ConfigSet( @@ -134,9 +134,9 @@ contract VRFCoordinatorV2PlusUpgradedVersion is * @notice Sets the configuration of the vrfv2 coordinator * @param minimumRequestConfirmations global min for request confirmations * @param maxGasLimit global max for request gas limit - * @param stalenessSeconds if the eth/link feed is more stale then this, use the fallback price + * @param stalenessSeconds if the native/link feed is more stale then this, use the fallback price * @param gasAfterPaymentCalculation gas used in doing accounting after completing the gas measurement - * @param fallbackWeiPerUnitLink fallback eth/link price in the case of a stale feed + * @param fallbackWeiPerUnitLink fallback native/link price in the case of a stale feed * @param feeConfig fee configuration */ function setConfig( @@ -219,7 +219,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is * in your fulfillRandomWords callback. Note these numbers are expanded in a * secure way by the VRFCoordinator from a single random value supplied by the oracle. * extraArgs - Encoded extra arguments that has a boolean flag for whether payment - * should be made in ETH or LINK. Payment in LINK is only available if the LINK token is available to this contract. + * should be made in native or LINK. Payment in LINK is only available if the LINK token is available to this contract. * @return requestId - A unique identifier of the request. Can be used to match * a request to a response in fulfillRandomWords. */ @@ -424,11 +424,11 @@ contract VRFCoordinatorV2PlusUpgradedVersion is nativePayment ); if (nativePayment) { - if (s_subscriptions[rc.subId].ethBalance < payment) { + if (s_subscriptions[rc.subId].nativeBalance < payment) { revert InsufficientBalance(); } - s_subscriptions[rc.subId].ethBalance -= payment; - s_withdrawableEth[s_provingKeys[output.keyHash]] += payment; + s_subscriptions[rc.subId].nativeBalance -= payment; + s_withdrawableNative[s_provingKeys[output.keyHash]] += payment; } else { if (s_subscriptions[rc.subId].balance < payment) { revert InsufficientBalance(); @@ -453,10 +453,10 @@ contract VRFCoordinatorV2PlusUpgradedVersion is ) internal view returns (uint96) { if (nativePayment) { return - calculatePaymentAmountEth( + calculatePaymentAmountNative( startGas, gasAfterPaymentCalculation, - s_feeConfig.fulfillmentFlatFeeEthPPM, + s_feeConfig.fulfillmentFlatFeeNativePPM, weiPerUnitGas ); } @@ -469,7 +469,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is ); } - function calculatePaymentAmountEth( + function calculatePaymentAmountNative( uint256 startGas, uint256 gasAfterPaymentCalculation, uint32 fulfillmentFlatFeePPM, @@ -514,7 +514,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is bool staleFallback = stalenessSeconds > 0; uint256 timestamp; int256 weiPerUnitLink; - (, weiPerUnitLink, , timestamp, ) = LINK_ETH_FEED.latestRoundData(); + (, weiPerUnitLink, , timestamp, ) = LINK_NATIVE_FEED.latestRoundData(); // solhint-disable-next-line not-rely-on-time if (staleFallback && stalenessSeconds < block.timestamp - timestamp) { weiPerUnitLink = s_fallbackWeiPerUnitLink; @@ -531,7 +531,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is * @dev Looping is bounded to MAX_CONSUMERS*(number of keyhashes). * @dev Used to disable subscription canceling while outstanding request are present. */ - function pendingRequestExists(uint256 subId) public view returns (bool) { + function pendingRequestExists(uint256 subId) public view override returns (bool) { SubscriptionConfig memory subConfig = s_subscriptionConfigs[subId]; for (uint256 i = 0; i < subConfig.consumers.length; i++) { for (uint256 j = 0; j < s_provingKeyHashes.length; j++) { @@ -613,7 +613,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is address subOwner; address[] consumers; uint96 linkBalance; - uint96 ethBalance; + uint96 nativeBalance; } function isTargetRegistered(address target) internal view returns (bool) { @@ -637,7 +637,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is if (!isTargetRegistered(newCoordinator)) { revert CoordinatorNotRegistered(newCoordinator); } - (uint96 balance, uint96 ethBalance, , address owner, address[] memory consumers) = getSubscription(subId); + (uint96 balance, uint96 nativeBalance, , address owner, address[] memory consumers) = getSubscription(subId); require(owner == msg.sender, "Not subscription owner"); require(!pendingRequestExists(subId), "Pending request exists"); @@ -647,11 +647,11 @@ contract VRFCoordinatorV2PlusUpgradedVersion is subOwner: owner, consumers: consumers, linkBalance: balance, - ethBalance: ethBalance + nativeBalance: nativeBalance }); bytes memory encodedData = abi.encode(migrationData); deleteSubscription(subId); - IVRFCoordinatorV2PlusMigration(newCoordinator).onMigration{value: ethBalance}(encodedData); + IVRFCoordinatorV2PlusMigration(newCoordinator).onMigration{value: nativeBalance}(encodedData); // Only transfer LINK if the token is active and there is a balance. if (address(LINK) != address(0) && balance != 0) { @@ -683,8 +683,8 @@ contract VRFCoordinatorV2PlusUpgradedVersion is revert InvalidVersion(migrationData.fromVersion, 1); } - if (msg.value != uint256(migrationData.ethBalance)) { - revert InvalidNativeBalance(msg.value, migrationData.ethBalance); + if (msg.value != uint256(migrationData.nativeBalance)) { + revert InvalidNativeBalance(msg.value, migrationData.nativeBalance); } // it should be impossible to have a subscription id collision, for two reasons: @@ -704,7 +704,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is } s_subscriptions[migrationData.subId] = Subscription({ - ethBalance: migrationData.ethBalance, + nativeBalance: migrationData.nativeBalance, balance: migrationData.linkBalance, reqCount: 0 }); @@ -715,7 +715,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is }); s_totalBalance += uint96(migrationData.linkBalance); - s_totalEthBalance += uint96(migrationData.ethBalance); + s_totalNativeBalance += uint96(migrationData.nativeBalance); s_subIds.add(migrationData.subId); } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol index fd6d5b2f094..52a5b864c6b 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol @@ -3,19 +3,20 @@ pragma solidity ^0.8.4; import "../../../shared/interfaces/LinkTokenInterface.sol"; import "../../interfaces/IVRFCoordinatorV2PlusMigration.sol"; -import "../../interfaces/IVRFMigratableCoordinatorV2Plus.sol"; +import "../../interfaces/IVRFCoordinatorV2Plus.sol"; import "../VRFConsumerBaseV2Plus.sol"; /// @dev this contract is only meant for testing migration /// @dev it is a simplified example of future version (V2) of VRFCoordinatorV2Plus -contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration, IVRFMigratableCoordinatorV2Plus { +contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration { error SubscriptionIDCollisionFound(); struct Subscription { - address owner; - address[] consumers; uint96 linkBalance; uint96 nativeBalance; + uint64 reqCount; + address owner; + address[] consumers; } mapping(uint256 => Subscription) public s_subscriptions; /* subId */ /* subscription */ @@ -44,15 +45,20 @@ contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration, IVRFM function getSubscription( uint256 subId - ) public view returns (address owner, address[] memory consumers, uint96 linkBalance, uint96 nativeBalance) { + ) + public + view + returns (uint96 linkBalance, uint96 nativeBalance, uint64 reqCount, address owner, address[] memory consumers) + { if (s_subscriptions[subId].owner == address(0)) { revert InvalidSubscription(); } return ( - s_subscriptions[subId].owner, - s_subscriptions[subId].consumers, s_subscriptions[subId].linkBalance, - s_subscriptions[subId].nativeBalance + s_subscriptions[subId].nativeBalance, + s_subscriptions[subId].reqCount, + s_subscriptions[subId].owner, + s_subscriptions[subId].consumers ); } @@ -78,7 +84,7 @@ contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration, IVRFM address subOwner; address[] consumers; uint96 linkBalance; - uint96 ethBalance; + uint96 nativeBalance; } /** @@ -95,8 +101,8 @@ contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration, IVRFM revert InvalidVersion(migrationData.fromVersion, 1); } - if (msg.value != uint256(migrationData.ethBalance)) { - revert InvalidNativeBalance(msg.value, migrationData.ethBalance); + if (msg.value != uint256(migrationData.nativeBalance)) { + revert InvalidNativeBalance(msg.value, migrationData.nativeBalance); } // it should be impossible to have a subscription id collision, for two reasons: @@ -112,12 +118,13 @@ contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration, IVRFM } s_subscriptions[migrationData.subId] = Subscription({ + nativeBalance: migrationData.nativeBalance, + linkBalance: migrationData.linkBalance, + reqCount: 0, owner: migrationData.subOwner, - consumers: migrationData.consumers, - nativeBalance: migrationData.ethBalance, - linkBalance: migrationData.linkBalance + consumers: migrationData.consumers }); - s_totalNativeBalance += migrationData.ethBalance; + s_totalNativeBalance += migrationData.nativeBalance; s_totalLinkBalance += migrationData.linkBalance; } @@ -125,12 +132,9 @@ contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration, IVRFM * Section: Request/Response **************************************************************************/ - /** - * @inheritdoc IVRFMigratableCoordinatorV2Plus - */ - function requestRandomWords( - VRFV2PlusClient.RandomWordsRequest calldata /* req */ - ) external override returns (uint256 requestId) { + function requestRandomWords(VRFV2PlusClient.RandomWordsRequest calldata req) external returns (uint256 requestId) { + Subscription memory sub = s_subscriptions[req.subId]; + sub.reqCount = sub.reqCount + 1; return handleRequest(msg.sender); } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol index ff9245b688e..948cc17b3f3 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol @@ -42,7 +42,7 @@ contract VRFV2PlusConsumerExample is ConfirmedOwner, VRFConsumerBaseV2Plus { function createSubscriptionAndFundNative() external payable { subscribe(); - s_vrfCoordinatorApiV1.fundSubscriptionWithEth{value: msg.value}(s_subId); + s_vrfCoordinatorApiV1.fundSubscriptionWithNative{value: msg.value}(s_subId); } function createSubscriptionAndFund(uint96 amount) external { @@ -58,7 +58,7 @@ contract VRFV2PlusConsumerExample is ConfirmedOwner, VRFConsumerBaseV2Plus { function topUpSubscriptionNative() external payable { require(s_subId != 0, "sub not set"); - s_vrfCoordinatorApiV1.fundSubscriptionWithEth{value: msg.value}(s_subId); + s_vrfCoordinatorApiV1.fundSubscriptionWithNative{value: msg.value}(s_subId); } function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol index f7b2233246e..b1dca81ebdf 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol @@ -2,14 +2,14 @@ pragma solidity ^0.8.0; import "../../interfaces/IVRFMigratableConsumerV2Plus.sol"; -import "../../interfaces/IVRFMigratableCoordinatorV2Plus.sol"; +import "../../interfaces/IVRFCoordinatorV2Plus.sol"; import "../libraries/VRFV2PlusClient.sol"; contract VRFV2PlusMaliciousMigrator is IVRFMigratableConsumerV2Plus { - IVRFMigratableCoordinatorV2Plus s_vrfCoordinator; + IVRFCoordinatorV2Plus s_vrfCoordinator; constructor(address _vrfCoordinator) { - s_vrfCoordinator = IVRFMigratableCoordinatorV2Plus(_vrfCoordinator); + s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator); } /** diff --git a/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Mock.t.sol b/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Mock.t.sol index ee184bd145e..dd607f2ce7b 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Mock.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Mock.t.sol @@ -6,7 +6,6 @@ import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; import {VRFCoordinatorV2Mock} from "../../../../src/v0.8/mocks/VRFCoordinatorV2Mock.sol"; import {VRFConsumerV2} from "../../../../src/v0.8/vrf/testhelpers/VRFConsumerV2.sol"; -import {VRFCoordinatorV2Plus} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2Plus.sol"; contract VRFCoordinatorV2MockTest is BaseTest { MockLinkToken internal s_linkToken; diff --git a/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Plus_Migration.t.sol b/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Plus_Migration.t.sol index 41cb24492c6..a847bd5beee 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Plus_Migration.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Plus_Migration.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.6; import "../BaseTest.t.sol"; import {VRFCoordinatorV2Plus_V2Example} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol"; -import {ExposedVRFCoordinatorV2Plus} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2Plus.sol"; -import {VRFCoordinatorV2Plus} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2Plus.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; +import {VRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol"; import {SubscriptionAPI} from "../../../../src/v0.8/dev/vrf/SubscriptionAPI.sol"; import {VRFV2PlusConsumerExample} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; @@ -24,9 +24,9 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { hex"a0434d9e47f3c86235477c7b1ae6ae5d3442d49b1943c2b752a68e2a47e247c701"; bytes32 internal constant KEY_HASH = hex"9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528"; - ExposedVRFCoordinatorV2Plus v1Coordinator; + ExposedVRFCoordinatorV2_5 v1Coordinator; VRFCoordinatorV2Plus_V2Example v2Coordinator; - ExposedVRFCoordinatorV2Plus v1Coordinator_noLink; + ExposedVRFCoordinatorV2_5 v1Coordinator_noLink; VRFCoordinatorV2Plus_V2Example v2Coordinator_noLink; uint256 subId; uint256 subId_noLink; @@ -34,7 +34,7 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { VRFV2PlusConsumerExample testConsumer_noLink; MockLinkToken linkToken; address linkTokenAddr; - MockV3Aggregator linkEthFeed; + MockV3Aggregator linkNativeFeed; address v1CoordinatorAddr; address v2CoordinatorAddr; address v1CoordinatorAddr_noLink; @@ -48,13 +48,13 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { BaseTest.setUp(); vm.deal(OWNER, 100 ether); address bhs = makeAddr("bhs"); - v1Coordinator = new ExposedVRFCoordinatorV2Plus(bhs); - v1Coordinator_noLink = new ExposedVRFCoordinatorV2Plus(bhs); + v1Coordinator = new ExposedVRFCoordinatorV2_5(bhs); + v1Coordinator_noLink = new ExposedVRFCoordinatorV2_5(bhs); subId = v1Coordinator.createSubscription(); subId_noLink = v1Coordinator_noLink.createSubscription(); linkToken = new MockLinkToken(); - linkEthFeed = new MockV3Aggregator(18, 500000000000000000); // .5 ETH (good for testing) - v1Coordinator.setLINKAndLINKETHFeed(address(linkToken), address(linkEthFeed)); + linkNativeFeed = new MockV3Aggregator(18, 500000000000000000); // .5 ETH (good for testing) + v1Coordinator.setLINKAndLINKNativeFeed(address(linkToken), address(linkNativeFeed)); linkTokenAddr = address(linkToken); v2Coordinator = new VRFCoordinatorV2Plus_V2Example(address(linkToken), address(v1Coordinator)); v2Coordinator_noLink = new VRFCoordinatorV2Plus_V2Example(address(0), address(v1Coordinator_noLink)); @@ -91,7 +91,7 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { 600, 10_000, 20_000, - VRFCoordinatorV2Plus.FeeConfig({fulfillmentFlatFeeLinkPPM: 200, fulfillmentFlatFeeEthPPM: 100}) + VRFCoordinatorV2_5.FeeConfig({fulfillmentFlatFeeLinkPPM: 200, fulfillmentFlatFeeNativePPM: 100}) ); v1Coordinator_noLink.setConfig( DEFAULT_REQUEST_CONFIRMATIONS, @@ -99,7 +99,7 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { 600, 10_000, 20_000, - VRFCoordinatorV2Plus.FeeConfig({fulfillmentFlatFeeLinkPPM: 200, fulfillmentFlatFeeEthPPM: 100}) + VRFCoordinatorV2_5.FeeConfig({fulfillmentFlatFeeLinkPPM: 200, fulfillmentFlatFeeNativePPM: 100}) ); registerProvingKey(); testConsumer.setCoordinator(v1CoordinatorAddr); @@ -117,7 +117,7 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { v1Coordinator.deregisterMigratableCoordinator(v2CoordinatorAddr); assertFalse(v1Coordinator.isTargetRegisteredExternal(v2CoordinatorAddr)); - vm.expectRevert(abi.encodeWithSelector(VRFCoordinatorV2Plus.CoordinatorNotRegistered.selector, v2CoordinatorAddr)); + vm.expectRevert(abi.encodeWithSelector(VRFCoordinatorV2_5.CoordinatorNotRegistered.selector, v2CoordinatorAddr)); v1Coordinator.migrate(subId, v2CoordinatorAddr); // test register/deregister multiple coordinators @@ -146,20 +146,20 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { function testMigration() public { linkToken.transferAndCall(v1CoordinatorAddr, DEFAULT_LINK_FUNDING, abi.encode(subId)); - v1Coordinator.fundSubscriptionWithEth{value: DEFAULT_NATIVE_FUNDING}(subId); + v1Coordinator.fundSubscriptionWithNative{value: DEFAULT_NATIVE_FUNDING}(subId); v1Coordinator.addConsumer(subId, address(testConsumer)); // subscription exists in V1 coordinator before migration - (uint96 balance, uint96 ethBalance, uint64 reqCount, address owner, address[] memory consumers) = v1Coordinator + (uint96 balance, uint96 nativeBalance, uint64 reqCount, address owner, address[] memory consumers) = v1Coordinator .getSubscription(subId); assertEq(balance, DEFAULT_LINK_FUNDING); - assertEq(ethBalance, DEFAULT_NATIVE_FUNDING); + assertEq(nativeBalance, DEFAULT_NATIVE_FUNDING); assertEq(owner, address(OWNER)); assertEq(consumers.length, 1); assertEq(consumers[0], address(testConsumer)); assertEq(v1Coordinator.s_totalBalance(), DEFAULT_LINK_FUNDING); - assertEq(v1Coordinator.s_totalEthBalance(), DEFAULT_NATIVE_FUNDING); + assertEq(v1Coordinator.s_totalNativeBalance(), DEFAULT_NATIVE_FUNDING); // Update consumer to point to the new coordinator vm.expectEmit( @@ -175,17 +175,18 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { vm.expectRevert(SubscriptionAPI.InvalidSubscription.selector); v1Coordinator.getSubscription(subId); assertEq(v1Coordinator.s_totalBalance(), 0); - assertEq(v1Coordinator.s_totalEthBalance(), 0); + assertEq(v1Coordinator.s_totalNativeBalance(), 0); assertEq(linkToken.balanceOf(v1CoordinatorAddr), 0); assertEq(v1CoordinatorAddr.balance, 0); // subscription exists in v2 coordinator - (owner, consumers, balance, ethBalance) = v2Coordinator.getSubscription(subId); + (balance, nativeBalance, reqCount, owner, consumers) = v2Coordinator.getSubscription(subId); assertEq(owner, address(OWNER)); assertEq(consumers.length, 1); assertEq(consumers[0], address(testConsumer)); + assertEq(reqCount, 0); assertEq(balance, DEFAULT_LINK_FUNDING); - assertEq(ethBalance, DEFAULT_NATIVE_FUNDING); + assertEq(nativeBalance, DEFAULT_NATIVE_FUNDING); assertEq(v2Coordinator.s_totalLinkBalance(), DEFAULT_LINK_FUNDING); assertEq(v2Coordinator.s_totalNativeBalance(), DEFAULT_NATIVE_FUNDING); assertEq(linkToken.balanceOf(v2CoordinatorAddr), DEFAULT_LINK_FUNDING); @@ -213,25 +214,25 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { } function testMigrationNoLink() public { - v1Coordinator_noLink.fundSubscriptionWithEth{value: DEFAULT_NATIVE_FUNDING}(subId_noLink); + v1Coordinator_noLink.fundSubscriptionWithNative{value: DEFAULT_NATIVE_FUNDING}(subId_noLink); v1Coordinator_noLink.addConsumer(subId_noLink, address(testConsumer_noLink)); // subscription exists in V1 coordinator before migration ( uint96 balance, - uint96 ethBalance, + uint96 nativeBalance, uint64 reqCount, address owner, address[] memory consumers ) = v1Coordinator_noLink.getSubscription(subId_noLink); assertEq(balance, 0); - assertEq(ethBalance, DEFAULT_NATIVE_FUNDING); + assertEq(nativeBalance, DEFAULT_NATIVE_FUNDING); assertEq(owner, address(OWNER)); assertEq(consumers.length, 1); assertEq(consumers[0], address(testConsumer_noLink)); assertEq(v1Coordinator_noLink.s_totalBalance(), 0); - assertEq(v1Coordinator_noLink.s_totalEthBalance(), DEFAULT_NATIVE_FUNDING); + assertEq(v1Coordinator_noLink.s_totalNativeBalance(), DEFAULT_NATIVE_FUNDING); // Update consumer to point to the new coordinator vm.expectEmit( @@ -247,17 +248,18 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { vm.expectRevert(SubscriptionAPI.InvalidSubscription.selector); v1Coordinator_noLink.getSubscription(subId); assertEq(v1Coordinator_noLink.s_totalBalance(), 0); - assertEq(v1Coordinator_noLink.s_totalEthBalance(), 0); + assertEq(v1Coordinator_noLink.s_totalNativeBalance(), 0); assertEq(linkToken.balanceOf(v1CoordinatorAddr_noLink), 0); assertEq(v1CoordinatorAddr_noLink.balance, 0); // subscription exists in v2 coordinator - (owner, consumers, balance, ethBalance) = v2Coordinator_noLink.getSubscription(subId_noLink); + (balance, nativeBalance, reqCount, owner, consumers) = v2Coordinator_noLink.getSubscription(subId_noLink); assertEq(owner, address(OWNER)); assertEq(consumers.length, 1); assertEq(consumers[0], address(testConsumer_noLink)); + assertEq(reqCount, 0); assertEq(balance, 0); - assertEq(ethBalance, DEFAULT_NATIVE_FUNDING); + assertEq(nativeBalance, DEFAULT_NATIVE_FUNDING); assertEq(v2Coordinator_noLink.s_totalLinkBalance(), 0); assertEq(v2Coordinator_noLink.s_totalNativeBalance(), DEFAULT_NATIVE_FUNDING); assertEq(linkToken.balanceOf(v2CoordinatorAddr_noLink), 0); @@ -288,7 +290,7 @@ contract VRFCoordinatorV2Plus_Migration is BaseTest { address invalidCoordinator = makeAddr("invalidCoordinator"); vm.expectRevert( - abi.encodeWithSelector(VRFCoordinatorV2Plus.CoordinatorNotRegistered.selector, address(invalidCoordinator)) + abi.encodeWithSelector(VRFCoordinatorV2_5.CoordinatorNotRegistered.selector, address(invalidCoordinator)) ); v1Coordinator.migrate(subId, invalidCoordinator); } diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol index 9eb3550a8f7..13d52b676c5 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol @@ -4,8 +4,8 @@ import "../BaseTest.t.sol"; import {VRF} from "../../../../src/v0.8/vrf/VRF.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; -import {ExposedVRFCoordinatorV2Plus} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2Plus.sol"; -import {VRFCoordinatorV2Plus} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2Plus.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; +import {VRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol"; import {SubscriptionAPI} from "../../../../src/v0.8/dev/vrf/SubscriptionAPI.sol"; import {BlockhashStore} from "../../../../src/v0.8/dev/BlockhashStore.sol"; import {VRFV2PlusConsumerExample} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol"; @@ -31,14 +31,14 @@ contract VRFV2Plus is BaseTest { hex"60806040523480156200001157600080fd5b5060405162001377380380620013778339810160408190526200003491620001cc565b8133806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000103565b5050600280546001600160a01b03199081166001600160a01b0394851617909155600580548216958416959095179094555060038054909316911617905562000204565b6001600160a01b0381163314156200015e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001c757600080fd5b919050565b60008060408385031215620001e057600080fd5b620001eb83620001af565b9150620001fb60208401620001af565b90509250929050565b61116380620002146000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80638098004311610097578063cf62c8ab11610066578063cf62c8ab14610242578063de367c8e14610255578063eff2701714610268578063f2fde38b1461027b57600080fd5b806380980043146101ab5780638da5cb5b146101be5780638ea98117146101cf578063a168fa89146101e257600080fd5b80635d7d53e3116100d35780635d7d53e314610166578063706da1ca1461016f5780637725135b1461017857806379ba5097146101a357600080fd5b80631fe543e31461010557806329e5d8311461011a5780632fa4e4421461014057806336bfffed14610153575b600080fd5b610118610113366004610e4e565b61028e565b005b61012d610128366004610ef2565b6102fa565b6040519081526020015b60405180910390f35b61011861014e366004610f7f565b610410565b610118610161366004610d5b565b6104bc565b61012d60045481565b61012d60065481565b60035461018b906001600160a01b031681565b6040516001600160a01b039091168152602001610137565b6101186105c0565b6101186101b9366004610e1c565b600655565b6000546001600160a01b031661018b565b6101186101dd366004610d39565b61067e565b61021d6101f0366004610e1c565b6007602052600090815260409020805460019091015460ff82169161010090046001600160a01b03169083565b6040805193151584526001600160a01b03909216602084015290820152606001610137565b610118610250366004610f7f565b61073d565b60055461018b906001600160a01b031681565b610118610276366004610f14565b610880565b610118610289366004610d39565b610a51565b6002546001600160a01b031633146102ec576002546040517f1cf993f40000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911660248201526044015b60405180910390fd5b6102f68282610a65565b5050565b60008281526007602090815260408083208151608081018352815460ff81161515825261010090046001600160a01b0316818501526001820154818401526002820180548451818702810187019095528085528695929460608601939092919083018282801561038957602002820191906000526020600020905b815481526020019060010190808311610375575b50505050508152505090508060400151600014156103e95760405162461bcd60e51b815260206004820152601760248201527f7265717565737420494420697320696e636f727265637400000000000000000060448201526064016102e3565b806060015183815181106103ff576103ff61111c565b602002602001015191505092915050565b6003546002546006546040805160208101929092526001600160a01b0393841693634000aea09316918591015b6040516020818303038152906040526040518463ffffffff1660e01b815260040161046a93929190610ffa565b602060405180830381600087803b15801561048457600080fd5b505af1158015610498573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f69190610dff565b60065461050b5760405162461bcd60e51b815260206004820152600d60248201527f7375624944206e6f74207365740000000000000000000000000000000000000060448201526064016102e3565b60005b81518110156102f65760055460065483516001600160a01b039092169163bec4c08c91908590859081106105445761054461111c565b60200260200101516040518363ffffffff1660e01b815260040161057b9291909182526001600160a01b0316602082015260400190565b600060405180830381600087803b15801561059557600080fd5b505af11580156105a9573d6000803e3d6000fd5b5050505080806105b8906110f3565b91505061050e565b6001546001600160a01b0316331461061a5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016102e3565b600080543373ffffffffffffffffffffffffffffffffffffffff19808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000546001600160a01b031633148015906106a457506002546001600160a01b03163314155b1561070e57336106bc6000546001600160a01b031690565b6002546040517f061db9c10000000000000000000000000000000000000000000000000000000081526001600160a01b03938416600482015291831660248301529190911660448201526064016102e3565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60065461041057600560009054906101000a90046001600160a01b03166001600160a01b031663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561079457600080fd5b505af11580156107a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cc9190610e35565b60068190556005546040517fbec4c08c00000000000000000000000000000000000000000000000000000000815260048101929092523060248301526001600160a01b03169063bec4c08c90604401600060405180830381600087803b15801561083557600080fd5b505af1158015610849573d6000803e3d6000fd5b505050506003546002546006546040516001600160a01b0393841693634000aea0931691859161043d919060200190815260200190565b60006040518060c0016040528084815260200160065481526020018661ffff1681526020018763ffffffff1681526020018563ffffffff1681526020016108d66040518060200160405280861515815250610af8565b90526002546040517f9b1c385e0000000000000000000000000000000000000000000000000000000081529192506000916001600160a01b0390911690639b1c385e90610927908590600401611039565b602060405180830381600087803b15801561094157600080fd5b505af1158015610955573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109799190610e35565b604080516080810182526000808252336020808401918252838501868152855184815280830187526060860190815287855260078352959093208451815493517fffffffffffffffffffffff0000000000000000000000000000000000000000009094169015157fffffffffffffffffffffff0000000000000000000000000000000000000000ff16176101006001600160a01b039094169390930292909217825591516001820155925180519495509193849392610a3f926002850192910190610ca9565b50505060049190915550505050505050565b610a59610b96565b610a6281610bf2565b50565b6004548214610ab65760405162461bcd60e51b815260206004820152601760248201527f7265717565737420494420697320696e636f727265637400000000000000000060448201526064016102e3565b60008281526007602090815260409091208251610adb92600290920191840190610ca9565b50506000908152600760205260409020805460ff19166001179055565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401610b3191511515815260200190565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b6000546001600160a01b03163314610bf05760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016102e3565b565b6001600160a01b038116331415610c4b5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016102e3565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610ce4579160200282015b82811115610ce4578251825591602001919060010190610cc9565b50610cf0929150610cf4565b5090565b5b80821115610cf05760008155600101610cf5565b80356001600160a01b0381168114610d2057600080fd5b919050565b803563ffffffff81168114610d2057600080fd5b600060208284031215610d4b57600080fd5b610d5482610d09565b9392505050565b60006020808385031215610d6e57600080fd5b823567ffffffffffffffff811115610d8557600080fd5b8301601f81018513610d9657600080fd5b8035610da9610da4826110cf565b61109e565b80828252848201915084840188868560051b8701011115610dc957600080fd5b600094505b83851015610df357610ddf81610d09565b835260019490940193918501918501610dce565b50979650505050505050565b600060208284031215610e1157600080fd5b8151610d5481611148565b600060208284031215610e2e57600080fd5b5035919050565b600060208284031215610e4757600080fd5b5051919050565b60008060408385031215610e6157600080fd5b8235915060208084013567ffffffffffffffff811115610e8057600080fd5b8401601f81018613610e9157600080fd5b8035610e9f610da4826110cf565b80828252848201915084840189868560051b8701011115610ebf57600080fd5b600094505b83851015610ee2578035835260019490940193918501918501610ec4565b5080955050505050509250929050565b60008060408385031215610f0557600080fd5b50508035926020909101359150565b600080600080600060a08688031215610f2c57600080fd5b610f3586610d25565b9450602086013561ffff81168114610f4c57600080fd5b9350610f5a60408701610d25565b9250606086013591506080860135610f7181611148565b809150509295509295909350565b600060208284031215610f9157600080fd5b81356bffffffffffffffffffffffff81168114610d5457600080fd5b6000815180845260005b81811015610fd357602081850181015186830182015201610fb7565b81811115610fe5576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b03841681526bffffffffffffffffffffffff831660208201526060604082015260006110306060830184610fad565b95945050505050565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c08084015261109660e0840182610fad565b949350505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156110c7576110c7611132565b604052919050565b600067ffffffffffffffff8211156110e9576110e9611132565b5060051b60200190565b600060001982141561111557634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610a6257600080fdfea164736f6c6343000806000a"; BlockhashStore s_bhs; - ExposedVRFCoordinatorV2Plus s_testCoordinator; - ExposedVRFCoordinatorV2Plus s_testCoordinator_noLink; + ExposedVRFCoordinatorV2_5 s_testCoordinator; + ExposedVRFCoordinatorV2_5 s_testCoordinator_noLink; VRFV2PlusConsumerExample s_testConsumer; MockLinkToken s_linkToken; - MockV3Aggregator s_linkEthFeed; + MockV3Aggregator s_linkNativeFeed; - VRFCoordinatorV2Plus.FeeConfig basicFeeConfig = - VRFCoordinatorV2Plus.FeeConfig({fulfillmentFlatFeeLinkPPM: 0, fulfillmentFlatFeeEthPPM: 0}); + VRFCoordinatorV2_5.FeeConfig basicFeeConfig = + VRFCoordinatorV2_5.FeeConfig({fulfillmentFlatFeeLinkPPM: 0, fulfillmentFlatFeeNativePPM: 0}); // VRF KeyV2 generated from a node; not sensitive information. // The secret key used to generate this key is: 10. @@ -60,9 +60,9 @@ contract VRFV2Plus is BaseTest { // Deploy coordinator and consumer. // Note: adding contract deployments to this section will require the VRF proofs be regenerated. - s_testCoordinator = new ExposedVRFCoordinatorV2Plus(address(s_bhs)); + s_testCoordinator = new ExposedVRFCoordinatorV2_5(address(s_bhs)); s_linkToken = new MockLinkToken(); - s_linkEthFeed = new MockV3Aggregator(18, 500000000000000000); // .5 ETH (good for testing) + s_linkNativeFeed = new MockV3Aggregator(18, 500000000000000000); // .5 ETH (good for testing) // Use create2 to deploy our consumer, so that its address is always the same // and surrounding changes do not alter our generated proofs. @@ -82,13 +82,13 @@ contract VRFV2Plus is BaseTest { } s_testConsumer = VRFV2PlusConsumerExample(consumerCreate2Address); - s_testCoordinator_noLink = new ExposedVRFCoordinatorV2Plus(address(s_bhs)); + s_testCoordinator_noLink = new ExposedVRFCoordinatorV2_5(address(s_bhs)); // Configure the coordinator. - s_testCoordinator.setLINKAndLINKETHFeed(address(s_linkToken), address(s_linkEthFeed)); + s_testCoordinator.setLINKAndLINKNativeFeed(address(s_linkToken), address(s_linkNativeFeed)); } - function setConfig(VRFCoordinatorV2Plus.FeeConfig memory feeConfig) internal { + function setConfig(VRFCoordinatorV2_5.FeeConfig memory feeConfig) internal { s_testCoordinator.setConfig( 0, // minRequestConfirmations 2_500_000, // maxGasLimit @@ -107,11 +107,11 @@ contract VRFV2Plus is BaseTest { assertEq(gasLimit, 2_500_000); // Test that setting requestConfirmations above MAX_REQUEST_CONFIRMATIONS reverts. - vm.expectRevert(abi.encodeWithSelector(VRFCoordinatorV2Plus.InvalidRequestConfirmations.selector, 500, 500, 200)); + vm.expectRevert(abi.encodeWithSelector(VRFCoordinatorV2_5.InvalidRequestConfirmations.selector, 500, 500, 200)); s_testCoordinator.setConfig(500, 2_500_000, 1, 50_000, 50000000000000000, basicFeeConfig); // Test that setting fallbackWeiPerUnitLink to zero reverts. - vm.expectRevert(abi.encodeWithSelector(VRFCoordinatorV2Plus.InvalidLinkWeiPrice.selector, 0)); + vm.expectRevert(abi.encodeWithSelector(VRFCoordinatorV2_5.InvalidLinkWeiPrice.selector, 0)); s_testCoordinator.setConfig(0, 2_500_000, 1, 50_000, 0, basicFeeConfig); } @@ -123,7 +123,7 @@ contract VRFV2Plus is BaseTest { // Should revert when already registered. uint256[2] memory uncompressedKeyParts = this.getProvingKeyParts(vrfUncompressedPublicKey); - vm.expectRevert(abi.encodeWithSelector(VRFCoordinatorV2Plus.ProvingKeyAlreadyRegistered.selector, vrfKeyHash)); + vm.expectRevert(abi.encodeWithSelector(VRFCoordinatorV2_5.ProvingKeyAlreadyRegistered.selector, vrfKeyHash)); s_testCoordinator.registerProvingKey(LINK_WHALE, uncompressedKeyParts); } @@ -142,12 +142,12 @@ contract VRFV2Plus is BaseTest { function testCreateSubscription() public { uint256 subId = s_testCoordinator.createSubscription(); - s_testCoordinator.fundSubscriptionWithEth{value: 10 ether}(subId); + s_testCoordinator.fundSubscriptionWithNative{value: 10 ether}(subId); } function testCancelSubWithNoLink() public { uint256 subId = s_testCoordinator_noLink.createSubscription(); - s_testCoordinator_noLink.fundSubscriptionWithEth{value: 1000 ether}(subId); + s_testCoordinator_noLink.fundSubscriptionWithNative{value: 1000 ether}(subId); assertEq(LINK_WHALE.balance, 9000 ether); s_testCoordinator_noLink.cancelSubscription(subId, LINK_WHALE); @@ -204,7 +204,7 @@ contract VRFV2Plus is BaseTest { } function paginateSubscriptions( - ExposedVRFCoordinatorV2Plus coordinator, + ExposedVRFCoordinatorV2_5 coordinator, uint256 batchSize ) internal view returns (uint256[][] memory) { uint arrIndex = 0; @@ -244,7 +244,7 @@ contract VRFV2Plus is BaseTest { vm.roll(requestBlock); s_testConsumer.createSubscriptionAndFund(0); uint256 subId = s_testConsumer.s_subId(); - s_testCoordinator.fundSubscriptionWithEth{value: 10 ether}(subId); + s_testCoordinator.fundSubscriptionWithNative{value: 10 ether}(subId); // Apply basic configs to contract. setConfig(basicFeeConfig); @@ -318,7 +318,7 @@ contract VRFV2Plus is BaseTest { ], zInv: 92231836131549905872346812799402691650433126386650679876913933650318463342041 }); - VRFCoordinatorV2Plus.RequestCommitment memory rc = VRFCoordinatorV2Plus.RequestCommitment({ + VRFCoordinatorV2_5.RequestCommitment memory rc = VRFCoordinatorV2_5.RequestCommitment({ blockNum: requestBlock, subId: subId, callbackGasLimit: 1_000_000, @@ -326,7 +326,7 @@ contract VRFV2Plus is BaseTest { sender: address(s_testConsumer), extraArgs: VRFV2PlusClient._argsToBytes(VRFV2PlusClient.ExtraArgsV1({nativePayment: true})) }); - (, uint96 ethBalanceBefore, , , ) = s_testCoordinator.getSubscription(subId); + (, uint96 nativeBalanceBefore, , , ) = s_testCoordinator.getSubscription(subId); uint256 outputSeed = s_testCoordinator.getRandomnessFromProofExternal(proof, rc).randomness; vm.recordLogs(); @@ -352,8 +352,8 @@ contract VRFV2Plus is BaseTest { // billed_fee = baseFeeWei + flatFeeWei + l1CostWei // billed_fee = baseFeeWei + 0 + 0 // billed_fee = 150_000 - (, uint96 ethBalanceAfter, , , ) = s_testCoordinator.getSubscription(subId); - assertApproxEqAbs(ethBalanceAfter, ethBalanceBefore - 120_000, 10_000); + (, uint96 nativeBalanceAfter, , , ) = s_testCoordinator.getSubscription(subId); + assertApproxEqAbs(nativeBalanceAfter, nativeBalanceBefore - 120_000, 10_000); } function testRequestAndFulfillRandomWordsLINK() public { @@ -434,7 +434,7 @@ contract VRFV2Plus is BaseTest { ], zInv: 37397948970756055003892765560695914630264479979131589134478580629419519112029 }); - VRFCoordinatorV2Plus.RequestCommitment memory rc = VRFCoordinatorV2Plus.RequestCommitment({ + VRFCoordinatorV2_5.RequestCommitment memory rc = VRFCoordinatorV2_5.RequestCommitment({ blockNum: requestBlock, subId: subId, callbackGasLimit: 1000000, @@ -462,14 +462,14 @@ contract VRFV2Plus is BaseTest { // gasAfterPaymentCalculation is 50_000. // // The cost of the VRF fulfillment charged to the user is: - // paymentNoFee = (weiPerUnitGas * (gasAfterPaymentCalculation + startGas - gasleft() + l1CostWei) / link_eth_ratio) + // paymentNoFee = (weiPerUnitGas * (gasAfterPaymentCalculation + startGas - gasleft() + l1CostWei) / link_native_ratio) // paymentNoFee = (1 * (50_000 + 90_000 + 0)) / .5 // paymentNoFee = 280_000 // ... // billed_fee = paymentNoFee + fulfillmentFlatFeeLinkPPM // billed_fee = baseFeeWei + 0 // billed_fee = 280_000 - // note: delta is doubled from the native test to account for more variance due to the link/eth ratio + // note: delta is doubled from the native test to account for more variance due to the link/native ratio (uint96 linkBalanceAfter, , , , ) = s_testCoordinator.getSubscription(subId); assertApproxEqAbs(linkBalanceAfter, linkBalanceBefore - 280_000, 20_000); } diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol index 813b3d4c808..db9e11e059e 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol @@ -1,7 +1,7 @@ pragma solidity 0.8.6; import "../BaseTest.t.sol"; -import {ExposedVRFCoordinatorV2Plus} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2Plus.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; import {SubscriptionAPI} from "../../../../src/v0.8/dev/vrf/SubscriptionAPI.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; @@ -9,41 +9,41 @@ import "@openzeppelin/contracts/utils/Strings.sol"; // for Strings.toString contract VRFV2PlusSubscriptionAPITest is BaseTest { event SubscriptionFunded(uint256 indexed subId, uint256 oldBalance, uint256 newBalance); - event SubscriptionFundedWithEth(uint256 indexed subId, uint256 oldEthBalance, uint256 newEthBalance); - event SubscriptionCanceled(uint256 indexed subId, address to, uint256 amountLink, uint256 amountEth); + event SubscriptionFundedWithNative(uint256 indexed subId, uint256 oldNativeBalance, uint256 newNativeBalance); + event SubscriptionCanceled(uint256 indexed subId, address to, uint256 amountLink, uint256 amountNative); event FundsRecovered(address to, uint256 amountLink); - event EthFundsRecovered(address to, uint256 amountEth); + event NativeFundsRecovered(address to, uint256 amountNative); event SubscriptionOwnerTransferRequested(uint256 indexed subId, address from, address to); event SubscriptionOwnerTransferred(uint256 indexed subId, address from, address to); event SubscriptionConsumerAdded(uint256 indexed subId, address consumer); - ExposedVRFCoordinatorV2Plus s_subscriptionAPI; + ExposedVRFCoordinatorV2_5 s_subscriptionAPI; function setUp() public override { BaseTest.setUp(); address bhs = makeAddr("bhs"); - s_subscriptionAPI = new ExposedVRFCoordinatorV2Plus(bhs); + s_subscriptionAPI = new ExposedVRFCoordinatorV2_5(bhs); } function testDefaultState() public { assertEq(address(s_subscriptionAPI.LINK()), address(0)); - assertEq(address(s_subscriptionAPI.LINK_ETH_FEED()), address(0)); + assertEq(address(s_subscriptionAPI.LINK_NATIVE_FEED()), address(0)); assertEq(s_subscriptionAPI.s_currentSubNonce(), 0); assertEq(s_subscriptionAPI.getActiveSubscriptionIdsLength(), 0); assertEq(s_subscriptionAPI.s_totalBalance(), 0); - assertEq(s_subscriptionAPI.s_totalEthBalance(), 0); + assertEq(s_subscriptionAPI.s_totalNativeBalance(), 0); } - function testSetLINKAndLINKETHFeed() public { + function testSetLINKAndLINKNativeFeed() public { address link = makeAddr("link"); - address linkEthFeed = makeAddr("linkEthFeed"); - s_subscriptionAPI.setLINKAndLINKETHFeed(link, linkEthFeed); + address linkNativeFeed = makeAddr("linkNativeFeed"); + s_subscriptionAPI.setLINKAndLINKNativeFeed(link, linkNativeFeed); assertEq(address(s_subscriptionAPI.LINK()), link); - assertEq(address(s_subscriptionAPI.LINK_ETH_FEED()), linkEthFeed); + assertEq(address(s_subscriptionAPI.LINK_NATIVE_FEED()), linkNativeFeed); // try setting it again, should revert vm.expectRevert(SubscriptionAPI.LinkAlreadySet.selector); - s_subscriptionAPI.setLINKAndLINKETHFeed(link, linkEthFeed); + s_subscriptionAPI.setLINKAndLINKNativeFeed(link, linkNativeFeed); } function testOwnerCancelSubscriptionNoFunds() public { @@ -88,8 +88,8 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // fund the subscription with ether vm.deal(subOwner, 10 ether); vm.expectEmit(true, false, false, true); - emit SubscriptionFundedWithEth(subId, 0, 5 ether); - s_subscriptionAPI.fundSubscriptionWithEth{value: 5 ether}(subId); + emit SubscriptionFundedWithNative(subId, 0, 5 ether); + s_subscriptionAPI.fundSubscriptionWithNative{value: 5 ether}(subId); // change back to owner and cancel the subscription changePrank(OWNER); @@ -100,9 +100,9 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // assert that the subscription no longer exists assertEq(s_subscriptionAPI.getActiveSubscriptionIdsLength(), 0); assertEq(s_subscriptionAPI.getSubscriptionConfig(subId).owner, address(0)); - assertEq(s_subscriptionAPI.getSubscriptionStruct(subId).ethBalance, 0); + assertEq(s_subscriptionAPI.getSubscriptionStruct(subId).nativeBalance, 0); - // check the ether balance of the subOwner, should be 10 ether + // check the native balance of the subOwner, should be 10 ether assertEq(address(subOwner).balance, 10 ether); } @@ -113,7 +113,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // Create link token and set the link token on the subscription api object MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // Create the subscription from a separate address @@ -151,7 +151,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // Create link token and set the link token on the subscription api object MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // Create the subscription from a separate address @@ -172,8 +172,8 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { vm.deal(subOwner, 10 ether); changePrank(subOwner); vm.expectEmit(true, false, false, true); - emit SubscriptionFundedWithEth(subId, 0, 5 ether); - s_subscriptionAPI.fundSubscriptionWithEth{value: 5 ether}(subId); + emit SubscriptionFundedWithNative(subId, 0, 5 ether); + s_subscriptionAPI.fundSubscriptionWithNative{value: 5 ether}(subId); // change back to owner and cancel the subscription changePrank(OWNER); @@ -185,12 +185,12 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { assertEq(s_subscriptionAPI.getActiveSubscriptionIdsLength(), 0); assertEq(s_subscriptionAPI.getSubscriptionConfig(subId).owner, address(0)); assertEq(s_subscriptionAPI.getSubscriptionStruct(subId).balance, 0); - assertEq(s_subscriptionAPI.getSubscriptionStruct(subId).ethBalance, 0); + assertEq(s_subscriptionAPI.getSubscriptionStruct(subId).nativeBalance, 0); // check the link balance of the sub owner, should be 5 LINK assertEq(linkToken.balanceOf(subOwner), 5 ether, "link balance incorrect"); // check the ether balance of the sub owner, should be 10 ether - assertEq(address(subOwner).balance, 10 ether, "eth balance incorrect"); + assertEq(address(subOwner).balance, 10 ether, "native balance incorrect"); } function testRecoverFundsLINKNotSet() public { @@ -208,7 +208,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // Create link token and set the link token on the subscription api object MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // set the total balance to be greater than the external balance @@ -230,7 +230,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // Create link token and set the link token on the subscription api object MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // transfer 10 LINK to the contract to recover @@ -250,7 +250,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // Create link token and set the link token on the subscription api object MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // create a subscription and fund it with 5 LINK @@ -272,29 +272,29 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { assertEq(linkToken.balanceOf(address(s_subscriptionAPI)), s_subscriptionAPI.s_totalBalance()); } - function testRecoverEthFundsBalanceInvariantViolated() public { + function testRecoverNativeFundsBalanceInvariantViolated() public { // set the total balance to be greater than the external balance // so that we trigger the invariant violation // note that this field is not modifiable in the actual contracts // other than through onTokenTransfer or similar functions - s_subscriptionAPI.setTotalEthBalanceTestingOnlyXXX(100 ether); + s_subscriptionAPI.setTotalNativeBalanceTestingOnlyXXX(100 ether); // call recoverFunds vm.expectRevert(abi.encodeWithSelector(SubscriptionAPI.BalanceInvariantViolated.selector, 100 ether, 0)); - s_subscriptionAPI.recoverEthFunds(payable(OWNER)); + s_subscriptionAPI.recoverNativeFunds(payable(OWNER)); } - function testRecoverEthFundsAmountToTransfer() public { + function testRecoverNativeFundsAmountToTransfer() public { // transfer 10 LINK to the contract to recover vm.deal(address(s_subscriptionAPI), 10 ether); // call recoverFunds vm.expectEmit(true, false, false, true); - emit EthFundsRecovered(OWNER, 10 ether); - s_subscriptionAPI.recoverEthFunds(payable(OWNER)); + emit NativeFundsRecovered(OWNER, 10 ether); + s_subscriptionAPI.recoverNativeFunds(payable(OWNER)); } - function testRecoverEthFundsNothingToTransfer() public { + function testRecoverNativeFundsNothingToTransfer() public { // create a subscription and fund it with 5 ether address subOwner = makeAddr("subOwner"); changePrank(subOwner); @@ -306,13 +306,13 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { vm.deal(subOwner, 5 ether); changePrank(subOwner); vm.expectEmit(true, false, false, true); - emit SubscriptionFundedWithEth(subId, 0, 5 ether); - s_subscriptionAPI.fundSubscriptionWithEth{value: 5 ether}(subId); + emit SubscriptionFundedWithNative(subId, 0, 5 ether); + s_subscriptionAPI.fundSubscriptionWithNative{value: 5 ether}(subId); - // call recoverEthFunds, nothing should happen because external balance == internal balance + // call recoverNativeFunds, nothing should happen because external balance == internal balance changePrank(OWNER); - s_subscriptionAPI.recoverEthFunds(payable(OWNER)); - assertEq(address(s_subscriptionAPI).balance, s_subscriptionAPI.s_totalEthBalance()); + s_subscriptionAPI.recoverNativeFunds(payable(OWNER)); + assertEq(address(s_subscriptionAPI).balance, s_subscriptionAPI.s_totalNativeBalance()); } function testOracleWithdrawNoLink() public { @@ -325,7 +325,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // CASE: link token set, trying to withdraw // more than balance MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // call oracleWithdraw @@ -337,7 +337,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // CASE: link token set, trying to withdraw // less than balance MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // transfer 10 LINK to the contract to withdraw @@ -364,16 +364,16 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { assertEq(s_subscriptionAPI.s_totalBalance(), 9 ether, "total balance incorrect"); } - function testOracleWithdrawEthInsufficientBalance() public { + function testOracleWithdrawNativeInsufficientBalance() public { // CASE: trying to withdraw more than balance // should revert with InsufficientBalance - // call oracleWithdrawEth + // call oracleWithdrawNative vm.expectRevert(SubscriptionAPI.InsufficientBalance.selector); - s_subscriptionAPI.oracleWithdrawEth(payable(OWNER), 1 ether); + s_subscriptionAPI.oracleWithdrawNative(payable(OWNER), 1 ether); } - function testOracleWithdrawEthSufficientBalance() public { + function testOracleWithdrawNativeSufficientBalance() public { // CASE: trying to withdraw less than balance // should withdraw successfully @@ -382,22 +382,22 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // set the withdrawable eth of the oracle to be 1 ether address oracle = makeAddr("oracle"); - s_subscriptionAPI.setWithdrawableEthTestingOnlyXXX(oracle, 1 ether); - assertEq(s_subscriptionAPI.getWithdrawableEthTestingOnlyXXX(oracle), 1 ether); + s_subscriptionAPI.setWithdrawableNativeTestingOnlyXXX(oracle, 1 ether); + assertEq(s_subscriptionAPI.getWithdrawableNativeTestingOnlyXXX(oracle), 1 ether); // set the total balance to be the same as the eth balance for consistency // (this is not necessary for the test, but just to be sane) - s_subscriptionAPI.setTotalEthBalanceTestingOnlyXXX(10 ether); + s_subscriptionAPI.setTotalNativeBalanceTestingOnlyXXX(10 ether); - // call oracleWithdrawEth from oracle address + // call oracleWithdrawNative from oracle address changePrank(oracle); - s_subscriptionAPI.oracleWithdrawEth(payable(oracle), 1 ether); - // assert eth balance of oracle - assertEq(address(oracle).balance, 1 ether, "oracle eth balance incorrect"); + s_subscriptionAPI.oracleWithdrawNative(payable(oracle), 1 ether); + // assert native balance of oracle + assertEq(address(oracle).balance, 1 ether, "oracle native balance incorrect"); // assert state of subscription api - assertEq(s_subscriptionAPI.getWithdrawableEthTestingOnlyXXX(oracle), 0, "oracle withdrawable eth incorrect"); + assertEq(s_subscriptionAPI.getWithdrawableNativeTestingOnlyXXX(oracle), 0, "oracle withdrawable native incorrect"); // assert that total balance is changed by the withdrawn amount - assertEq(s_subscriptionAPI.s_totalEthBalance(), 9 ether, "total eth balance incorrect"); + assertEq(s_subscriptionAPI.s_totalNativeBalance(), 9 ether, "total native balance incorrect"); } function testOnTokenTransferCallerNotLink() public { @@ -408,7 +408,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { function testOnTokenTransferInvalidCalldata() public { // create and set link token on subscription api MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // call link.transferAndCall with invalid calldata @@ -419,7 +419,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { function testOnTokenTransferInvalidSubscriptionId() public { // create and set link token on subscription api MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // generate bogus sub id @@ -434,7 +434,7 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { // happy path link funding test // create and set link token on subscription api MockLinkToken linkToken = new MockLinkToken(); - s_subscriptionAPI.setLINKAndLINKETHFeed(address(linkToken), address(0)); + s_subscriptionAPI.setLINKAndLINKNativeFeed(address(linkToken), address(0)); assertEq(address(s_subscriptionAPI.LINK()), address(linkToken)); // create a subscription and fund it with 5 LINK @@ -455,40 +455,40 @@ contract VRFV2PlusSubscriptionAPITest is BaseTest { assertEq(s_subscriptionAPI.getSubscriptionStruct(subId).balance, 5 ether); } - function testFundSubscriptionWithEthInvalidSubscriptionId() public { + function testFundSubscriptionWithNativeInvalidSubscriptionId() public { // CASE: invalid subscription id // should revert with InvalidSubscription uint256 subId = uint256(keccak256("idontexist")); - // try to fund the subscription with ether, should fail + // try to fund the subscription with native, should fail address funder = makeAddr("funder"); vm.deal(funder, 5 ether); changePrank(funder); vm.expectRevert(SubscriptionAPI.InvalidSubscription.selector); - s_subscriptionAPI.fundSubscriptionWithEth{value: 5 ether}(subId); + s_subscriptionAPI.fundSubscriptionWithNative{value: 5 ether}(subId); } - function testFundSubscriptionWithEth() public { + function testFundSubscriptionWithNative() public { // happy path test - // funding subscription with ether + // funding subscription with native - // create a subscription and fund it with ether + // create a subscription and fund it with native address subOwner = makeAddr("subOwner"); changePrank(subOwner); uint64 nonceBefore = s_subscriptionAPI.s_currentSubNonce(); uint256 subId = s_subscriptionAPI.createSubscription(); assertEq(s_subscriptionAPI.s_currentSubNonce(), nonceBefore + 1); - // fund the subscription with ether + // fund the subscription with native vm.deal(subOwner, 5 ether); changePrank(subOwner); vm.expectEmit(true, false, false, true); - emit SubscriptionFundedWithEth(subId, 0, 5 ether); - s_subscriptionAPI.fundSubscriptionWithEth{value: 5 ether}(subId); + emit SubscriptionFundedWithNative(subId, 0, 5 ether); + s_subscriptionAPI.fundSubscriptionWithNative{value: 5 ether}(subId); // assert that the subscription is funded - assertEq(s_subscriptionAPI.getSubscriptionStruct(subId).ethBalance, 5 ether); + assertEq(s_subscriptionAPI.getSubscriptionStruct(subId).nativeBalance, 5 ether); } function testCreateSubscription() public { diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol index 33bc72998f8..8ed39093821 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol @@ -4,10 +4,10 @@ import "../BaseTest.t.sol"; import {VRF} from "../../../../src/v0.8/vrf/VRF.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; -import {ExposedVRFCoordinatorV2Plus} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2Plus.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; import {VRFV2PlusWrapperConsumerBase} from "../../../../src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol"; import {VRFV2PlusWrapperConsumerExample} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol"; -import {VRFCoordinatorV2Plus} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2Plus.sol"; +import {VRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol"; import {VRFV2PlusWrapper} from "../../../../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol"; import {VRFV2PlusClient} from "../../../../src/v0.8/dev/vrf/libraries/VRFV2PlusClient.sol"; import {console} from "forge-std/console.sol"; @@ -18,14 +18,14 @@ contract VRFV2PlusWrapperTest is BaseTest { uint32 wrapperGasOverhead = 10_000; uint32 coordinatorGasOverhead = 20_000; - ExposedVRFCoordinatorV2Plus s_testCoordinator; + ExposedVRFCoordinatorV2_5 s_testCoordinator; MockLinkToken s_linkToken; - MockV3Aggregator s_linkEthFeed; + MockV3Aggregator s_linkNativeFeed; VRFV2PlusWrapper s_wrapper; VRFV2PlusWrapperConsumerExample s_consumer; - VRFCoordinatorV2Plus.FeeConfig basicFeeConfig = - VRFCoordinatorV2Plus.FeeConfig({fulfillmentFlatFeeLinkPPM: 0, fulfillmentFlatFeeEthPPM: 0}); + VRFCoordinatorV2_5.FeeConfig basicFeeConfig = + VRFCoordinatorV2_5.FeeConfig({fulfillmentFlatFeeLinkPPM: 0, fulfillmentFlatFeeNativePPM: 0}); function setUp() public override { BaseTest.setUp(); @@ -35,24 +35,24 @@ contract VRFV2PlusWrapperTest is BaseTest { vm.deal(LINK_WHALE, 10_000 ether); changePrank(LINK_WHALE); - // Deploy link token and link/eth feed. + // Deploy link token and link/native feed. s_linkToken = new MockLinkToken(); - s_linkEthFeed = new MockV3Aggregator(18, 500000000000000000); // .5 ETH (good for testing) + s_linkNativeFeed = new MockV3Aggregator(18, 500000000000000000); // .5 ETH (good for testing) // Deploy coordinator and consumer. - s_testCoordinator = new ExposedVRFCoordinatorV2Plus(address(0)); - s_wrapper = new VRFV2PlusWrapper(address(s_linkToken), address(s_linkEthFeed), address(s_testCoordinator)); + s_testCoordinator = new ExposedVRFCoordinatorV2_5(address(0)); + s_wrapper = new VRFV2PlusWrapper(address(s_linkToken), address(s_linkNativeFeed), address(s_testCoordinator)); s_consumer = new VRFV2PlusWrapperConsumerExample(address(s_linkToken), address(s_wrapper)); // Configure the coordinator. - s_testCoordinator.setLINKAndLINKETHFeed(address(s_linkToken), address(s_linkEthFeed)); + s_testCoordinator.setLINKAndLINKNativeFeed(address(s_linkToken), address(s_linkNativeFeed)); setConfigCoordinator(basicFeeConfig); setConfigWrapper(); s_testCoordinator.s_config(); } - function setConfigCoordinator(VRFCoordinatorV2Plus.FeeConfig memory feeConfig) internal { + function setConfigCoordinator(VRFCoordinatorV2_5.FeeConfig memory feeConfig) internal { s_testCoordinator.setConfig( 0, // minRequestConfirmations 2_500_000, // maxGasLimit @@ -100,14 +100,14 @@ contract VRFV2PlusWrapperTest is BaseTest { address indexed sender ); - function testSetLinkAndLinkEthFeed() public { + function testSetLinkAndLinkNativeFeed() public { VRFV2PlusWrapper wrapper = new VRFV2PlusWrapper(address(0), address(0), address(s_testCoordinator)); - // Set LINK and LINK/ETH feed on wrapper. + // Set LINK and LINK/Native feed on wrapper. wrapper.setLINK(address(s_linkToken)); - wrapper.setLinkEthFeed(address(s_linkEthFeed)); + wrapper.setLinkNativeFeed(address(s_linkNativeFeed)); assertEq(address(wrapper.s_link()), address(s_linkToken)); - assertEq(address(wrapper.s_linkEthFeed()), address(s_linkEthFeed)); + assertEq(address(wrapper.s_linkNativeFeed()), address(s_linkNativeFeed)); // Revert for subsequent assignment. vm.expectRevert(VRFV2PlusWrapper.LinkAlreadySet.selector); @@ -124,7 +124,7 @@ contract VRFV2PlusWrapperTest is BaseTest { function testRequestAndFulfillRandomWordsNativeWrapper() public { // Fund subscription. - s_testCoordinator.fundSubscriptionWithEth{value: 10 ether}(s_wrapper.SUBSCRIPTION_ID()); + s_testCoordinator.fundSubscriptionWithNative{value: 10 ether}(s_wrapper.SUBSCRIPTION_ID()); vm.deal(address(s_consumer), 10 ether); // Get type and version. @@ -222,7 +222,7 @@ contract VRFV2PlusWrapperTest is BaseTest { uint32 expectedPaid = (callbackGasLimit + wrapperGasOverhead + coordinatorGasOverhead) * 2; uint256 wrapperCostEstimate = s_wrapper.estimateRequestPrice(callbackGasLimit, tx.gasprice); uint256 wrapperCostCalculation = s_wrapper.calculateRequestPrice(callbackGasLimit); - assertEq(paid, expectedPaid); // 1_030_000 * 2 for link/eth ratio + assertEq(paid, expectedPaid); // 1_030_000 * 2 for link/native ratio assertEq(uint256(paid), wrapperCostEstimate); assertEq(wrapperCostEstimate, wrapperCostCalculation); assertEq(fulfilled, false); diff --git a/core/chains/evm/txmgr/transmitchecker.go b/core/chains/evm/txmgr/transmitchecker.go index 4569063d63d..969e789031c 100644 --- a/core/chains/evm/txmgr/transmitchecker.go +++ b/core/chains/evm/txmgr/transmitchecker.go @@ -19,7 +19,7 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" v1 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" v2 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - v2plus "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" bigmath "github.com/smartcontractkit/chainlink/v2/core/utils/big_math" @@ -84,7 +84,7 @@ func (c *CheckerFactory) BuildChecker(spec TransmitCheckerSpec) (TransmitChecker if spec.VRFCoordinatorAddress == nil { return nil, errors.Errorf("malformed checker, expected non-nil VRFCoordinatorAddress, got: %v", spec) } - coord, err := v2plus.NewVRFCoordinatorV2Plus(*spec.VRFCoordinatorAddress, c.Client) + coord, err := vrf_coordinator_v2plus_interface.NewIVRFCoordinatorV2PlusInternal(*spec.VRFCoordinatorAddress, c.Client) if err != nil { return nil, errors.Wrapf(err, "failed to create VRF V2 coordinator plus at address %v", spec.VRFCoordinatorAddress) diff --git a/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go b/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go new file mode 100644 index 00000000000..d4da270386e --- /dev/null +++ b/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go @@ -0,0 +1,3950 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package vrf_coordinator_v2_5 + +import ( + "errors" + "fmt" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type VRFCoordinatorV25FeeConfig struct { + FulfillmentFlatFeeLinkPPM uint32 + FulfillmentFlatFeeNativePPM uint32 +} + +type VRFCoordinatorV25RequestCommitment struct { + BlockNum uint64 + SubId *big.Int + CallbackGasLimit uint32 + NumWords uint32 + Sender common.Address + ExtraArgs []byte +} + +type VRFProof struct { + Pk [2]*big.Int + Gamma [2]*big.Int + C *big.Int + S *big.Int + Seed *big.Int + UWitness common.Address + CGammaWitness [2]*big.Int + SHashWitness [2]*big.Int + ZInv *big.Int +} + +type VRFV2PlusClientRandomWordsRequest struct { + KeyHash [32]byte + SubId *big.Int + RequestConfirmations uint16 + CallbackGasLimit uint32 + NumWords uint32 + ExtraArgs []byte +} + +var VRFCoordinatorV25MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2_5.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountNative\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldNativeBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNativeBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithNative\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"deregisterMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"deregisterProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2_5.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverNativeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2_5.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b506040516200615938038062006159833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615f7e620001db600039600081816106150152613a860152615f7e6000f3fe6080604052600436106102dc5760003560e01c806379ba50971161017f578063b08c8795116100e1578063da2f26101161008a578063e72f6e3011610064578063e72f6e3014610964578063ee9d2d3814610984578063f2fde38b146109b157600080fd5b8063da2f2610146108dd578063dac83d2914610913578063dc311dd31461093357600080fd5b8063caf70c4a116100bb578063caf70c4a1461087d578063cb6317971461089d578063d98e620e146108bd57600080fd5b8063b08c87951461081d578063b2a7cac51461083d578063bec4c08c1461085d57600080fd5b80639b1c385e11610143578063a4c0ed361161011d578063a4c0ed36146107b0578063aa433aff146107d0578063aefb212f146107f057600080fd5b80639b1c385e146107435780639d40a6fd14610763578063a21a23e41461079b57600080fd5b806379ba5097146106bd5780638402595e146106d257806386fe91c7146106f25780638da5cb5b1461071257806395b55cfc1461073057600080fd5b8063330987b31161024357806365982744116101ec5780636b6feccc116101c65780636b6feccc146106375780636f64f03f1461067d57806372e9d5651461069d57600080fd5b806365982744146105c357806366316d8d146105e3578063689c45171461060357600080fd5b806341af6c871161021d57806341af6c871461055e5780635d06b4ab1461058e57806364d51a2a146105ae57600080fd5b8063330987b3146104f3578063405b84fa1461051357806340d6bb821461053357600080fd5b80630ae09540116102a55780631b6b6d231161027f5780631b6b6d231461047f57806329492657146104b7578063294daa49146104d757600080fd5b80630ae09540146103f857806315c48b841461041857806318e3dd271461044057600080fd5b8062012291146102e157806304104edb1461030e578063043bd6ae14610330578063088070f51461035457806308821d58146103d8575b600080fd5b3480156102ed57600080fd5b506102f66109d1565b60405161030593929190615ae2565b60405180910390f35b34801561031a57600080fd5b5061032e61032936600461542f565b610a4d565b005b34801561033c57600080fd5b5061034660115481565b604051908152602001610305565b34801561036057600080fd5b50600d546103a09061ffff81169063ffffffff62010000820481169160ff600160301b820416916701000000000000008204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a001610305565b3480156103e457600080fd5b5061032e6103f336600461556f565b610c0f565b34801561040457600080fd5b5061032e610413366004615811565b610da3565b34801561042457600080fd5b5061042d60c881565b60405161ffff9091168152602001610305565b34801561044c57600080fd5b50600a5461046790600160601b90046001600160601b031681565b6040516001600160601b039091168152602001610305565b34801561048b57600080fd5b5060025461049f906001600160a01b031681565b6040516001600160a01b039091168152602001610305565b3480156104c357600080fd5b5061032e6104d236600461544c565b610e71565b3480156104e357600080fd5b5060405160018152602001610305565b3480156104ff57600080fd5b5061046761050e366004615641565b610fee565b34801561051f57600080fd5b5061032e61052e366004615811565b6114d8565b34801561053f57600080fd5b506105496101f481565b60405163ffffffff9091168152602001610305565b34801561056a57600080fd5b5061057e6105793660046155c4565b6118ff565b6040519015158152602001610305565b34801561059a57600080fd5b5061032e6105a936600461542f565b611b00565b3480156105ba57600080fd5b5061042d606481565b3480156105cf57600080fd5b5061032e6105de366004615481565b611bbe565b3480156105ef57600080fd5b5061032e6105fe36600461544c565b611c1e565b34801561060f57600080fd5b5061049f7f000000000000000000000000000000000000000000000000000000000000000081565b34801561064357600080fd5b506012546106609063ffffffff8082169164010000000090041682565b6040805163ffffffff938416815292909116602083015201610305565b34801561068957600080fd5b5061032e6106983660046154ba565b611de6565b3480156106a957600080fd5b5060035461049f906001600160a01b031681565b3480156106c957600080fd5b5061032e611ee5565b3480156106de57600080fd5b5061032e6106ed36600461542f565b611f96565b3480156106fe57600080fd5b50600a54610467906001600160601b031681565b34801561071e57600080fd5b506000546001600160a01b031661049f565b61032e61073e3660046155c4565b6120b1565b34801561074f57600080fd5b5061034661075e36600461571e565b6121f8565b34801561076f57600080fd5b50600754610783906001600160401b031681565b6040516001600160401b039091168152602001610305565b3480156107a757600080fd5b506103466125ed565b3480156107bc57600080fd5b5061032e6107cb3660046154e7565b61283d565b3480156107dc57600080fd5b5061032e6107eb3660046155c4565b6129dd565b3480156107fc57600080fd5b5061081061080b366004615836565b612a3d565b6040516103059190615a47565b34801561082957600080fd5b5061032e610838366004615773565b612b3e565b34801561084957600080fd5b5061032e6108583660046155c4565b612cd2565b34801561086957600080fd5b5061032e610878366004615811565b612e00565b34801561088957600080fd5b5061034661089836600461558b565b612f9c565b3480156108a957600080fd5b5061032e6108b8366004615811565b612fcc565b3480156108c957600080fd5b506103466108d83660046155c4565b6132cf565b3480156108e957600080fd5b5061049f6108f83660046155c4565b600e602052600090815260409020546001600160a01b031681565b34801561091f57600080fd5b5061032e61092e366004615811565b6132f0565b34801561093f57600080fd5b5061095361094e3660046155c4565b61340f565b604051610305959493929190615c4a565b34801561097057600080fd5b5061032e61097f36600461542f565b61350a565b34801561099057600080fd5b5061034661099f3660046155c4565b60106020526000908152604090205481565b3480156109bd57600080fd5b5061032e6109cc36600461542f565b6136f2565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff16939192839190830182828015610a3b57602002820191906000526020600020905b815481526020019060010190808311610a27575b50505050509050925092509250909192565b610a55613703565b60135460005b81811015610be257826001600160a01b031660138281548110610a8057610a80615f22565b6000918252602090912001546001600160a01b03161415610bd0576013610aa8600184615e1b565b81548110610ab857610ab8615f22565b600091825260209091200154601380546001600160a01b039092169183908110610ae457610ae4615f22565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055826013610b1b600185615e1b565b81548110610b2b57610b2b615f22565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506013805480610b6a57610b6a615f0c565b6000828152602090819020600019908301810180546001600160a01b03191690559091019091556040516001600160a01b03851681527ff80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af37910160405180910390a1505050565b80610bda81615e8a565b915050610a5b565b50604051635428d44960e01b81526001600160a01b03831660048201526024015b60405180910390fd5b50565b610c17613703565b604080518082018252600091610c46919084906002908390839080828437600092019190915250612f9c915050565b6000818152600e60205260409020549091506001600160a01b031680610c8257604051631dfd6e1360e21b815260048101839052602401610c03565b6000828152600e6020526040812080546001600160a01b03191690555b600f54811015610d5a5782600f8281548110610cbd57610cbd615f22565b90600052602060002001541415610d4857600f805460009190610ce290600190615e1b565b81548110610cf257610cf2615f22565b9060005260206000200154905080600f8381548110610d1357610d13615f22565b600091825260209091200155600f805480610d3057610d30615f0c565b60019003818190600052602060002001600090559055505b80610d5281615e8a565b915050610c9f565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610d9691815260200190565b60405180910390a2505050565b60008281526005602052604090205482906001600160a01b031680610ddb57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614610e0f57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615610e3a5760405163769dd35360e11b815260040160405180910390fd5b610e43846118ff565b15610e6157604051631685ecdd60e31b815260040160405180910390fd5b610e6b848461375f565b50505050565b600d54600160301b900460ff1615610e9c5760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610ed857604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610f009084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610f489190615e32565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610fc2576040519150601f19603f3d011682016040523d82523d6000602084013e610fc7565b606091505b5050905080610fe95760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff161561101c5760405163769dd35360e11b815260040160405180910390fd5b60005a9050600061102d858561391b565b90506000846060015163ffffffff166001600160401b0381111561105357611053615f38565b60405190808252806020026020018201604052801561107c578160200160208202803683370190505b50905060005b856060015163ffffffff168110156110fc578260400151816040516020016110b4929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c8282815181106110df576110df615f22565b6020908102919091010152806110f481615e8a565b915050611082565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b9161113491908690602401615b55565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805466ff0000000000001916600160301b17905590880151608089015191925060009161119c9163ffffffff169084613ba8565b600d805466ff00000000000019169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b03166111df816001615d9b565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a0151805161122c90600190615e1b565b8151811061123c5761123c615f22565b602091010151600d5460f89190911c600114915060009061126d908a90600160581b900463ffffffff163a85613bf6565b90508115611376576020808c01516000908152600690915260409020546001600160601b03808316600160601b9092041610156112bd57604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c906112f4908490600160601b90046001600160601b0316615e32565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c90915281208054859450909261134d91859116615dc6565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550611462565b6020808c01516000908152600690915260409020546001600160601b03808316911610156113b757604051631e9acf1760e31b815260040160405180910390fd5b6020808c0151600090815260069091526040812080548392906113e49084906001600160601b0316615e32565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b90915281208054859450909261143d91859116615dc6565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a6040015184886040516114bf939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff16156115035760405163769dd35360e11b815260040160405180910390fd5b61150c81613c46565b61153457604051635428d44960e01b81526001600160a01b0382166004820152602401610c03565b6000806000806115438661340f565b945094505093509350336001600160a01b0316826001600160a01b0316146115ad5760405162461bcd60e51b815260206004820152601660248201527f4e6f7420737562736372697074696f6e206f776e6572000000000000000000006044820152606401610c03565b6115b6866118ff565b156116035760405162461bcd60e51b815260206004820152601660248201527f50656e64696e67207265717565737420657869737473000000000000000000006044820152606401610c03565b60006040518060c00160405280611618600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b0316815250905060008160405160200161166c9190615a6d565b604051602081830303815290604052905061168688613cb0565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b038816906116bf908590600401615a5a565b6000604051808303818588803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611715905057506001600160601b03861615155b156117f45760025460405163a9059cbb60e01b81526001600160a01b0389811660048301526001600160601b03891660248301529091169063a9059cbb90604401602060405180830381600087803b15801561177057600080fd5b505af1158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a891906155a7565b6117f45760405162461bcd60e51b815260206004820152601260248201527f696e73756666696369656e742066756e647300000000000000000000000000006044820152606401610c03565b600d805466ff0000000000001916600160301b17905560005b83518110156118a25783818151811061182857611828615f22565b6020908102919091010151604051638ea9811760e01b81526001600160a01b038a8116600483015290911690638ea9811790602401600060405180830381600087803b15801561187757600080fd5b505af115801561188b573d6000803e3d6000fd5b50505050808061189a90615e8a565b91505061180d565b50600d805466ff00000000000019169055604080516001600160a01b0389168152602081018a90527fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187910160405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561198957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161196b575b505050505081525050905060005b816040015151811015611af65760005b600f54811015611ae3576000611aac600f83815481106119c9576119c9615f22565b9060005260206000200154856040015185815181106119ea576119ea615f22565b6020026020010151886004600089604001518981518110611a0d57611a0d615f22565b6020908102919091018101516001600160a01b03908116835282820193909352604091820160009081208e82528252829020548251808301889052959093168583015260608501939093526001600160401b039091166080808501919091528151808503909101815260a08401825280519083012060c084019490945260e0808401859052815180850390910181526101009093019052815191012091565b5060008181526010602052604090205490915015611ad05750600195945050505050565b5080611adb81615e8a565b9150506119a7565b5080611aee81615e8a565b915050611997565b5060009392505050565b611b08613703565b611b1181613c46565b15611b3a5760405163ac8a27ef60e01b81526001600160a01b0382166004820152602401610c03565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af016259060200160405180910390a150565b611bc6613703565b6002546001600160a01b031615611bf057604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff1615611c495760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b0316611c725760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b0380831691161015611cae57604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b602052604081208054839290611cd69084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b0316611d1e9190615e32565b82546101009290920a6001600160601b0381810219909316918316021790915560025460405163a9059cbb60e01b81526001600160a01b03868116600483015292851660248201529116915063a9059cbb90604401602060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc591906155a7565b611de257604051631e9acf1760e31b815260040160405180910390fd5b5050565b611dee613703565b604080518082018252600091611e1d919084906002908390839080828437600092019190915250612f9c915050565b6000818152600e60205260409020549091506001600160a01b031615611e5957604051634a0b8fa760e01b815260048101829052602401610c03565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610d96565b6001546001600160a01b03163314611f3f5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610c03565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611f9e613703565b600a544790600160601b90046001600160601b031681811115611fde576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015610fe9576000611ff28284615e1b565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114612041576040519150601f19603f3d011682016040523d82523d6000602084013e612046565b606091505b50509050806120685760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b0387168152602081018490527f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c910160405180910390a15050505050565b600d54600160301b900460ff16156120dc5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661211157604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c6121408385615dc6565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b03166121889190615dc6565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e9028234846121db9190615d83565b604080519283526020830191909152015b60405180910390a25050565b600d54600090600160301b900460ff16156122265760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b031661226157604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b0316806122b2576040516379bfd40160e01b815260208401356004820152336024820152604401610c03565b600d5461ffff166122c96060850160408601615758565b61ffff1610806122ec575060c86122e66060850160408601615758565b61ffff16115b15612332576123016060840160408501615758565b600d5460405163539c34bb60e11b815261ffff92831660048201529116602482015260c86044820152606401610c03565b600d5462010000900463ffffffff166123516080850160608601615858565b63ffffffff1611156123a15761236d6080840160608501615858565b600d54604051637aebf00f60e11b815263ffffffff9283166004820152620100009091049091166024820152604401610c03565b6101f46123b460a0850160808601615858565b63ffffffff1611156123fa576123d060a0840160808501615858565b6040516311ce1afb60e21b815263ffffffff90911660048201526101f46024820152604401610c03565b6000612407826001615d9b565b604080518635602080830182905233838501528089013560608401526001600160401b0385166080808501919091528451808503909101815260a0808501865281519183019190912060c085019390935260e0808501849052855180860390910181526101009094019094528251920191909120929350906000906124979061249290890189615c9f565b613eff565b905060006124a482613f7c565b9050836124af613fed565b60208a01356124c460808c0160608d01615858565b6124d460a08d0160808e01615858565b33866040516020016124ec9796959493929190615bad565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d60400160208101906125639190615758565b8e60600160208101906125769190615858565b8f60800160208101906125899190615858565b8960405161259c96959493929190615b6e565b60405180910390a450503360009081526004602090815260408083208983013584529091529020805467ffffffffffffffff19166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561261b5760405163769dd35360e11b815260040160405180910390fd5b600033612629600143615e1b565b600754604051606093841b6bffffffffffffffffffffffff199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006126a883615ea5565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b038111156126e7576126e7615f38565b604051908082528060200260200182016040528015612710578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b0392831617835592516001830180549094169116179091559251805194955090936127f19260028501920190615145565b5061280191506008905083614086565b5060405133815282907f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d9060200160405180910390a250905090565b600d54600160301b900460ff16156128685760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03163314612893576040516344b0e3c360e01b815260040160405180910390fd5b602081146128b457604051638129bbcd60e01b815260040160405180910390fd5b60006128c2828401846155c4565b6000818152600560205260409020549091506001600160a01b03166128fa57604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b0316918691906129218385615dc6565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166129699190615dc6565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846129bc9190615d83565b604080519283526020830191909152015b60405180910390a2505050505050565b6129e5613703565b6000818152600560205260409020546001600160a01b0316612a1a57604051630fb532db60e11b815260040160405180910390fd5b600081815260056020526040902054610c0c9082906001600160a01b031661375f565b60606000612a4b6008614092565b9050808410612a6d57604051631390f2a160e01b815260040160405180910390fd5b6000612a798486615d83565b905081811180612a87575083155b612a915780612a93565b815b90506000612aa18683615e1b565b6001600160401b03811115612ab857612ab8615f38565b604051908082528060200260200182016040528015612ae1578160200160208202803683370190505b50905060005b8151811015612b3457612b05612afd8883615d83565b60089061409c565b828281518110612b1757612b17615f22565b602090810291909101015280612b2c81615e8a565b915050612ae7565b5095945050505050565b612b46613703565b60c861ffff87161115612b805760405163539c34bb60e11b815261ffff871660048201819052602482015260c86044820152606401610c03565b60008213612ba4576040516321ea67b360e11b815260048101839052602401610c03565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff19168817620100008702176effffffffffffffffff000000000000191667010000000000000085026effffffff0000000000000000000000191617600160581b83021790558a51601280548d87015192891667ffffffffffffffff199091161764010000000092891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff1615612cfd5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316612d3257604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612d8b576000818152600560205260409081902060010154905163d084e97560e01b81526001600160a01b039091166004820152602401610c03565b6000818152600560209081526040918290208054336001600160a01b0319808316821784556001909301805490931690925583516001600160a01b0390911680825292810191909152909183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691016121ec565b60008281526005602052604090205482906001600160a01b031680612e3857604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612e6c57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615612e975760405163769dd35360e11b815260040160405180910390fd5b60008481526005602052604090206002015460641415612eca576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b031615612f0157610e6b565b6001600160a01b03831660008181526004602090815260408083208884528252808320805467ffffffffffffffff19166001908117909155600583528184206002018054918201815584529282902090920180546001600160a01b03191684179055905191825285917f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e191015b60405180910390a250505050565b600081604051602001612faf9190615a39565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b03168061300457604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461303857604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156130635760405163769dd35360e11b815260040160405180910390fd5b61306c846118ff565b1561308a57604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b03166130e6576040516379bfd40160e01b8152600481018590526001600160a01b0384166024820152604401610c03565b60008481526005602090815260408083206002018054825181850281018501909352808352919290919083018282801561314957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161312b575b505050505090506000600182516131609190615e1b565b905060005b825181101561326c57856001600160a01b031683828151811061318a5761318a615f22565b60200260200101516001600160a01b0316141561325a5760008383815181106131b5576131b5615f22565b6020026020010151905080600560008a815260200190815260200160002060020183815481106131e7576131e7615f22565b600091825260208083209190910180546001600160a01b0319166001600160a01b03949094169390931790925589815260059091526040902060020180548061323257613232615f0c565b600082815260209020810160001990810180546001600160a01b03191690550190555061326c565b8061326481615e8a565b915050613165565b506001600160a01b03851660008181526004602090815260408083208a8452825291829020805467ffffffffffffffff19169055905191825287917f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a791016129cd565b600f81815481106132df57600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061332857604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461335c57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156133875760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b03848116911614610e6b5760008481526005602090815260409182902060010180546001600160a01b0319166001600160a01b03871690811790915582513381529182015285917f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19101612f8e565b6000818152600560205260408120548190819081906060906001600160a01b031661344d57604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156134f057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116134d2575b505050505090509450945094509450945091939590929450565b613512613703565b6002546001600160a01b031661353b5760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561357f57600080fd5b505afa158015613593573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135b791906155dd565b600a549091506001600160601b0316818111156135f1576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015610fe95760006136058284615e1b565b60025460405163a9059cbb60e01b81526001600160a01b0387811660048301526024820184905292935091169063a9059cbb90604401602060405180830381600087803b15801561365557600080fd5b505af1158015613669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061368d91906155a7565b6136aa57604051631f01ff1360e21b815260040160405180910390fd5b604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a150505050565b6136fa613703565b610c0c816140a8565b6000546001600160a01b0316331461375d5760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c03565b565b60008061376b84613cb0565b60025491935091506001600160a01b03161580159061379257506001600160601b03821615155b156138425760025460405163a9059cbb60e01b81526001600160a01b0385811660048301526001600160601b03851660248301529091169063a9059cbb90604401602060405180830381600087803b1580156137ed57600080fd5b505af1158015613801573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382591906155a7565b61384257604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613898576040519150601f19603f3d011682016040523d82523d6000602084013e61389d565b606091505b50509050806138bf5760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006139478460000151612f9c565b6000818152600e60205260409020549091506001600160a01b03168061398357604051631dfd6e1360e21b815260048101839052602401610c03565b60008286608001516040516020016139a5929190918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526010909352912054909150806139eb57604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613a1a978a979096959101615bf7565b604051602081830303815290604052805190602001208114613a4f5760405163354a450b60e21b815260040160405180910390fd5b6000613a5e8760000151614152565b905080613b36578651604051631d2827a760e31b81526001600160401b0390911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b158015613ad057600080fd5b505afa158015613ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b0891906155dd565b905080613b3657865160405163175dadad60e01b81526001600160401b039091166004820152602401610c03565b6000886080015182604051602001613b58929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506000613b7f8a83614249565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a611388811015613bba57600080fd5b611388810390508460408204820311613bd257600080fd5b50823b613bde57600080fd5b60008083516020850160008789f190505b9392505050565b60008115613c2457601254613c1d9086908690640100000000900463ffffffff16866142b4565b9050613c3e565b601254613c3b908690869063ffffffff168661431e565b90505b949350505050565b6000805b601354811015613ca757826001600160a01b031660138281548110613c7157613c71615f22565b6000918252602090912001546001600160a01b03161415613c955750600192915050565b80613c9f81615e8a565b915050613c4a565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287968796949594860193919290830182828015613d3c57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613d1e575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613e19576004600084604001518381518110613dc857613dc8615f22565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208982529092529020805467ffffffffffffffff1916905580613e1181615e8a565b915050613da1565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613e5160028301826151aa565b5050600085815260066020526040812055613e6d60088661440c565b50600a8054859190600090613e8c9084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613ed49190615e32565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081019091526000815281613f2857506040805160208101909152600081526114d2565b63125fa26760e31b613f3a8385615e5a565b6001600160e01b03191614613f6257604051632923fee760e11b815260040160405180910390fd5b613f6f8260048186615d59565b810190613bef91906155f6565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613fb591511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b60004661a4b1811480614002575062066eed81145b1561407f5760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561404157600080fd5b505afa158015614055573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061407991906155dd565b91505090565b4391505090565b6000613bef8383614418565b60006114d2825490565b6000613bef8383614467565b6001600160a01b0381163314156141015760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c03565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60004661a4b1811480614167575062066eed81145b80614174575062066eee81145b1561423a57610100836001600160401b031661418e613fed565b6141989190615e1b565b11806141b457506141a7613fed565b836001600160401b031610155b156141c25750600092915050565b6040516315a03d4160e11b81526001600160401b0384166004820152606490632b407a829060240160206040518083038186803b15801561420257600080fd5b505afa158015614216573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bef91906155dd565b50506001600160401b03164090565b600061427d8360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151614491565b60038360200151604051602001614295929190615b41565b60408051601f1981840301815291905280516020909101209392505050565b6000806142bf6146bc565b905060005a6142ce8888615d83565b6142d89190615e1b565b6142e29085615dfc565b905060006142fb63ffffffff871664e8d4a51000615dfc565b9050826143088284615d83565b6143129190615d83565b98975050505050505050565b600080614329614718565b90506000811361434f576040516321ea67b360e11b815260048101829052602401610c03565b60006143596146bc565b9050600082825a61436a8b8b615d83565b6143749190615e1b565b61437e9088615dfc565b6143889190615d83565b61439a90670de0b6b3a7640000615dfc565b6143a49190615de8565b905060006143bd63ffffffff881664e8d4a51000615dfc565b90506143d5816b033b2e3c9fd0803ce8000000615e1b565b8211156143f55760405163e80fa38160e01b815260040160405180910390fd5b6143ff8183615d83565b9998505050505050505050565b6000613bef83836147e7565b600081815260018301602052604081205461445f575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556114d2565b5060006114d2565b600082600001828154811061447e5761447e615f22565b9060005260206000200154905092915050565b61449a896148da565b6144e65760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e2063757276650000000000006044820152606401610c03565b6144ef886148da565b61453b5760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e20637572766500000000000000000000006044820152606401610c03565b614544836148da565b6145905760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e2063757276650000006044820152606401610c03565b614599826148da565b6145e55760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e206375727665000000006044820152606401610c03565b6145f1878a88876149b3565b61463d5760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e657373000000000000006044820152606401610c03565b60006146498a87614ad6565b9050600061465c898b878b868989614b3a565b9050600061466d838d8d8a86614c5a565b9050808a146146ae5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610c03565b505050505050505050505050565b60004661a4b18114806146d1575062066eed81145b1561471057606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561404157600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093670100000000000000900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561477a57600080fd5b505afa15801561478e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b29190615873565b5094509092508491505080156147d657506147cd8242615e1b565b8463ffffffff16105b15613c3e5750601154949350505050565b600081815260018301602052604081205480156148d057600061480b600183615e1b565b855490915060009061481f90600190615e1b565b905081811461488457600086600001828154811061483f5761483f615f22565b906000526020600020015490508087600001848154811061486257614862615f22565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061489557614895615f0c565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506114d2565b60009150506114d2565b80516000906401000003d019116149335760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d0191161498c5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d0199080096149ac8360005b6020020151614c9a565b1492915050565b60006001600160a01b0382166149f95760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b6044820152606401610c03565b602084015160009060011615614a1057601c614a13565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614aae573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614ade6151c8565b614b0b60018484604051602001614af793929190615a18565b604051602081830303815290604052614cbe565b90505b614b17816148da565b6114d2578051604080516020810192909252614b339101614af7565b9050614b0e565b614b426151c8565b825186516401000003d0199081900691061415614ba15760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e637400006044820152606401610c03565b614bac878988614d0c565b614bf85760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c6564000000000000000000006044820152606401610c03565b614c03848685614d0c565b614c4f5760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c65640000000000000000006044820152606401610c03565b614312868484614e34565b600060028686868587604051602001614c78969594939291906159b9565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614cc66151c8565b614ccf82614efb565b8152614ce4614cdf8260006149a2565b614f36565b6020820181905260029006600114156125e8576020810180516401000003d019039052919050565b600082614d495760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b6044820152606401610c03565b83516020850151600090614d5f90600290615ecc565b15614d6b57601c614d6e565b601b5b9050600070014551231950b75fc4402da1732fc9bebe198387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa158015614de0573d6000803e3d6000fd5b505050602060405103519050600086604051602001614dff91906159a7565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614e3c6151c8565b835160208086015185519186015160009384938493614e5d93909190614f56565b919450925090506401000003d019858209600114614ebd5760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a000000000000006044820152606401610c03565b60405180604001604052806401000003d01980614edc57614edc615ef6565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d01981106125e857604080516020808201939093528151808203840181529082019091528051910120614f03565b60006114d2826002614f4f6401000003d0196001615d83565b901c615036565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614f96838385856150d8565b9098509050614fa788828e886150fc565b9098509050614fb888828c876150fc565b90985090506000614fcb8d878b856150fc565b9098509050614fdc888286866150d8565b9098509050614fed88828e896150fc565b9098509050818114615022576401000003d019818a0998506401000003d01982890997506401000003d0198183099650615026565b8196505b5050505050509450945094915050565b6000806150416151e6565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152615073615204565b60208160c0846005600019fa9250826150ce5760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c7572652100000000000000000000000000006044820152606401610c03565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b82805482825590600052602060002090810192821561519a579160200282015b8281111561519a57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615165565b506151a6929150615222565b5090565b5080546000825590600052602060002090810190610c0c9190615222565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b808211156151a65760008155600101615223565b80356125e881615f4e565b80604081018310156114d257600080fd5b600082601f83011261526457600080fd5b61526c615cec565b80838560408601111561527e57600080fd5b60005b60028110156152a0578135845260209384019390910190600101615281565b509095945050505050565b600082601f8301126152bc57600080fd5b81356001600160401b03808211156152d6576152d6615f38565b604051601f8301601f19908116603f011681019082821181831017156152fe576152fe615f38565b8160405283815286602085880101111561531757600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060c0828403121561534957600080fd5b615351615d14565b905081356001600160401b03808216821461536b57600080fd5b81835260208401356020840152615384604085016153ea565b6040840152615395606085016153ea565b60608401526153a660808501615237565b608084015260a08401359150808211156153bf57600080fd5b506153cc848285016152ab565b60a08301525092915050565b803561ffff811681146125e857600080fd5b803563ffffffff811681146125e857600080fd5b805169ffffffffffffffffffff811681146125e857600080fd5b80356001600160601b03811681146125e857600080fd5b60006020828403121561544157600080fd5b8135613bef81615f4e565b6000806040838503121561545f57600080fd5b823561546a81615f4e565b915061547860208401615418565b90509250929050565b6000806040838503121561549457600080fd5b823561549f81615f4e565b915060208301356154af81615f4e565b809150509250929050565b600080606083850312156154cd57600080fd5b82356154d881615f4e565b91506154788460208501615242565b600080600080606085870312156154fd57600080fd5b843561550881615f4e565b93506020850135925060408501356001600160401b038082111561552b57600080fd5b818701915087601f83011261553f57600080fd5b81358181111561554e57600080fd5b88602082850101111561556057600080fd5b95989497505060200194505050565b60006040828403121561558157600080fd5b613bef8383615242565b60006040828403121561559d57600080fd5b613bef8383615253565b6000602082840312156155b957600080fd5b8151613bef81615f63565b6000602082840312156155d657600080fd5b5035919050565b6000602082840312156155ef57600080fd5b5051919050565b60006020828403121561560857600080fd5b604051602081018181106001600160401b038211171561562a5761562a615f38565b604052823561563881615f63565b81529392505050565b6000808284036101c081121561565657600080fd5b6101a08082121561566657600080fd5b61566e615d36565b915061567a8686615253565b82526156898660408701615253565b60208301526080850135604083015260a0850135606083015260c085013560808301526156b860e08601615237565b60a08301526101006156cc87828801615253565b60c08401526156df876101408801615253565b60e0840152610180860135908301529092508301356001600160401b0381111561570857600080fd5b61571485828601615337565b9150509250929050565b60006020828403121561573057600080fd5b81356001600160401b0381111561574657600080fd5b820160c08185031215613bef57600080fd5b60006020828403121561576a57600080fd5b613bef826153d8565b60008060008060008086880360e081121561578d57600080fd5b615796886153d8565b96506157a4602089016153ea565b95506157b2604089016153ea565b94506157c0606089016153ea565b9350608088013592506040609f19820112156157db57600080fd5b506157e4615cec565b6157f060a089016153ea565b81526157fe60c089016153ea565b6020820152809150509295509295509295565b6000806040838503121561582457600080fd5b8235915060208301356154af81615f4e565b6000806040838503121561584957600080fd5b50508035926020909101359150565b60006020828403121561586a57600080fd5b613bef826153ea565b600080600080600060a0868803121561588b57600080fd5b615894866153fe565b94506020860151935060408601519250606086015191506158b7608087016153fe565b90509295509295909350565b600081518084526020808501945080840160005b838110156158fc5781516001600160a01b0316875295820195908201906001016158d7565b509495945050505050565b8060005b6002811015610e6b57815184526020938401939091019060010161590b565b600081518084526020808501945080840160005b838110156158fc5781518752958201959082019060010161593e565b6000815180845260005b8181101561598057602081850181015186830182015201615964565b81811115615992576000602083870101525b50601f01601f19169290920160200192915050565b6159b18183615907565b604001919050565b8681526159c96020820187615907565b6159d66060820186615907565b6159e360a0820185615907565b6159f060e0820184615907565b60609190911b6bffffffffffffffffffffffff19166101208201526101340195945050505050565b838152615a286020820184615907565b606081019190915260800192915050565b604081016114d28284615907565b602081526000613bef602083018461592a565b602081526000613bef602083018461595a565b6020815260ff8251166020820152602082015160408201526001600160a01b0360408301511660608201526000606083015160c06080840152615ab360e08401826158c3565b905060808401516001600160601b0380821660a08601528060a08701511660c086015250508091505092915050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615b3357845183529383019391830191600101615b17565b509098975050505050505050565b82815260608101613bef6020830184615907565b828152604060208201526000613c3e604083018461592a565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261431260c083018461595a565b878152866020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143ff60e083018461595a565b8781526001600160401b0387166020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143ff60e083018461595a565b60006001600160601b0380881683528087166020840152506001600160401b03851660408301526001600160a01b038416606083015260a06080830152615c9460a08301846158c3565b979650505050505050565b6000808335601e19843603018112615cb657600080fd5b8301803591506001600160401b03821115615cd057600080fd5b602001915036819003821315615ce557600080fd5b9250929050565b604080519081016001600160401b0381118282101715615d0e57615d0e615f38565b60405290565b60405160c081016001600160401b0381118282101715615d0e57615d0e615f38565b60405161012081016001600160401b0381118282101715615d0e57615d0e615f38565b60008085851115615d6957600080fd5b83861115615d7657600080fd5b5050820193919092039150565b60008219821115615d9657615d96615ee0565b500190565b60006001600160401b03808316818516808303821115615dbd57615dbd615ee0565b01949350505050565b60006001600160601b03808316818516808303821115615dbd57615dbd615ee0565b600082615df757615df7615ef6565b500490565b6000816000190483118215151615615e1657615e16615ee0565b500290565b600082821015615e2d57615e2d615ee0565b500390565b60006001600160601b0383811690831681811015615e5257615e52615ee0565b039392505050565b6001600160e01b03198135818116916004851015615e825780818660040360031b1b83161692505b505092915050565b6000600019821415615e9e57615e9e615ee0565b5060010190565b60006001600160401b0380831681811415615ec257615ec2615ee0565b6001019392505050565b600082615edb57615edb615ef6565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c0c57600080fd5b8015158114610c0c57600080fdfea164736f6c6343000806000a", +} + +var VRFCoordinatorV25ABI = VRFCoordinatorV25MetaData.ABI + +var VRFCoordinatorV25Bin = VRFCoordinatorV25MetaData.Bin + +func DeployVRFCoordinatorV25(auth *bind.TransactOpts, backend bind.ContractBackend, blockhashStore common.Address) (common.Address, *types.Transaction, *VRFCoordinatorV25, error) { + parsed, err := VRFCoordinatorV25MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(VRFCoordinatorV25Bin), backend, blockhashStore) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &VRFCoordinatorV25{VRFCoordinatorV25Caller: VRFCoordinatorV25Caller{contract: contract}, VRFCoordinatorV25Transactor: VRFCoordinatorV25Transactor{contract: contract}, VRFCoordinatorV25Filterer: VRFCoordinatorV25Filterer{contract: contract}}, nil +} + +type VRFCoordinatorV25 struct { + address common.Address + abi abi.ABI + VRFCoordinatorV25Caller + VRFCoordinatorV25Transactor + VRFCoordinatorV25Filterer +} + +type VRFCoordinatorV25Caller struct { + contract *bind.BoundContract +} + +type VRFCoordinatorV25Transactor struct { + contract *bind.BoundContract +} + +type VRFCoordinatorV25Filterer struct { + contract *bind.BoundContract +} + +type VRFCoordinatorV25Session struct { + Contract *VRFCoordinatorV25 + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type VRFCoordinatorV25CallerSession struct { + Contract *VRFCoordinatorV25Caller + CallOpts bind.CallOpts +} + +type VRFCoordinatorV25TransactorSession struct { + Contract *VRFCoordinatorV25Transactor + TransactOpts bind.TransactOpts +} + +type VRFCoordinatorV25Raw struct { + Contract *VRFCoordinatorV25 +} + +type VRFCoordinatorV25CallerRaw struct { + Contract *VRFCoordinatorV25Caller +} + +type VRFCoordinatorV25TransactorRaw struct { + Contract *VRFCoordinatorV25Transactor +} + +func NewVRFCoordinatorV25(address common.Address, backend bind.ContractBackend) (*VRFCoordinatorV25, error) { + abi, err := abi.JSON(strings.NewReader(VRFCoordinatorV25ABI)) + if err != nil { + return nil, err + } + contract, err := bindVRFCoordinatorV25(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25{address: address, abi: abi, VRFCoordinatorV25Caller: VRFCoordinatorV25Caller{contract: contract}, VRFCoordinatorV25Transactor: VRFCoordinatorV25Transactor{contract: contract}, VRFCoordinatorV25Filterer: VRFCoordinatorV25Filterer{contract: contract}}, nil +} + +func NewVRFCoordinatorV25Caller(address common.Address, caller bind.ContractCaller) (*VRFCoordinatorV25Caller, error) { + contract, err := bindVRFCoordinatorV25(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25Caller{contract: contract}, nil +} + +func NewVRFCoordinatorV25Transactor(address common.Address, transactor bind.ContractTransactor) (*VRFCoordinatorV25Transactor, error) { + contract, err := bindVRFCoordinatorV25(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25Transactor{contract: contract}, nil +} + +func NewVRFCoordinatorV25Filterer(address common.Address, filterer bind.ContractFilterer) (*VRFCoordinatorV25Filterer, error) { + contract, err := bindVRFCoordinatorV25(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25Filterer{contract: contract}, nil +} + +func bindVRFCoordinatorV25(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := VRFCoordinatorV25MetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _VRFCoordinatorV25.Contract.VRFCoordinatorV25Caller.contract.Call(opts, result, method, params...) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.VRFCoordinatorV25Transactor.contract.Transfer(opts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.VRFCoordinatorV25Transactor.contract.Transact(opts, method, params...) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _VRFCoordinatorV25.Contract.contract.Call(opts, result, method, params...) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.contract.Transfer(opts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.contract.Transact(opts, method, params...) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) BLOCKHASHSTORE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "BLOCKHASH_STORE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) BLOCKHASHSTORE() (common.Address, error) { + return _VRFCoordinatorV25.Contract.BLOCKHASHSTORE(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) BLOCKHASHSTORE() (common.Address, error) { + return _VRFCoordinatorV25.Contract.BLOCKHASHSTORE(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) LINK(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "LINK") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) LINK() (common.Address, error) { + return _VRFCoordinatorV25.Contract.LINK(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) LINK() (common.Address, error) { + return _VRFCoordinatorV25.Contract.LINK(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) LINKNATIVEFEED(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "LINK_NATIVE_FEED") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) LINKNATIVEFEED() (common.Address, error) { + return _VRFCoordinatorV25.Contract.LINKNATIVEFEED(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) LINKNATIVEFEED() (common.Address, error) { + return _VRFCoordinatorV25.Contract.LINKNATIVEFEED(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "MAX_CONSUMERS") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) MAXCONSUMERS() (uint16, error) { + return _VRFCoordinatorV25.Contract.MAXCONSUMERS(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) MAXCONSUMERS() (uint16, error) { + return _VRFCoordinatorV25.Contract.MAXCONSUMERS(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) MAXNUMWORDS(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "MAX_NUM_WORDS") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) MAXNUMWORDS() (uint32, error) { + return _VRFCoordinatorV25.Contract.MAXNUMWORDS(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) MAXNUMWORDS() (uint32, error) { + return _VRFCoordinatorV25.Contract.MAXNUMWORDS(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) MAXREQUESTCONFIRMATIONS(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "MAX_REQUEST_CONFIRMATIONS") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) MAXREQUESTCONFIRMATIONS() (uint16, error) { + return _VRFCoordinatorV25.Contract.MAXREQUESTCONFIRMATIONS(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) MAXREQUESTCONFIRMATIONS() (uint16, error) { + return _VRFCoordinatorV25.Contract.MAXREQUESTCONFIRMATIONS(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) GetActiveSubscriptionIds(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "getActiveSubscriptionIds", startIndex, maxCount) + + if err != nil { + return *new([]*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) GetActiveSubscriptionIds(startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + return _VRFCoordinatorV25.Contract.GetActiveSubscriptionIds(&_VRFCoordinatorV25.CallOpts, startIndex, maxCount) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) GetActiveSubscriptionIds(startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + return _VRFCoordinatorV25.Contract.GetActiveSubscriptionIds(&_VRFCoordinatorV25.CallOpts, startIndex, maxCount) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) GetRequestConfig(opts *bind.CallOpts) (uint16, uint32, [][32]byte, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "getRequestConfig") + + if err != nil { + return *new(uint16), *new(uint32), *new([][32]byte), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + out1 := *abi.ConvertType(out[1], new(uint32)).(*uint32) + out2 := *abi.ConvertType(out[2], new([][32]byte)).(*[][32]byte) + + return out0, out1, out2, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) GetRequestConfig() (uint16, uint32, [][32]byte, error) { + return _VRFCoordinatorV25.Contract.GetRequestConfig(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) GetRequestConfig() (uint16, uint32, [][32]byte, error) { + return _VRFCoordinatorV25.Contract.GetRequestConfig(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) GetSubscription(opts *bind.CallOpts, subId *big.Int) (GetSubscription, + + error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "getSubscription", subId) + + outstruct := new(GetSubscription) + if err != nil { + return *outstruct, err + } + + outstruct.Balance = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.NativeBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.ReqCount = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.Owner = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.Consumers = *abi.ConvertType(out[4], new([]common.Address)).(*[]common.Address) + + return *outstruct, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) GetSubscription(subId *big.Int) (GetSubscription, + + error) { + return _VRFCoordinatorV25.Contract.GetSubscription(&_VRFCoordinatorV25.CallOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) GetSubscription(subId *big.Int) (GetSubscription, + + error) { + return _VRFCoordinatorV25.Contract.GetSubscription(&_VRFCoordinatorV25.CallOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) HashOfKey(opts *bind.CallOpts, publicKey [2]*big.Int) ([32]byte, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "hashOfKey", publicKey) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) HashOfKey(publicKey [2]*big.Int) ([32]byte, error) { + return _VRFCoordinatorV25.Contract.HashOfKey(&_VRFCoordinatorV25.CallOpts, publicKey) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) HashOfKey(publicKey [2]*big.Int) ([32]byte, error) { + return _VRFCoordinatorV25.Contract.HashOfKey(&_VRFCoordinatorV25.CallOpts, publicKey) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) MigrationVersion(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "migrationVersion") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) MigrationVersion() (uint8, error) { + return _VRFCoordinatorV25.Contract.MigrationVersion(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) MigrationVersion() (uint8, error) { + return _VRFCoordinatorV25.Contract.MigrationVersion(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) Owner() (common.Address, error) { + return _VRFCoordinatorV25.Contract.Owner(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) Owner() (common.Address, error) { + return _VRFCoordinatorV25.Contract.Owner(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) PendingRequestExists(opts *bind.CallOpts, subId *big.Int) (bool, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "pendingRequestExists", subId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) PendingRequestExists(subId *big.Int) (bool, error) { + return _VRFCoordinatorV25.Contract.PendingRequestExists(&_VRFCoordinatorV25.CallOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) PendingRequestExists(subId *big.Int) (bool, error) { + return _VRFCoordinatorV25.Contract.PendingRequestExists(&_VRFCoordinatorV25.CallOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) SConfig(opts *bind.CallOpts) (SConfig, + + error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_config") + + outstruct := new(SConfig) + if err != nil { + return *outstruct, err + } + + outstruct.MinimumRequestConfirmations = *abi.ConvertType(out[0], new(uint16)).(*uint16) + outstruct.MaxGasLimit = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ReentrancyLock = *abi.ConvertType(out[2], new(bool)).(*bool) + outstruct.StalenessSeconds = *abi.ConvertType(out[3], new(uint32)).(*uint32) + outstruct.GasAfterPaymentCalculation = *abi.ConvertType(out[4], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SConfig() (SConfig, + + error) { + return _VRFCoordinatorV25.Contract.SConfig(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) SConfig() (SConfig, + + error) { + return _VRFCoordinatorV25.Contract.SConfig(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) SCurrentSubNonce(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_currentSubNonce") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SCurrentSubNonce() (uint64, error) { + return _VRFCoordinatorV25.Contract.SCurrentSubNonce(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) SCurrentSubNonce() (uint64, error) { + return _VRFCoordinatorV25.Contract.SCurrentSubNonce(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) SFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_fallbackWeiPerUnitLink") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SFallbackWeiPerUnitLink() (*big.Int, error) { + return _VRFCoordinatorV25.Contract.SFallbackWeiPerUnitLink(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) SFallbackWeiPerUnitLink() (*big.Int, error) { + return _VRFCoordinatorV25.Contract.SFallbackWeiPerUnitLink(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) SFeeConfig(opts *bind.CallOpts) (SFeeConfig, + + error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_feeConfig") + + outstruct := new(SFeeConfig) + if err != nil { + return *outstruct, err + } + + outstruct.FulfillmentFlatFeeLinkPPM = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.FulfillmentFlatFeeNativePPM = *abi.ConvertType(out[1], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SFeeConfig() (SFeeConfig, + + error) { + return _VRFCoordinatorV25.Contract.SFeeConfig(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) SFeeConfig() (SFeeConfig, + + error) { + return _VRFCoordinatorV25.Contract.SFeeConfig(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) SProvingKeyHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_provingKeyHashes", arg0) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SProvingKeyHashes(arg0 *big.Int) ([32]byte, error) { + return _VRFCoordinatorV25.Contract.SProvingKeyHashes(&_VRFCoordinatorV25.CallOpts, arg0) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) SProvingKeyHashes(arg0 *big.Int) ([32]byte, error) { + return _VRFCoordinatorV25.Contract.SProvingKeyHashes(&_VRFCoordinatorV25.CallOpts, arg0) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) SProvingKeys(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_provingKeys", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SProvingKeys(arg0 [32]byte) (common.Address, error) { + return _VRFCoordinatorV25.Contract.SProvingKeys(&_VRFCoordinatorV25.CallOpts, arg0) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) SProvingKeys(arg0 [32]byte) (common.Address, error) { + return _VRFCoordinatorV25.Contract.SProvingKeys(&_VRFCoordinatorV25.CallOpts, arg0) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) SRequestCommitments(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_requestCommitments", arg0) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SRequestCommitments(arg0 *big.Int) ([32]byte, error) { + return _VRFCoordinatorV25.Contract.SRequestCommitments(&_VRFCoordinatorV25.CallOpts, arg0) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) SRequestCommitments(arg0 *big.Int) ([32]byte, error) { + return _VRFCoordinatorV25.Contract.SRequestCommitments(&_VRFCoordinatorV25.CallOpts, arg0) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) STotalBalance(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_totalBalance") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) STotalBalance() (*big.Int, error) { + return _VRFCoordinatorV25.Contract.STotalBalance(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) STotalBalance() (*big.Int, error) { + return _VRFCoordinatorV25.Contract.STotalBalance(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Caller) STotalNativeBalance(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _VRFCoordinatorV25.contract.Call(opts, &out, "s_totalNativeBalance") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) STotalNativeBalance() (*big.Int, error) { + return _VRFCoordinatorV25.Contract.STotalNativeBalance(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25CallerSession) STotalNativeBalance() (*big.Int, error) { + return _VRFCoordinatorV25.Contract.STotalNativeBalance(&_VRFCoordinatorV25.CallOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "acceptOwnership") +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) AcceptOwnership() (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.AcceptOwnership(&_VRFCoordinatorV25.TransactOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.AcceptOwnership(&_VRFCoordinatorV25.TransactOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "acceptSubscriptionOwnerTransfer", subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) AcceptSubscriptionOwnerTransfer(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.AcceptSubscriptionOwnerTransfer(&_VRFCoordinatorV25.TransactOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) AcceptSubscriptionOwnerTransfer(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.AcceptSubscriptionOwnerTransfer(&_VRFCoordinatorV25.TransactOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) AddConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "addConsumer", subId, consumer) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) AddConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.AddConsumer(&_VRFCoordinatorV25.TransactOpts, subId, consumer) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) AddConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.AddConsumer(&_VRFCoordinatorV25.TransactOpts, subId, consumer) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) CancelSubscription(opts *bind.TransactOpts, subId *big.Int, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "cancelSubscription", subId, to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) CancelSubscription(subId *big.Int, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.CancelSubscription(&_VRFCoordinatorV25.TransactOpts, subId, to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) CancelSubscription(subId *big.Int, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.CancelSubscription(&_VRFCoordinatorV25.TransactOpts, subId, to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "createSubscription") +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) CreateSubscription() (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.CreateSubscription(&_VRFCoordinatorV25.TransactOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) CreateSubscription() (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.CreateSubscription(&_VRFCoordinatorV25.TransactOpts) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) DeregisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "deregisterMigratableCoordinator", target) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) DeregisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.DeregisterMigratableCoordinator(&_VRFCoordinatorV25.TransactOpts, target) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) DeregisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.DeregisterMigratableCoordinator(&_VRFCoordinatorV25.TransactOpts, target) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) DeregisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "deregisterProvingKey", publicProvingKey) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) DeregisterProvingKey(publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.DeregisterProvingKey(&_VRFCoordinatorV25.TransactOpts, publicProvingKey) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) DeregisterProvingKey(publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.DeregisterProvingKey(&_VRFCoordinatorV25.TransactOpts, publicProvingKey) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) FulfillRandomWords(opts *bind.TransactOpts, proof VRFProof, rc VRFCoordinatorV25RequestCommitment) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "fulfillRandomWords", proof, rc) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) FulfillRandomWords(proof VRFProof, rc VRFCoordinatorV25RequestCommitment) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.FulfillRandomWords(&_VRFCoordinatorV25.TransactOpts, proof, rc) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) FulfillRandomWords(proof VRFProof, rc VRFCoordinatorV25RequestCommitment) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.FulfillRandomWords(&_VRFCoordinatorV25.TransactOpts, proof, rc) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) FundSubscriptionWithNative(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "fundSubscriptionWithNative", subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) FundSubscriptionWithNative(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.FundSubscriptionWithNative(&_VRFCoordinatorV25.TransactOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) FundSubscriptionWithNative(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.FundSubscriptionWithNative(&_VRFCoordinatorV25.TransactOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) Migrate(opts *bind.TransactOpts, subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "migrate", subId, newCoordinator) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) Migrate(subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.Migrate(&_VRFCoordinatorV25.TransactOpts, subId, newCoordinator) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) Migrate(subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.Migrate(&_VRFCoordinatorV25.TransactOpts, subId, newCoordinator) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "onTokenTransfer", arg0, amount, data) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) OnTokenTransfer(arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.OnTokenTransfer(&_VRFCoordinatorV25.TransactOpts, arg0, amount, data) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) OnTokenTransfer(arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.OnTokenTransfer(&_VRFCoordinatorV25.TransactOpts, arg0, amount, data) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) OracleWithdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "oracleWithdraw", recipient, amount) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) OracleWithdraw(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.OracleWithdraw(&_VRFCoordinatorV25.TransactOpts, recipient, amount) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) OracleWithdraw(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.OracleWithdraw(&_VRFCoordinatorV25.TransactOpts, recipient, amount) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) OracleWithdrawNative(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "oracleWithdrawNative", recipient, amount) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) OracleWithdrawNative(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.OracleWithdrawNative(&_VRFCoordinatorV25.TransactOpts, recipient, amount) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) OracleWithdrawNative(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.OracleWithdrawNative(&_VRFCoordinatorV25.TransactOpts, recipient, amount) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) OwnerCancelSubscription(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "ownerCancelSubscription", subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) OwnerCancelSubscription(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.OwnerCancelSubscription(&_VRFCoordinatorV25.TransactOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) OwnerCancelSubscription(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.OwnerCancelSubscription(&_VRFCoordinatorV25.TransactOpts, subId) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "recoverFunds", to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) RecoverFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RecoverFunds(&_VRFCoordinatorV25.TransactOpts, to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) RecoverFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RecoverFunds(&_VRFCoordinatorV25.TransactOpts, to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) RecoverNativeFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "recoverNativeFunds", to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) RecoverNativeFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RecoverNativeFunds(&_VRFCoordinatorV25.TransactOpts, to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) RecoverNativeFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RecoverNativeFunds(&_VRFCoordinatorV25.TransactOpts, to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) RegisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "registerMigratableCoordinator", target) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) RegisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RegisterMigratableCoordinator(&_VRFCoordinatorV25.TransactOpts, target) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) RegisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RegisterMigratableCoordinator(&_VRFCoordinatorV25.TransactOpts, target) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) RegisterProvingKey(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "registerProvingKey", oracle, publicProvingKey) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) RegisterProvingKey(oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RegisterProvingKey(&_VRFCoordinatorV25.TransactOpts, oracle, publicProvingKey) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) RegisterProvingKey(oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RegisterProvingKey(&_VRFCoordinatorV25.TransactOpts, oracle, publicProvingKey) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) RemoveConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "removeConsumer", subId, consumer) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) RemoveConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RemoveConsumer(&_VRFCoordinatorV25.TransactOpts, subId, consumer) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) RemoveConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RemoveConsumer(&_VRFCoordinatorV25.TransactOpts, subId, consumer) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "requestRandomWords", req) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RequestRandomWords(&_VRFCoordinatorV25.TransactOpts, req) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RequestRandomWords(&_VRFCoordinatorV25.TransactOpts, req) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "requestSubscriptionOwnerTransfer", subId, newOwner) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) RequestSubscriptionOwnerTransfer(subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RequestSubscriptionOwnerTransfer(&_VRFCoordinatorV25.TransactOpts, subId, newOwner) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) RequestSubscriptionOwnerTransfer(subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.RequestSubscriptionOwnerTransfer(&_VRFCoordinatorV25.TransactOpts, subId, newOwner) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) SetConfig(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV25FeeConfig) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "setConfig", minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV25FeeConfig) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.SetConfig(&_VRFCoordinatorV25.TransactOpts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV25FeeConfig) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.SetConfig(&_VRFCoordinatorV25.TransactOpts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) SetLINKAndLINKNativeFeed(opts *bind.TransactOpts, link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "setLINKAndLINKNativeFeed", link, linkNativeFeed) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) SetLINKAndLINKNativeFeed(link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.SetLINKAndLINKNativeFeed(&_VRFCoordinatorV25.TransactOpts, link, linkNativeFeed) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) SetLINKAndLINKNativeFeed(link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.SetLINKAndLINKNativeFeed(&_VRFCoordinatorV25.TransactOpts, link, linkNativeFeed) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Transactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.contract.Transact(opts, "transferOwnership", to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Session) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.TransferOwnership(&_VRFCoordinatorV25.TransactOpts, to) +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25TransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV25.Contract.TransferOwnership(&_VRFCoordinatorV25.TransactOpts, to) +} + +type VRFCoordinatorV25ConfigSetIterator struct { + Event *VRFCoordinatorV25ConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25ConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25ConfigSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25ConfigSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25ConfigSetIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25ConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25ConfigSet struct { + MinimumRequestConfirmations uint16 + MaxGasLimit uint32 + StalenessSeconds uint32 + GasAfterPaymentCalculation uint32 + FallbackWeiPerUnitLink *big.Int + FeeConfig VRFCoordinatorV25FeeConfig + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterConfigSet(opts *bind.FilterOpts) (*VRFCoordinatorV25ConfigSetIterator, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &VRFCoordinatorV25ConfigSetIterator{contract: _VRFCoordinatorV25.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25ConfigSet) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25ConfigSet) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseConfigSet(log types.Log) (*VRFCoordinatorV25ConfigSet, error) { + event := new(VRFCoordinatorV25ConfigSet) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25CoordinatorDeregisteredIterator struct { + Event *VRFCoordinatorV25CoordinatorDeregistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25CoordinatorDeregisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25CoordinatorDeregistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25CoordinatorDeregistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25CoordinatorDeregisteredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25CoordinatorDeregisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25CoordinatorDeregistered struct { + CoordinatorAddress common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterCoordinatorDeregistered(opts *bind.FilterOpts) (*VRFCoordinatorV25CoordinatorDeregisteredIterator, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "CoordinatorDeregistered") + if err != nil { + return nil, err + } + return &VRFCoordinatorV25CoordinatorDeregisteredIterator{contract: _VRFCoordinatorV25.contract, event: "CoordinatorDeregistered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchCoordinatorDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25CoordinatorDeregistered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "CoordinatorDeregistered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25CoordinatorDeregistered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "CoordinatorDeregistered", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseCoordinatorDeregistered(log types.Log) (*VRFCoordinatorV25CoordinatorDeregistered, error) { + event := new(VRFCoordinatorV25CoordinatorDeregistered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "CoordinatorDeregistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25CoordinatorRegisteredIterator struct { + Event *VRFCoordinatorV25CoordinatorRegistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25CoordinatorRegisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25CoordinatorRegistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25CoordinatorRegistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25CoordinatorRegisteredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25CoordinatorRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25CoordinatorRegistered struct { + CoordinatorAddress common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterCoordinatorRegistered(opts *bind.FilterOpts) (*VRFCoordinatorV25CoordinatorRegisteredIterator, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "CoordinatorRegistered") + if err != nil { + return nil, err + } + return &VRFCoordinatorV25CoordinatorRegisteredIterator{contract: _VRFCoordinatorV25.contract, event: "CoordinatorRegistered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchCoordinatorRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25CoordinatorRegistered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "CoordinatorRegistered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25CoordinatorRegistered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "CoordinatorRegistered", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseCoordinatorRegistered(log types.Log) (*VRFCoordinatorV25CoordinatorRegistered, error) { + event := new(VRFCoordinatorV25CoordinatorRegistered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "CoordinatorRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25FundsRecoveredIterator struct { + Event *VRFCoordinatorV25FundsRecovered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25FundsRecoveredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25FundsRecovered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25FundsRecovered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25FundsRecoveredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25FundsRecoveredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25FundsRecovered struct { + To common.Address + Amount *big.Int + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV25FundsRecoveredIterator, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "FundsRecovered") + if err != nil { + return nil, err + } + return &VRFCoordinatorV25FundsRecoveredIterator{contract: _VRFCoordinatorV25.contract, event: "FundsRecovered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25FundsRecovered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "FundsRecovered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25FundsRecovered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "FundsRecovered", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseFundsRecovered(log types.Log) (*VRFCoordinatorV25FundsRecovered, error) { + event := new(VRFCoordinatorV25FundsRecovered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "FundsRecovered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25MigrationCompletedIterator struct { + Event *VRFCoordinatorV25MigrationCompleted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25MigrationCompletedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25MigrationCompleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25MigrationCompleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25MigrationCompletedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25MigrationCompletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25MigrationCompleted struct { + NewCoordinator common.Address + SubId *big.Int + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterMigrationCompleted(opts *bind.FilterOpts) (*VRFCoordinatorV25MigrationCompletedIterator, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "MigrationCompleted") + if err != nil { + return nil, err + } + return &VRFCoordinatorV25MigrationCompletedIterator{contract: _VRFCoordinatorV25.contract, event: "MigrationCompleted", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchMigrationCompleted(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25MigrationCompleted) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "MigrationCompleted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25MigrationCompleted) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseMigrationCompleted(log types.Log) (*VRFCoordinatorV25MigrationCompleted, error) { + event := new(VRFCoordinatorV25MigrationCompleted) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25NativeFundsRecoveredIterator struct { + Event *VRFCoordinatorV25NativeFundsRecovered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25NativeFundsRecoveredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25NativeFundsRecovered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25NativeFundsRecovered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25NativeFundsRecoveredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25NativeFundsRecoveredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25NativeFundsRecovered struct { + To common.Address + Amount *big.Int + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterNativeFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV25NativeFundsRecoveredIterator, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "NativeFundsRecovered") + if err != nil { + return nil, err + } + return &VRFCoordinatorV25NativeFundsRecoveredIterator{contract: _VRFCoordinatorV25.contract, event: "NativeFundsRecovered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchNativeFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25NativeFundsRecovered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "NativeFundsRecovered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25NativeFundsRecovered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "NativeFundsRecovered", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseNativeFundsRecovered(log types.Log) (*VRFCoordinatorV25NativeFundsRecovered, error) { + event := new(VRFCoordinatorV25NativeFundsRecovered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "NativeFundsRecovered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25OwnershipTransferRequestedIterator struct { + Event *VRFCoordinatorV25OwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25OwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25OwnershipTransferRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25OwnershipTransferRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25OwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25OwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25OwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV25OwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25OwnershipTransferRequestedIterator{contract: _VRFCoordinatorV25.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25OwnershipTransferRequested) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseOwnershipTransferRequested(log types.Log) (*VRFCoordinatorV25OwnershipTransferRequested, error) { + event := new(VRFCoordinatorV25OwnershipTransferRequested) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25OwnershipTransferredIterator struct { + Event *VRFCoordinatorV25OwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25OwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25OwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25OwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25OwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25OwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25OwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV25OwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25OwnershipTransferredIterator{contract: _VRFCoordinatorV25.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25OwnershipTransferred) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseOwnershipTransferred(log types.Log) (*VRFCoordinatorV25OwnershipTransferred, error) { + event := new(VRFCoordinatorV25OwnershipTransferred) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25ProvingKeyDeregisteredIterator struct { + Event *VRFCoordinatorV25ProvingKeyDeregistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25ProvingKeyDeregisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25ProvingKeyDeregistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25ProvingKeyDeregistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25ProvingKeyDeregisteredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25ProvingKeyDeregisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25ProvingKeyDeregistered struct { + KeyHash [32]byte + Oracle common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterProvingKeyDeregistered(opts *bind.FilterOpts, oracle []common.Address) (*VRFCoordinatorV25ProvingKeyDeregisteredIterator, error) { + + var oracleRule []interface{} + for _, oracleItem := range oracle { + oracleRule = append(oracleRule, oracleItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "ProvingKeyDeregistered", oracleRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25ProvingKeyDeregisteredIterator{contract: _VRFCoordinatorV25.contract, event: "ProvingKeyDeregistered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchProvingKeyDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25ProvingKeyDeregistered, oracle []common.Address) (event.Subscription, error) { + + var oracleRule []interface{} + for _, oracleItem := range oracle { + oracleRule = append(oracleRule, oracleItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "ProvingKeyDeregistered", oracleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25ProvingKeyDeregistered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "ProvingKeyDeregistered", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseProvingKeyDeregistered(log types.Log) (*VRFCoordinatorV25ProvingKeyDeregistered, error) { + event := new(VRFCoordinatorV25ProvingKeyDeregistered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "ProvingKeyDeregistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25ProvingKeyRegisteredIterator struct { + Event *VRFCoordinatorV25ProvingKeyRegistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25ProvingKeyRegisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25ProvingKeyRegistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25ProvingKeyRegistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25ProvingKeyRegisteredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25ProvingKeyRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25ProvingKeyRegistered struct { + KeyHash [32]byte + Oracle common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterProvingKeyRegistered(opts *bind.FilterOpts, oracle []common.Address) (*VRFCoordinatorV25ProvingKeyRegisteredIterator, error) { + + var oracleRule []interface{} + for _, oracleItem := range oracle { + oracleRule = append(oracleRule, oracleItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "ProvingKeyRegistered", oracleRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25ProvingKeyRegisteredIterator{contract: _VRFCoordinatorV25.contract, event: "ProvingKeyRegistered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchProvingKeyRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25ProvingKeyRegistered, oracle []common.Address) (event.Subscription, error) { + + var oracleRule []interface{} + for _, oracleItem := range oracle { + oracleRule = append(oracleRule, oracleItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "ProvingKeyRegistered", oracleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25ProvingKeyRegistered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "ProvingKeyRegistered", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseProvingKeyRegistered(log types.Log) (*VRFCoordinatorV25ProvingKeyRegistered, error) { + event := new(VRFCoordinatorV25ProvingKeyRegistered) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "ProvingKeyRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25RandomWordsFulfilledIterator struct { + Event *VRFCoordinatorV25RandomWordsFulfilled + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25RandomWordsFulfilledIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25RandomWordsFulfilled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25RandomWordsFulfilled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25RandomWordsFulfilledIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25RandomWordsFulfilledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25RandomWordsFulfilled struct { + RequestId *big.Int + OutputSeed *big.Int + SubId *big.Int + Payment *big.Int + Success bool + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int, subId []*big.Int) (*VRFCoordinatorV25RandomWordsFulfilledIterator, error) { + + var requestIdRule []interface{} + for _, requestIdItem := range requestId { + requestIdRule = append(requestIdRule, requestIdItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "RandomWordsFulfilled", requestIdRule, subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25RandomWordsFulfilledIterator{contract: _VRFCoordinatorV25.contract, event: "RandomWordsFulfilled", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25RandomWordsFulfilled, requestId []*big.Int, subId []*big.Int) (event.Subscription, error) { + + var requestIdRule []interface{} + for _, requestIdItem := range requestId { + requestIdRule = append(requestIdRule, requestIdItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "RandomWordsFulfilled", requestIdRule, subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25RandomWordsFulfilled) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "RandomWordsFulfilled", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseRandomWordsFulfilled(log types.Log) (*VRFCoordinatorV25RandomWordsFulfilled, error) { + event := new(VRFCoordinatorV25RandomWordsFulfilled) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "RandomWordsFulfilled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25RandomWordsRequestedIterator struct { + Event *VRFCoordinatorV25RandomWordsRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25RandomWordsRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25RandomWordsRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25RandomWordsRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25RandomWordsRequestedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25RandomWordsRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25RandomWordsRequested struct { + KeyHash [32]byte + RequestId *big.Int + PreSeed *big.Int + SubId *big.Int + MinimumRequestConfirmations uint16 + CallbackGasLimit uint32 + NumWords uint32 + ExtraArgs []byte + Sender common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (*VRFCoordinatorV25RandomWordsRequestedIterator, error) { + + var keyHashRule []interface{} + for _, keyHashItem := range keyHash { + keyHashRule = append(keyHashRule, keyHashItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "RandomWordsRequested", keyHashRule, subIdRule, senderRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25RandomWordsRequestedIterator{contract: _VRFCoordinatorV25.contract, event: "RandomWordsRequested", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25RandomWordsRequested, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (event.Subscription, error) { + + var keyHashRule []interface{} + for _, keyHashItem := range keyHash { + keyHashRule = append(keyHashRule, keyHashItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "RandomWordsRequested", keyHashRule, subIdRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25RandomWordsRequested) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "RandomWordsRequested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseRandomWordsRequested(log types.Log) (*VRFCoordinatorV25RandomWordsRequested, error) { + event := new(VRFCoordinatorV25RandomWordsRequested) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "RandomWordsRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25SubscriptionCanceledIterator struct { + Event *VRFCoordinatorV25SubscriptionCanceled + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25SubscriptionCanceledIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionCanceled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionCanceled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25SubscriptionCanceledIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25SubscriptionCanceledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25SubscriptionCanceled struct { + SubId *big.Int + To common.Address + AmountLink *big.Int + AmountNative *big.Int + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterSubscriptionCanceled(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionCanceledIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "SubscriptionCanceled", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25SubscriptionCanceledIterator{contract: _VRFCoordinatorV25.contract, event: "SubscriptionCanceled", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchSubscriptionCanceled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionCanceled, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "SubscriptionCanceled", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25SubscriptionCanceled) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionCanceled", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseSubscriptionCanceled(log types.Log) (*VRFCoordinatorV25SubscriptionCanceled, error) { + event := new(VRFCoordinatorV25SubscriptionCanceled) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionCanceled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25SubscriptionConsumerAddedIterator struct { + Event *VRFCoordinatorV25SubscriptionConsumerAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25SubscriptionConsumerAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionConsumerAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionConsumerAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25SubscriptionConsumerAddedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25SubscriptionConsumerAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25SubscriptionConsumerAdded struct { + SubId *big.Int + Consumer common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterSubscriptionConsumerAdded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionConsumerAddedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "SubscriptionConsumerAdded", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25SubscriptionConsumerAddedIterator{contract: _VRFCoordinatorV25.contract, event: "SubscriptionConsumerAdded", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchSubscriptionConsumerAdded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionConsumerAdded, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "SubscriptionConsumerAdded", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25SubscriptionConsumerAdded) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionConsumerAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseSubscriptionConsumerAdded(log types.Log) (*VRFCoordinatorV25SubscriptionConsumerAdded, error) { + event := new(VRFCoordinatorV25SubscriptionConsumerAdded) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionConsumerAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25SubscriptionConsumerRemovedIterator struct { + Event *VRFCoordinatorV25SubscriptionConsumerRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25SubscriptionConsumerRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionConsumerRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionConsumerRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25SubscriptionConsumerRemovedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25SubscriptionConsumerRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25SubscriptionConsumerRemoved struct { + SubId *big.Int + Consumer common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterSubscriptionConsumerRemoved(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionConsumerRemovedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "SubscriptionConsumerRemoved", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25SubscriptionConsumerRemovedIterator{contract: _VRFCoordinatorV25.contract, event: "SubscriptionConsumerRemoved", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchSubscriptionConsumerRemoved(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionConsumerRemoved, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "SubscriptionConsumerRemoved", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25SubscriptionConsumerRemoved) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionConsumerRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseSubscriptionConsumerRemoved(log types.Log) (*VRFCoordinatorV25SubscriptionConsumerRemoved, error) { + event := new(VRFCoordinatorV25SubscriptionConsumerRemoved) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionConsumerRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25SubscriptionCreatedIterator struct { + Event *VRFCoordinatorV25SubscriptionCreated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25SubscriptionCreatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25SubscriptionCreatedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25SubscriptionCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25SubscriptionCreated struct { + SubId *big.Int + Owner common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterSubscriptionCreated(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionCreatedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "SubscriptionCreated", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25SubscriptionCreatedIterator{contract: _VRFCoordinatorV25.contract, event: "SubscriptionCreated", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchSubscriptionCreated(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionCreated, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "SubscriptionCreated", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25SubscriptionCreated) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionCreated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseSubscriptionCreated(log types.Log) (*VRFCoordinatorV25SubscriptionCreated, error) { + event := new(VRFCoordinatorV25SubscriptionCreated) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25SubscriptionFundedIterator struct { + Event *VRFCoordinatorV25SubscriptionFunded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25SubscriptionFundedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionFunded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionFunded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25SubscriptionFundedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25SubscriptionFundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25SubscriptionFunded struct { + SubId *big.Int + OldBalance *big.Int + NewBalance *big.Int + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterSubscriptionFunded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionFundedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "SubscriptionFunded", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25SubscriptionFundedIterator{contract: _VRFCoordinatorV25.contract, event: "SubscriptionFunded", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchSubscriptionFunded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionFunded, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "SubscriptionFunded", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25SubscriptionFunded) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionFunded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseSubscriptionFunded(log types.Log) (*VRFCoordinatorV25SubscriptionFunded, error) { + event := new(VRFCoordinatorV25SubscriptionFunded) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionFunded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25SubscriptionFundedWithNativeIterator struct { + Event *VRFCoordinatorV25SubscriptionFundedWithNative + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25SubscriptionFundedWithNativeIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionFundedWithNative) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionFundedWithNative) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25SubscriptionFundedWithNativeIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25SubscriptionFundedWithNativeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25SubscriptionFundedWithNative struct { + SubId *big.Int + OldNativeBalance *big.Int + NewNativeBalance *big.Int + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterSubscriptionFundedWithNative(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionFundedWithNativeIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "SubscriptionFundedWithNative", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25SubscriptionFundedWithNativeIterator{contract: _VRFCoordinatorV25.contract, event: "SubscriptionFundedWithNative", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchSubscriptionFundedWithNative(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionFundedWithNative, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "SubscriptionFundedWithNative", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25SubscriptionFundedWithNative) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionFundedWithNative", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseSubscriptionFundedWithNative(log types.Log) (*VRFCoordinatorV25SubscriptionFundedWithNative, error) { + event := new(VRFCoordinatorV25SubscriptionFundedWithNative) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionFundedWithNative", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25SubscriptionOwnerTransferRequestedIterator struct { + Event *VRFCoordinatorV25SubscriptionOwnerTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25SubscriptionOwnerTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionOwnerTransferRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionOwnerTransferRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25SubscriptionOwnerTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25SubscriptionOwnerTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25SubscriptionOwnerTransferRequested struct { + SubId *big.Int + From common.Address + To common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterSubscriptionOwnerTransferRequested(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionOwnerTransferRequestedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "SubscriptionOwnerTransferRequested", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25SubscriptionOwnerTransferRequestedIterator{contract: _VRFCoordinatorV25.contract, event: "SubscriptionOwnerTransferRequested", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchSubscriptionOwnerTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionOwnerTransferRequested, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "SubscriptionOwnerTransferRequested", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25SubscriptionOwnerTransferRequested) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionOwnerTransferRequested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseSubscriptionOwnerTransferRequested(log types.Log) (*VRFCoordinatorV25SubscriptionOwnerTransferRequested, error) { + event := new(VRFCoordinatorV25SubscriptionOwnerTransferRequested) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionOwnerTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorV25SubscriptionOwnerTransferredIterator struct { + Event *VRFCoordinatorV25SubscriptionOwnerTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorV25SubscriptionOwnerTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionOwnerTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorV25SubscriptionOwnerTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *VRFCoordinatorV25SubscriptionOwnerTransferredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorV25SubscriptionOwnerTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorV25SubscriptionOwnerTransferred struct { + SubId *big.Int + From common.Address + To common.Address + Raw types.Log +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) FilterSubscriptionOwnerTransferred(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionOwnerTransferredIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.FilterLogs(opts, "SubscriptionOwnerTransferred", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorV25SubscriptionOwnerTransferredIterator{contract: _VRFCoordinatorV25.contract, event: "SubscriptionOwnerTransferred", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) WatchSubscriptionOwnerTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionOwnerTransferred, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorV25.contract.WatchLogs(opts, "SubscriptionOwnerTransferred", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorV25SubscriptionOwnerTransferred) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionOwnerTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25Filterer) ParseSubscriptionOwnerTransferred(log types.Log) (*VRFCoordinatorV25SubscriptionOwnerTransferred, error) { + event := new(VRFCoordinatorV25SubscriptionOwnerTransferred) + if err := _VRFCoordinatorV25.contract.UnpackLog(event, "SubscriptionOwnerTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetSubscription struct { + Balance *big.Int + NativeBalance *big.Int + ReqCount uint64 + Owner common.Address + Consumers []common.Address +} +type SConfig struct { + MinimumRequestConfirmations uint16 + MaxGasLimit uint32 + ReentrancyLock bool + StalenessSeconds uint32 + GasAfterPaymentCalculation uint32 +} +type SFeeConfig struct { + FulfillmentFlatFeeLinkPPM uint32 + FulfillmentFlatFeeNativePPM uint32 +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _VRFCoordinatorV25.abi.Events["ConfigSet"].ID: + return _VRFCoordinatorV25.ParseConfigSet(log) + case _VRFCoordinatorV25.abi.Events["CoordinatorDeregistered"].ID: + return _VRFCoordinatorV25.ParseCoordinatorDeregistered(log) + case _VRFCoordinatorV25.abi.Events["CoordinatorRegistered"].ID: + return _VRFCoordinatorV25.ParseCoordinatorRegistered(log) + case _VRFCoordinatorV25.abi.Events["FundsRecovered"].ID: + return _VRFCoordinatorV25.ParseFundsRecovered(log) + case _VRFCoordinatorV25.abi.Events["MigrationCompleted"].ID: + return _VRFCoordinatorV25.ParseMigrationCompleted(log) + case _VRFCoordinatorV25.abi.Events["NativeFundsRecovered"].ID: + return _VRFCoordinatorV25.ParseNativeFundsRecovered(log) + case _VRFCoordinatorV25.abi.Events["OwnershipTransferRequested"].ID: + return _VRFCoordinatorV25.ParseOwnershipTransferRequested(log) + case _VRFCoordinatorV25.abi.Events["OwnershipTransferred"].ID: + return _VRFCoordinatorV25.ParseOwnershipTransferred(log) + case _VRFCoordinatorV25.abi.Events["ProvingKeyDeregistered"].ID: + return _VRFCoordinatorV25.ParseProvingKeyDeregistered(log) + case _VRFCoordinatorV25.abi.Events["ProvingKeyRegistered"].ID: + return _VRFCoordinatorV25.ParseProvingKeyRegistered(log) + case _VRFCoordinatorV25.abi.Events["RandomWordsFulfilled"].ID: + return _VRFCoordinatorV25.ParseRandomWordsFulfilled(log) + case _VRFCoordinatorV25.abi.Events["RandomWordsRequested"].ID: + return _VRFCoordinatorV25.ParseRandomWordsRequested(log) + case _VRFCoordinatorV25.abi.Events["SubscriptionCanceled"].ID: + return _VRFCoordinatorV25.ParseSubscriptionCanceled(log) + case _VRFCoordinatorV25.abi.Events["SubscriptionConsumerAdded"].ID: + return _VRFCoordinatorV25.ParseSubscriptionConsumerAdded(log) + case _VRFCoordinatorV25.abi.Events["SubscriptionConsumerRemoved"].ID: + return _VRFCoordinatorV25.ParseSubscriptionConsumerRemoved(log) + case _VRFCoordinatorV25.abi.Events["SubscriptionCreated"].ID: + return _VRFCoordinatorV25.ParseSubscriptionCreated(log) + case _VRFCoordinatorV25.abi.Events["SubscriptionFunded"].ID: + return _VRFCoordinatorV25.ParseSubscriptionFunded(log) + case _VRFCoordinatorV25.abi.Events["SubscriptionFundedWithNative"].ID: + return _VRFCoordinatorV25.ParseSubscriptionFundedWithNative(log) + case _VRFCoordinatorV25.abi.Events["SubscriptionOwnerTransferRequested"].ID: + return _VRFCoordinatorV25.ParseSubscriptionOwnerTransferRequested(log) + case _VRFCoordinatorV25.abi.Events["SubscriptionOwnerTransferred"].ID: + return _VRFCoordinatorV25.ParseSubscriptionOwnerTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (VRFCoordinatorV25ConfigSet) Topic() common.Hash { + return common.HexToHash("0x777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e78") +} + +func (VRFCoordinatorV25CoordinatorDeregistered) Topic() common.Hash { + return common.HexToHash("0xf80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af37") +} + +func (VRFCoordinatorV25CoordinatorRegistered) Topic() common.Hash { + return common.HexToHash("0xb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af01625") +} + +func (VRFCoordinatorV25FundsRecovered) Topic() common.Hash { + return common.HexToHash("0x59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600") +} + +func (VRFCoordinatorV25MigrationCompleted) Topic() common.Hash { + return common.HexToHash("0xd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187") +} + +func (VRFCoordinatorV25NativeFundsRecovered) Topic() common.Hash { + return common.HexToHash("0x4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c") +} + +func (VRFCoordinatorV25OwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (VRFCoordinatorV25OwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (VRFCoordinatorV25ProvingKeyDeregistered) Topic() common.Hash { + return common.HexToHash("0x72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d") +} + +func (VRFCoordinatorV25ProvingKeyRegistered) Topic() common.Hash { + return common.HexToHash("0xe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b8") +} + +func (VRFCoordinatorV25RandomWordsFulfilled) Topic() common.Hash { + return common.HexToHash("0x49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa7") +} + +func (VRFCoordinatorV25RandomWordsRequested) Topic() common.Hash { + return common.HexToHash("0xeb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e") +} + +func (VRFCoordinatorV25SubscriptionCanceled) Topic() common.Hash { + return common.HexToHash("0x8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4") +} + +func (VRFCoordinatorV25SubscriptionConsumerAdded) Topic() common.Hash { + return common.HexToHash("0x1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e1") +} + +func (VRFCoordinatorV25SubscriptionConsumerRemoved) Topic() common.Hash { + return common.HexToHash("0x32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7") +} + +func (VRFCoordinatorV25SubscriptionCreated) Topic() common.Hash { + return common.HexToHash("0x1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d") +} + +func (VRFCoordinatorV25SubscriptionFunded) Topic() common.Hash { + return common.HexToHash("0x1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a") +} + +func (VRFCoordinatorV25SubscriptionFundedWithNative) Topic() common.Hash { + return common.HexToHash("0x7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902") +} + +func (VRFCoordinatorV25SubscriptionOwnerTransferRequested) Topic() common.Hash { + return common.HexToHash("0x21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a1") +} + +func (VRFCoordinatorV25SubscriptionOwnerTransferred) Topic() common.Hash { + return common.HexToHash("0xd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c9386") +} + +func (_VRFCoordinatorV25 *VRFCoordinatorV25) Address() common.Address { + return _VRFCoordinatorV25.address +} + +type VRFCoordinatorV25Interface interface { + BLOCKHASHSTORE(opts *bind.CallOpts) (common.Address, error) + + LINK(opts *bind.CallOpts) (common.Address, error) + + LINKNATIVEFEED(opts *bind.CallOpts) (common.Address, error) + + MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) + + MAXNUMWORDS(opts *bind.CallOpts) (uint32, error) + + MAXREQUESTCONFIRMATIONS(opts *bind.CallOpts) (uint16, error) + + GetActiveSubscriptionIds(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) + + GetRequestConfig(opts *bind.CallOpts) (uint16, uint32, [][32]byte, error) + + GetSubscription(opts *bind.CallOpts, subId *big.Int) (GetSubscription, + + error) + + HashOfKey(opts *bind.CallOpts, publicKey [2]*big.Int) ([32]byte, error) + + MigrationVersion(opts *bind.CallOpts) (uint8, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + PendingRequestExists(opts *bind.CallOpts, subId *big.Int) (bool, error) + + SConfig(opts *bind.CallOpts) (SConfig, + + error) + + SCurrentSubNonce(opts *bind.CallOpts) (uint64, error) + + SFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) + + SFeeConfig(opts *bind.CallOpts) (SFeeConfig, + + error) + + SProvingKeyHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) + + SProvingKeys(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) + + SRequestCommitments(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) + + STotalBalance(opts *bind.CallOpts) (*big.Int, error) + + STotalNativeBalance(opts *bind.CallOpts) (*big.Int, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + + AddConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) + + CancelSubscription(opts *bind.TransactOpts, subId *big.Int, to common.Address) (*types.Transaction, error) + + CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) + + DeregisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) + + DeregisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int) (*types.Transaction, error) + + FulfillRandomWords(opts *bind.TransactOpts, proof VRFProof, rc VRFCoordinatorV25RequestCommitment) (*types.Transaction, error) + + FundSubscriptionWithNative(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + + Migrate(opts *bind.TransactOpts, subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) + + OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) + + OracleWithdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) + + OracleWithdrawNative(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) + + OwnerCancelSubscription(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + + RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + RecoverNativeFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + RegisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) + + RegisterProvingKey(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) + + RemoveConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) + + RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) + + RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int, newOwner common.Address) (*types.Transaction, error) + + SetConfig(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV25FeeConfig) (*types.Transaction, error) + + SetLINKAndLINKNativeFeed(opts *bind.TransactOpts, link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*VRFCoordinatorV25ConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25ConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*VRFCoordinatorV25ConfigSet, error) + + FilterCoordinatorDeregistered(opts *bind.FilterOpts) (*VRFCoordinatorV25CoordinatorDeregisteredIterator, error) + + WatchCoordinatorDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25CoordinatorDeregistered) (event.Subscription, error) + + ParseCoordinatorDeregistered(log types.Log) (*VRFCoordinatorV25CoordinatorDeregistered, error) + + FilterCoordinatorRegistered(opts *bind.FilterOpts) (*VRFCoordinatorV25CoordinatorRegisteredIterator, error) + + WatchCoordinatorRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25CoordinatorRegistered) (event.Subscription, error) + + ParseCoordinatorRegistered(log types.Log) (*VRFCoordinatorV25CoordinatorRegistered, error) + + FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV25FundsRecoveredIterator, error) + + WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25FundsRecovered) (event.Subscription, error) + + ParseFundsRecovered(log types.Log) (*VRFCoordinatorV25FundsRecovered, error) + + FilterMigrationCompleted(opts *bind.FilterOpts) (*VRFCoordinatorV25MigrationCompletedIterator, error) + + WatchMigrationCompleted(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25MigrationCompleted) (event.Subscription, error) + + ParseMigrationCompleted(log types.Log) (*VRFCoordinatorV25MigrationCompleted, error) + + FilterNativeFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV25NativeFundsRecoveredIterator, error) + + WatchNativeFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25NativeFundsRecovered) (event.Subscription, error) + + ParseNativeFundsRecovered(log types.Log) (*VRFCoordinatorV25NativeFundsRecovered, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV25OwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*VRFCoordinatorV25OwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV25OwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*VRFCoordinatorV25OwnershipTransferred, error) + + FilterProvingKeyDeregistered(opts *bind.FilterOpts, oracle []common.Address) (*VRFCoordinatorV25ProvingKeyDeregisteredIterator, error) + + WatchProvingKeyDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25ProvingKeyDeregistered, oracle []common.Address) (event.Subscription, error) + + ParseProvingKeyDeregistered(log types.Log) (*VRFCoordinatorV25ProvingKeyDeregistered, error) + + FilterProvingKeyRegistered(opts *bind.FilterOpts, oracle []common.Address) (*VRFCoordinatorV25ProvingKeyRegisteredIterator, error) + + WatchProvingKeyRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25ProvingKeyRegistered, oracle []common.Address) (event.Subscription, error) + + ParseProvingKeyRegistered(log types.Log) (*VRFCoordinatorV25ProvingKeyRegistered, error) + + FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int, subId []*big.Int) (*VRFCoordinatorV25RandomWordsFulfilledIterator, error) + + WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25RandomWordsFulfilled, requestId []*big.Int, subId []*big.Int) (event.Subscription, error) + + ParseRandomWordsFulfilled(log types.Log) (*VRFCoordinatorV25RandomWordsFulfilled, error) + + FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (*VRFCoordinatorV25RandomWordsRequestedIterator, error) + + WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25RandomWordsRequested, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (event.Subscription, error) + + ParseRandomWordsRequested(log types.Log) (*VRFCoordinatorV25RandomWordsRequested, error) + + FilterSubscriptionCanceled(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionCanceledIterator, error) + + WatchSubscriptionCanceled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionCanceled, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionCanceled(log types.Log) (*VRFCoordinatorV25SubscriptionCanceled, error) + + FilterSubscriptionConsumerAdded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionConsumerAddedIterator, error) + + WatchSubscriptionConsumerAdded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionConsumerAdded, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionConsumerAdded(log types.Log) (*VRFCoordinatorV25SubscriptionConsumerAdded, error) + + FilterSubscriptionConsumerRemoved(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionConsumerRemovedIterator, error) + + WatchSubscriptionConsumerRemoved(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionConsumerRemoved, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionConsumerRemoved(log types.Log) (*VRFCoordinatorV25SubscriptionConsumerRemoved, error) + + FilterSubscriptionCreated(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionCreatedIterator, error) + + WatchSubscriptionCreated(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionCreated, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionCreated(log types.Log) (*VRFCoordinatorV25SubscriptionCreated, error) + + FilterSubscriptionFunded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionFundedIterator, error) + + WatchSubscriptionFunded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionFunded, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionFunded(log types.Log) (*VRFCoordinatorV25SubscriptionFunded, error) + + FilterSubscriptionFundedWithNative(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionFundedWithNativeIterator, error) + + WatchSubscriptionFundedWithNative(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionFundedWithNative, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionFundedWithNative(log types.Log) (*VRFCoordinatorV25SubscriptionFundedWithNative, error) + + FilterSubscriptionOwnerTransferRequested(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionOwnerTransferRequestedIterator, error) + + WatchSubscriptionOwnerTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionOwnerTransferRequested, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionOwnerTransferRequested(log types.Log) (*VRFCoordinatorV25SubscriptionOwnerTransferRequested, error) + + FilterSubscriptionOwnerTransferred(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV25SubscriptionOwnerTransferredIterator, error) + + WatchSubscriptionOwnerTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV25SubscriptionOwnerTransferred, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionOwnerTransferred(log types.Log) (*VRFCoordinatorV25SubscriptionOwnerTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/generated/vrf_coordinator_v2_plus_v2_example/vrf_coordinator_v2_plus_v2_example.go b/core/gethwrappers/generated/vrf_coordinator_v2_plus_v2_example/vrf_coordinator_v2_plus_v2_example.go index 6824b918912..dd7865fe8aa 100644 --- a/core/gethwrappers/generated/vrf_coordinator_v2_plus_v2_example/vrf_coordinator_v2_plus_v2_example.go +++ b/core/gethwrappers/generated/vrf_coordinator_v2_plus_v2_example/vrf_coordinator_v2_plus_v2_example.go @@ -38,8 +38,8 @@ type VRFV2PlusClientRandomWordsRequest struct { } var VRFCoordinatorV2PlusV2ExampleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transferredValue\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"expectedValue\",\"type\":\"uint96\"}],\"name\":\"InvalidNativeBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"requestVersion\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"expectedVersion\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"previousCoordinator\",\"type\":\"address\"}],\"name\":\"MustBePreviousCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubscriptionIDCollisionFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestID\",\"type\":\"uint256\"}],\"name\":\"generateFakeRandomness\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"},{\"internalType\":\"uint96\",\"name\":\"linkBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedData\",\"type\":\"bytes\"}],\"name\":\"onMigration\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_prevCoordinator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestConsumerMapping\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_subscriptions\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"linkBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalLinkBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6080604052600060035534801561001557600080fd5b50604051610fc6380380610fc683398101604081905261003491610081565b600580546001600160a01b039384166001600160a01b031991821617909155600480549290931691161790556100b4565b80516001600160a01b038116811461007c57600080fd5b919050565b6000806040838503121561009457600080fd5b61009d83610065565b91506100ab60208401610065565b90509250929050565b610f03806100c36000396000f3fe6080604052600436106100c75760003560e01c8063ce3f471911610074578063dc311dd31161004e578063dc311dd314610325578063e89e106a14610355578063ed8b558f1461036b57600080fd5b8063ce3f4719146102c3578063d6100d1c146102d8578063da4f5e6d146102f857600080fd5b806386175f58116100a557806386175f581461022557806393f3acb6146102685780639b1c385e1461029557600080fd5b80630495f265146100cc578063086597b31461018157806318e3dd27146101d3575b600080fd5b3480156100d857600080fd5b5061013b6100e7366004610ce7565b6000602081905290815260409020805460029091015473ffffffffffffffffffffffffffffffffffffffff909116906bffffffffffffffffffffffff808216916c0100000000000000000000000090041683565b6040805173ffffffffffffffffffffffffffffffffffffffff90941684526bffffffffffffffffffffffff92831660208501529116908201526060015b60405180910390f35b34801561018d57600080fd5b506004546101ae9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610178565b3480156101df57600080fd5b50600254610208906c0100000000000000000000000090046bffffffffffffffffffffffff1681565b6040516bffffffffffffffffffffffff9091168152602001610178565b34801561023157600080fd5b506101ae610240366004610ce7565b60016020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b34801561027457600080fd5b50610288610283366004610ce7565b610390565b6040516101789190610dc4565b3480156102a157600080fd5b506102b56102b0366004610be2565b61043b565b604051908152602001610178565b6102d66102d1366004610b70565b61044c565b005b3480156102e457600080fd5b506102d66102f3366004610ce7565b6107a7565b34801561030457600080fd5b506005546101ae9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561033157600080fd5b50610345610340366004610ce7565b61082f565b6040516101789493929190610d3b565b34801561036157600080fd5b506102b560035481565b34801561037757600080fd5b50600254610208906bffffffffffffffffffffffff1681565b6040805160018082528183019092526060916000919060208083019080368337019050509050826040516020016103fe918152604060208201819052600a908201527f6e6f742072616e646f6d00000000000000000000000000000000000000000000606082015260800190565b6040516020818303038152906040528051906020012060001c8160008151811061042a5761042a610e98565b602090810291909101015292915050565b60006104463361095a565b92915050565b60045473ffffffffffffffffffffffffffffffffffffffff1633146104c557600480546040517ff5828f73000000000000000000000000000000000000000000000000000000008152339281019290925273ffffffffffffffffffffffffffffffffffffffff1660248201526044015b60405180910390fd5b60006104d382840184610c24565b9050806000015160ff166001146105255780516040517f8df4607c00000000000000000000000000000000000000000000000000000000815260ff9091166004820152600160248201526044016104bc565b8060a001516bffffffffffffffffffffffff16341461058c5760a08101516040517f6acf13500000000000000000000000000000000000000000000000000000000081523460048201526bffffffffffffffffffffffff90911660248201526044016104bc565b602080820151600090815290819052604090205473ffffffffffffffffffffffffffffffffffffffff16156105ed576040517f4d5f486a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051608080820183528383015173ffffffffffffffffffffffffffffffffffffffff90811683526060808601516020808601918252938701516bffffffffffffffffffffffff9081168688015260a0880151169185019190915282860151600090815280845294909420835181547fffffffffffffffffffffffff00000000000000000000000000000000000000001692169190911781559251805192939261069e92600185019201906109c6565b506040820151600291820180546060909401516bffffffffffffffffffffffff9283167fffffffffffffffff000000000000000000000000000000000000000000000000909516949094176c01000000000000000000000000948316850217905560a084015182549093600c92610719928692900416610e39565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508060800151600260008282829054906101000a90046bffffffffffffffffffffffff166107749190610e39565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550505050565b60008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1680631fe543e3836107dc81610390565b6040518363ffffffff1660e01b81526004016107f9929190610dd7565b600060405180830381600087803b15801561081357600080fd5b505af1158015610827573d6000803e3d6000fd5b505050505050565b6000818152602081905260408120546060908290819073ffffffffffffffffffffffffffffffffffffffff16610891576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526020818152604091829020805460028201546001909201805485518186028101860190965280865273ffffffffffffffffffffffffffffffffffffffff9092169490936bffffffffffffffffffffffff808516946c0100000000000000000000000090041692859183018282801561094457602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610919575b5050505050925093509350935093509193509193565b6000600354600161096b9190610e21565b6003819055600081815260016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff94909416939093179092555090565b828054828255906000526020600020908101928215610a40579160200282015b82811115610a4057825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906109e6565b50610a4c929150610a50565b5090565b5b80821115610a4c5760008155600101610a51565b803573ffffffffffffffffffffffffffffffffffffffff81168114610a8957600080fd5b919050565b600082601f830112610a9f57600080fd5b8135602067ffffffffffffffff80831115610abc57610abc610ec7565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108482111715610aff57610aff610ec7565b60405284815283810192508684018288018501891015610b1e57600080fd5b600092505b85831015610b4857610b3481610a65565b845292840192600192909201918401610b23565b50979650505050505050565b80356bffffffffffffffffffffffff81168114610a8957600080fd5b60008060208385031215610b8357600080fd5b823567ffffffffffffffff80821115610b9b57600080fd5b818501915085601f830112610baf57600080fd5b813581811115610bbe57600080fd5b866020828501011115610bd057600080fd5b60209290920196919550909350505050565b600060208284031215610bf457600080fd5b813567ffffffffffffffff811115610c0b57600080fd5b820160c08185031215610c1d57600080fd5b9392505050565b600060208284031215610c3657600080fd5b813567ffffffffffffffff80821115610c4e57600080fd5b9083019060c08286031215610c6257600080fd5b610c6a610df8565b823560ff81168114610c7b57600080fd5b815260208381013590820152610c9360408401610a65565b6040820152606083013582811115610caa57600080fd5b610cb687828601610a8e565b606083015250610cc860808401610b54565b6080820152610cd960a08401610b54565b60a082015295945050505050565b600060208284031215610cf957600080fd5b5035919050565b600081518084526020808501945080840160005b83811015610d3057815187529582019590820190600101610d14565b509495945050505050565b60006080820173ffffffffffffffffffffffffffffffffffffffff8088168452602060808186015282885180855260a087019150828a01945060005b81811015610d95578551851683529483019491830191600101610d77565b50506bffffffffffffffffffffffff978816604087015295909616606090940193909352509195945050505050565b602081526000610c1d6020830184610d00565b828152604060208201526000610df06040830184610d00565b949350505050565b60405160c0810167ffffffffffffffff81118282101715610e1b57610e1b610ec7565b60405290565b60008219821115610e3457610e34610e69565b500190565b60006bffffffffffffffffffffffff808316818516808303821115610e6057610e60610e69565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transferredValue\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"expectedValue\",\"type\":\"uint96\"}],\"name\":\"InvalidNativeBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"requestVersion\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"expectedVersion\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"previousCoordinator\",\"type\":\"address\"}],\"name\":\"MustBePreviousCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubscriptionIDCollisionFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestID\",\"type\":\"uint256\"}],\"name\":\"generateFakeRandomness\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"linkBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedData\",\"type\":\"bytes\"}],\"name\":\"onMigration\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_prevCoordinator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestConsumerMapping\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_subscriptions\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"linkBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalLinkBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6080604052600060035534801561001557600080fd5b506040516111d73803806111d783398101604081905261003491610081565b600580546001600160a01b039384166001600160a01b031991821617909155600480549290931691161790556100b4565b80516001600160a01b038116811461007c57600080fd5b919050565b6000806040838503121561009457600080fd5b61009d83610065565b91506100ab60208401610065565b90509250929050565b611114806100c36000396000f3fe6080604052600436106100c75760003560e01c8063ce3f471911610074578063dc311dd31161004e578063dc311dd314610361578063e89e106a14610392578063ed8b558f146103a857600080fd5b8063ce3f4719146102ff578063d6100d1c14610314578063da4f5e6d1461033457600080fd5b806386175f58116100a557806386175f581461026157806393f3acb6146102a45780639b1c385e146102d157600080fd5b80630495f265146100cc578063086597b3146101bd57806318e3dd271461020f575b600080fd5b3480156100d857600080fd5b506101636100e7366004610ec8565b600060208190529081526040902080546001909101546bffffffffffffffffffffffff808316926c01000000000000000000000000810490911691780100000000000000000000000000000000000000000000000090910467ffffffffffffffff169073ffffffffffffffffffffffffffffffffffffffff1684565b604080516bffffffffffffffffffffffff958616815294909316602085015267ffffffffffffffff9091169183019190915273ffffffffffffffffffffffffffffffffffffffff1660608201526080015b60405180910390f35b3480156101c957600080fd5b506004546101ea9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b4565b34801561021b57600080fd5b50600254610244906c0100000000000000000000000090046bffffffffffffffffffffffff1681565b6040516bffffffffffffffffffffffff90911681526020016101b4565b34801561026d57600080fd5b506101ea61027c366004610ec8565b60016020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b3480156102b057600080fd5b506102c46102bf366004610ec8565b6103cd565b6040516101b49190610f1c565b3480156102dd57600080fd5b506102f16102ec366004610dca565b610478565b6040519081526020016101b4565b61031261030d366004610d58565b6105aa565b005b34801561032057600080fd5b5061031261032f366004610ec8565b61095e565b34801561034057600080fd5b506005546101ea9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561036d57600080fd5b5061038161037c366004610ec8565b6109e6565b6040516101b4959493929190610f50565b34801561039e57600080fd5b506102f160035481565b3480156103b457600080fd5b50600254610244906bffffffffffffffffffffffff1681565b60408051600180825281830190925260609160009190602080830190803683370190505090508260405160200161043b918152604060208201819052600a908201527f6e6f742072616e646f6d00000000000000000000000000000000000000000000606082015260800190565b6040516020818303038152906040528051906020012060001c81600081518110610467576104676110a9565b602090810291909101015292915050565b60208181013560009081528082526040808220815160a08101835281546bffffffffffffffffffffffff80821683526c01000000000000000000000000820416828701527801000000000000000000000000000000000000000000000000900467ffffffffffffffff1681840152600182015473ffffffffffffffffffffffffffffffffffffffff166060820152600282018054845181880281018801909552808552949586959294608086019390929183018282801561056f57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610544575b50505050508152505090508060400151600161058b919061102b565b67ffffffffffffffff1660408201526105a333610b42565b9392505050565b60045473ffffffffffffffffffffffffffffffffffffffff16331461062357600480546040517ff5828f73000000000000000000000000000000000000000000000000000000008152339281019290925273ffffffffffffffffffffffffffffffffffffffff1660248201526044015b60405180910390fd5b600061063182840184610e05565b9050806000015160ff166001146106835780516040517f8df4607c00000000000000000000000000000000000000000000000000000000815260ff90911660048201526001602482015260440161061a565b8060a001516bffffffffffffffffffffffff1634146106ea5760a08101516040517f6acf13500000000000000000000000000000000000000000000000000000000081523460048201526bffffffffffffffffffffffff909116602482015260440161061a565b602080820151600090815290819052604090206001015473ffffffffffffffffffffffffffffffffffffffff161561074e576040517f4d5f486a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a080820183526080808501516bffffffffffffffffffffffff9081168452918501518216602080850191825260008587018181528888015173ffffffffffffffffffffffffffffffffffffffff9081166060808a019182528b0151968901968752848b0151845283855298909220875181549551925167ffffffffffffffff1678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9389166c01000000000000000000000000027fffffffffffffffff000000000000000000000000000000000000000000000000909716919098161794909417169490941782559451600182018054919094167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617909255518051929391926108989260028501920190610bae565b50505060a081015160028054600c906108d09084906c0100000000000000000000000090046bffffffffffffffffffffffff16611057565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508060800151600260008282829054906101000a90046bffffffffffffffffffffffff1661092b9190611057565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550505050565b60008181526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1680631fe543e383610993816103cd565b6040518363ffffffff1660e01b81526004016109b0929190610f2f565b600060405180830381600087803b1580156109ca57600080fd5b505af11580156109de573d6000803e3d6000fd5b505050505050565b60008181526020819052604081206001015481908190819060609073ffffffffffffffffffffffffffffffffffffffff16610a4d576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000868152602081815260409182902080546001820154600290920180548551818602810186019096528086526bffffffffffffffffffffffff808416966c01000000000000000000000000850490911695780100000000000000000000000000000000000000000000000090940467ffffffffffffffff169473ffffffffffffffffffffffffffffffffffffffff169390918391830182828015610b2857602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610afd575b505050505090509450945094509450945091939590929450565b60006003546001610b539190611013565b6003819055600081815260016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff94909416939093179092555090565b828054828255906000526020600020908101928215610c28579160200282015b82811115610c2857825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190610bce565b50610c34929150610c38565b5090565b5b80821115610c345760008155600101610c39565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c7157600080fd5b919050565b600082601f830112610c8757600080fd5b8135602067ffffffffffffffff80831115610ca457610ca46110d8565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108482111715610ce757610ce76110d8565b60405284815283810192508684018288018501891015610d0657600080fd5b600092505b85831015610d3057610d1c81610c4d565b845292840192600192909201918401610d0b565b50979650505050505050565b80356bffffffffffffffffffffffff81168114610c7157600080fd5b60008060208385031215610d6b57600080fd5b823567ffffffffffffffff80821115610d8357600080fd5b818501915085601f830112610d9757600080fd5b813581811115610da657600080fd5b866020828501011115610db857600080fd5b60209290920196919550909350505050565b600060208284031215610ddc57600080fd5b813567ffffffffffffffff811115610df357600080fd5b820160c081850312156105a357600080fd5b600060208284031215610e1757600080fd5b813567ffffffffffffffff80821115610e2f57600080fd5b9083019060c08286031215610e4357600080fd5b610e4b610fea565b823560ff81168114610e5c57600080fd5b815260208381013590820152610e7460408401610c4d565b6040820152606083013582811115610e8b57600080fd5b610e9787828601610c76565b606083015250610ea960808401610d3c565b6080820152610eba60a08401610d3c565b60a082015295945050505050565b600060208284031215610eda57600080fd5b5035919050565b600081518084526020808501945080840160005b83811015610f1157815187529582019590820190600101610ef5565b509495945050505050565b6020815260006105a36020830184610ee1565b828152604060208201526000610f486040830184610ee1565b949350505050565b600060a082016bffffffffffffffffffffffff808916845260208189168186015267ffffffffffffffff8816604086015273ffffffffffffffffffffffffffffffffffffffff9150818716606086015260a0608086015282865180855260c087019150828801945060005b81811015610fd9578551851683529483019491830191600101610fbb565b50909b9a5050505050505050505050565b60405160c0810167ffffffffffffffff8111828210171561100d5761100d6110d8565b60405290565b600082198211156110265761102661107a565b500190565b600067ffffffffffffffff80831681851680830382111561104e5761104e61107a565b01949350505050565b60006bffffffffffffffffffffffff80831681851680830382111561104e5761104e5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFCoordinatorV2PlusV2ExampleABI = VRFCoordinatorV2PlusV2ExampleMetaData.ABI @@ -211,10 +211,11 @@ func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleCaller) GetSu return *outstruct, err } - outstruct.Owner = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - outstruct.Consumers = *abi.ConvertType(out[1], new([]common.Address)).(*[]common.Address) - outstruct.LinkBalance = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) - outstruct.NativeBalance = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.LinkBalance = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.NativeBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.ReqCount = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.Owner = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.Consumers = *abi.ConvertType(out[4], new([]common.Address)).(*[]common.Address) return *outstruct, err @@ -331,9 +332,10 @@ func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleCaller) SSubs return *outstruct, err } - outstruct.Owner = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - outstruct.LinkBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - outstruct.NativeBalance = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.LinkBalance = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.NativeBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.ReqCount = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.Owner = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) return *outstruct, err @@ -419,28 +421,30 @@ func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleTransactorSes return _VRFCoordinatorV2PlusV2Example.Contract.OnMigration(&_VRFCoordinatorV2PlusV2Example.TransactOpts, encodedData) } -func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleTransactor) RequestRandomWords(opts *bind.TransactOpts, arg0 VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusV2Example.contract.Transact(opts, "requestRandomWords", arg0) +func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleTransactor) RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusV2Example.contract.Transact(opts, "requestRandomWords", req) } -func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleSession) RequestRandomWords(arg0 VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusV2Example.Contract.RequestRandomWords(&_VRFCoordinatorV2PlusV2Example.TransactOpts, arg0) +func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleSession) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusV2Example.Contract.RequestRandomWords(&_VRFCoordinatorV2PlusV2Example.TransactOpts, req) } -func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleTransactorSession) RequestRandomWords(arg0 VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusV2Example.Contract.RequestRandomWords(&_VRFCoordinatorV2PlusV2Example.TransactOpts, arg0) +func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2ExampleTransactorSession) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusV2Example.Contract.RequestRandomWords(&_VRFCoordinatorV2PlusV2Example.TransactOpts, req) } type GetSubscription struct { - Owner common.Address - Consumers []common.Address LinkBalance *big.Int NativeBalance *big.Int + ReqCount uint64 + Owner common.Address + Consumers []common.Address } type SSubscriptions struct { - Owner common.Address LinkBalance *big.Int NativeBalance *big.Int + ReqCount uint64 + Owner common.Address } func (_VRFCoordinatorV2PlusV2Example *VRFCoordinatorV2PlusV2Example) Address() common.Address { @@ -474,7 +478,7 @@ type VRFCoordinatorV2PlusV2ExampleInterface interface { OnMigration(opts *bind.TransactOpts, encodedData []byte) (*types.Transaction, error) - RequestRandomWords(opts *bind.TransactOpts, arg0 VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) + RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) Address() common.Address } diff --git a/core/gethwrappers/generated/vrf_coordinator_v2plus/vrf_coordinator_v2plus.go b/core/gethwrappers/generated/vrf_coordinator_v2plus/vrf_coordinator_v2plus.go deleted file mode 100644 index a57ed02b815..00000000000 --- a/core/gethwrappers/generated/vrf_coordinator_v2plus/vrf_coordinator_v2plus.go +++ /dev/null @@ -1,3950 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package vrf_coordinator_v2plus - -import ( - "errors" - "fmt" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" -) - -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -type VRFCoordinatorV2PlusFeeConfig struct { - FulfillmentFlatFeeLinkPPM uint32 - FulfillmentFlatFeeEthPPM uint32 -} - -type VRFCoordinatorV2PlusRequestCommitment struct { - BlockNum uint64 - SubId *big.Int - CallbackGasLimit uint32 - NumWords uint32 - Sender common.Address - ExtraArgs []byte -} - -type VRFProof struct { - Pk [2]*big.Int - Gamma [2]*big.Int - C *big.Int - S *big.Int - Seed *big.Int - UWitness common.Address - CGammaWitness [2]*big.Int - SHashWitness [2]*big.Int - ZInv *big.Int -} - -type VRFV2PlusClientRandomWordsRequest struct { - KeyHash [32]byte - SubId *big.Int - RequestConfirmations uint16 - CallbackGasLimit uint32 - NumWords uint32 - ExtraArgs []byte -} - -var VRFCoordinatorV2PlusMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendEther\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeEthPPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2Plus.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EthFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountEth\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldEthBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newEthBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithEth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_ETH_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"deregisterMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"deregisterProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2Plus.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithEth\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawEth\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverEthFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeEthPPM\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalEthBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeEthPPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2Plus.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkEthFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKETHFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b506040516200615938038062006159833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615f7e620001db600039600081816105ee0152613a860152615f7e6000f3fe6080604052600436106102dc5760003560e01c80638da5cb5b1161017f578063bec4c08c116100e1578063dc311dd31161008a578063e95704bd11610064578063e95704bd1461095d578063ee9d2d3814610984578063f2fde38b146109b157600080fd5b8063dc311dd3146108f9578063e72f6e301461092a578063e8509bff1461094a57600080fd5b8063d98e620e116100bb578063d98e620e14610883578063da2f2610146108a3578063dac83d29146108d957600080fd5b8063bec4c08c14610823578063caf70c4a14610843578063cb6317971461086357600080fd5b8063a8cb447b11610143578063aefb212f1161011d578063aefb212f146107b6578063b08c8795146107e3578063b2a7cac51461080357600080fd5b8063a8cb447b14610756578063aa433aff14610776578063ad1783611461079657600080fd5b80638da5cb5b146106ab5780639b1c385e146106c95780639d40a6fd146106e9578063a21a23e414610721578063a4c0ed361461073657600080fd5b806340d6bb821161024357806366316d8d116101ec5780636f64f03f116101c65780636f64f03f1461065657806379ba50971461067657806386fe91c71461068b57600080fd5b806366316d8d146105bc578063689c4517146105dc5780636b6feccc1461061057600080fd5b806357133e641161021d57806357133e64146105675780635d06b4ab1461058757806364d51a2a146105a757600080fd5b806340d6bb82146104ec57806341af6c871461051757806346d8d4861461054757600080fd5b80630ae09540116102a5578063294daa491161027f578063294daa4914610478578063330987b314610494578063405b84fa146104cc57600080fd5b80630ae09540146103f857806315c48b84146104185780631b6b6d231461044057600080fd5b8062012291146102e157806304104edb1461030e578063043bd6ae14610330578063088070f51461035457806308821d58146103d8575b600080fd5b3480156102ed57600080fd5b506102f66109d1565b60405161030593929190615ae2565b60405180910390f35b34801561031a57600080fd5b5061032e61032936600461542f565b610a4d565b005b34801561033c57600080fd5b5061034660115481565b604051908152602001610305565b34801561036057600080fd5b50600d546103a09061ffff81169063ffffffff62010000820481169160ff600160301b820416916701000000000000008204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a001610305565b3480156103e457600080fd5b5061032e6103f336600461556f565b610c0f565b34801561040457600080fd5b5061032e610413366004615811565b610da3565b34801561042457600080fd5b5061042d60c881565b60405161ffff9091168152602001610305565b34801561044c57600080fd5b50600254610460906001600160a01b031681565b6040516001600160a01b039091168152602001610305565b34801561048457600080fd5b5060405160018152602001610305565b3480156104a057600080fd5b506104b46104af366004615641565b610e71565b6040516001600160601b039091168152602001610305565b3480156104d857600080fd5b5061032e6104e7366004615811565b61135b565b3480156104f857600080fd5b506105026101f481565b60405163ffffffff9091168152602001610305565b34801561052357600080fd5b506105376105323660046155c4565b611782565b6040519015158152602001610305565b34801561055357600080fd5b5061032e61056236600461544c565b611983565b34801561057357600080fd5b5061032e610582366004615481565b611b00565b34801561059357600080fd5b5061032e6105a236600461542f565b611b60565b3480156105b357600080fd5b5061042d606481565b3480156105c857600080fd5b5061032e6105d736600461544c565b611c1e565b3480156105e857600080fd5b506104607f000000000000000000000000000000000000000000000000000000000000000081565b34801561061c57600080fd5b506012546106399063ffffffff8082169164010000000090041682565b6040805163ffffffff938416815292909116602083015201610305565b34801561066257600080fd5b5061032e6106713660046154ba565b611de6565b34801561068257600080fd5b5061032e611ee5565b34801561069757600080fd5b50600a546104b4906001600160601b031681565b3480156106b757600080fd5b506000546001600160a01b0316610460565b3480156106d557600080fd5b506103466106e436600461571e565b611f96565b3480156106f557600080fd5b50600754610709906001600160401b031681565b6040516001600160401b039091168152602001610305565b34801561072d57600080fd5b5061034661238b565b34801561074257600080fd5b5061032e6107513660046154e7565b6125db565b34801561076257600080fd5b5061032e61077136600461542f565b61277b565b34801561078257600080fd5b5061032e6107913660046155c4565b612896565b3480156107a257600080fd5b50600354610460906001600160a01b031681565b3480156107c257600080fd5b506107d66107d1366004615836565b6128f6565b6040516103059190615a47565b3480156107ef57600080fd5b5061032e6107fe366004615773565b6129f7565b34801561080f57600080fd5b5061032e61081e3660046155c4565b612b8b565b34801561082f57600080fd5b5061032e61083e366004615811565b612cc1565b34801561084f57600080fd5b5061034661085e36600461558b565b612e5d565b34801561086f57600080fd5b5061032e61087e366004615811565b612e8d565b34801561088f57600080fd5b5061034661089e3660046155c4565b613190565b3480156108af57600080fd5b506104606108be3660046155c4565b600e602052600090815260409020546001600160a01b031681565b3480156108e557600080fd5b5061032e6108f4366004615811565b6131b1565b34801561090557600080fd5b506109196109143660046155c4565b6132d0565b604051610305959493929190615c4a565b34801561093657600080fd5b5061032e61094536600461542f565b6133cb565b61032e6109583660046155c4565b6135b3565b34801561096957600080fd5b50600a546104b490600160601b90046001600160601b031681565b34801561099057600080fd5b5061034661099f3660046155c4565b60106020526000908152604090205481565b3480156109bd57600080fd5b5061032e6109cc36600461542f565b6136f2565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff16939192839190830182828015610a3b57602002820191906000526020600020905b815481526020019060010190808311610a27575b50505050509050925092509250909192565b610a55613703565b60135460005b81811015610be257826001600160a01b031660138281548110610a8057610a80615f22565b6000918252602090912001546001600160a01b03161415610bd0576013610aa8600184615e1b565b81548110610ab857610ab8615f22565b600091825260209091200154601380546001600160a01b039092169183908110610ae457610ae4615f22565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055826013610b1b600185615e1b565b81548110610b2b57610b2b615f22565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506013805480610b6a57610b6a615f0c565b6000828152602090819020600019908301810180546001600160a01b03191690559091019091556040516001600160a01b03851681527ff80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af37910160405180910390a1505050565b80610bda81615e8a565b915050610a5b565b50604051635428d44960e01b81526001600160a01b03831660048201526024015b60405180910390fd5b50565b610c17613703565b604080518082018252600091610c46919084906002908390839080828437600092019190915250612e5d915050565b6000818152600e60205260409020549091506001600160a01b031680610c8257604051631dfd6e1360e21b815260048101839052602401610c03565b6000828152600e6020526040812080546001600160a01b03191690555b600f54811015610d5a5782600f8281548110610cbd57610cbd615f22565b90600052602060002001541415610d4857600f805460009190610ce290600190615e1b565b81548110610cf257610cf2615f22565b9060005260206000200154905080600f8381548110610d1357610d13615f22565b600091825260209091200155600f805480610d3057610d30615f0c565b60019003818190600052602060002001600090559055505b80610d5281615e8a565b915050610c9f565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610d9691815260200190565b60405180910390a2505050565b60008281526005602052604090205482906001600160a01b031680610ddb57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614610e0f57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615610e3a5760405163769dd35360e11b815260040160405180910390fd5b610e4384611782565b15610e6157604051631685ecdd60e31b815260040160405180910390fd5b610e6b848461375f565b50505050565b600d54600090600160301b900460ff1615610e9f5760405163769dd35360e11b815260040160405180910390fd5b60005a90506000610eb0858561391b565b90506000846060015163ffffffff166001600160401b03811115610ed657610ed6615f38565b604051908082528060200260200182016040528015610eff578160200160208202803683370190505b50905060005b856060015163ffffffff16811015610f7f57826040015181604051602001610f37929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c828281518110610f6257610f62615f22565b602090810291909101015280610f7781615e8a565b915050610f05565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b91610fb791908690602401615b55565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805466ff0000000000001916600160301b17905590880151608089015191925060009161101f9163ffffffff169084613ba8565b600d805466ff00000000000019169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b0316611062816001615d9b565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a015180516110af90600190615e1b565b815181106110bf576110bf615f22565b602091010151600d5460f89190911c60011491506000906110f0908a90600160581b900463ffffffff163a85613bf6565b905081156111f9576020808c01516000908152600690915260409020546001600160601b03808316600160601b90920416101561114057604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c90611177908490600160601b90046001600160601b0316615e32565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c9091528120805485945090926111d091859116615dc6565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506112e5565b6020808c01516000908152600690915260409020546001600160601b038083169116101561123a57604051631e9acf1760e31b815260040160405180910390fd5b6020808c0151600090815260069091526040812080548392906112679084906001600160601b0316615e32565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b9091528120805485945090926112c091859116615dc6565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a604001518488604051611342939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff16156113865760405163769dd35360e11b815260040160405180910390fd5b61138f81613c46565b6113b757604051635428d44960e01b81526001600160a01b0382166004820152602401610c03565b6000806000806113c6866132d0565b945094505093509350336001600160a01b0316826001600160a01b0316146114305760405162461bcd60e51b815260206004820152601660248201527f4e6f7420737562736372697074696f6e206f776e6572000000000000000000006044820152606401610c03565b61143986611782565b156114865760405162461bcd60e51b815260206004820152601660248201527f50656e64696e67207265717565737420657869737473000000000000000000006044820152606401610c03565b60006040518060c0016040528061149b600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b031681525090506000816040516020016114ef9190615a6d565b604051602081830303815290604052905061150988613cb0565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b03881690611542908590600401615a5a565b6000604051808303818588803b15801561155b57600080fd5b505af115801561156f573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611598905057506001600160601b03861615155b156116775760025460405163a9059cbb60e01b81526001600160a01b0389811660048301526001600160601b03891660248301529091169063a9059cbb90604401602060405180830381600087803b1580156115f357600080fd5b505af1158015611607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162b91906155a7565b6116775760405162461bcd60e51b815260206004820152601260248201527f696e73756666696369656e742066756e647300000000000000000000000000006044820152606401610c03565b600d805466ff0000000000001916600160301b17905560005b8351811015611725578381815181106116ab576116ab615f22565b6020908102919091010151604051638ea9811760e01b81526001600160a01b038a8116600483015290911690638ea9811790602401600060405180830381600087803b1580156116fa57600080fd5b505af115801561170e573d6000803e3d6000fd5b50505050808061171d90615e8a565b915050611690565b50600d805466ff00000000000019169055604080516001600160a01b0389168152602081018a90527fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187910160405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561180c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116117ee575b505050505081525050905060005b8160400151518110156119795760005b600f5481101561196657600061192f600f838154811061184c5761184c615f22565b90600052602060002001548560400151858151811061186d5761186d615f22565b602002602001015188600460008960400151898151811061189057611890615f22565b6020908102919091018101516001600160a01b03908116835282820193909352604091820160009081208e82528252829020548251808301889052959093168583015260608501939093526001600160401b039091166080808501919091528151808503909101815260a08401825280519083012060c084019490945260e0808401859052815180850390910181526101009093019052815191012091565b50600081815260106020526040902054909150156119535750600195945050505050565b508061195e81615e8a565b91505061182a565b508061197181615e8a565b91505061181a565b5060009392505050565b600d54600160301b900460ff16156119ae5760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b03808316911610156119ea57604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290611a129084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316611a5a9190615e32565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114611ad4576040519150601f19603f3d011682016040523d82523d6000602084013e611ad9565b606091505b5050905080611afb57604051630dcf35db60e41b815260040160405180910390fd5b505050565b611b08613703565b6002546001600160a01b031615611b3257604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b611b68613703565b611b7181613c46565b15611b9a5760405163ac8a27ef60e01b81526001600160a01b0382166004820152602401610c03565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af016259060200160405180910390a150565b600d54600160301b900460ff1615611c495760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b0316611c725760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b0380831691161015611cae57604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b602052604081208054839290611cd69084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b0316611d1e9190615e32565b82546101009290920a6001600160601b0381810219909316918316021790915560025460405163a9059cbb60e01b81526001600160a01b03868116600483015292851660248201529116915063a9059cbb90604401602060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc591906155a7565b611de257604051631e9acf1760e31b815260040160405180910390fd5b5050565b611dee613703565b604080518082018252600091611e1d919084906002908390839080828437600092019190915250612e5d915050565b6000818152600e60205260409020549091506001600160a01b031615611e5957604051634a0b8fa760e01b815260048101829052602401610c03565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610d96565b6001546001600160a01b03163314611f3f5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610c03565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600d54600090600160301b900460ff1615611fc45760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b0316611fff57604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b031680612050576040516379bfd40160e01b815260208401356004820152336024820152604401610c03565b600d5461ffff166120676060850160408601615758565b61ffff16108061208a575060c86120846060850160408601615758565b61ffff16115b156120d05761209f6060840160408501615758565b600d5460405163539c34bb60e11b815261ffff92831660048201529116602482015260c86044820152606401610c03565b600d5462010000900463ffffffff166120ef6080850160608601615858565b63ffffffff16111561213f5761210b6080840160608501615858565b600d54604051637aebf00f60e11b815263ffffffff9283166004820152620100009091049091166024820152604401610c03565b6101f461215260a0850160808601615858565b63ffffffff1611156121985761216e60a0840160808501615858565b6040516311ce1afb60e21b815263ffffffff90911660048201526101f46024820152604401610c03565b60006121a5826001615d9b565b604080518635602080830182905233838501528089013560608401526001600160401b0385166080808501919091528451808503909101815260a0808501865281519183019190912060c085019390935260e0808501849052855180860390910181526101009094019094528251920191909120929350906000906122359061223090890189615c9f565b613eff565b9050600061224282613f7c565b90508361224d613fed565b60208a013561226260808c0160608d01615858565b61227260a08d0160808e01615858565b338660405160200161228a9796959493929190615bad565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d60400160208101906123019190615758565b8e60600160208101906123149190615858565b8f60800160208101906123279190615858565b8960405161233a96959493929190615b6e565b60405180910390a450503360009081526004602090815260408083208983013584529091529020805467ffffffffffffffff19166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff16156123b95760405163769dd35360e11b815260040160405180910390fd5b6000336123c7600143615e1b565b600754604051606093841b6bffffffffffffffffffffffff199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b0390911690600061244683615ea5565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b0381111561248557612485615f38565b6040519080825280602002602001820160405280156124ae578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b03928316178355925160018301805490941691161790915592518051949550909361258f9260028501920190615145565b5061259f91506008905083614086565b5060405133815282907f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d9060200160405180910390a250905090565b600d54600160301b900460ff16156126065760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03163314612631576040516344b0e3c360e01b815260040160405180910390fd5b6020811461265257604051638129bbcd60e01b815260040160405180910390fd5b6000612660828401846155c4565b6000818152600560205260409020549091506001600160a01b031661269857604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b0316918691906126bf8385615dc6565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166127079190615dc6565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a82878461275a9190615d83565b604080519283526020830191909152015b60405180910390a2505050505050565b612783613703565b600a544790600160601b90046001600160601b0316818111156127c3576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015611afb5760006127d78284615e1b565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114612826576040519150601f19603f3d011682016040523d82523d6000602084013e61282b565b606091505b505090508061284d57604051630dcf35db60e41b815260040160405180910390fd5b604080516001600160a01b0387168152602081018490527f879c9ea2b9d5345b84ccd12610b032602808517cebdb795007f3dcb4df377317910160405180910390a15050505050565b61289e613703565b6000818152600560205260409020546001600160a01b03166128d357604051630fb532db60e11b815260040160405180910390fd5b600081815260056020526040902054610c0c9082906001600160a01b031661375f565b606060006129046008614092565b905080841061292657604051631390f2a160e01b815260040160405180910390fd5b60006129328486615d83565b905081811180612940575083155b61294a578061294c565b815b9050600061295a8683615e1b565b6001600160401b0381111561297157612971615f38565b60405190808252806020026020018201604052801561299a578160200160208202803683370190505b50905060005b81518110156129ed576129be6129b68883615d83565b60089061409c565b8282815181106129d0576129d0615f22565b6020908102919091010152806129e581615e8a565b9150506129a0565b5095945050505050565b6129ff613703565b60c861ffff87161115612a395760405163539c34bb60e11b815261ffff871660048201819052602482015260c86044820152606401610c03565b60008213612a5d576040516321ea67b360e11b815260048101839052602401610c03565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff19168817620100008702176effffffffffffffffff000000000000191667010000000000000085026effffffff0000000000000000000000191617600160581b83021790558a51601280548d87015192891667ffffffffffffffff199091161764010000000092891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff1615612bb65760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316612beb57604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612c44576000818152600560205260409081902060010154905163d084e97560e01b81526001600160a01b039091166004820152602401610c03565b6000818152600560209081526040918290208054336001600160a01b0319808316821784556001909301805490931690925583516001600160a01b0390911680825292810191909152909183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691015b60405180910390a25050565b60008281526005602052604090205482906001600160a01b031680612cf957604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612d2d57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615612d585760405163769dd35360e11b815260040160405180910390fd5b60008481526005602052604090206002015460641415612d8b576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b031615612dc257610e6b565b6001600160a01b03831660008181526004602090815260408083208884528252808320805467ffffffffffffffff19166001908117909155600583528184206002018054918201815584529282902090920180546001600160a01b03191684179055905191825285917f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e191015b60405180910390a250505050565b600081604051602001612e709190615a39565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b031680612ec557604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612ef957604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615612f245760405163769dd35360e11b815260040160405180910390fd5b612f2d84611782565b15612f4b57604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316612fa7576040516379bfd40160e01b8152600481018590526001600160a01b0384166024820152604401610c03565b60008481526005602090815260408083206002018054825181850281018501909352808352919290919083018282801561300a57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612fec575b505050505090506000600182516130219190615e1b565b905060005b825181101561312d57856001600160a01b031683828151811061304b5761304b615f22565b60200260200101516001600160a01b0316141561311b57600083838151811061307657613076615f22565b6020026020010151905080600560008a815260200190815260200160002060020183815481106130a8576130a8615f22565b600091825260208083209190910180546001600160a01b0319166001600160a01b0394909416939093179092558981526005909152604090206002018054806130f3576130f3615f0c565b600082815260209020810160001990810180546001600160a01b03191690550190555061312d565b8061312581615e8a565b915050613026565b506001600160a01b03851660008181526004602090815260408083208a8452825291829020805467ffffffffffffffff19169055905191825287917f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7910161276b565b600f81815481106131a057600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b0316806131e957604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461321d57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156132485760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b03848116911614610e6b5760008481526005602090815260409182902060010180546001600160a01b0319166001600160a01b03871690811790915582513381529182015285917f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19101612e4f565b6000818152600560205260408120548190819081906060906001600160a01b031661330e57604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156133b157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613393575b505050505090509450945094509450945091939590929450565b6133d3613703565b6002546001600160a01b03166133fc5760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561344057600080fd5b505afa158015613454573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061347891906155dd565b600a549091506001600160601b0316818111156134b2576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015611afb5760006134c68284615e1b565b60025460405163a9059cbb60e01b81526001600160a01b0387811660048301526024820184905292935091169063a9059cbb90604401602060405180830381600087803b15801561351657600080fd5b505af115801561352a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061354e91906155a7565b61356b57604051631f01ff1360e21b815260040160405180910390fd5b604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a150505050565b600d54600160301b900460ff16156135de5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661361357604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c6136428385615dc6565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b031661368a9190615dc6565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f3f1ddc3ab1bdb39001ad76ca51a0e6f57ce6627c69f251d1de41622847721cde8234846136dd9190615d83565b60408051928352602083019190915201612cb5565b6136fa613703565b610c0c816140a8565b6000546001600160a01b0316331461375d5760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c03565b565b60008061376b84613cb0565b60025491935091506001600160a01b03161580159061379257506001600160601b03821615155b156138425760025460405163a9059cbb60e01b81526001600160a01b0385811660048301526001600160601b03851660248301529091169063a9059cbb90604401602060405180830381600087803b1580156137ed57600080fd5b505af1158015613801573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382591906155a7565b61384257604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613898576040519150601f19603f3d011682016040523d82523d6000602084013e61389d565b606091505b50509050806138bf57604051630dcf35db60e41b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006139478460000151612e5d565b6000818152600e60205260409020549091506001600160a01b03168061398357604051631dfd6e1360e21b815260048101839052602401610c03565b60008286608001516040516020016139a5929190918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526010909352912054909150806139eb57604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613a1a978a979096959101615bf7565b604051602081830303815290604052805190602001208114613a4f5760405163354a450b60e21b815260040160405180910390fd5b6000613a5e8760000151614152565b905080613b36578651604051631d2827a760e31b81526001600160401b0390911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b158015613ad057600080fd5b505afa158015613ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b0891906155dd565b905080613b3657865160405163175dadad60e01b81526001600160401b039091166004820152602401610c03565b6000886080015182604051602001613b58929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506000613b7f8a83614249565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a611388811015613bba57600080fd5b611388810390508460408204820311613bd257600080fd5b50823b613bde57600080fd5b60008083516020850160008789f190505b9392505050565b60008115613c2457601254613c1d9086908690640100000000900463ffffffff16866142b4565b9050613c3e565b601254613c3b908690869063ffffffff168661431e565b90505b949350505050565b6000805b601354811015613ca757826001600160a01b031660138281548110613c7157613c71615f22565b6000918252602090912001546001600160a01b03161415613c955750600192915050565b80613c9f81615e8a565b915050613c4a565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287968796949594860193919290830182828015613d3c57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613d1e575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613e19576004600084604001518381518110613dc857613dc8615f22565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208982529092529020805467ffffffffffffffff1916905580613e1181615e8a565b915050613da1565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613e5160028301826151aa565b5050600085815260066020526040812055613e6d60088661440c565b50600a8054859190600090613e8c9084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613ed49190615e32565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081019091526000815281613f285750604080516020810190915260008152611355565b63125fa26760e31b613f3a8385615e5a565b6001600160e01b03191614613f6257604051632923fee760e11b815260040160405180910390fd5b613f6f8260048186615d59565b810190613bef91906155f6565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613fb591511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b60004661a4b1811480614002575062066eed81145b1561407f5760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561404157600080fd5b505afa158015614055573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061407991906155dd565b91505090565b4391505090565b6000613bef8383614418565b6000611355825490565b6000613bef8383614467565b6001600160a01b0381163314156141015760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c03565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60004661a4b1811480614167575062066eed81145b80614174575062066eee81145b1561423a57610100836001600160401b031661418e613fed565b6141989190615e1b565b11806141b457506141a7613fed565b836001600160401b031610155b156141c25750600092915050565b6040516315a03d4160e11b81526001600160401b0384166004820152606490632b407a829060240160206040518083038186803b15801561420257600080fd5b505afa158015614216573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bef91906155dd565b50506001600160401b03164090565b600061427d8360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151614491565b60038360200151604051602001614295929190615b41565b60408051601f1981840301815291905280516020909101209392505050565b6000806142bf6146bc565b905060005a6142ce8888615d83565b6142d89190615e1b565b6142e29085615dfc565b905060006142fb63ffffffff871664e8d4a51000615dfc565b9050826143088284615d83565b6143129190615d83565b98975050505050505050565b600080614329614718565b90506000811361434f576040516321ea67b360e11b815260048101829052602401610c03565b60006143596146bc565b9050600082825a61436a8b8b615d83565b6143749190615e1b565b61437e9088615dfc565b6143889190615d83565b61439a90670de0b6b3a7640000615dfc565b6143a49190615de8565b905060006143bd63ffffffff881664e8d4a51000615dfc565b90506143d5816b033b2e3c9fd0803ce8000000615e1b565b8211156143f55760405163e80fa38160e01b815260040160405180910390fd5b6143ff8183615d83565b9998505050505050505050565b6000613bef83836147e7565b600081815260018301602052604081205461445f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611355565b506000611355565b600082600001828154811061447e5761447e615f22565b9060005260206000200154905092915050565b61449a896148da565b6144e65760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e2063757276650000000000006044820152606401610c03565b6144ef886148da565b61453b5760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e20637572766500000000000000000000006044820152606401610c03565b614544836148da565b6145905760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e2063757276650000006044820152606401610c03565b614599826148da565b6145e55760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e206375727665000000006044820152606401610c03565b6145f1878a88876149b3565b61463d5760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e657373000000000000006044820152606401610c03565b60006146498a87614ad6565b9050600061465c898b878b868989614b3a565b9050600061466d838d8d8a86614c5a565b9050808a146146ae5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610c03565b505050505050505050505050565b60004661a4b18114806146d1575062066eed81145b1561471057606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561404157600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093670100000000000000900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561477a57600080fd5b505afa15801561478e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b29190615873565b5094509092508491505080156147d657506147cd8242615e1b565b8463ffffffff16105b15613c3e5750601154949350505050565b600081815260018301602052604081205480156148d057600061480b600183615e1b565b855490915060009061481f90600190615e1b565b905081811461488457600086600001828154811061483f5761483f615f22565b906000526020600020015490508087600001848154811061486257614862615f22565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061489557614895615f0c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611355565b6000915050611355565b80516000906401000003d019116149335760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d0191161498c5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d0199080096149ac8360005b6020020151614c9a565b1492915050565b60006001600160a01b0382166149f95760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b6044820152606401610c03565b602084015160009060011615614a1057601c614a13565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614aae573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614ade6151c8565b614b0b60018484604051602001614af793929190615a18565b604051602081830303815290604052614cbe565b90505b614b17816148da565b611355578051604080516020810192909252614b339101614af7565b9050614b0e565b614b426151c8565b825186516401000003d0199081900691061415614ba15760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e637400006044820152606401610c03565b614bac878988614d0c565b614bf85760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c6564000000000000000000006044820152606401610c03565b614c03848685614d0c565b614c4f5760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c65640000000000000000006044820152606401610c03565b614312868484614e34565b600060028686868587604051602001614c78969594939291906159b9565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614cc66151c8565b614ccf82614efb565b8152614ce4614cdf8260006149a2565b614f36565b602082018190526002900660011415612386576020810180516401000003d019039052919050565b600082614d495760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b6044820152606401610c03565b83516020850151600090614d5f90600290615ecc565b15614d6b57601c614d6e565b601b5b9050600070014551231950b75fc4402da1732fc9bebe198387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa158015614de0573d6000803e3d6000fd5b505050602060405103519050600086604051602001614dff91906159a7565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614e3c6151c8565b835160208086015185519186015160009384938493614e5d93909190614f56565b919450925090506401000003d019858209600114614ebd5760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a000000000000006044820152606401610c03565b60405180604001604052806401000003d01980614edc57614edc615ef6565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d019811061238657604080516020808201939093528151808203840181529082019091528051910120614f03565b6000611355826002614f4f6401000003d0196001615d83565b901c615036565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614f96838385856150d8565b9098509050614fa788828e886150fc565b9098509050614fb888828c876150fc565b90985090506000614fcb8d878b856150fc565b9098509050614fdc888286866150d8565b9098509050614fed88828e896150fc565b9098509050818114615022576401000003d019818a0998506401000003d01982890997506401000003d0198183099650615026565b8196505b5050505050509450945094915050565b6000806150416151e6565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152615073615204565b60208160c0846005600019fa9250826150ce5760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c7572652100000000000000000000000000006044820152606401610c03565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b82805482825590600052602060002090810192821561519a579160200282015b8281111561519a57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615165565b506151a6929150615222565b5090565b5080546000825590600052602060002090810190610c0c9190615222565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b808211156151a65760008155600101615223565b803561238681615f4e565b806040810183101561135557600080fd5b600082601f83011261526457600080fd5b61526c615cec565b80838560408601111561527e57600080fd5b60005b60028110156152a0578135845260209384019390910190600101615281565b509095945050505050565b600082601f8301126152bc57600080fd5b81356001600160401b03808211156152d6576152d6615f38565b604051601f8301601f19908116603f011681019082821181831017156152fe576152fe615f38565b8160405283815286602085880101111561531757600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060c0828403121561534957600080fd5b615351615d14565b905081356001600160401b03808216821461536b57600080fd5b81835260208401356020840152615384604085016153ea565b6040840152615395606085016153ea565b60608401526153a660808501615237565b608084015260a08401359150808211156153bf57600080fd5b506153cc848285016152ab565b60a08301525092915050565b803561ffff8116811461238657600080fd5b803563ffffffff8116811461238657600080fd5b805169ffffffffffffffffffff8116811461238657600080fd5b80356001600160601b038116811461238657600080fd5b60006020828403121561544157600080fd5b8135613bef81615f4e565b6000806040838503121561545f57600080fd5b823561546a81615f4e565b915061547860208401615418565b90509250929050565b6000806040838503121561549457600080fd5b823561549f81615f4e565b915060208301356154af81615f4e565b809150509250929050565b600080606083850312156154cd57600080fd5b82356154d881615f4e565b91506154788460208501615242565b600080600080606085870312156154fd57600080fd5b843561550881615f4e565b93506020850135925060408501356001600160401b038082111561552b57600080fd5b818701915087601f83011261553f57600080fd5b81358181111561554e57600080fd5b88602082850101111561556057600080fd5b95989497505060200194505050565b60006040828403121561558157600080fd5b613bef8383615242565b60006040828403121561559d57600080fd5b613bef8383615253565b6000602082840312156155b957600080fd5b8151613bef81615f63565b6000602082840312156155d657600080fd5b5035919050565b6000602082840312156155ef57600080fd5b5051919050565b60006020828403121561560857600080fd5b604051602081018181106001600160401b038211171561562a5761562a615f38565b604052823561563881615f63565b81529392505050565b6000808284036101c081121561565657600080fd5b6101a08082121561566657600080fd5b61566e615d36565b915061567a8686615253565b82526156898660408701615253565b60208301526080850135604083015260a0850135606083015260c085013560808301526156b860e08601615237565b60a08301526101006156cc87828801615253565b60c08401526156df876101408801615253565b60e0840152610180860135908301529092508301356001600160401b0381111561570857600080fd5b61571485828601615337565b9150509250929050565b60006020828403121561573057600080fd5b81356001600160401b0381111561574657600080fd5b820160c08185031215613bef57600080fd5b60006020828403121561576a57600080fd5b613bef826153d8565b60008060008060008086880360e081121561578d57600080fd5b615796886153d8565b96506157a4602089016153ea565b95506157b2604089016153ea565b94506157c0606089016153ea565b9350608088013592506040609f19820112156157db57600080fd5b506157e4615cec565b6157f060a089016153ea565b81526157fe60c089016153ea565b6020820152809150509295509295509295565b6000806040838503121561582457600080fd5b8235915060208301356154af81615f4e565b6000806040838503121561584957600080fd5b50508035926020909101359150565b60006020828403121561586a57600080fd5b613bef826153ea565b600080600080600060a0868803121561588b57600080fd5b615894866153fe565b94506020860151935060408601519250606086015191506158b7608087016153fe565b90509295509295909350565b600081518084526020808501945080840160005b838110156158fc5781516001600160a01b0316875295820195908201906001016158d7565b509495945050505050565b8060005b6002811015610e6b57815184526020938401939091019060010161590b565b600081518084526020808501945080840160005b838110156158fc5781518752958201959082019060010161593e565b6000815180845260005b8181101561598057602081850181015186830182015201615964565b81811115615992576000602083870101525b50601f01601f19169290920160200192915050565b6159b18183615907565b604001919050565b8681526159c96020820187615907565b6159d66060820186615907565b6159e360a0820185615907565b6159f060e0820184615907565b60609190911b6bffffffffffffffffffffffff19166101208201526101340195945050505050565b838152615a286020820184615907565b606081019190915260800192915050565b604081016113558284615907565b602081526000613bef602083018461592a565b602081526000613bef602083018461595a565b6020815260ff8251166020820152602082015160408201526001600160a01b0360408301511660608201526000606083015160c06080840152615ab360e08401826158c3565b905060808401516001600160601b0380821660a08601528060a08701511660c086015250508091505092915050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615b3357845183529383019391830191600101615b17565b509098975050505050505050565b82815260608101613bef6020830184615907565b828152604060208201526000613c3e604083018461592a565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261431260c083018461595a565b878152866020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143ff60e083018461595a565b8781526001600160401b0387166020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143ff60e083018461595a565b60006001600160601b0380881683528087166020840152506001600160401b03851660408301526001600160a01b038416606083015260a06080830152615c9460a08301846158c3565b979650505050505050565b6000808335601e19843603018112615cb657600080fd5b8301803591506001600160401b03821115615cd057600080fd5b602001915036819003821315615ce557600080fd5b9250929050565b604080519081016001600160401b0381118282101715615d0e57615d0e615f38565b60405290565b60405160c081016001600160401b0381118282101715615d0e57615d0e615f38565b60405161012081016001600160401b0381118282101715615d0e57615d0e615f38565b60008085851115615d6957600080fd5b83861115615d7657600080fd5b5050820193919092039150565b60008219821115615d9657615d96615ee0565b500190565b60006001600160401b03808316818516808303821115615dbd57615dbd615ee0565b01949350505050565b60006001600160601b03808316818516808303821115615dbd57615dbd615ee0565b600082615df757615df7615ef6565b500490565b6000816000190483118215151615615e1657615e16615ee0565b500290565b600082821015615e2d57615e2d615ee0565b500390565b60006001600160601b0383811690831681811015615e5257615e52615ee0565b039392505050565b6001600160e01b03198135818116916004851015615e825780818660040360031b1b83161692505b505092915050565b6000600019821415615e9e57615e9e615ee0565b5060010190565b60006001600160401b0380831681811415615ec257615ec2615ee0565b6001019392505050565b600082615edb57615edb615ef6565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c0c57600080fd5b8015158114610c0c57600080fdfea164736f6c6343000806000a", -} - -var VRFCoordinatorV2PlusABI = VRFCoordinatorV2PlusMetaData.ABI - -var VRFCoordinatorV2PlusBin = VRFCoordinatorV2PlusMetaData.Bin - -func DeployVRFCoordinatorV2Plus(auth *bind.TransactOpts, backend bind.ContractBackend, blockhashStore common.Address) (common.Address, *types.Transaction, *VRFCoordinatorV2Plus, error) { - parsed, err := VRFCoordinatorV2PlusMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(VRFCoordinatorV2PlusBin), backend, blockhashStore) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &VRFCoordinatorV2Plus{VRFCoordinatorV2PlusCaller: VRFCoordinatorV2PlusCaller{contract: contract}, VRFCoordinatorV2PlusTransactor: VRFCoordinatorV2PlusTransactor{contract: contract}, VRFCoordinatorV2PlusFilterer: VRFCoordinatorV2PlusFilterer{contract: contract}}, nil -} - -type VRFCoordinatorV2Plus struct { - address common.Address - abi abi.ABI - VRFCoordinatorV2PlusCaller - VRFCoordinatorV2PlusTransactor - VRFCoordinatorV2PlusFilterer -} - -type VRFCoordinatorV2PlusCaller struct { - contract *bind.BoundContract -} - -type VRFCoordinatorV2PlusTransactor struct { - contract *bind.BoundContract -} - -type VRFCoordinatorV2PlusFilterer struct { - contract *bind.BoundContract -} - -type VRFCoordinatorV2PlusSession struct { - Contract *VRFCoordinatorV2Plus - CallOpts bind.CallOpts - TransactOpts bind.TransactOpts -} - -type VRFCoordinatorV2PlusCallerSession struct { - Contract *VRFCoordinatorV2PlusCaller - CallOpts bind.CallOpts -} - -type VRFCoordinatorV2PlusTransactorSession struct { - Contract *VRFCoordinatorV2PlusTransactor - TransactOpts bind.TransactOpts -} - -type VRFCoordinatorV2PlusRaw struct { - Contract *VRFCoordinatorV2Plus -} - -type VRFCoordinatorV2PlusCallerRaw struct { - Contract *VRFCoordinatorV2PlusCaller -} - -type VRFCoordinatorV2PlusTransactorRaw struct { - Contract *VRFCoordinatorV2PlusTransactor -} - -func NewVRFCoordinatorV2Plus(address common.Address, backend bind.ContractBackend) (*VRFCoordinatorV2Plus, error) { - abi, err := abi.JSON(strings.NewReader(VRFCoordinatorV2PlusABI)) - if err != nil { - return nil, err - } - contract, err := bindVRFCoordinatorV2Plus(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2Plus{address: address, abi: abi, VRFCoordinatorV2PlusCaller: VRFCoordinatorV2PlusCaller{contract: contract}, VRFCoordinatorV2PlusTransactor: VRFCoordinatorV2PlusTransactor{contract: contract}, VRFCoordinatorV2PlusFilterer: VRFCoordinatorV2PlusFilterer{contract: contract}}, nil -} - -func NewVRFCoordinatorV2PlusCaller(address common.Address, caller bind.ContractCaller) (*VRFCoordinatorV2PlusCaller, error) { - contract, err := bindVRFCoordinatorV2Plus(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusCaller{contract: contract}, nil -} - -func NewVRFCoordinatorV2PlusTransactor(address common.Address, transactor bind.ContractTransactor) (*VRFCoordinatorV2PlusTransactor, error) { - contract, err := bindVRFCoordinatorV2Plus(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusTransactor{contract: contract}, nil -} - -func NewVRFCoordinatorV2PlusFilterer(address common.Address, filterer bind.ContractFilterer) (*VRFCoordinatorV2PlusFilterer, error) { - contract, err := bindVRFCoordinatorV2Plus(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusFilterer{contract: contract}, nil -} - -func bindVRFCoordinatorV2Plus(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := VRFCoordinatorV2PlusMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _VRFCoordinatorV2Plus.Contract.VRFCoordinatorV2PlusCaller.contract.Call(opts, result, method, params...) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.VRFCoordinatorV2PlusTransactor.contract.Transfer(opts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.VRFCoordinatorV2PlusTransactor.contract.Transact(opts, method, params...) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _VRFCoordinatorV2Plus.Contract.contract.Call(opts, result, method, params...) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.contract.Transfer(opts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.contract.Transact(opts, method, params...) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) BLOCKHASHSTORE(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "BLOCKHASH_STORE") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) BLOCKHASHSTORE() (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.BLOCKHASHSTORE(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) BLOCKHASHSTORE() (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.BLOCKHASHSTORE(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) LINK(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "LINK") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) LINK() (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.LINK(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) LINK() (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.LINK(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) LINKETHFEED(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "LINK_ETH_FEED") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) LINKETHFEED() (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.LINKETHFEED(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) LINKETHFEED() (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.LINKETHFEED(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "MAX_CONSUMERS") - - if err != nil { - return *new(uint16), err - } - - out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) MAXCONSUMERS() (uint16, error) { - return _VRFCoordinatorV2Plus.Contract.MAXCONSUMERS(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) MAXCONSUMERS() (uint16, error) { - return _VRFCoordinatorV2Plus.Contract.MAXCONSUMERS(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) MAXNUMWORDS(opts *bind.CallOpts) (uint32, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "MAX_NUM_WORDS") - - if err != nil { - return *new(uint32), err - } - - out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) MAXNUMWORDS() (uint32, error) { - return _VRFCoordinatorV2Plus.Contract.MAXNUMWORDS(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) MAXNUMWORDS() (uint32, error) { - return _VRFCoordinatorV2Plus.Contract.MAXNUMWORDS(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) MAXREQUESTCONFIRMATIONS(opts *bind.CallOpts) (uint16, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "MAX_REQUEST_CONFIRMATIONS") - - if err != nil { - return *new(uint16), err - } - - out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) MAXREQUESTCONFIRMATIONS() (uint16, error) { - return _VRFCoordinatorV2Plus.Contract.MAXREQUESTCONFIRMATIONS(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) MAXREQUESTCONFIRMATIONS() (uint16, error) { - return _VRFCoordinatorV2Plus.Contract.MAXREQUESTCONFIRMATIONS(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) GetActiveSubscriptionIds(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "getActiveSubscriptionIds", startIndex, maxCount) - - if err != nil { - return *new([]*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) GetActiveSubscriptionIds(startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { - return _VRFCoordinatorV2Plus.Contract.GetActiveSubscriptionIds(&_VRFCoordinatorV2Plus.CallOpts, startIndex, maxCount) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) GetActiveSubscriptionIds(startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { - return _VRFCoordinatorV2Plus.Contract.GetActiveSubscriptionIds(&_VRFCoordinatorV2Plus.CallOpts, startIndex, maxCount) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) GetRequestConfig(opts *bind.CallOpts) (uint16, uint32, [][32]byte, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "getRequestConfig") - - if err != nil { - return *new(uint16), *new(uint32), *new([][32]byte), err - } - - out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) - out1 := *abi.ConvertType(out[1], new(uint32)).(*uint32) - out2 := *abi.ConvertType(out[2], new([][32]byte)).(*[][32]byte) - - return out0, out1, out2, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) GetRequestConfig() (uint16, uint32, [][32]byte, error) { - return _VRFCoordinatorV2Plus.Contract.GetRequestConfig(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) GetRequestConfig() (uint16, uint32, [][32]byte, error) { - return _VRFCoordinatorV2Plus.Contract.GetRequestConfig(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) GetSubscription(opts *bind.CallOpts, subId *big.Int) (GetSubscription, - - error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "getSubscription", subId) - - outstruct := new(GetSubscription) - if err != nil { - return *outstruct, err - } - - outstruct.Balance = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.EthBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - outstruct.ReqCount = *abi.ConvertType(out[2], new(uint64)).(*uint64) - outstruct.Owner = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) - outstruct.Consumers = *abi.ConvertType(out[4], new([]common.Address)).(*[]common.Address) - - return *outstruct, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) GetSubscription(subId *big.Int) (GetSubscription, - - error) { - return _VRFCoordinatorV2Plus.Contract.GetSubscription(&_VRFCoordinatorV2Plus.CallOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) GetSubscription(subId *big.Int) (GetSubscription, - - error) { - return _VRFCoordinatorV2Plus.Contract.GetSubscription(&_VRFCoordinatorV2Plus.CallOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) HashOfKey(opts *bind.CallOpts, publicKey [2]*big.Int) ([32]byte, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "hashOfKey", publicKey) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) HashOfKey(publicKey [2]*big.Int) ([32]byte, error) { - return _VRFCoordinatorV2Plus.Contract.HashOfKey(&_VRFCoordinatorV2Plus.CallOpts, publicKey) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) HashOfKey(publicKey [2]*big.Int) ([32]byte, error) { - return _VRFCoordinatorV2Plus.Contract.HashOfKey(&_VRFCoordinatorV2Plus.CallOpts, publicKey) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) MigrationVersion(opts *bind.CallOpts) (uint8, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "migrationVersion") - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) MigrationVersion() (uint8, error) { - return _VRFCoordinatorV2Plus.Contract.MigrationVersion(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) MigrationVersion() (uint8, error) { - return _VRFCoordinatorV2Plus.Contract.MigrationVersion(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) Owner() (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.Owner(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) Owner() (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.Owner(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) PendingRequestExists(opts *bind.CallOpts, subId *big.Int) (bool, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "pendingRequestExists", subId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) PendingRequestExists(subId *big.Int) (bool, error) { - return _VRFCoordinatorV2Plus.Contract.PendingRequestExists(&_VRFCoordinatorV2Plus.CallOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) PendingRequestExists(subId *big.Int) (bool, error) { - return _VRFCoordinatorV2Plus.Contract.PendingRequestExists(&_VRFCoordinatorV2Plus.CallOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) SConfig(opts *bind.CallOpts) (SConfig, - - error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_config") - - outstruct := new(SConfig) - if err != nil { - return *outstruct, err - } - - outstruct.MinimumRequestConfirmations = *abi.ConvertType(out[0], new(uint16)).(*uint16) - outstruct.MaxGasLimit = *abi.ConvertType(out[1], new(uint32)).(*uint32) - outstruct.ReentrancyLock = *abi.ConvertType(out[2], new(bool)).(*bool) - outstruct.StalenessSeconds = *abi.ConvertType(out[3], new(uint32)).(*uint32) - outstruct.GasAfterPaymentCalculation = *abi.ConvertType(out[4], new(uint32)).(*uint32) - - return *outstruct, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SConfig() (SConfig, - - error) { - return _VRFCoordinatorV2Plus.Contract.SConfig(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) SConfig() (SConfig, - - error) { - return _VRFCoordinatorV2Plus.Contract.SConfig(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) SCurrentSubNonce(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_currentSubNonce") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SCurrentSubNonce() (uint64, error) { - return _VRFCoordinatorV2Plus.Contract.SCurrentSubNonce(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) SCurrentSubNonce() (uint64, error) { - return _VRFCoordinatorV2Plus.Contract.SCurrentSubNonce(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) SFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_fallbackWeiPerUnitLink") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SFallbackWeiPerUnitLink() (*big.Int, error) { - return _VRFCoordinatorV2Plus.Contract.SFallbackWeiPerUnitLink(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) SFallbackWeiPerUnitLink() (*big.Int, error) { - return _VRFCoordinatorV2Plus.Contract.SFallbackWeiPerUnitLink(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) SFeeConfig(opts *bind.CallOpts) (SFeeConfig, - - error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_feeConfig") - - outstruct := new(SFeeConfig) - if err != nil { - return *outstruct, err - } - - outstruct.FulfillmentFlatFeeLinkPPM = *abi.ConvertType(out[0], new(uint32)).(*uint32) - outstruct.FulfillmentFlatFeeEthPPM = *abi.ConvertType(out[1], new(uint32)).(*uint32) - - return *outstruct, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SFeeConfig() (SFeeConfig, - - error) { - return _VRFCoordinatorV2Plus.Contract.SFeeConfig(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) SFeeConfig() (SFeeConfig, - - error) { - return _VRFCoordinatorV2Plus.Contract.SFeeConfig(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) SProvingKeyHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_provingKeyHashes", arg0) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SProvingKeyHashes(arg0 *big.Int) ([32]byte, error) { - return _VRFCoordinatorV2Plus.Contract.SProvingKeyHashes(&_VRFCoordinatorV2Plus.CallOpts, arg0) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) SProvingKeyHashes(arg0 *big.Int) ([32]byte, error) { - return _VRFCoordinatorV2Plus.Contract.SProvingKeyHashes(&_VRFCoordinatorV2Plus.CallOpts, arg0) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) SProvingKeys(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_provingKeys", arg0) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SProvingKeys(arg0 [32]byte) (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.SProvingKeys(&_VRFCoordinatorV2Plus.CallOpts, arg0) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) SProvingKeys(arg0 [32]byte) (common.Address, error) { - return _VRFCoordinatorV2Plus.Contract.SProvingKeys(&_VRFCoordinatorV2Plus.CallOpts, arg0) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) SRequestCommitments(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_requestCommitments", arg0) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SRequestCommitments(arg0 *big.Int) ([32]byte, error) { - return _VRFCoordinatorV2Plus.Contract.SRequestCommitments(&_VRFCoordinatorV2Plus.CallOpts, arg0) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) SRequestCommitments(arg0 *big.Int) ([32]byte, error) { - return _VRFCoordinatorV2Plus.Contract.SRequestCommitments(&_VRFCoordinatorV2Plus.CallOpts, arg0) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) STotalBalance(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_totalBalance") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) STotalBalance() (*big.Int, error) { - return _VRFCoordinatorV2Plus.Contract.STotalBalance(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) STotalBalance() (*big.Int, error) { - return _VRFCoordinatorV2Plus.Contract.STotalBalance(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCaller) STotalEthBalance(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _VRFCoordinatorV2Plus.contract.Call(opts, &out, "s_totalEthBalance") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) STotalEthBalance() (*big.Int, error) { - return _VRFCoordinatorV2Plus.Contract.STotalEthBalance(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusCallerSession) STotalEthBalance() (*big.Int, error) { - return _VRFCoordinatorV2Plus.Contract.STotalEthBalance(&_VRFCoordinatorV2Plus.CallOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "acceptOwnership") -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) AcceptOwnership() (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.AcceptOwnership(&_VRFCoordinatorV2Plus.TransactOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) AcceptOwnership() (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.AcceptOwnership(&_VRFCoordinatorV2Plus.TransactOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "acceptSubscriptionOwnerTransfer", subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) AcceptSubscriptionOwnerTransfer(subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.AcceptSubscriptionOwnerTransfer(&_VRFCoordinatorV2Plus.TransactOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) AcceptSubscriptionOwnerTransfer(subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.AcceptSubscriptionOwnerTransfer(&_VRFCoordinatorV2Plus.TransactOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) AddConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "addConsumer", subId, consumer) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) AddConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.AddConsumer(&_VRFCoordinatorV2Plus.TransactOpts, subId, consumer) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) AddConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.AddConsumer(&_VRFCoordinatorV2Plus.TransactOpts, subId, consumer) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) CancelSubscription(opts *bind.TransactOpts, subId *big.Int, to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "cancelSubscription", subId, to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) CancelSubscription(subId *big.Int, to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.CancelSubscription(&_VRFCoordinatorV2Plus.TransactOpts, subId, to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) CancelSubscription(subId *big.Int, to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.CancelSubscription(&_VRFCoordinatorV2Plus.TransactOpts, subId, to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "createSubscription") -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) CreateSubscription() (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.CreateSubscription(&_VRFCoordinatorV2Plus.TransactOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) CreateSubscription() (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.CreateSubscription(&_VRFCoordinatorV2Plus.TransactOpts) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) DeregisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "deregisterMigratableCoordinator", target) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) DeregisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.DeregisterMigratableCoordinator(&_VRFCoordinatorV2Plus.TransactOpts, target) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) DeregisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.DeregisterMigratableCoordinator(&_VRFCoordinatorV2Plus.TransactOpts, target) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) DeregisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "deregisterProvingKey", publicProvingKey) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) DeregisterProvingKey(publicProvingKey [2]*big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.DeregisterProvingKey(&_VRFCoordinatorV2Plus.TransactOpts, publicProvingKey) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) DeregisterProvingKey(publicProvingKey [2]*big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.DeregisterProvingKey(&_VRFCoordinatorV2Plus.TransactOpts, publicProvingKey) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) FulfillRandomWords(opts *bind.TransactOpts, proof VRFProof, rc VRFCoordinatorV2PlusRequestCommitment) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "fulfillRandomWords", proof, rc) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) FulfillRandomWords(proof VRFProof, rc VRFCoordinatorV2PlusRequestCommitment) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.FulfillRandomWords(&_VRFCoordinatorV2Plus.TransactOpts, proof, rc) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) FulfillRandomWords(proof VRFProof, rc VRFCoordinatorV2PlusRequestCommitment) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.FulfillRandomWords(&_VRFCoordinatorV2Plus.TransactOpts, proof, rc) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) FundSubscriptionWithEth(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "fundSubscriptionWithEth", subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) FundSubscriptionWithEth(subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.FundSubscriptionWithEth(&_VRFCoordinatorV2Plus.TransactOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) FundSubscriptionWithEth(subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.FundSubscriptionWithEth(&_VRFCoordinatorV2Plus.TransactOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) Migrate(opts *bind.TransactOpts, subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "migrate", subId, newCoordinator) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) Migrate(subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.Migrate(&_VRFCoordinatorV2Plus.TransactOpts, subId, newCoordinator) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) Migrate(subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.Migrate(&_VRFCoordinatorV2Plus.TransactOpts, subId, newCoordinator) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "onTokenTransfer", arg0, amount, data) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) OnTokenTransfer(arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.OnTokenTransfer(&_VRFCoordinatorV2Plus.TransactOpts, arg0, amount, data) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) OnTokenTransfer(arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.OnTokenTransfer(&_VRFCoordinatorV2Plus.TransactOpts, arg0, amount, data) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) OracleWithdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "oracleWithdraw", recipient, amount) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) OracleWithdraw(recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.OracleWithdraw(&_VRFCoordinatorV2Plus.TransactOpts, recipient, amount) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) OracleWithdraw(recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.OracleWithdraw(&_VRFCoordinatorV2Plus.TransactOpts, recipient, amount) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) OracleWithdrawEth(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "oracleWithdrawEth", recipient, amount) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) OracleWithdrawEth(recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.OracleWithdrawEth(&_VRFCoordinatorV2Plus.TransactOpts, recipient, amount) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) OracleWithdrawEth(recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.OracleWithdrawEth(&_VRFCoordinatorV2Plus.TransactOpts, recipient, amount) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) OwnerCancelSubscription(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "ownerCancelSubscription", subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) OwnerCancelSubscription(subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.OwnerCancelSubscription(&_VRFCoordinatorV2Plus.TransactOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) OwnerCancelSubscription(subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.OwnerCancelSubscription(&_VRFCoordinatorV2Plus.TransactOpts, subId) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) RecoverEthFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "recoverEthFunds", to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) RecoverEthFunds(to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RecoverEthFunds(&_VRFCoordinatorV2Plus.TransactOpts, to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) RecoverEthFunds(to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RecoverEthFunds(&_VRFCoordinatorV2Plus.TransactOpts, to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "recoverFunds", to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) RecoverFunds(to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RecoverFunds(&_VRFCoordinatorV2Plus.TransactOpts, to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) RecoverFunds(to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RecoverFunds(&_VRFCoordinatorV2Plus.TransactOpts, to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) RegisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "registerMigratableCoordinator", target) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) RegisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RegisterMigratableCoordinator(&_VRFCoordinatorV2Plus.TransactOpts, target) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) RegisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RegisterMigratableCoordinator(&_VRFCoordinatorV2Plus.TransactOpts, target) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) RegisterProvingKey(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "registerProvingKey", oracle, publicProvingKey) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) RegisterProvingKey(oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RegisterProvingKey(&_VRFCoordinatorV2Plus.TransactOpts, oracle, publicProvingKey) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) RegisterProvingKey(oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RegisterProvingKey(&_VRFCoordinatorV2Plus.TransactOpts, oracle, publicProvingKey) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) RemoveConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "removeConsumer", subId, consumer) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) RemoveConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RemoveConsumer(&_VRFCoordinatorV2Plus.TransactOpts, subId, consumer) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) RemoveConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RemoveConsumer(&_VRFCoordinatorV2Plus.TransactOpts, subId, consumer) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "requestRandomWords", req) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RequestRandomWords(&_VRFCoordinatorV2Plus.TransactOpts, req) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RequestRandomWords(&_VRFCoordinatorV2Plus.TransactOpts, req) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int, newOwner common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "requestSubscriptionOwnerTransfer", subId, newOwner) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) RequestSubscriptionOwnerTransfer(subId *big.Int, newOwner common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RequestSubscriptionOwnerTransfer(&_VRFCoordinatorV2Plus.TransactOpts, subId, newOwner) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) RequestSubscriptionOwnerTransfer(subId *big.Int, newOwner common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.RequestSubscriptionOwnerTransfer(&_VRFCoordinatorV2Plus.TransactOpts, subId, newOwner) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) SetConfig(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV2PlusFeeConfig) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "setConfig", minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV2PlusFeeConfig) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.SetConfig(&_VRFCoordinatorV2Plus.TransactOpts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV2PlusFeeConfig) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.SetConfig(&_VRFCoordinatorV2Plus.TransactOpts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) SetLINKAndLINKETHFeed(opts *bind.TransactOpts, link common.Address, linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "setLINKAndLINKETHFeed", link, linkEthFeed) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) SetLINKAndLINKETHFeed(link common.Address, linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.SetLINKAndLINKETHFeed(&_VRFCoordinatorV2Plus.TransactOpts, link, linkEthFeed) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) SetLINKAndLINKETHFeed(link common.Address, linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.SetLINKAndLINKETHFeed(&_VRFCoordinatorV2Plus.TransactOpts, link, linkEthFeed) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.contract.Transact(opts, "transferOwnership", to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusSession) TransferOwnership(to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.TransferOwnership(&_VRFCoordinatorV2Plus.TransactOpts, to) -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2Plus.Contract.TransferOwnership(&_VRFCoordinatorV2Plus.TransactOpts, to) -} - -type VRFCoordinatorV2PlusConfigSetIterator struct { - Event *VRFCoordinatorV2PlusConfigSet - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusConfigSetIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusConfigSet) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusConfigSet) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusConfigSetIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusConfigSetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusConfigSet struct { - MinimumRequestConfirmations uint16 - MaxGasLimit uint32 - StalenessSeconds uint32 - GasAfterPaymentCalculation uint32 - FallbackWeiPerUnitLink *big.Int - FeeConfig VRFCoordinatorV2PlusFeeConfig - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterConfigSet(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusConfigSetIterator, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "ConfigSet") - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusConfigSetIterator{contract: _VRFCoordinatorV2Plus.contract, event: "ConfigSet", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusConfigSet) (event.Subscription, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "ConfigSet") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusConfigSet) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "ConfigSet", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseConfigSet(log types.Log) (*VRFCoordinatorV2PlusConfigSet, error) { - event := new(VRFCoordinatorV2PlusConfigSet) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "ConfigSet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusCoordinatorDeregisteredIterator struct { - Event *VRFCoordinatorV2PlusCoordinatorDeregistered - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusCoordinatorDeregisteredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusCoordinatorDeregistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusCoordinatorDeregistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusCoordinatorDeregisteredIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusCoordinatorDeregisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusCoordinatorDeregistered struct { - CoordinatorAddress common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterCoordinatorDeregistered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusCoordinatorDeregisteredIterator, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "CoordinatorDeregistered") - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusCoordinatorDeregisteredIterator{contract: _VRFCoordinatorV2Plus.contract, event: "CoordinatorDeregistered", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchCoordinatorDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusCoordinatorDeregistered) (event.Subscription, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "CoordinatorDeregistered") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusCoordinatorDeregistered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "CoordinatorDeregistered", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseCoordinatorDeregistered(log types.Log) (*VRFCoordinatorV2PlusCoordinatorDeregistered, error) { - event := new(VRFCoordinatorV2PlusCoordinatorDeregistered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "CoordinatorDeregistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusCoordinatorRegisteredIterator struct { - Event *VRFCoordinatorV2PlusCoordinatorRegistered - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusCoordinatorRegisteredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusCoordinatorRegistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusCoordinatorRegistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusCoordinatorRegisteredIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusCoordinatorRegisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusCoordinatorRegistered struct { - CoordinatorAddress common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterCoordinatorRegistered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusCoordinatorRegisteredIterator, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "CoordinatorRegistered") - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusCoordinatorRegisteredIterator{contract: _VRFCoordinatorV2Plus.contract, event: "CoordinatorRegistered", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchCoordinatorRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusCoordinatorRegistered) (event.Subscription, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "CoordinatorRegistered") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusCoordinatorRegistered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "CoordinatorRegistered", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseCoordinatorRegistered(log types.Log) (*VRFCoordinatorV2PlusCoordinatorRegistered, error) { - event := new(VRFCoordinatorV2PlusCoordinatorRegistered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "CoordinatorRegistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusEthFundsRecoveredIterator struct { - Event *VRFCoordinatorV2PlusEthFundsRecovered - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusEthFundsRecoveredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusEthFundsRecovered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusEthFundsRecovered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusEthFundsRecoveredIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusEthFundsRecoveredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusEthFundsRecovered struct { - To common.Address - Amount *big.Int - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterEthFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusEthFundsRecoveredIterator, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "EthFundsRecovered") - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusEthFundsRecoveredIterator{contract: _VRFCoordinatorV2Plus.contract, event: "EthFundsRecovered", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchEthFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusEthFundsRecovered) (event.Subscription, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "EthFundsRecovered") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusEthFundsRecovered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "EthFundsRecovered", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseEthFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusEthFundsRecovered, error) { - event := new(VRFCoordinatorV2PlusEthFundsRecovered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "EthFundsRecovered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusFundsRecoveredIterator struct { - Event *VRFCoordinatorV2PlusFundsRecovered - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusFundsRecoveredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusFundsRecovered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusFundsRecovered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusFundsRecoveredIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusFundsRecoveredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusFundsRecovered struct { - To common.Address - Amount *big.Int - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusFundsRecoveredIterator, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "FundsRecovered") - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusFundsRecoveredIterator{contract: _VRFCoordinatorV2Plus.contract, event: "FundsRecovered", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusFundsRecovered) (event.Subscription, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "FundsRecovered") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusFundsRecovered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "FundsRecovered", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusFundsRecovered, error) { - event := new(VRFCoordinatorV2PlusFundsRecovered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "FundsRecovered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusMigrationCompletedIterator struct { - Event *VRFCoordinatorV2PlusMigrationCompleted - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusMigrationCompletedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusMigrationCompleted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusMigrationCompleted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusMigrationCompletedIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusMigrationCompletedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusMigrationCompleted struct { - NewCoordinator common.Address - SubId *big.Int - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterMigrationCompleted(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusMigrationCompletedIterator, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "MigrationCompleted") - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusMigrationCompletedIterator{contract: _VRFCoordinatorV2Plus.contract, event: "MigrationCompleted", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchMigrationCompleted(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusMigrationCompleted) (event.Subscription, error) { - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "MigrationCompleted") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusMigrationCompleted) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseMigrationCompleted(log types.Log) (*VRFCoordinatorV2PlusMigrationCompleted, error) { - event := new(VRFCoordinatorV2PlusMigrationCompleted) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusOwnershipTransferRequestedIterator struct { - Event *VRFCoordinatorV2PlusOwnershipTransferRequested - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusOwnershipTransferRequestedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusOwnershipTransferRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusOwnershipTransferRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusOwnershipTransferRequestedIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusOwnershipTransferRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusOwnershipTransferRequested struct { - From common.Address - To common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV2PlusOwnershipTransferRequestedIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusOwnershipTransferRequestedIterator{contract: _VRFCoordinatorV2Plus.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusOwnershipTransferRequested) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseOwnershipTransferRequested(log types.Log) (*VRFCoordinatorV2PlusOwnershipTransferRequested, error) { - event := new(VRFCoordinatorV2PlusOwnershipTransferRequested) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusOwnershipTransferredIterator struct { - Event *VRFCoordinatorV2PlusOwnershipTransferred - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusOwnershipTransferredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusOwnershipTransferredIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusOwnershipTransferred struct { - From common.Address - To common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV2PlusOwnershipTransferredIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusOwnershipTransferredIterator{contract: _VRFCoordinatorV2Plus.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusOwnershipTransferred) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseOwnershipTransferred(log types.Log) (*VRFCoordinatorV2PlusOwnershipTransferred, error) { - event := new(VRFCoordinatorV2PlusOwnershipTransferred) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusProvingKeyDeregisteredIterator struct { - Event *VRFCoordinatorV2PlusProvingKeyDeregistered - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusProvingKeyDeregisteredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusProvingKeyDeregistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusProvingKeyDeregistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusProvingKeyDeregisteredIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusProvingKeyDeregisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusProvingKeyDeregistered struct { - KeyHash [32]byte - Oracle common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterProvingKeyDeregistered(opts *bind.FilterOpts, oracle []common.Address) (*VRFCoordinatorV2PlusProvingKeyDeregisteredIterator, error) { - - var oracleRule []interface{} - for _, oracleItem := range oracle { - oracleRule = append(oracleRule, oracleItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "ProvingKeyDeregistered", oracleRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusProvingKeyDeregisteredIterator{contract: _VRFCoordinatorV2Plus.contract, event: "ProvingKeyDeregistered", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchProvingKeyDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusProvingKeyDeregistered, oracle []common.Address) (event.Subscription, error) { - - var oracleRule []interface{} - for _, oracleItem := range oracle { - oracleRule = append(oracleRule, oracleItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "ProvingKeyDeregistered", oracleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusProvingKeyDeregistered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "ProvingKeyDeregistered", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseProvingKeyDeregistered(log types.Log) (*VRFCoordinatorV2PlusProvingKeyDeregistered, error) { - event := new(VRFCoordinatorV2PlusProvingKeyDeregistered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "ProvingKeyDeregistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusProvingKeyRegisteredIterator struct { - Event *VRFCoordinatorV2PlusProvingKeyRegistered - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusProvingKeyRegisteredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusProvingKeyRegistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusProvingKeyRegistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusProvingKeyRegisteredIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusProvingKeyRegisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusProvingKeyRegistered struct { - KeyHash [32]byte - Oracle common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterProvingKeyRegistered(opts *bind.FilterOpts, oracle []common.Address) (*VRFCoordinatorV2PlusProvingKeyRegisteredIterator, error) { - - var oracleRule []interface{} - for _, oracleItem := range oracle { - oracleRule = append(oracleRule, oracleItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "ProvingKeyRegistered", oracleRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusProvingKeyRegisteredIterator{contract: _VRFCoordinatorV2Plus.contract, event: "ProvingKeyRegistered", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchProvingKeyRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusProvingKeyRegistered, oracle []common.Address) (event.Subscription, error) { - - var oracleRule []interface{} - for _, oracleItem := range oracle { - oracleRule = append(oracleRule, oracleItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "ProvingKeyRegistered", oracleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusProvingKeyRegistered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "ProvingKeyRegistered", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseProvingKeyRegistered(log types.Log) (*VRFCoordinatorV2PlusProvingKeyRegistered, error) { - event := new(VRFCoordinatorV2PlusProvingKeyRegistered) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "ProvingKeyRegistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusRandomWordsFulfilledIterator struct { - Event *VRFCoordinatorV2PlusRandomWordsFulfilled - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusRandomWordsFulfilledIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusRandomWordsFulfilled) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusRandomWordsFulfilled) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusRandomWordsFulfilledIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusRandomWordsFulfilledIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusRandomWordsFulfilled struct { - RequestId *big.Int - OutputSeed *big.Int - SubID *big.Int - Payment *big.Int - Success bool - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int, subID []*big.Int) (*VRFCoordinatorV2PlusRandomWordsFulfilledIterator, error) { - - var requestIdRule []interface{} - for _, requestIdItem := range requestId { - requestIdRule = append(requestIdRule, requestIdItem) - } - - var subIDRule []interface{} - for _, subIDItem := range subID { - subIDRule = append(subIDRule, subIDItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "RandomWordsFulfilled", requestIdRule, subIDRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusRandomWordsFulfilledIterator{contract: _VRFCoordinatorV2Plus.contract, event: "RandomWordsFulfilled", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusRandomWordsFulfilled, requestId []*big.Int, subID []*big.Int) (event.Subscription, error) { - - var requestIdRule []interface{} - for _, requestIdItem := range requestId { - requestIdRule = append(requestIdRule, requestIdItem) - } - - var subIDRule []interface{} - for _, subIDItem := range subID { - subIDRule = append(subIDRule, subIDItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "RandomWordsFulfilled", requestIdRule, subIDRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusRandomWordsFulfilled) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "RandomWordsFulfilled", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseRandomWordsFulfilled(log types.Log) (*VRFCoordinatorV2PlusRandomWordsFulfilled, error) { - event := new(VRFCoordinatorV2PlusRandomWordsFulfilled) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "RandomWordsFulfilled", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusRandomWordsRequestedIterator struct { - Event *VRFCoordinatorV2PlusRandomWordsRequested - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusRandomWordsRequestedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusRandomWordsRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusRandomWordsRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusRandomWordsRequestedIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusRandomWordsRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusRandomWordsRequested struct { - KeyHash [32]byte - RequestId *big.Int - PreSeed *big.Int - SubId *big.Int - MinimumRequestConfirmations uint16 - CallbackGasLimit uint32 - NumWords uint32 - ExtraArgs []byte - Sender common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (*VRFCoordinatorV2PlusRandomWordsRequestedIterator, error) { - - var keyHashRule []interface{} - for _, keyHashItem := range keyHash { - keyHashRule = append(keyHashRule, keyHashItem) - } - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "RandomWordsRequested", keyHashRule, subIdRule, senderRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusRandomWordsRequestedIterator{contract: _VRFCoordinatorV2Plus.contract, event: "RandomWordsRequested", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusRandomWordsRequested, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (event.Subscription, error) { - - var keyHashRule []interface{} - for _, keyHashItem := range keyHash { - keyHashRule = append(keyHashRule, keyHashItem) - } - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "RandomWordsRequested", keyHashRule, subIdRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusRandomWordsRequested) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "RandomWordsRequested", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseRandomWordsRequested(log types.Log) (*VRFCoordinatorV2PlusRandomWordsRequested, error) { - event := new(VRFCoordinatorV2PlusRandomWordsRequested) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "RandomWordsRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusSubscriptionCanceledIterator struct { - Event *VRFCoordinatorV2PlusSubscriptionCanceled - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusSubscriptionCanceledIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionCanceled) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionCanceled) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusSubscriptionCanceledIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusSubscriptionCanceledIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusSubscriptionCanceled struct { - SubId *big.Int - To common.Address - AmountLink *big.Int - AmountEth *big.Int - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterSubscriptionCanceled(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionCanceledIterator, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "SubscriptionCanceled", subIdRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusSubscriptionCanceledIterator{contract: _VRFCoordinatorV2Plus.contract, event: "SubscriptionCanceled", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchSubscriptionCanceled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionCanceled, subId []*big.Int) (event.Subscription, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "SubscriptionCanceled", subIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusSubscriptionCanceled) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionCanceled", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseSubscriptionCanceled(log types.Log) (*VRFCoordinatorV2PlusSubscriptionCanceled, error) { - event := new(VRFCoordinatorV2PlusSubscriptionCanceled) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionCanceled", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusSubscriptionConsumerAddedIterator struct { - Event *VRFCoordinatorV2PlusSubscriptionConsumerAdded - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusSubscriptionConsumerAddedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionConsumerAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionConsumerAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusSubscriptionConsumerAddedIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusSubscriptionConsumerAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusSubscriptionConsumerAdded struct { - SubId *big.Int - Consumer common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterSubscriptionConsumerAdded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionConsumerAddedIterator, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "SubscriptionConsumerAdded", subIdRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusSubscriptionConsumerAddedIterator{contract: _VRFCoordinatorV2Plus.contract, event: "SubscriptionConsumerAdded", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchSubscriptionConsumerAdded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionConsumerAdded, subId []*big.Int) (event.Subscription, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "SubscriptionConsumerAdded", subIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusSubscriptionConsumerAdded) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionConsumerAdded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseSubscriptionConsumerAdded(log types.Log) (*VRFCoordinatorV2PlusSubscriptionConsumerAdded, error) { - event := new(VRFCoordinatorV2PlusSubscriptionConsumerAdded) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionConsumerAdded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusSubscriptionConsumerRemovedIterator struct { - Event *VRFCoordinatorV2PlusSubscriptionConsumerRemoved - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusSubscriptionConsumerRemovedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionConsumerRemoved) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionConsumerRemoved) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusSubscriptionConsumerRemovedIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusSubscriptionConsumerRemovedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusSubscriptionConsumerRemoved struct { - SubId *big.Int - Consumer common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterSubscriptionConsumerRemoved(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionConsumerRemovedIterator, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "SubscriptionConsumerRemoved", subIdRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusSubscriptionConsumerRemovedIterator{contract: _VRFCoordinatorV2Plus.contract, event: "SubscriptionConsumerRemoved", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchSubscriptionConsumerRemoved(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionConsumerRemoved, subId []*big.Int) (event.Subscription, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "SubscriptionConsumerRemoved", subIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusSubscriptionConsumerRemoved) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionConsumerRemoved", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseSubscriptionConsumerRemoved(log types.Log) (*VRFCoordinatorV2PlusSubscriptionConsumerRemoved, error) { - event := new(VRFCoordinatorV2PlusSubscriptionConsumerRemoved) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionConsumerRemoved", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusSubscriptionCreatedIterator struct { - Event *VRFCoordinatorV2PlusSubscriptionCreated - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusSubscriptionCreatedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionCreated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionCreated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusSubscriptionCreatedIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusSubscriptionCreatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusSubscriptionCreated struct { - SubId *big.Int - Owner common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterSubscriptionCreated(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionCreatedIterator, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "SubscriptionCreated", subIdRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusSubscriptionCreatedIterator{contract: _VRFCoordinatorV2Plus.contract, event: "SubscriptionCreated", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchSubscriptionCreated(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionCreated, subId []*big.Int) (event.Subscription, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "SubscriptionCreated", subIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusSubscriptionCreated) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionCreated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseSubscriptionCreated(log types.Log) (*VRFCoordinatorV2PlusSubscriptionCreated, error) { - event := new(VRFCoordinatorV2PlusSubscriptionCreated) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionCreated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusSubscriptionFundedIterator struct { - Event *VRFCoordinatorV2PlusSubscriptionFunded - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusSubscriptionFundedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionFunded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionFunded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusSubscriptionFundedIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusSubscriptionFundedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusSubscriptionFunded struct { - SubId *big.Int - OldBalance *big.Int - NewBalance *big.Int - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterSubscriptionFunded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionFundedIterator, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "SubscriptionFunded", subIdRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusSubscriptionFundedIterator{contract: _VRFCoordinatorV2Plus.contract, event: "SubscriptionFunded", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchSubscriptionFunded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionFunded, subId []*big.Int) (event.Subscription, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "SubscriptionFunded", subIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusSubscriptionFunded) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionFunded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseSubscriptionFunded(log types.Log) (*VRFCoordinatorV2PlusSubscriptionFunded, error) { - event := new(VRFCoordinatorV2PlusSubscriptionFunded) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionFunded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusSubscriptionFundedWithEthIterator struct { - Event *VRFCoordinatorV2PlusSubscriptionFundedWithEth - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusSubscriptionFundedWithEthIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionFundedWithEth) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionFundedWithEth) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusSubscriptionFundedWithEthIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusSubscriptionFundedWithEthIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusSubscriptionFundedWithEth struct { - SubId *big.Int - OldEthBalance *big.Int - NewEthBalance *big.Int - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterSubscriptionFundedWithEth(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionFundedWithEthIterator, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "SubscriptionFundedWithEth", subIdRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusSubscriptionFundedWithEthIterator{contract: _VRFCoordinatorV2Plus.contract, event: "SubscriptionFundedWithEth", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchSubscriptionFundedWithEth(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionFundedWithEth, subId []*big.Int) (event.Subscription, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "SubscriptionFundedWithEth", subIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusSubscriptionFundedWithEth) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionFundedWithEth", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseSubscriptionFundedWithEth(log types.Log) (*VRFCoordinatorV2PlusSubscriptionFundedWithEth, error) { - event := new(VRFCoordinatorV2PlusSubscriptionFundedWithEth) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionFundedWithEth", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusSubscriptionOwnerTransferRequestedIterator struct { - Event *VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusSubscriptionOwnerTransferRequestedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusSubscriptionOwnerTransferRequestedIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusSubscriptionOwnerTransferRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested struct { - SubId *big.Int - From common.Address - To common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterSubscriptionOwnerTransferRequested(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionOwnerTransferRequestedIterator, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "SubscriptionOwnerTransferRequested", subIdRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusSubscriptionOwnerTransferRequestedIterator{contract: _VRFCoordinatorV2Plus.contract, event: "SubscriptionOwnerTransferRequested", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchSubscriptionOwnerTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested, subId []*big.Int) (event.Subscription, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "SubscriptionOwnerTransferRequested", subIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionOwnerTransferRequested", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseSubscriptionOwnerTransferRequested(log types.Log) (*VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested, error) { - event := new(VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionOwnerTransferRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type VRFCoordinatorV2PlusSubscriptionOwnerTransferredIterator struct { - Event *VRFCoordinatorV2PlusSubscriptionOwnerTransferred - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *VRFCoordinatorV2PlusSubscriptionOwnerTransferredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionOwnerTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusSubscriptionOwnerTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *VRFCoordinatorV2PlusSubscriptionOwnerTransferredIterator) Error() error { - return it.fail -} - -func (it *VRFCoordinatorV2PlusSubscriptionOwnerTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type VRFCoordinatorV2PlusSubscriptionOwnerTransferred struct { - SubId *big.Int - From common.Address - To common.Address - Raw types.Log -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) FilterSubscriptionOwnerTransferred(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionOwnerTransferredIterator, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.FilterLogs(opts, "SubscriptionOwnerTransferred", subIdRule) - if err != nil { - return nil, err - } - return &VRFCoordinatorV2PlusSubscriptionOwnerTransferredIterator{contract: _VRFCoordinatorV2Plus.contract, event: "SubscriptionOwnerTransferred", logs: logs, sub: sub}, nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) WatchSubscriptionOwnerTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionOwnerTransferred, subId []*big.Int) (event.Subscription, error) { - - var subIdRule []interface{} - for _, subIdItem := range subId { - subIdRule = append(subIdRule, subIdItem) - } - - logs, sub, err := _VRFCoordinatorV2Plus.contract.WatchLogs(opts, "SubscriptionOwnerTransferred", subIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(VRFCoordinatorV2PlusSubscriptionOwnerTransferred) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionOwnerTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2PlusFilterer) ParseSubscriptionOwnerTransferred(log types.Log) (*VRFCoordinatorV2PlusSubscriptionOwnerTransferred, error) { - event := new(VRFCoordinatorV2PlusSubscriptionOwnerTransferred) - if err := _VRFCoordinatorV2Plus.contract.UnpackLog(event, "SubscriptionOwnerTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type GetSubscription struct { - Balance *big.Int - EthBalance *big.Int - ReqCount uint64 - Owner common.Address - Consumers []common.Address -} -type SConfig struct { - MinimumRequestConfirmations uint16 - MaxGasLimit uint32 - ReentrancyLock bool - StalenessSeconds uint32 - GasAfterPaymentCalculation uint32 -} -type SFeeConfig struct { - FulfillmentFlatFeeLinkPPM uint32 - FulfillmentFlatFeeEthPPM uint32 -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2Plus) ParseLog(log types.Log) (generated.AbigenLog, error) { - switch log.Topics[0] { - case _VRFCoordinatorV2Plus.abi.Events["ConfigSet"].ID: - return _VRFCoordinatorV2Plus.ParseConfigSet(log) - case _VRFCoordinatorV2Plus.abi.Events["CoordinatorDeregistered"].ID: - return _VRFCoordinatorV2Plus.ParseCoordinatorDeregistered(log) - case _VRFCoordinatorV2Plus.abi.Events["CoordinatorRegistered"].ID: - return _VRFCoordinatorV2Plus.ParseCoordinatorRegistered(log) - case _VRFCoordinatorV2Plus.abi.Events["EthFundsRecovered"].ID: - return _VRFCoordinatorV2Plus.ParseEthFundsRecovered(log) - case _VRFCoordinatorV2Plus.abi.Events["FundsRecovered"].ID: - return _VRFCoordinatorV2Plus.ParseFundsRecovered(log) - case _VRFCoordinatorV2Plus.abi.Events["MigrationCompleted"].ID: - return _VRFCoordinatorV2Plus.ParseMigrationCompleted(log) - case _VRFCoordinatorV2Plus.abi.Events["OwnershipTransferRequested"].ID: - return _VRFCoordinatorV2Plus.ParseOwnershipTransferRequested(log) - case _VRFCoordinatorV2Plus.abi.Events["OwnershipTransferred"].ID: - return _VRFCoordinatorV2Plus.ParseOwnershipTransferred(log) - case _VRFCoordinatorV2Plus.abi.Events["ProvingKeyDeregistered"].ID: - return _VRFCoordinatorV2Plus.ParseProvingKeyDeregistered(log) - case _VRFCoordinatorV2Plus.abi.Events["ProvingKeyRegistered"].ID: - return _VRFCoordinatorV2Plus.ParseProvingKeyRegistered(log) - case _VRFCoordinatorV2Plus.abi.Events["RandomWordsFulfilled"].ID: - return _VRFCoordinatorV2Plus.ParseRandomWordsFulfilled(log) - case _VRFCoordinatorV2Plus.abi.Events["RandomWordsRequested"].ID: - return _VRFCoordinatorV2Plus.ParseRandomWordsRequested(log) - case _VRFCoordinatorV2Plus.abi.Events["SubscriptionCanceled"].ID: - return _VRFCoordinatorV2Plus.ParseSubscriptionCanceled(log) - case _VRFCoordinatorV2Plus.abi.Events["SubscriptionConsumerAdded"].ID: - return _VRFCoordinatorV2Plus.ParseSubscriptionConsumerAdded(log) - case _VRFCoordinatorV2Plus.abi.Events["SubscriptionConsumerRemoved"].ID: - return _VRFCoordinatorV2Plus.ParseSubscriptionConsumerRemoved(log) - case _VRFCoordinatorV2Plus.abi.Events["SubscriptionCreated"].ID: - return _VRFCoordinatorV2Plus.ParseSubscriptionCreated(log) - case _VRFCoordinatorV2Plus.abi.Events["SubscriptionFunded"].ID: - return _VRFCoordinatorV2Plus.ParseSubscriptionFunded(log) - case _VRFCoordinatorV2Plus.abi.Events["SubscriptionFundedWithEth"].ID: - return _VRFCoordinatorV2Plus.ParseSubscriptionFundedWithEth(log) - case _VRFCoordinatorV2Plus.abi.Events["SubscriptionOwnerTransferRequested"].ID: - return _VRFCoordinatorV2Plus.ParseSubscriptionOwnerTransferRequested(log) - case _VRFCoordinatorV2Plus.abi.Events["SubscriptionOwnerTransferred"].ID: - return _VRFCoordinatorV2Plus.ParseSubscriptionOwnerTransferred(log) - - default: - return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) - } -} - -func (VRFCoordinatorV2PlusConfigSet) Topic() common.Hash { - return common.HexToHash("0x777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e78") -} - -func (VRFCoordinatorV2PlusCoordinatorDeregistered) Topic() common.Hash { - return common.HexToHash("0xf80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af37") -} - -func (VRFCoordinatorV2PlusCoordinatorRegistered) Topic() common.Hash { - return common.HexToHash("0xb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af01625") -} - -func (VRFCoordinatorV2PlusEthFundsRecovered) Topic() common.Hash { - return common.HexToHash("0x879c9ea2b9d5345b84ccd12610b032602808517cebdb795007f3dcb4df377317") -} - -func (VRFCoordinatorV2PlusFundsRecovered) Topic() common.Hash { - return common.HexToHash("0x59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600") -} - -func (VRFCoordinatorV2PlusMigrationCompleted) Topic() common.Hash { - return common.HexToHash("0xd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187") -} - -func (VRFCoordinatorV2PlusOwnershipTransferRequested) Topic() common.Hash { - return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") -} - -func (VRFCoordinatorV2PlusOwnershipTransferred) Topic() common.Hash { - return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") -} - -func (VRFCoordinatorV2PlusProvingKeyDeregistered) Topic() common.Hash { - return common.HexToHash("0x72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d") -} - -func (VRFCoordinatorV2PlusProvingKeyRegistered) Topic() common.Hash { - return common.HexToHash("0xe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b8") -} - -func (VRFCoordinatorV2PlusRandomWordsFulfilled) Topic() common.Hash { - return common.HexToHash("0x49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa7") -} - -func (VRFCoordinatorV2PlusRandomWordsRequested) Topic() common.Hash { - return common.HexToHash("0xeb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e") -} - -func (VRFCoordinatorV2PlusSubscriptionCanceled) Topic() common.Hash { - return common.HexToHash("0x8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4") -} - -func (VRFCoordinatorV2PlusSubscriptionConsumerAdded) Topic() common.Hash { - return common.HexToHash("0x1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e1") -} - -func (VRFCoordinatorV2PlusSubscriptionConsumerRemoved) Topic() common.Hash { - return common.HexToHash("0x32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7") -} - -func (VRFCoordinatorV2PlusSubscriptionCreated) Topic() common.Hash { - return common.HexToHash("0x1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d") -} - -func (VRFCoordinatorV2PlusSubscriptionFunded) Topic() common.Hash { - return common.HexToHash("0x1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a") -} - -func (VRFCoordinatorV2PlusSubscriptionFundedWithEth) Topic() common.Hash { - return common.HexToHash("0x3f1ddc3ab1bdb39001ad76ca51a0e6f57ce6627c69f251d1de41622847721cde") -} - -func (VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested) Topic() common.Hash { - return common.HexToHash("0x21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a1") -} - -func (VRFCoordinatorV2PlusSubscriptionOwnerTransferred) Topic() common.Hash { - return common.HexToHash("0xd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c9386") -} - -func (_VRFCoordinatorV2Plus *VRFCoordinatorV2Plus) Address() common.Address { - return _VRFCoordinatorV2Plus.address -} - -type VRFCoordinatorV2PlusInterface interface { - BLOCKHASHSTORE(opts *bind.CallOpts) (common.Address, error) - - LINK(opts *bind.CallOpts) (common.Address, error) - - LINKETHFEED(opts *bind.CallOpts) (common.Address, error) - - MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) - - MAXNUMWORDS(opts *bind.CallOpts) (uint32, error) - - MAXREQUESTCONFIRMATIONS(opts *bind.CallOpts) (uint16, error) - - GetActiveSubscriptionIds(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) - - GetRequestConfig(opts *bind.CallOpts) (uint16, uint32, [][32]byte, error) - - GetSubscription(opts *bind.CallOpts, subId *big.Int) (GetSubscription, - - error) - - HashOfKey(opts *bind.CallOpts, publicKey [2]*big.Int) ([32]byte, error) - - MigrationVersion(opts *bind.CallOpts) (uint8, error) - - Owner(opts *bind.CallOpts) (common.Address, error) - - PendingRequestExists(opts *bind.CallOpts, subId *big.Int) (bool, error) - - SConfig(opts *bind.CallOpts) (SConfig, - - error) - - SCurrentSubNonce(opts *bind.CallOpts) (uint64, error) - - SFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) - - SFeeConfig(opts *bind.CallOpts) (SFeeConfig, - - error) - - SProvingKeyHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) - - SProvingKeys(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) - - SRequestCommitments(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) - - STotalBalance(opts *bind.CallOpts) (*big.Int, error) - - STotalEthBalance(opts *bind.CallOpts) (*big.Int, error) - - AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) - - AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) - - AddConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) - - CancelSubscription(opts *bind.TransactOpts, subId *big.Int, to common.Address) (*types.Transaction, error) - - CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) - - DeregisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) - - DeregisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int) (*types.Transaction, error) - - FulfillRandomWords(opts *bind.TransactOpts, proof VRFProof, rc VRFCoordinatorV2PlusRequestCommitment) (*types.Transaction, error) - - FundSubscriptionWithEth(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) - - Migrate(opts *bind.TransactOpts, subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) - - OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) - - OracleWithdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) - - OracleWithdrawEth(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) - - OwnerCancelSubscription(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) - - RecoverEthFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - - RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - - RegisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) - - RegisterProvingKey(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) - - RemoveConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) - - RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) - - RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int, newOwner common.Address) (*types.Transaction, error) - - SetConfig(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV2PlusFeeConfig) (*types.Transaction, error) - - SetLINKAndLINKETHFeed(opts *bind.TransactOpts, link common.Address, linkEthFeed common.Address) (*types.Transaction, error) - - TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - - FilterConfigSet(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusConfigSetIterator, error) - - WatchConfigSet(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusConfigSet) (event.Subscription, error) - - ParseConfigSet(log types.Log) (*VRFCoordinatorV2PlusConfigSet, error) - - FilterCoordinatorDeregistered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusCoordinatorDeregisteredIterator, error) - - WatchCoordinatorDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusCoordinatorDeregistered) (event.Subscription, error) - - ParseCoordinatorDeregistered(log types.Log) (*VRFCoordinatorV2PlusCoordinatorDeregistered, error) - - FilterCoordinatorRegistered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusCoordinatorRegisteredIterator, error) - - WatchCoordinatorRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusCoordinatorRegistered) (event.Subscription, error) - - ParseCoordinatorRegistered(log types.Log) (*VRFCoordinatorV2PlusCoordinatorRegistered, error) - - FilterEthFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusEthFundsRecoveredIterator, error) - - WatchEthFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusEthFundsRecovered) (event.Subscription, error) - - ParseEthFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusEthFundsRecovered, error) - - FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusFundsRecoveredIterator, error) - - WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusFundsRecovered) (event.Subscription, error) - - ParseFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusFundsRecovered, error) - - FilterMigrationCompleted(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusMigrationCompletedIterator, error) - - WatchMigrationCompleted(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusMigrationCompleted) (event.Subscription, error) - - ParseMigrationCompleted(log types.Log) (*VRFCoordinatorV2PlusMigrationCompleted, error) - - FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV2PlusOwnershipTransferRequestedIterator, error) - - WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) - - ParseOwnershipTransferRequested(log types.Log) (*VRFCoordinatorV2PlusOwnershipTransferRequested, error) - - FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV2PlusOwnershipTransferredIterator, error) - - WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) - - ParseOwnershipTransferred(log types.Log) (*VRFCoordinatorV2PlusOwnershipTransferred, error) - - FilterProvingKeyDeregistered(opts *bind.FilterOpts, oracle []common.Address) (*VRFCoordinatorV2PlusProvingKeyDeregisteredIterator, error) - - WatchProvingKeyDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusProvingKeyDeregistered, oracle []common.Address) (event.Subscription, error) - - ParseProvingKeyDeregistered(log types.Log) (*VRFCoordinatorV2PlusProvingKeyDeregistered, error) - - FilterProvingKeyRegistered(opts *bind.FilterOpts, oracle []common.Address) (*VRFCoordinatorV2PlusProvingKeyRegisteredIterator, error) - - WatchProvingKeyRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusProvingKeyRegistered, oracle []common.Address) (event.Subscription, error) - - ParseProvingKeyRegistered(log types.Log) (*VRFCoordinatorV2PlusProvingKeyRegistered, error) - - FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int, subID []*big.Int) (*VRFCoordinatorV2PlusRandomWordsFulfilledIterator, error) - - WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusRandomWordsFulfilled, requestId []*big.Int, subID []*big.Int) (event.Subscription, error) - - ParseRandomWordsFulfilled(log types.Log) (*VRFCoordinatorV2PlusRandomWordsFulfilled, error) - - FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (*VRFCoordinatorV2PlusRandomWordsRequestedIterator, error) - - WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusRandomWordsRequested, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (event.Subscription, error) - - ParseRandomWordsRequested(log types.Log) (*VRFCoordinatorV2PlusRandomWordsRequested, error) - - FilterSubscriptionCanceled(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionCanceledIterator, error) - - WatchSubscriptionCanceled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionCanceled, subId []*big.Int) (event.Subscription, error) - - ParseSubscriptionCanceled(log types.Log) (*VRFCoordinatorV2PlusSubscriptionCanceled, error) - - FilterSubscriptionConsumerAdded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionConsumerAddedIterator, error) - - WatchSubscriptionConsumerAdded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionConsumerAdded, subId []*big.Int) (event.Subscription, error) - - ParseSubscriptionConsumerAdded(log types.Log) (*VRFCoordinatorV2PlusSubscriptionConsumerAdded, error) - - FilterSubscriptionConsumerRemoved(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionConsumerRemovedIterator, error) - - WatchSubscriptionConsumerRemoved(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionConsumerRemoved, subId []*big.Int) (event.Subscription, error) - - ParseSubscriptionConsumerRemoved(log types.Log) (*VRFCoordinatorV2PlusSubscriptionConsumerRemoved, error) - - FilterSubscriptionCreated(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionCreatedIterator, error) - - WatchSubscriptionCreated(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionCreated, subId []*big.Int) (event.Subscription, error) - - ParseSubscriptionCreated(log types.Log) (*VRFCoordinatorV2PlusSubscriptionCreated, error) - - FilterSubscriptionFunded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionFundedIterator, error) - - WatchSubscriptionFunded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionFunded, subId []*big.Int) (event.Subscription, error) - - ParseSubscriptionFunded(log types.Log) (*VRFCoordinatorV2PlusSubscriptionFunded, error) - - FilterSubscriptionFundedWithEth(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionFundedWithEthIterator, error) - - WatchSubscriptionFundedWithEth(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionFundedWithEth, subId []*big.Int) (event.Subscription, error) - - ParseSubscriptionFundedWithEth(log types.Log) (*VRFCoordinatorV2PlusSubscriptionFundedWithEth, error) - - FilterSubscriptionOwnerTransferRequested(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionOwnerTransferRequestedIterator, error) - - WatchSubscriptionOwnerTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested, subId []*big.Int) (event.Subscription, error) - - ParseSubscriptionOwnerTransferRequested(log types.Log) (*VRFCoordinatorV2PlusSubscriptionOwnerTransferRequested, error) - - FilterSubscriptionOwnerTransferred(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusSubscriptionOwnerTransferredIterator, error) - - WatchSubscriptionOwnerTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusSubscriptionOwnerTransferred, subId []*big.Int) (event.Subscription, error) - - ParseSubscriptionOwnerTransferred(log types.Log) (*VRFCoordinatorV2PlusSubscriptionOwnerTransferred, error) - - ParseLog(log types.Log) (generated.AbigenLog, error) - - Address() common.Address -} diff --git a/core/gethwrappers/generated/vrf_coordinator_v2plus_interface/vrf_coordinator_v2plus_interface.go b/core/gethwrappers/generated/vrf_coordinator_v2plus_interface/vrf_coordinator_v2plus_interface.go new file mode 100644 index 00000000000..9ed2e34687e --- /dev/null +++ b/core/gethwrappers/generated/vrf_coordinator_v2plus_interface/vrf_coordinator_v2plus_interface.go @@ -0,0 +1,788 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package vrf_coordinator_v2plus_interface + +import ( + "errors" + "fmt" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type IVRFCoordinatorV2PlusInternalProof struct { + Pk [2]*big.Int + Gamma [2]*big.Int + C *big.Int + S *big.Int + Seed *big.Int + UWitness common.Address + CGammaWitness [2]*big.Int + SHashWitness [2]*big.Int + ZInv *big.Int +} + +type IVRFCoordinatorV2PlusInternalRequestCommitment struct { + BlockNum uint64 + SubId *big.Int + CallbackGasLimit uint32 + NumWords uint32 + Sender common.Address + ExtraArgs []byte +} + +type VRFV2PlusClientRandomWordsRequest struct { + KeyHash [32]byte + SubId *big.Int + RequestConfirmations uint16 + CallbackGasLimit uint32 + NumWords uint32 + ExtraArgs []byte +} + +var IVRFCoordinatorV2PlusInternalMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structIVRFCoordinatorV2PlusInternal.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structIVRFCoordinatorV2PlusInternal.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestID\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var IVRFCoordinatorV2PlusInternalABI = IVRFCoordinatorV2PlusInternalMetaData.ABI + +type IVRFCoordinatorV2PlusInternal struct { + address common.Address + abi abi.ABI + IVRFCoordinatorV2PlusInternalCaller + IVRFCoordinatorV2PlusInternalTransactor + IVRFCoordinatorV2PlusInternalFilterer +} + +type IVRFCoordinatorV2PlusInternalCaller struct { + contract *bind.BoundContract +} + +type IVRFCoordinatorV2PlusInternalTransactor struct { + contract *bind.BoundContract +} + +type IVRFCoordinatorV2PlusInternalFilterer struct { + contract *bind.BoundContract +} + +type IVRFCoordinatorV2PlusInternalSession struct { + Contract *IVRFCoordinatorV2PlusInternal + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type IVRFCoordinatorV2PlusInternalCallerSession struct { + Contract *IVRFCoordinatorV2PlusInternalCaller + CallOpts bind.CallOpts +} + +type IVRFCoordinatorV2PlusInternalTransactorSession struct { + Contract *IVRFCoordinatorV2PlusInternalTransactor + TransactOpts bind.TransactOpts +} + +type IVRFCoordinatorV2PlusInternalRaw struct { + Contract *IVRFCoordinatorV2PlusInternal +} + +type IVRFCoordinatorV2PlusInternalCallerRaw struct { + Contract *IVRFCoordinatorV2PlusInternalCaller +} + +type IVRFCoordinatorV2PlusInternalTransactorRaw struct { + Contract *IVRFCoordinatorV2PlusInternalTransactor +} + +func NewIVRFCoordinatorV2PlusInternal(address common.Address, backend bind.ContractBackend) (*IVRFCoordinatorV2PlusInternal, error) { + abi, err := abi.JSON(strings.NewReader(IVRFCoordinatorV2PlusInternalABI)) + if err != nil { + return nil, err + } + contract, err := bindIVRFCoordinatorV2PlusInternal(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IVRFCoordinatorV2PlusInternal{address: address, abi: abi, IVRFCoordinatorV2PlusInternalCaller: IVRFCoordinatorV2PlusInternalCaller{contract: contract}, IVRFCoordinatorV2PlusInternalTransactor: IVRFCoordinatorV2PlusInternalTransactor{contract: contract}, IVRFCoordinatorV2PlusInternalFilterer: IVRFCoordinatorV2PlusInternalFilterer{contract: contract}}, nil +} + +func NewIVRFCoordinatorV2PlusInternalCaller(address common.Address, caller bind.ContractCaller) (*IVRFCoordinatorV2PlusInternalCaller, error) { + contract, err := bindIVRFCoordinatorV2PlusInternal(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IVRFCoordinatorV2PlusInternalCaller{contract: contract}, nil +} + +func NewIVRFCoordinatorV2PlusInternalTransactor(address common.Address, transactor bind.ContractTransactor) (*IVRFCoordinatorV2PlusInternalTransactor, error) { + contract, err := bindIVRFCoordinatorV2PlusInternal(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IVRFCoordinatorV2PlusInternalTransactor{contract: contract}, nil +} + +func NewIVRFCoordinatorV2PlusInternalFilterer(address common.Address, filterer bind.ContractFilterer) (*IVRFCoordinatorV2PlusInternalFilterer, error) { + contract, err := bindIVRFCoordinatorV2PlusInternal(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IVRFCoordinatorV2PlusInternalFilterer{contract: contract}, nil +} + +func bindIVRFCoordinatorV2PlusInternal(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IVRFCoordinatorV2PlusInternalMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IVRFCoordinatorV2PlusInternal.Contract.IVRFCoordinatorV2PlusInternalCaller.contract.Call(opts, result, method, params...) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.IVRFCoordinatorV2PlusInternalTransactor.contract.Transfer(opts) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.IVRFCoordinatorV2PlusInternalTransactor.contract.Transact(opts, method, params...) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IVRFCoordinatorV2PlusInternal.Contract.contract.Call(opts, result, method, params...) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.contract.Transfer(opts) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.contract.Transact(opts, method, params...) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCaller) LINKNATIVEFEED(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IVRFCoordinatorV2PlusInternal.contract.Call(opts, &out, "LINK_NATIVE_FEED") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) LINKNATIVEFEED() (common.Address, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.LINKNATIVEFEED(&_IVRFCoordinatorV2PlusInternal.CallOpts) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCallerSession) LINKNATIVEFEED() (common.Address, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.LINKNATIVEFEED(&_IVRFCoordinatorV2PlusInternal.CallOpts) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCaller) GetActiveSubscriptionIds(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + var out []interface{} + err := _IVRFCoordinatorV2PlusInternal.contract.Call(opts, &out, "getActiveSubscriptionIds", startIndex, maxCount) + + if err != nil { + return *new([]*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) + + return out0, err + +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) GetActiveSubscriptionIds(startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.GetActiveSubscriptionIds(&_IVRFCoordinatorV2PlusInternal.CallOpts, startIndex, maxCount) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCallerSession) GetActiveSubscriptionIds(startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.GetActiveSubscriptionIds(&_IVRFCoordinatorV2PlusInternal.CallOpts, startIndex, maxCount) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCaller) GetSubscription(opts *bind.CallOpts, subId *big.Int) (GetSubscription, + + error) { + var out []interface{} + err := _IVRFCoordinatorV2PlusInternal.contract.Call(opts, &out, "getSubscription", subId) + + outstruct := new(GetSubscription) + if err != nil { + return *outstruct, err + } + + outstruct.Balance = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.NativeBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.ReqCount = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.Owner = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.Consumers = *abi.ConvertType(out[4], new([]common.Address)).(*[]common.Address) + + return *outstruct, err + +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) GetSubscription(subId *big.Int) (GetSubscription, + + error) { + return _IVRFCoordinatorV2PlusInternal.Contract.GetSubscription(&_IVRFCoordinatorV2PlusInternal.CallOpts, subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCallerSession) GetSubscription(subId *big.Int) (GetSubscription, + + error) { + return _IVRFCoordinatorV2PlusInternal.Contract.GetSubscription(&_IVRFCoordinatorV2PlusInternal.CallOpts, subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCaller) PendingRequestExists(opts *bind.CallOpts, subId *big.Int) (bool, error) { + var out []interface{} + err := _IVRFCoordinatorV2PlusInternal.contract.Call(opts, &out, "pendingRequestExists", subId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) PendingRequestExists(subId *big.Int) (bool, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.PendingRequestExists(&_IVRFCoordinatorV2PlusInternal.CallOpts, subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCallerSession) PendingRequestExists(subId *big.Int) (bool, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.PendingRequestExists(&_IVRFCoordinatorV2PlusInternal.CallOpts, subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCaller) SRequestCommitments(opts *bind.CallOpts, requestID *big.Int) ([32]byte, error) { + var out []interface{} + err := _IVRFCoordinatorV2PlusInternal.contract.Call(opts, &out, "s_requestCommitments", requestID) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) SRequestCommitments(requestID *big.Int) ([32]byte, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.SRequestCommitments(&_IVRFCoordinatorV2PlusInternal.CallOpts, requestID) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalCallerSession) SRequestCommitments(requestID *big.Int) ([32]byte, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.SRequestCommitments(&_IVRFCoordinatorV2PlusInternal.CallOpts, requestID) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "acceptSubscriptionOwnerTransfer", subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) AcceptSubscriptionOwnerTransfer(subId *big.Int) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.AcceptSubscriptionOwnerTransfer(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) AcceptSubscriptionOwnerTransfer(subId *big.Int) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.AcceptSubscriptionOwnerTransfer(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) AddConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "addConsumer", subId, consumer) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) AddConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.AddConsumer(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId, consumer) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) AddConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.AddConsumer(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId, consumer) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) CancelSubscription(opts *bind.TransactOpts, subId *big.Int, to common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "cancelSubscription", subId, to) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) CancelSubscription(subId *big.Int, to common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.CancelSubscription(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId, to) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) CancelSubscription(subId *big.Int, to common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.CancelSubscription(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId, to) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "createSubscription") +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) CreateSubscription() (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.CreateSubscription(&_IVRFCoordinatorV2PlusInternal.TransactOpts) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) CreateSubscription() (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.CreateSubscription(&_IVRFCoordinatorV2PlusInternal.TransactOpts) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) FulfillRandomWords(opts *bind.TransactOpts, proof IVRFCoordinatorV2PlusInternalProof, rc IVRFCoordinatorV2PlusInternalRequestCommitment) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "fulfillRandomWords", proof, rc) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) FulfillRandomWords(proof IVRFCoordinatorV2PlusInternalProof, rc IVRFCoordinatorV2PlusInternalRequestCommitment) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.FulfillRandomWords(&_IVRFCoordinatorV2PlusInternal.TransactOpts, proof, rc) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) FulfillRandomWords(proof IVRFCoordinatorV2PlusInternalProof, rc IVRFCoordinatorV2PlusInternalRequestCommitment) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.FulfillRandomWords(&_IVRFCoordinatorV2PlusInternal.TransactOpts, proof, rc) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) FundSubscriptionWithNative(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "fundSubscriptionWithNative", subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) FundSubscriptionWithNative(subId *big.Int) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.FundSubscriptionWithNative(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) FundSubscriptionWithNative(subId *big.Int) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.FundSubscriptionWithNative(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) RemoveConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "removeConsumer", subId, consumer) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) RemoveConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.RemoveConsumer(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId, consumer) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) RemoveConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.RemoveConsumer(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId, consumer) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "requestRandomWords", req) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.RequestRandomWords(&_IVRFCoordinatorV2PlusInternal.TransactOpts, req) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.RequestRandomWords(&_IVRFCoordinatorV2PlusInternal.TransactOpts, req) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactor) RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.contract.Transact(opts, "requestSubscriptionOwnerTransfer", subId, newOwner) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalSession) RequestSubscriptionOwnerTransfer(subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.RequestSubscriptionOwnerTransfer(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId, newOwner) +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalTransactorSession) RequestSubscriptionOwnerTransfer(subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _IVRFCoordinatorV2PlusInternal.Contract.RequestSubscriptionOwnerTransfer(&_IVRFCoordinatorV2PlusInternal.TransactOpts, subId, newOwner) +} + +type IVRFCoordinatorV2PlusInternalRandomWordsFulfilledIterator struct { + Event *IVRFCoordinatorV2PlusInternalRandomWordsFulfilled + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *IVRFCoordinatorV2PlusInternalRandomWordsFulfilledIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(IVRFCoordinatorV2PlusInternalRandomWordsFulfilled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(IVRFCoordinatorV2PlusInternalRandomWordsFulfilled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *IVRFCoordinatorV2PlusInternalRandomWordsFulfilledIterator) Error() error { + return it.fail +} + +func (it *IVRFCoordinatorV2PlusInternalRandomWordsFulfilledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type IVRFCoordinatorV2PlusInternalRandomWordsFulfilled struct { + RequestId *big.Int + OutputSeed *big.Int + SubId *big.Int + Payment *big.Int + Success bool + Raw types.Log +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalFilterer) FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int, subId []*big.Int) (*IVRFCoordinatorV2PlusInternalRandomWordsFulfilledIterator, error) { + + var requestIdRule []interface{} + for _, requestIdItem := range requestId { + requestIdRule = append(requestIdRule, requestIdItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _IVRFCoordinatorV2PlusInternal.contract.FilterLogs(opts, "RandomWordsFulfilled", requestIdRule, subIdRule) + if err != nil { + return nil, err + } + return &IVRFCoordinatorV2PlusInternalRandomWordsFulfilledIterator{contract: _IVRFCoordinatorV2PlusInternal.contract, event: "RandomWordsFulfilled", logs: logs, sub: sub}, nil +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalFilterer) WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *IVRFCoordinatorV2PlusInternalRandomWordsFulfilled, requestId []*big.Int, subId []*big.Int) (event.Subscription, error) { + + var requestIdRule []interface{} + for _, requestIdItem := range requestId { + requestIdRule = append(requestIdRule, requestIdItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _IVRFCoordinatorV2PlusInternal.contract.WatchLogs(opts, "RandomWordsFulfilled", requestIdRule, subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(IVRFCoordinatorV2PlusInternalRandomWordsFulfilled) + if err := _IVRFCoordinatorV2PlusInternal.contract.UnpackLog(event, "RandomWordsFulfilled", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalFilterer) ParseRandomWordsFulfilled(log types.Log) (*IVRFCoordinatorV2PlusInternalRandomWordsFulfilled, error) { + event := new(IVRFCoordinatorV2PlusInternalRandomWordsFulfilled) + if err := _IVRFCoordinatorV2PlusInternal.contract.UnpackLog(event, "RandomWordsFulfilled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type IVRFCoordinatorV2PlusInternalRandomWordsRequestedIterator struct { + Event *IVRFCoordinatorV2PlusInternalRandomWordsRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *IVRFCoordinatorV2PlusInternalRandomWordsRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(IVRFCoordinatorV2PlusInternalRandomWordsRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(IVRFCoordinatorV2PlusInternalRandomWordsRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *IVRFCoordinatorV2PlusInternalRandomWordsRequestedIterator) Error() error { + return it.fail +} + +func (it *IVRFCoordinatorV2PlusInternalRandomWordsRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type IVRFCoordinatorV2PlusInternalRandomWordsRequested struct { + KeyHash [32]byte + RequestId *big.Int + PreSeed *big.Int + SubId *big.Int + MinimumRequestConfirmations uint16 + CallbackGasLimit uint32 + NumWords uint32 + ExtraArgs []byte + Sender common.Address + Raw types.Log +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalFilterer) FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (*IVRFCoordinatorV2PlusInternalRandomWordsRequestedIterator, error) { + + var keyHashRule []interface{} + for _, keyHashItem := range keyHash { + keyHashRule = append(keyHashRule, keyHashItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IVRFCoordinatorV2PlusInternal.contract.FilterLogs(opts, "RandomWordsRequested", keyHashRule, subIdRule, senderRule) + if err != nil { + return nil, err + } + return &IVRFCoordinatorV2PlusInternalRandomWordsRequestedIterator{contract: _IVRFCoordinatorV2PlusInternal.contract, event: "RandomWordsRequested", logs: logs, sub: sub}, nil +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalFilterer) WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *IVRFCoordinatorV2PlusInternalRandomWordsRequested, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (event.Subscription, error) { + + var keyHashRule []interface{} + for _, keyHashItem := range keyHash { + keyHashRule = append(keyHashRule, keyHashItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _IVRFCoordinatorV2PlusInternal.contract.WatchLogs(opts, "RandomWordsRequested", keyHashRule, subIdRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(IVRFCoordinatorV2PlusInternalRandomWordsRequested) + if err := _IVRFCoordinatorV2PlusInternal.contract.UnpackLog(event, "RandomWordsRequested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternalFilterer) ParseRandomWordsRequested(log types.Log) (*IVRFCoordinatorV2PlusInternalRandomWordsRequested, error) { + event := new(IVRFCoordinatorV2PlusInternalRandomWordsRequested) + if err := _IVRFCoordinatorV2PlusInternal.contract.UnpackLog(event, "RandomWordsRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetSubscription struct { + Balance *big.Int + NativeBalance *big.Int + ReqCount uint64 + Owner common.Address + Consumers []common.Address +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternal) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _IVRFCoordinatorV2PlusInternal.abi.Events["RandomWordsFulfilled"].ID: + return _IVRFCoordinatorV2PlusInternal.ParseRandomWordsFulfilled(log) + case _IVRFCoordinatorV2PlusInternal.abi.Events["RandomWordsRequested"].ID: + return _IVRFCoordinatorV2PlusInternal.ParseRandomWordsRequested(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (IVRFCoordinatorV2PlusInternalRandomWordsFulfilled) Topic() common.Hash { + return common.HexToHash("0x49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa7") +} + +func (IVRFCoordinatorV2PlusInternalRandomWordsRequested) Topic() common.Hash { + return common.HexToHash("0xeb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e") +} + +func (_IVRFCoordinatorV2PlusInternal *IVRFCoordinatorV2PlusInternal) Address() common.Address { + return _IVRFCoordinatorV2PlusInternal.address +} + +type IVRFCoordinatorV2PlusInternalInterface interface { + LINKNATIVEFEED(opts *bind.CallOpts) (common.Address, error) + + GetActiveSubscriptionIds(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) + + GetSubscription(opts *bind.CallOpts, subId *big.Int) (GetSubscription, + + error) + + PendingRequestExists(opts *bind.CallOpts, subId *big.Int) (bool, error) + + SRequestCommitments(opts *bind.CallOpts, requestID *big.Int) ([32]byte, error) + + AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + + AddConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) + + CancelSubscription(opts *bind.TransactOpts, subId *big.Int, to common.Address) (*types.Transaction, error) + + CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) + + FulfillRandomWords(opts *bind.TransactOpts, proof IVRFCoordinatorV2PlusInternalProof, rc IVRFCoordinatorV2PlusInternalRequestCommitment) (*types.Transaction, error) + + FundSubscriptionWithNative(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + + RemoveConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) + + RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) + + RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int, newOwner common.Address) (*types.Transaction, error) + + FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int, subId []*big.Int) (*IVRFCoordinatorV2PlusInternalRandomWordsFulfilledIterator, error) + + WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *IVRFCoordinatorV2PlusInternalRandomWordsFulfilled, requestId []*big.Int, subId []*big.Int) (event.Subscription, error) + + ParseRandomWordsFulfilled(log types.Log) (*IVRFCoordinatorV2PlusInternalRandomWordsFulfilled, error) + + FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (*IVRFCoordinatorV2PlusInternalRandomWordsRequestedIterator, error) + + WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *IVRFCoordinatorV2PlusInternalRandomWordsRequested, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (event.Subscription, error) + + ParseRandomWordsRequested(log types.Log) (*IVRFCoordinatorV2PlusInternalRandomWordsRequested, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/generated/vrf_malicious_consumer_v2_plus/vrf_malicious_consumer_v2_plus.go b/core/gethwrappers/generated/vrf_malicious_consumer_v2_plus/vrf_malicious_consumer_v2_plus.go index 4b71dfd50b6..b6051bf09ff 100644 --- a/core/gethwrappers/generated/vrf_malicious_consumer_v2_plus/vrf_malicious_consumer_v2_plus.go +++ b/core/gethwrappers/generated/vrf_malicious_consumer_v2_plus/vrf_malicious_consumer_v2_plus.go @@ -31,7 +31,7 @@ var ( ) var VRFMaliciousConsumerV2PlusMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"createSubscriptionAndFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"requestRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_gasAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_randomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFMigratableCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"name\":\"updateSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"createSubscriptionAndFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"requestRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_gasAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_randomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"name\":\"updateSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x60806040523480156200001157600080fd5b5060405162001243380380620012438339810160408190526200003491620001cc565b8133806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000103565b5050600280546001600160a01b03199081166001600160a01b0394851617909155600580548216958416959095179094555060068054909316911617905562000204565b6001600160a01b0381163314156200015e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001c757600080fd5b919050565b60008060408385031215620001e057600080fd5b620001eb83620001af565b9150620001fb60208401620001af565b90509250929050565b61102f80620002146000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80639eccacf611610081578063f08c5daa1161005b578063f08c5daa146101bd578063f2fde38b146101c6578063f6eaffc8146101d957600080fd5b80639eccacf614610181578063cf62c8ab146101a1578063e89e106a146101b457600080fd5b806379ba5097116100b257806379ba5097146101275780638da5cb5b1461012f5780638ea981171461016e57600080fd5b80631fe543e3146100d957806336bfffed146100ee5780635e3b709f14610101575b600080fd5b6100ec6100e7366004610d03565b6101ec565b005b6100ec6100fc366004610c0b565b610272565b61011461010f366004610cd1565b6103aa565b6040519081526020015b60405180910390f35b6100ec6104a0565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161011e565b6100ec61017c366004610bf0565b61059d565b6002546101499073ffffffffffffffffffffffffffffffffffffffff1681565b6100ec6101af366004610da7565b6106a8565b61011460045481565b61011460075481565b6100ec6101d4366004610bf0565b6108ae565b6101146101e7366004610cd1565b6108c2565b60025473ffffffffffffffffffffffffffffffffffffffff163314610264576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b61026e82826108e3565b5050565b6008546102db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f7375624944206e6f742073657400000000000000000000000000000000000000604482015260640161025b565b60005b815181101561026e57600554600854835173ffffffffffffffffffffffffffffffffffffffff9092169163bec4c08c919085908590811061032157610321610fc4565b60200260200101516040518363ffffffff1660e01b815260040161036592919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b600060405180830381600087803b15801561037f57600080fd5b505af1158015610393573d6000803e3d6000fd5b5050505080806103a290610f64565b9150506102de565b60098190556040805160c08101825282815260085460208083019190915260018284018190526207a1206060840152608083015282519081018352600080825260a083019190915260055492517f9b1c385e000000000000000000000000000000000000000000000000000000008152909273ffffffffffffffffffffffffffffffffffffffff1690639b1c385e90610447908490600401610e8c565b602060405180830381600087803b15801561046157600080fd5b505af1158015610475573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104999190610cea565b9392505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610521576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161025b565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906105dd575060025473ffffffffffffffffffffffffffffffffffffffff163314155b15610661573361060260005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015291909116604482015260640161025b565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6008546107e057600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561071957600080fd5b505af115801561072d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107519190610cea565b60088190556005546040517fbec4c08c000000000000000000000000000000000000000000000000000000008152600481019290925230602483015273ffffffffffffffffffffffffffffffffffffffff169063bec4c08c90604401600060405180830381600087803b1580156107c757600080fd5b505af11580156107db573d6000803e3d6000fd5b505050505b6006546005546008546040805160208082019390935281518082039093018352808201918290527f4000aea00000000000000000000000000000000000000000000000000000000090915273ffffffffffffffffffffffffffffffffffffffff93841693634000aea09361085c93911691869190604401610e40565b602060405180830381600087803b15801561087657600080fd5b505af115801561088a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026e9190610caf565b6108b66109ee565b6108bf81610a71565b50565b600381815481106108d257600080fd5b600091825260209091200154905081565b5a60075580516108fa906003906020840190610b67565b5060048281556040805160c0810182526009548152600854602080830191909152600182840181905262030d4060608401526080830152825190810183526000815260a082015260055491517f9b1c385e000000000000000000000000000000000000000000000000000000008152909273ffffffffffffffffffffffffffffffffffffffff90921691639b1c385e9161099691859101610e8c565b602060405180830381600087803b1580156109b057600080fd5b505af11580156109c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e89190610cea565b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161025b565b565b73ffffffffffffffffffffffffffffffffffffffff8116331415610af1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161025b565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610ba2579160200282015b82811115610ba2578251825591602001919060010190610b87565b50610bae929150610bb2565b5090565b5b80821115610bae5760008155600101610bb3565b803573ffffffffffffffffffffffffffffffffffffffff81168114610beb57600080fd5b919050565b600060208284031215610c0257600080fd5b61049982610bc7565b60006020808385031215610c1e57600080fd5b823567ffffffffffffffff811115610c3557600080fd5b8301601f81018513610c4657600080fd5b8035610c59610c5482610f40565b610ef1565b80828252848201915084840188868560051b8701011115610c7957600080fd5b600094505b83851015610ca357610c8f81610bc7565b835260019490940193918501918501610c7e565b50979650505050505050565b600060208284031215610cc157600080fd5b8151801515811461049957600080fd5b600060208284031215610ce357600080fd5b5035919050565b600060208284031215610cfc57600080fd5b5051919050565b60008060408385031215610d1657600080fd5b8235915060208084013567ffffffffffffffff811115610d3557600080fd5b8401601f81018613610d4657600080fd5b8035610d54610c5482610f40565b80828252848201915084840189868560051b8701011115610d7457600080fd5b600094505b83851015610d97578035835260019490940193918501918501610d79565b5080955050505050509250929050565b600060208284031215610db957600080fd5b81356bffffffffffffffffffffffff8116811461049957600080fd5b6000815180845260005b81811015610dfb57602081850181015186830182015201610ddf565b81811115610e0d576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff841681526bffffffffffffffffffffffff83166020820152606060408201526000610e836060830184610dd5565b95945050505050565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c080840152610ee960e0840182610dd5565b949350505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610f3857610f38610ff3565b604052919050565b600067ffffffffffffffff821115610f5a57610f5a610ff3565b5060051b60200190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610fbd577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } diff --git a/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics/vrf_v2plus_load_test_with_metrics.go b/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics/vrf_v2plus_load_test_with_metrics.go index 1c3b30895a8..9bb00660e12 100644 --- a/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics/vrf_v2plus_load_test_with_metrics.go +++ b/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics/vrf_v2plus_load_test_with_metrics.go @@ -31,7 +31,7 @@ var ( ) var VRFV2PlusLoadTestWithMetricsMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"_nativePayment\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFMigratableCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"_nativePayment\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x6080604052600060055560006006556103e760075534801561002057600080fd5b5060405161134738038061134783398101604081905261003f9161019b565b8033806000816100965760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100c6576100c6816100f1565b5050600280546001600160a01b0319166001600160a01b039390931692909217909155506101cb9050565b6001600160a01b03811633141561014a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161008d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156101ad57600080fd5b81516001600160a01b03811681146101c457600080fd5b9392505050565b61116d806101da6000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80638ea9811711610097578063d826f88f11610066578063d826f88f14610252578063d8a4676f14610271578063dc1670db14610296578063f2fde38b1461029f57600080fd5b80638ea98117146101ab5780639eccacf6146101be578063a168fa89146101de578063b1e217491461024957600080fd5b8063737144bc116100d3578063737144bc1461015257806374dba1241461015b57806379ba5097146101645780638da5cb5b1461016c57600080fd5b80631757f11c146101055780631fe543e314610121578063557d2e92146101365780636846de201461013f575b600080fd5b61010e60065481565b6040519081526020015b60405180910390f35b61013461012f366004610d66565b6102b2565b005b61010e60045481565b61013461014d366004610e55565b610338565b61010e60055481565b61010e60075481565b610134610565565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b6101346101b9366004610cf7565b610662565b6002546101869073ffffffffffffffffffffffffffffffffffffffff1681565b61021f6101ec366004610d34565b600a602052600090815260409020805460028201546003830154600484015460059094015460ff90931693919290919085565b6040805195151586526020860194909452928401919091526060830152608082015260a001610118565b61010e60085481565b6101346000600581905560068190556103e76007556004819055600355565b61028461027f366004610d34565b61076d565b60405161011896959493929190610ed4565b61010e60035481565b6101346102ad366004610cf7565b610852565b60025473ffffffffffffffffffffffffffffffffffffffff16331461032a576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b6103348282610866565b5050565b610340610991565b60005b8161ffff168161ffff16101561055b5760006040518060c001604052808881526020018a81526020018961ffff1681526020018763ffffffff1681526020018563ffffffff1681526020016103a76040518060200160405280891515815250610a14565b90526002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e90610405908590600401610f40565b602060405180830381600087803b15801561041f57600080fd5b505af1158015610433573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104579190610d4d565b600881905590506000610468610ad0565b6040805160c08101825260008082528251818152602080820185528084019182524284860152606084018390526080840186905260a08401839052878352600a815293909120825181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690151517815590518051949550919390926104f6926001850192910190610c6c565b506040820151600282015560608201516003820155608082015160048083019190915560a0909201516005909101558054906000610533836110c9565b9091555050600091825260096020526040909120555080610553816110a7565b915050610343565b5050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610321565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906106a2575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561072657336106c760005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610321565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000818152600a60209081526040808320815160c081018352815460ff16151581526001820180548451818702810187019095528085526060958795869586958695869591949293858401939092908301828280156107eb57602002820191906000526020600020905b8154815260200190600101908083116107d7575b505050505081526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050806000015181602001518260400151836060015184608001518560a001519650965096509650965096505091939550919395565b61085a610991565b61086381610b76565b50565b6000610870610ad0565b6000848152600960205260408120549192509061088d9083611090565b9050600061089e82620f4240611053565b90506006548211156108b05760068290555b60075482106108c1576007546108c3565b815b6007556003546108d35780610906565b6003546108e1906001611000565b816003546005546108f29190611053565b6108fc9190611000565b6109069190611018565b6005556000858152600a6020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811782558651610958939290910191870190610c6c565b506000858152600a60205260408120426003808301919091556005909101859055805491610985836110c9565b91905055505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610321565b565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401610a4d91511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b60004661a4b1811480610ae5575062066eed81145b15610b6f57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b3157600080fd5b505afa158015610b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b699190610d4d565b91505090565b4391505090565b73ffffffffffffffffffffffffffffffffffffffff8116331415610bf6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610321565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610ca7579160200282015b82811115610ca7578251825591602001919060010190610c8c565b50610cb3929150610cb7565b5090565b5b80821115610cb35760008155600101610cb8565b803561ffff81168114610cde57600080fd5b919050565b803563ffffffff81168114610cde57600080fd5b600060208284031215610d0957600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610d2d57600080fd5b9392505050565b600060208284031215610d4657600080fd5b5035919050565b600060208284031215610d5f57600080fd5b5051919050565b60008060408385031215610d7957600080fd5b8235915060208084013567ffffffffffffffff80821115610d9957600080fd5b818601915086601f830112610dad57600080fd5b813581811115610dbf57610dbf611131565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610e0257610e02611131565b604052828152858101935084860182860187018b1015610e2157600080fd5b600095505b83861015610e44578035855260019590950194938601938601610e26565b508096505050505050509250929050565b600080600080600080600060e0888a031215610e7057600080fd5b87359650610e8060208901610ccc565b955060408801359450610e9560608901610ce3565b935060808801358015158114610eaa57600080fd5b9250610eb860a08901610ce3565b9150610ec660c08901610ccc565b905092959891949750929550565b600060c082018815158352602060c08185015281895180845260e086019150828b01935060005b81811015610f1757845183529383019391830191600101610efb565b505060408501989098525050506060810193909352608083019190915260a09091015292915050565b6000602080835283518184015280840151604084015261ffff6040850151166060840152606084015163ffffffff80821660808601528060808701511660a0860152505060a084015160c08085015280518060e086015260005b81811015610fb75782810184015186820161010001528301610f9a565b81811115610fca57600061010083880101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169390930161010001949350505050565b6000821982111561101357611013611102565b500190565b60008261104e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561108b5761108b611102565b500290565b6000828210156110a2576110a2611102565b500390565b600061ffff808316818114156110bf576110bf611102565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156110fb576110fb611102565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } diff --git a/core/gethwrappers/generated/vrf_v2plus_single_consumer/vrf_v2plus_single_consumer.go b/core/gethwrappers/generated/vrf_v2plus_single_consumer/vrf_v2plus_single_consumer.go index adc4bf2f4f9..6e0f5f3ccd8 100644 --- a/core/gethwrappers/generated/vrf_v2plus_single_consumer/vrf_v2plus_single_consumer.go +++ b/core/gethwrappers/generated/vrf_v2plus_single_consumer/vrf_v2plus_single_consumer.go @@ -31,7 +31,7 @@ var ( ) var VRFV2PlusSingleConsumerExampleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"fundAndRequestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_randomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestConfig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFMigratableCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscribe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"topUpSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"unsubscribe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"fundAndRequestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_randomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestConfig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscribe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"topUpSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"unsubscribe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x60806040523480156200001157600080fd5b506040516200186338038062001863833981016040819052620000349162000464565b8633806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf81620001b4565b5050600280546001600160a01b03199081166001600160a01b03948516179091556003805482168b8516179055600480548216938a169390931790925550600b80543392169190911790556040805160c081018252600080825263ffffffff8881166020840181905261ffff8916948401859052908716606084018190526080840187905285151560a09094018490526005929092556006805465ffffffffffff19169091176401000000009094029390931763ffffffff60301b191666010000000000009091021790915560078390556008805460ff19169091179055620001a762000260565b5050505050505062000530565b6001600160a01b0381163314156200020f5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6200026a620003d4565b604080516001808252818301909252600091602080830190803683370190505090503081600081518110620002a357620002a36200051a565b6001600160a01b039283166020918202929092018101919091526003546040805163288688f960e21b81529051919093169263a21a23e49260048083019391928290030181600087803b158015620002fa57600080fd5b505af11580156200030f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000335919062000500565b600581905560035482516001600160a01b039091169163bec4c08c9184906000906200036557620003656200051a565b60200260200101516040518363ffffffff1660e01b81526004016200039d9291909182526001600160a01b0316602082015260400190565b600060405180830381600087803b158015620003b857600080fd5b505af1158015620003cd573d6000803e3d6000fd5b5050505050565b6000546001600160a01b03163314620004305760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640162000083565b565b80516001600160a01b03811681146200044a57600080fd5b919050565b805163ffffffff811681146200044a57600080fd5b600080600080600080600060e0888a0312156200048057600080fd5b6200048b8862000432565b96506200049b6020890162000432565b9550620004ab604089016200044f565b9450606088015161ffff81168114620004c357600080fd5b9350620004d3608089016200044f565b925060a0880151915060c08801518015158114620004f057600080fd5b8091505092959891949750929550565b6000602082840312156200051357600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b61132380620005406000396000f3fe608060405234801561001057600080fd5b50600436106100f45760003560e01c80638da5cb5b11610097578063e0c8628911610066578063e0c862891461025c578063e89e106a14610264578063f2fde38b1461027b578063f6eaffc81461028e57600080fd5b80638da5cb5b146101e25780638ea98117146102215780638f449a05146102345780639eccacf61461023c57600080fd5b80637262561c116100d35780637262561c1461013457806379ba5097146101475780637db9263f1461014f57806386850e93146101cf57600080fd5b8062f714ce146100f95780631fe543e31461010e5780636fd700bb14610121575b600080fd5b61010c61010736600461108f565b6102a1565b005b61010c61011c3660046110bb565b61035c565b61010c61012f36600461105d565b6103e2565b61010c610142366004611019565b610618565b61010c6106b8565b60055460065460075460085461018b939263ffffffff8082169361ffff6401000000008404169366010000000000009093049091169160ff1686565b6040805196875263ffffffff958616602088015261ffff90941693860193909352921660608401526080830191909152151560a082015260c0015b60405180910390f35b61010c6101dd36600461105d565b6107b5565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c6565b61010c61022f366004611019565b61088b565b61010c610996565b6002546101fc9073ffffffffffffffffffffffffffffffffffffffff1681565b61010c610b3b565b61026d600a5481565b6040519081526020016101c6565b61010c610289366004611019565b610ca8565b61026d61029c36600461105d565b610cbc565b6102a9610cdd565b600480546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116938201939093526024810185905291169063a9059cbb90604401602060405180830381600087803b15801561031f57600080fd5b505af1158015610333573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610357919061103b565b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146103d4576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b6103de8282610d60565b5050565b6103ea610cdd565b6040805160c08101825260055480825260065463ffffffff808216602080860191909152640100000000830461ffff16858701526601000000000000909204166060840152600754608084015260085460ff16151560a0840152600454600354855192830193909352929373ffffffffffffffffffffffffffffffffffffffff93841693634000aea09316918691016040516020818303038152906040526040518463ffffffff1660e01b81526004016104a693929190611215565b602060405180830381600087803b1580156104c057600080fd5b505af11580156104d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f8919061103b565b5060006040518060c001604052808360800151815260200183600001518152602001836040015161ffff168152602001836020015163ffffffff168152602001836060015163ffffffff16815260200161056560405180602001604052808660a001511515815250610dde565b90526003546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e906105be908490600401611253565b602060405180830381600087803b1580156105d857600080fd5b505af11580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190611076565b600a55505050565b610620610cdd565b6003546005546040517f0ae09540000000000000000000000000000000000000000000000000000000008152600481019190915273ffffffffffffffffffffffffffffffffffffffff838116602483015290911690630ae0954090604401600060405180830381600087803b15801561069857600080fd5b505af11580156106ac573d6000803e3d6000fd5b50506000600555505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610739576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016103cb565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6107bd610cdd565b6004546003546005546040805160208082019390935281518082039093018352808201918290527f4000aea00000000000000000000000000000000000000000000000000000000090915273ffffffffffffffffffffffffffffffffffffffff93841693634000aea09361083993911691869190604401611215565b602060405180830381600087803b15801561085357600080fd5b505af1158015610867573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103de919061103b565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906108cb575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561094f57336108f060005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff938416600482015291831660248301529190911660448201526064016103cb565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61099e610cdd565b6040805160018082528183019092526000916020808301908036833701905050905030816000815181106109d4576109d46112b8565b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201810191909152600354604080517fa21a23e40000000000000000000000000000000000000000000000000000000081529051919093169263a21a23e49260048083019391928290030181600087803b158015610a5057600080fd5b505af1158015610a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a889190611076565b6005819055600354825173ffffffffffffffffffffffffffffffffffffffff9091169163bec4c08c918490600090610ac257610ac26112b8565b60200260200101516040518363ffffffff1660e01b8152600401610b0692919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b600060405180830381600087803b158015610b2057600080fd5b505af1158015610b34573d6000803e3d6000fd5b5050505050565b610b43610cdd565b6040805160c08082018352600554825260065463ffffffff808216602080860191825261ffff640100000000850481168789019081526601000000000000909504841660608089019182526007546080808b0191825260085460ff16151560a0808d019182528d519b8c018e5292518b528b518b8801529851909416898c0152945186169088015251909316928501929092528551918201909552905115158152919260009290820190610bf690610dde565b90526003546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e90610c4f908490600401611253565b602060405180830381600087803b158015610c6957600080fd5b505af1158015610c7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca19190611076565b600a555050565b610cb0610cdd565b610cb981610e9a565b50565b60098181548110610ccc57600080fd5b600091825260209091200154905081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016103cb565b565b600a548214610dcb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265717565737420494420697320696e636f727265637400000000000000000060448201526064016103cb565b8051610357906009906020840190610f90565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401610e1791511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff8116331415610f1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016103cb565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610fcb579160200282015b82811115610fcb578251825591602001919060010190610fb0565b50610fd7929150610fdb565b5090565b5b80821115610fd75760008155600101610fdc565b803573ffffffffffffffffffffffffffffffffffffffff8116811461101457600080fd5b919050565b60006020828403121561102b57600080fd5b61103482610ff0565b9392505050565b60006020828403121561104d57600080fd5b8151801515811461103457600080fd5b60006020828403121561106f57600080fd5b5035919050565b60006020828403121561108857600080fd5b5051919050565b600080604083850312156110a257600080fd5b823591506110b260208401610ff0565b90509250929050565b600080604083850312156110ce57600080fd5b8235915060208084013567ffffffffffffffff808211156110ee57600080fd5b818601915086601f83011261110257600080fd5b813581811115611114576111146112e7565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611157576111576112e7565b604052828152858101935084860182860187018b101561117657600080fd5b600095505b8386101561119957803585526001959095019493860193860161117b565b508096505050505050509250929050565b6000815180845260005b818110156111d0576020818501810151868301820152016111b4565b818111156111e2576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8416815282602082015260606040820152600061124a60608301846111aa565b95945050505050565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c0808401526112b060e08401826111aa565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } diff --git a/core/gethwrappers/generated/vrf_v2plus_sub_owner/vrf_v2plus_sub_owner.go b/core/gethwrappers/generated/vrf_v2plus_sub_owner/vrf_v2plus_sub_owner.go index f422ed29bcd..34108bea1dc 100644 --- a/core/gethwrappers/generated/vrf_v2plus_sub_owner/vrf_v2plus_sub_owner.go +++ b/core/gethwrappers/generated/vrf_v2plus_sub_owner/vrf_v2plus_sub_owner.go @@ -31,7 +31,7 @@ var ( ) var VRFV2PlusExternalSubOwnerExampleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_randomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFMigratableCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_randomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x608060405234801561001057600080fd5b50604051610d77380380610d7783398101604081905261002f916101d0565b8133806000816100865760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100b6576100b68161010a565b5050600280546001600160a01b039384166001600160a01b03199182161790915560038054958416958216959095179094555060048054929091169183169190911790556007805490911633179055610203565b6001600160a01b0381163314156101635760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161007d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146101cb57600080fd5b919050565b600080604083850312156101e357600080fd5b6101ec836101b4565b91506101fa602084016101b4565b90509250929050565b610b65806102126000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80638ea9811711610076578063e89e106a1161005b578063e89e106a1461014f578063f2fde38b14610166578063f6eaffc81461017957600080fd5b80638ea981171461011c5780639eccacf61461012f57600080fd5b80631fe543e3146100a85780635b6c5de8146100bd57806379ba5097146100d05780638da5cb5b146100d8575b600080fd5b6100bb6100b6366004610902565b61018c565b005b6100bb6100cb3660046109f1565b610212565b6100bb610325565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100bb61012a366004610893565b610422565b6002546100f29073ffffffffffffffffffffffffffffffffffffffff1681565b61015860065481565b604051908152602001610113565b6100bb610174366004610893565b61052d565b6101586101873660046108d0565b610541565b60025473ffffffffffffffffffffffffffffffffffffffff163314610204576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b61020e8282610562565b5050565b61021a6105e5565b60006040518060c001604052808481526020018881526020018661ffff1681526020018763ffffffff1681526020018563ffffffff16815260200161026e6040518060200160405280861515815250610668565b90526003546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e906102c7908490600401610a69565b602060405180830381600087803b1580156102e157600080fd5b505af11580156102f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031991906108e9565b60065550505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146103a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016101fb565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590610462575060025473ffffffffffffffffffffffffffffffffffffffff163314155b156104e6573361048760005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff938416600482015291831660248301529190911660448201526064016101fb565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6105356105e5565b61053e81610724565b50565b6005818154811061055157600080fd5b600091825260209091200154905081565b60065482146105cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265717565737420494420697320696e636f727265637400000000000000000060448201526064016101fb565b80516105e090600590602084019061081a565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016101fb565b565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa826040516024016106a191511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff81163314156107a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016101fb565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610855579160200282015b8281111561085557825182559160200191906001019061083a565b50610861929150610865565b5090565b5b808211156108615760008155600101610866565b803563ffffffff8116811461088e57600080fd5b919050565b6000602082840312156108a557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146108c957600080fd5b9392505050565b6000602082840312156108e257600080fd5b5035919050565b6000602082840312156108fb57600080fd5b5051919050565b6000806040838503121561091557600080fd5b8235915060208084013567ffffffffffffffff8082111561093557600080fd5b818601915086601f83011261094957600080fd5b81358181111561095b5761095b610b29565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561099e5761099e610b29565b604052828152858101935084860182860187018b10156109bd57600080fd5b600095505b838610156109e05780358552600195909501949386019386016109c2565b508096505050505050509250929050565b60008060008060008060c08789031215610a0a57600080fd5b86359550610a1a6020880161087a565b9450604087013561ffff81168114610a3157600080fd5b9350610a3f6060880161087a565b92506080870135915060a08701358015158114610a5b57600080fd5b809150509295509295509295565b6000602080835283518184015280840151604084015261ffff6040850151166060840152606084015163ffffffff80821660808601528060808701511660a0860152505060a084015160c08085015280518060e086015260005b81811015610ae05782810184015186820161010001528301610ac3565b81811115610af357600061010083880101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169390930161010001949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } diff --git a/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go b/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go index fdb64cecc42..8d96b864642 100644 --- a/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go +++ b/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go @@ -31,8 +31,8 @@ var ( ) type VRFCoordinatorV2PlusUpgradedVersionFeeConfig struct { - FulfillmentFlatFeeLinkPPM uint32 - FulfillmentFlatFeeEthPPM uint32 + FulfillmentFlatFeeLinkPPM uint32 + FulfillmentFlatFeeNativePPM uint32 } type VRFCoordinatorV2PlusUpgradedVersionRequestCommitment struct { @@ -66,8 +66,8 @@ type VRFV2PlusClientRandomWordsRequest struct { } var VRFCoordinatorV2PlusUpgradedVersionMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendEther\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transferredValue\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"expectedValue\",\"type\":\"uint96\"}],\"name\":\"InvalidNativeBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"requestVersion\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"expectedVersion\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubscriptionIDCollisionFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeEthPPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EthFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountEth\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldEthBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newEthBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithEth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_ETH_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithEth\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedData\",\"type\":\"bytes\"}],\"name\":\"onMigration\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawEth\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverEthFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeEthPPM\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalEthBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeEthPPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkEthFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKETHFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b50604051620060b9380380620060b9833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615ede620001db600039600081816104c401526136f60152615ede6000f3fe6080604052600436106102015760003560e01c806201229114610206578063043bd6ae14610233578063088070f5146102575780630ae09540146102d757806315c48b84146102f95780631b6b6d2314610321578063294daa491461034e578063330987b31461036a578063405b84fa146103a257806340d6bb82146103c257806341af6c87146103ed57806346d8d4861461041d57806357133e641461043d5780635d06b4ab1461045d57806364d51a2a1461047d57806366316d8d14610492578063689c4517146104b25780636b6feccc146104e65780636f64f03f1461051c57806379ba50971461053c57806386fe91c7146105515780638da5cb5b146105715780639b1c385e1461058f5780639d40a6fd146105af578063a21a23e4146105dc578063a4c0ed36146105f1578063a8cb447b14610611578063aa433aff14610631578063ad17836114610651578063aefb212f14610671578063b08c87951461069e578063b2a7cac5146106be578063bec4c08c146106de578063caf70c4a146106fe578063cb6317971461071e578063ce3f47191461073e578063d98e620e14610751578063da2f261014610771578063dac83d29146107a7578063dc311dd3146107c7578063e72f6e30146107f8578063e8509bff14610818578063e95704bd1461082b578063ee9d2d3814610852578063f2fde38b1461087f575b600080fd5b34801561021257600080fd5b5061021b61089f565b60405161022a939291906159d4565b60405180910390f35b34801561023f57600080fd5b5061024960115481565b60405190815260200161022a565b34801561026357600080fd5b50600d5461029f9061ffff81169063ffffffff62010000820481169160ff600160301b82041691600160381b8204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a00161022a565b3480156102e357600080fd5b506102f76102f2366004615655565b61091b565b005b34801561030557600080fd5b5061030e60c881565b60405161ffff909116815260200161022a565b34801561032d57600080fd5b50600254610341906001600160a01b031681565b60405161022a9190615878565b34801561035a57600080fd5b506040516001815260200161022a565b34801561037657600080fd5b5061038a6103853660046153c3565b6109e9565b6040516001600160601b03909116815260200161022a565b3480156103ae57600080fd5b506102f76103bd366004615655565b610ec4565b3480156103ce57600080fd5b506103d86101f481565b60405163ffffffff909116815260200161022a565b3480156103f957600080fd5b5061040d610408366004615305565b6112af565b604051901515815260200161022a565b34801561042957600080fd5b506102f76104383660046151c7565b611450565b34801561044957600080fd5b506102f76104583660046151fc565b6115cd565b34801561046957600080fd5b506102f76104783660046151aa565b61162d565b34801561048957600080fd5b5061030e606481565b34801561049e57600080fd5b506102f76104ad3660046151c7565b6116e4565b3480156104be57600080fd5b506103417f000000000000000000000000000000000000000000000000000000000000000081565b3480156104f257600080fd5b5060125461050e9063ffffffff80821691600160201b90041682565b60405161022a929190615b56565b34801561052857600080fd5b506102f7610537366004615235565b6118ac565b34801561054857600080fd5b506102f76119b3565b34801561055d57600080fd5b50600a5461038a906001600160601b031681565b34801561057d57600080fd5b506000546001600160a01b0316610341565b34801561059b57600080fd5b506102496105aa3660046154a0565b611a5d565b3480156105bb57600080fd5b506007546105cf906001600160401b031681565b60405161022a9190615b6d565b3480156105e857600080fd5b50610249611dcd565b3480156105fd57600080fd5b506102f761060c366004615271565b61201b565b34801561061d57600080fd5b506102f761062c3660046151aa565b6121b8565b34801561063d57600080fd5b506102f761064c366004615305565b6122c4565b34801561065d57600080fd5b50600354610341906001600160a01b031681565b34801561067d57600080fd5b5061069161068c36600461567a565b612327565b60405161022a91906158ef565b3480156106aa57600080fd5b506102f76106b93660046155b7565b612428565b3480156106ca57600080fd5b506102f76106d9366004615305565b61259c565b3480156106ea57600080fd5b506102f76106f9366004615655565b6126cc565b34801561070a57600080fd5b506102496107193660046152cc565b612863565b34801561072a57600080fd5b506102f7610739366004615655565b612893565b6102f761074c366004615337565b612b80565b34801561075d57600080fd5b5061024961076c366004615305565b612e91565b34801561077d57600080fd5b5061034161078c366004615305565b600e602052600090815260409020546001600160a01b031681565b3480156107b357600080fd5b506102f76107c2366004615655565b612eb2565b3480156107d357600080fd5b506107e76107e2366004615305565b612fc2565b60405161022a959493929190615b81565b34801561080457600080fd5b506102f76108133660046151aa565b6130bd565b6102f7610826366004615305565b613298565b34801561083757600080fd5b50600a5461038a90600160601b90046001600160601b031681565b34801561085e57600080fd5b5061024961086d366004615305565b60106020526000908152604090205481565b34801561088b57600080fd5b506102f761089a3660046151aa565b6133d0565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561090957602002820191906000526020600020905b8154815260200190600101908083116108f5575b50505050509050925092509250909192565b60008281526005602052604090205482906001600160a01b03168061095357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146109875780604051636c51fda960e11b815260040161097e9190615878565b60405180910390fd5b600d54600160301b900460ff16156109b25760405163769dd35360e11b815260040160405180910390fd5b6109bb846112af565b156109d957604051631685ecdd60e31b815260040160405180910390fd5b6109e384846133e1565b50505050565b600d54600090600160301b900460ff1615610a175760405163769dd35360e11b815260040160405180910390fd5b60005a90506000610a28858561359c565b90506000846060015163ffffffff166001600160401b03811115610a4e57610a4e615e98565b604051908082528060200260200182016040528015610a77578160200160208202803683370190505b50905060005b856060015163ffffffff16811015610aee57826040015181604051602001610aa6929190615902565b6040516020818303038152906040528051906020012060001c828281518110610ad157610ad1615e82565b602090810291909101015280610ae681615dea565b915050610a7d565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b91610b2691908690602401615a5e565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805460ff60301b1916600160301b179055908801516080890151919250600091610b8b9163ffffffff16908461380f565b600d805460ff60301b19169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b0316610bcb816001615cfb565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a01518051610c1890600190615d7b565b81518110610c2857610c28615e82565b602091010151600d5460f89190911c6001149150600090610c59908a90600160581b900463ffffffff163a8561385d565b90508115610d62576020808c01516000908152600690915260409020546001600160601b03808316600160601b909204161015610ca957604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c90610ce0908490600160601b90046001600160601b0316615d92565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c909152812080548594509092610d3991859116615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550610e4e565b6020808c01516000908152600690915260409020546001600160601b0380831691161015610da357604051631e9acf1760e31b815260040160405180910390fd5b6020808c015160009081526006909152604081208054839290610dd09084906001600160601b0316615d92565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b909152812080548594509092610e2991859116615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a604001518488604051610eab939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff1615610eef5760405163769dd35360e11b815260040160405180910390fd5b610ef8816138ac565b610f175780604051635428d44960e01b815260040161097e9190615878565b600080600080610f2686612fc2565b945094505093509350336001600160a01b0316826001600160a01b031614610f895760405162461bcd60e51b81526020600482015260166024820152752737ba1039bab139b1b934b83a34b7b71037bbb732b960511b604482015260640161097e565b610f92866112af565b15610fd85760405162461bcd60e51b815260206004820152601660248201527550656e64696e6720726571756573742065786973747360501b604482015260640161097e565b60006040518060c00160405280610fed600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b031681525090506000816040516020016110419190615941565b604051602081830303815290604052905061105b88613916565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b0388169061109490859060040161592e565b6000604051808303818588803b1580156110ad57600080fd5b505af11580156110c1573d6000803e3d6000fd5b50506002546001600160a01b0316158015935091506110ea905057506001600160601b03861615155b156111b45760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90611121908a908a906004016158bf565b602060405180830381600087803b15801561113b57600080fd5b505af115801561114f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117391906152e8565b6111b45760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015260640161097e565b600d805460ff60301b1916600160301b17905560005b835181101561125d578381815181106111e5576111e5615e82565b60200260200101516001600160a01b0316638ea98117896040518263ffffffff1660e01b81526004016112189190615878565b600060405180830381600087803b15801561123257600080fd5b505af1158015611246573d6000803e3d6000fd5b50505050808061125590615dea565b9150506111ca565b50600d805460ff60301b191690556040517fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be41879061129d9089908b9061588c565b60405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561133957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161131b575b505050505081525050905060005b8160400151518110156114465760005b600f548110156114335760006113fc600f838154811061137957611379615e82565b90600052602060002001548560400151858151811061139a5761139a615e82565b60200260200101518860046000896040015189815181106113bd576113bd615e82565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208d82529092529020546001600160401b0316613b64565b50600081815260106020526040902054909150156114205750600195945050505050565b508061142b81615dea565b915050611357565b508061143e81615dea565b915050611347565b5060009392505050565b600d54600160301b900460ff161561147b5760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b03808316911610156114b757604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c6020526040812080548392906114df9084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b03166115279190615d92565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50509050806115c857604051630dcf35db60e41b815260040160405180910390fd5b505050565b6115d5613bed565b6002546001600160a01b0316156115ff57604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b611635613bed565b61163e816138ac565b1561165e578060405163ac8a27ef60e01b815260040161097e9190615878565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383161790556040517fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af01625906116d9908390615878565b60405180910390a150565b600d54600160301b900460ff161561170f5760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03166117385760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b038083169116101561177457604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b60205260408120805483929061179c9084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b03166117e49190615d92565b82546001600160601b039182166101009390930a92830291909202199091161790555060025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061183990859085906004016158bf565b602060405180830381600087803b15801561185357600080fd5b505af1158015611867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188b91906152e8565b6118a857604051631e9acf1760e31b815260040160405180910390fd5b5050565b6118b4613bed565b6040805180820182526000916118e3919084906002908390839080828437600092019190915250612863915050565b6000818152600e60205260409020549091506001600160a01b03161561191f57604051634a0b8fa760e01b81526004810182905260240161097e565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b8910160405180910390a2505050565b6001546001600160a01b03163314611a065760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015260640161097e565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600d54600090600160301b900460ff1615611a8b5760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b0316611ac657604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b031680611b13578260200135336040516379bfd40160e01b815260040161097e929190615a33565b600d5461ffff16611b2a606085016040860161559c565b61ffff161080611b4d575060c8611b47606085016040860161559c565b61ffff16115b15611b8757611b62606084016040850161559c565b600d5460405163539c34bb60e11b815261097e929161ffff169060c8906004016159b6565b600d5462010000900463ffffffff16611ba6608085016060860161569c565b63ffffffff161115611bec57611bc2608084016060850161569c565b600d54604051637aebf00f60e11b815261097e929162010000900463ffffffff1690600401615b56565b6101f4611bff60a085016080860161569c565b63ffffffff161115611c3957611c1b60a084016080850161569c565b6101f46040516311ce1afb60e21b815260040161097e929190615b56565b6000611c46826001615cfb565b9050600080611c5c863533602089013586613b64565b90925090506000611c78611c7360a0890189615bd6565b613c42565b90506000611c8582613cbf565b905083611c90613d30565b60208a0135611ca560808c0160608d0161569c565b611cb560a08d0160808e0161569c565b3386604051602001611ccd9796959493929190615ab6565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d6040016020810190611d44919061559c565b8e6060016020810190611d57919061569c565b8f6080016020810190611d6a919061569c565b89604051611d7d96959493929190615a77565b60405180910390a45050336000908152600460209081526040808320898301358452909152902080546001600160401b0319166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff1615611dfb5760405163769dd35360e11b815260040160405180910390fd5b600033611e09600143615d7b565b600754604051606093841b6001600160601b03199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b03909116906000611e8383615e05565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b03811115611ec257611ec2615e98565b604051908082528060200260200182016040528015611eeb578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b039283161783559251600183018054909416911617909155925180519495509093611fcc9260028501920190614e1b565b50611fdc91506008905083613dc9565b50817f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d3360405161200d9190615878565b60405180910390a250905090565b600d54600160301b900460ff16156120465760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03163314612071576040516344b0e3c360e01b815260040160405180910390fd5b6020811461209257604051638129bbcd60e01b815260040160405180910390fd5b60006120a082840184615305565b6000818152600560205260409020549091506001600160a01b03166120d857604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b0316918691906120ff8385615d26565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166121479190615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a82878461219a9190615ce3565b6040516121a8929190615902565b60405180910390a2505050505050565b6121c0613bed565b600a544790600160601b90046001600160601b0316818111156121fa5780826040516354ced18160e11b815260040161097e929190615902565b818110156115c857600061220e8284615d7b565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d806000811461225d576040519150601f19603f3d011682016040523d82523d6000602084013e612262565b606091505b505090508061228457604051630dcf35db60e41b815260040160405180910390fd5b7f879c9ea2b9d5345b84ccd12610b032602808517cebdb795007f3dcb4df37731785836040516122b592919061588c565b60405180910390a15050505050565b6122cc613bed565b6000818152600560205260409020546001600160a01b031661230157604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020546123249082906001600160a01b03166133e1565b50565b606060006123356008613dd5565b905080841061235757604051631390f2a160e01b815260040160405180910390fd5b60006123638486615ce3565b905081811180612371575083155b61237b578061237d565b815b9050600061238b8683615d7b565b6001600160401b038111156123a2576123a2615e98565b6040519080825280602002602001820160405280156123cb578160200160208202803683370190505b50905060005b815181101561241e576123ef6123e78883615ce3565b600890613ddf565b82828151811061240157612401615e82565b60209081029190910101528061241681615dea565b9150506123d1565b5095945050505050565b612430613bed565b60c861ffff8716111561245d57858660c860405163539c34bb60e11b815260040161097e939291906159b6565b60008213612481576040516321ea67b360e11b81526004810183905260240161097e565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff1916881762010000870217600160301b600160781b031916600160381b850263ffffffff60581b191617600160581b83021790558a51601280548d8701519289166001600160401b031990911617600160201b92891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff16156125c75760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b03166125fc57604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612653576000818152600560205260409081902060010154905163d084e97560e01b815261097e916001600160a01b031690600401615878565b6000818152600560205260409081902080546001600160a01b031980821633908117845560019093018054909116905591516001600160a01b039092169183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c9386916126c09185916158a5565b60405180910390a25050565b60008281526005602052604090205482906001600160a01b03168061270457604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461272f5780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff161561275a5760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600201546064141561278d576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316156127c4576109e3565b6001600160a01b0383166000818152600460209081526040808320888452825280832080546001600160401b031916600190811790915560058352818420600201805491820181558452919092200180546001600160a01b0319169092179091555184907f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e190612855908690615878565b60405180910390a250505050565b60008160405160200161287691906158e1565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b0316806128cb57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146128f65780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff16156129215760405163769dd35360e11b815260040160405180910390fd5b61292a846112af565b1561294857604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b03166129965783836040516379bfd40160e01b815260040161097e929190615a33565b6000848152600560209081526040808320600201805482518185028101850190935280835291929091908301828280156129f957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116129db575b50505050509050600060018251612a109190615d7b565b905060005b8251811015612b1c57856001600160a01b0316838281518110612a3a57612a3a615e82565b60200260200101516001600160a01b03161415612b0a576000838381518110612a6557612a65615e82565b6020026020010151905080600560008a81526020019081526020016000206002018381548110612a9757612a97615e82565b600091825260208083209190910180546001600160a01b0319166001600160a01b039490941693909317909255898152600590915260409020600201805480612ae257612ae2615e6c565b600082815260209020810160001990810180546001600160a01b031916905501905550612b1c565b80612b1481615dea565b915050612a15565b506001600160a01b03851660009081526004602090815260408083208984529091529081902080546001600160401b03191690555186907f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7906121a8908890615878565b6000612b8e828401846154da565b9050806000015160ff16600114612bc757805160405163237d181f60e21b815260ff90911660048201526001602482015260440161097e565b8060a001516001600160601b03163414612c0b5760a08101516040516306acf13560e41b81523460048201526001600160601b03909116602482015260440161097e565b6020808201516000908152600590915260409020546001600160a01b031615612c47576040516326afa43560e11b815260040160405180910390fd5b60005b816060015151811015612ce75760016004600084606001518481518110612c7357612c73615e82565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008460200151815260200190815260200160002060006101000a8154816001600160401b0302191690836001600160401b031602179055508080612cdf90615dea565b915050612c4a565b50604080516060808201835260808401516001600160601b03908116835260a0850151811660208085019182526000858701818152828901805183526006845288832097518854955192516001600160401b0316600160c01b026001600160c01b03938816600160601b026001600160c01b0319909716919097161794909417169390931790945584518084018652868601516001600160a01b03908116825281860184815294880151828801908152925184526005865295909220825181549087166001600160a01b0319918216178255935160018201805491909716941693909317909455925180519192612de692600285019290910190614e1b565b5050506080810151600a8054600090612e099084906001600160601b0316615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055508060a00151600a600c8282829054906101000a90046001600160601b0316612e559190615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506109e381602001516008613dc990919063ffffffff16565b600f8181548110612ea157600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b031680612eea57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612f155780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff1615612f405760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b038481169116146109e3576000848152600560205260409081902060010180546001600160a01b0319166001600160a01b0386161790555184907f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19061285590339087906158a5565b6000818152600560205260408120548190819081906060906001600160a01b031661300057604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156130a357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613085575b505050505090509450945094509450945091939590929450565b6130c5613bed565b6002546001600160a01b03166130ee5760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81526000916001600160a01b0316906370a082319061311f903090600401615878565b60206040518083038186803b15801561313757600080fd5b505afa15801561314b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061316f919061531e565b600a549091506001600160601b0316818111156131a35780826040516354ced18160e11b815260040161097e929190615902565b818110156115c85760006131b78284615d7b565b60025460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906131ea908790859060040161588c565b602060405180830381600087803b15801561320457600080fd5b505af1158015613218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061323c91906152e8565b61325957604051631f01ff1360e21b815260040160405180910390fd5b7f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600848260405161328a92919061588c565b60405180910390a150505050565b600d54600160301b900460ff16156132c35760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b03166132f857604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c6133278385615d26565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b031661336f9190615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f3f1ddc3ab1bdb39001ad76ca51a0e6f57ce6627c69f251d1de41622847721cde8234846133c29190615ce3565b6040516126c0929190615902565b6133d8613bed565b61232481613deb565b6000806133ed84613916565b60025491935091506001600160a01b03161580159061341457506001600160601b03821615155b156134c35760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906134549086906001600160601b0387169060040161588c565b602060405180830381600087803b15801561346e57600080fd5b505af1158015613482573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134a691906152e8565b6134c357604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613519576040519150601f19603f3d011682016040523d82523d6000602084013e61351e565b606091505b505090508061354057604051630dcf35db60e41b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006135c88460000151612863565b6000818152600e60205260409020549091506001600160a01b03168061360457604051631dfd6e1360e21b81526004810183905260240161097e565b600082866080015160405160200161361d929190615902565b60408051601f198184030181529181528151602092830120600081815260109093529120549091508061366357604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613692978a979096959101615b02565b6040516020818303038152906040528051906020012081146136c75760405163354a450b60e21b815260040160405180910390fd5b60006136d68760000151613e8f565b90508061379d578651604051631d2827a760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163e9413d389161372a9190600401615b6d565b60206040518083038186803b15801561374257600080fd5b505afa158015613756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061377a919061531e565b90508061379d57865160405163175dadad60e01b815261097e9190600401615b6d565b60008860800151826040516020016137bf929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905060006137e68a83613f82565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a61138881101561382157600080fd5b61138881039050846040820482031161383957600080fd5b50823b61384557600080fd5b60008083516020850160008789f190505b9392505050565b6000811561388a576012546138839086908690600160201b900463ffffffff1686613fed565b90506138a4565b6012546138a1908690869063ffffffff1686614057565b90505b949350505050565b6000805b60135481101561390d57826001600160a01b0316601382815481106138d7576138d7615e82565b6000918252602090912001546001600160a01b031614156138fb5750600192915050565b8061390581615dea565b9150506138b0565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879687969495948601939192908301828280156139a257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613984575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613a7e576004600084604001518381518110613a2e57613a2e615e82565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902080546001600160401b031916905580613a7681615dea565b915050613a07565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613ab66002830182614e80565b5050600085815260066020526040812055613ad2600886614144565b50600a8054859190600090613af19084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613b399190615d92565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081018690526001600160a01b03851691810191909152606081018390526001600160401b03821660808201526000908190819060a00160408051601f198184030181529082905280516020918201209250613bc9918991849101615902565b60408051808303601f19018152919052805160209091012097909650945050505050565b6000546001600160a01b03163314613c405760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b604482015260640161097e565b565b60408051602081019091526000815281613c6b5750604080516020810190915260008152610ebe565b63125fa26760e31b613c7d8385615dba565b6001600160e01b03191614613ca557604051632923fee760e11b815260040160405180910390fd5b613cb28260048186615cb9565b8101906138569190615378565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613cf891511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b60004661a4b1811480613d45575062066eed81145b15613dc25760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d8457600080fd5b505afa158015613d98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dbc919061531e565b91505090565b4391505090565b60006138568383614150565b6000610ebe825490565b6000613856838361419f565b6001600160a01b038116331415613e3e5760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b604482015260640161097e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60004661a4b1811480613ea4575062066eed81145b80613eb1575062066eee81145b15613f7357610100836001600160401b0316613ecb613d30565b613ed59190615d7b565b1180613ef15750613ee4613d30565b836001600160401b031610155b15613eff5750600092915050565b6040516315a03d4160e11b8152606490632b407a8290613f23908690600401615b6d565b60206040518083038186803b158015613f3b57600080fd5b505afa158015613f4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613856919061531e565b50506001600160401b03164090565b6000613fb68360000151846020015185604001518660600151868860a001518960c001518a60e001518b61010001516141c9565b60038360200151604051602001613fce929190615a4a565b60408051601f1981840301815291905280516020909101209392505050565b600080613ff86143e4565b905060005a6140078888615ce3565b6140119190615d7b565b61401b9085615d5c565b9050600061403463ffffffff871664e8d4a51000615d5c565b9050826140418284615ce3565b61404b9190615ce3565b98975050505050505050565b600080614062614440565b905060008113614088576040516321ea67b360e11b81526004810182905260240161097e565b60006140926143e4565b9050600082825a6140a38b8b615ce3565b6140ad9190615d7b565b6140b79088615d5c565b6140c19190615ce3565b6140d390670de0b6b3a7640000615d5c565b6140dd9190615d48565b905060006140f663ffffffff881664e8d4a51000615d5c565b905061410d81676765c793fa10079d601b1b615d7b565b82111561412d5760405163e80fa38160e01b815260040160405180910390fd5b6141378183615ce3565b9998505050505050505050565b6000613856838361450b565b600081815260018301602052604081205461419757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610ebe565b506000610ebe565b60008260000182815481106141b6576141b6615e82565b9060005260206000200154905092915050565b6141d2896145fe565b61421b5760405162461bcd60e51b815260206004820152601a6024820152797075626c6963206b6579206973206e6f74206f6e20637572766560301b604482015260640161097e565b614224886145fe565b6142685760405162461bcd60e51b815260206004820152601560248201527467616d6d61206973206e6f74206f6e20637572766560581b604482015260640161097e565b614271836145fe565b6142bd5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e206375727665000000604482015260640161097e565b6142c6826145fe565b6143115760405162461bcd60e51b815260206004820152601c60248201527b73486173685769746e657373206973206e6f74206f6e20637572766560201b604482015260640161097e565b61431d878a88876146c1565b6143655760405162461bcd60e51b81526020600482015260196024820152786164647228632a706b2b732a6729213d5f755769746e65737360381b604482015260640161097e565b60006143718a876147d5565b90506000614384898b878b868989614839565b90506000614395838d8d8a8661494c565b9050808a146143d65760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b604482015260640161097e565b505050505050505050505050565b60004661a4b18114806143f9575062066eed81145b1561443857606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d8457600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093600160381b900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561449e57600080fd5b505afa1580156144b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144d691906156b7565b5094509092508491505080156144fa57506144f18242615d7b565b8463ffffffff16105b156138a45750601154949350505050565b600081815260018301602052604081205480156145f457600061452f600183615d7b565b855490915060009061454390600190615d7b565b90508181146145a857600086600001828154811061456357614563615e82565b906000526020600020015490508087600001848154811061458657614586615e82565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145b9576145b9615e6c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610ebe565b6000915050610ebe565b80516000906401000003d0191161464c5760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420782d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d0191161469a5760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420792d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d0199080096146ba8360005b602002015161498c565b1492915050565b60006001600160a01b0382166147075760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b604482015260640161097e565b60208401516000906001161561471e57601c614721565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe199182039250600091908909875160408051600080825260209091019182905292935060019161478b91869188918790615910565b6020604051602081039080840390855afa1580156147ad573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b6147dd614e9e565b61480a600184846040516020016147f693929190615857565b6040516020818303038152906040526149b0565b90505b614816816145fe565b610ebe57805160408051602081019290925261483291016147f6565b905061480d565b614841614e9e565b825186516401000003d01990819006910614156148a05760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e63740000604482015260640161097e565b6148ab8789886149fe565b6148f05760405162461bcd60e51b8152602060048201526016602482015275119a5c9cdd081b5d5b0818da1958dac819985a5b195960521b604482015260640161097e565b6148fb8486856149fe565b6149415760405162461bcd60e51b815260206004820152601760248201527614d958dbdb99081b5d5b0818da1958dac819985a5b1959604a1b604482015260640161097e565b61404b868484614b19565b60006002868686858760405160200161496a969594939291906157fd565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b6149b8614e9e565b6149c182614bdc565b81526149d66149d18260006146b0565b614c17565b602082018190526002900660011415611dc8576020810180516401000003d019039052919050565b600082614a3b5760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b604482015260640161097e565b83516020850151600090614a5190600290615e2c565b15614a5d57601c614a60565b601b5b9050600070014551231950b75fc4402da1732fc9bebe19838709604080516000808252602090910191829052919250600190614aa3908390869088908790615910565b6020604051602081039080840390855afa158015614ac5573d6000803e3d6000fd5b505050602060405103519050600086604051602001614ae491906157eb565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614b21614e9e565b835160208086015185519186015160009384938493614b4293909190614c37565b919450925090506401000003d019858209600114614b9e5760405162461bcd60e51b815260206004820152601960248201527834b73b2d1036bab9ba1031329034b73b32b939b29037b3103d60391b604482015260640161097e565b60405180604001604052806401000003d01980614bbd57614bbd615e56565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d0198110611dc857604080516020808201939093528151808203840181529082019091528051910120614be4565b6000610ebe826002614c306401000003d0196001615ce3565b901c614d17565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614c7783838585614dae565b9098509050614c8888828e88614dd2565b9098509050614c9988828c87614dd2565b90985090506000614cac8d878b85614dd2565b9098509050614cbd88828686614dae565b9098509050614cce88828e89614dd2565b9098509050818114614d03576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614d07565b8196505b5050505050509450945094915050565b600080614d22614ebc565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614d54614eda565b60208160c0846005600019fa925082614da45760405162461bcd60e51b81526020600482015260126024820152716269674d6f64457870206661696c7572652160701b604482015260640161097e565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614e70579160200282015b82811115614e7057825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614e3b565b50614e7c929150614ef8565b5090565b50805460008255906000526020600020908101906123249190614ef8565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614e7c5760008155600101614ef9565b8035611dc881615eae565b600082601f830112614f2957600080fd5b813560206001600160401b03821115614f4457614f44615e98565b8160051b614f53828201615c89565b838152828101908684018388018501891015614f6e57600080fd5b600093505b85841015614f9a578035614f8681615eae565b835260019390930192918401918401614f73565b50979650505050505050565b600082601f830112614fb757600080fd5b614fbf615c1c565b808385604086011115614fd157600080fd5b60005b6002811015614ff3578135845260209384019390910190600101614fd4565b509095945050505050565b60008083601f84011261501057600080fd5b5081356001600160401b0381111561502757600080fd5b60208301915083602082850101111561503f57600080fd5b9250929050565b600082601f83011261505757600080fd5b81356001600160401b0381111561507057615070615e98565b615083601f8201601f1916602001615c89565b81815284602083860101111561509857600080fd5b816020850160208301376000918101602001919091529392505050565b600060c082840312156150c757600080fd5b6150cf615c44565b905081356001600160401b0380821682146150e957600080fd5b8183526020840135602084015261510260408501615168565b604084015261511360608501615168565b606084015261512460808501614f0d565b608084015260a084013591508082111561513d57600080fd5b5061514a84828501615046565b60a08301525092915050565b803561ffff81168114611dc857600080fd5b803563ffffffff81168114611dc857600080fd5b80516001600160501b0381168114611dc857600080fd5b80356001600160601b0381168114611dc857600080fd5b6000602082840312156151bc57600080fd5b813561385681615eae565b600080604083850312156151da57600080fd5b82356151e581615eae565b91506151f360208401615193565b90509250929050565b6000806040838503121561520f57600080fd5b823561521a81615eae565b9150602083013561522a81615eae565b809150509250929050565b6000806060838503121561524857600080fd5b823561525381615eae565b91506060830184101561526557600080fd5b50926020919091019150565b6000806000806060858703121561528757600080fd5b843561529281615eae565b93506020850135925060408501356001600160401b038111156152b457600080fd5b6152c087828801614ffe565b95989497509550505050565b6000604082840312156152de57600080fd5b6138568383614fa6565b6000602082840312156152fa57600080fd5b815161385681615ec3565b60006020828403121561531757600080fd5b5035919050565b60006020828403121561533057600080fd5b5051919050565b6000806020838503121561534a57600080fd5b82356001600160401b0381111561536057600080fd5b61536c85828601614ffe565b90969095509350505050565b60006020828403121561538a57600080fd5b604051602081016001600160401b03811182821017156153ac576153ac615e98565b60405282356153ba81615ec3565b81529392505050565b6000808284036101c08112156153d857600080fd5b6101a0808212156153e857600080fd5b6153f0615c66565b91506153fc8686614fa6565b825261540b8660408701614fa6565b60208301526080850135604083015260a0850135606083015260c0850135608083015261543a60e08601614f0d565b60a083015261010061544e87828801614fa6565b60c0840152615461876101408801614fa6565b60e0840152610180860135908301529092508301356001600160401b0381111561548a57600080fd5b615496858286016150b5565b9150509250929050565b6000602082840312156154b257600080fd5b81356001600160401b038111156154c857600080fd5b820160c0818503121561385657600080fd5b6000602082840312156154ec57600080fd5b81356001600160401b038082111561550357600080fd5b9083019060c0828603121561551757600080fd5b61551f615c44565b823560ff8116811461553057600080fd5b81526020838101359082015261554860408401614f0d565b604082015260608301358281111561555f57600080fd5b61556b87828601614f18565b60608301525061557d60808401615193565b608082015261558e60a08401615193565b60a082015295945050505050565b6000602082840312156155ae57600080fd5b61385682615156565b60008060008060008086880360e08112156155d157600080fd5b6155da88615156565b96506155e860208901615168565b95506155f660408901615168565b945061560460608901615168565b9350608088013592506040609f198201121561561f57600080fd5b50615628615c1c565b61563460a08901615168565b815261564260c08901615168565b6020820152809150509295509295509295565b6000806040838503121561566857600080fd5b82359150602083013561522a81615eae565b6000806040838503121561568d57600080fd5b50508035926020909101359150565b6000602082840312156156ae57600080fd5b61385682615168565b600080600080600060a086880312156156cf57600080fd5b6156d88661517c565b94506020860151935060408601519250606086015191506156fb6080870161517c565b90509295509295909350565b600081518084526020808501945080840160005b838110156157405781516001600160a01b03168752958201959082019060010161571b565b509495945050505050565b8060005b60028110156109e357815184526020938401939091019060010161574f565b600081518084526020808501945080840160005b8381101561574057815187529582019590820190600101615782565b6000815180845260005b818110156157c4576020818501810151868301820152016157a8565b818111156157d6576000602083870101525b50601f01601f19169290920160200192915050565b6157f5818361574b565b604001919050565b86815261580d602082018761574b565b61581a606082018661574b565b61582760a082018561574b565b61583460e082018461574b565b60609190911b6001600160601b0319166101208201526101340195945050505050565b838152615867602082018461574b565b606081019190915260800192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039290921682526001600160601b0316602082015260400190565b60408101610ebe828461574b565b602081526000613856602083018461576e565b918252602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b602081526000613856602083018461579e565b6020815260ff82511660208201526020820151604082015260018060a01b0360408301511660608201526000606083015160c0608084015261598660e0840182615707565b60808501516001600160601b0390811660a0868101919091529095015190941660c0909301929092525090919050565b61ffff93841681529183166020830152909116604082015260600190565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615a2557845183529383019391830191600101615a09565b509098975050505050505050565b9182526001600160a01b0316602082015260400190565b82815260608101613856602083018461574b565b8281526040602082015260006138a4604083018461576e565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261404b60c083018461579e565b878152602081018790526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c082018190526000906141379083018461579e565b8781526001600160401b03871660208201526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c082018190526000906141379083018461579e565b63ffffffff92831681529116602082015260400190565b6001600160401b0391909116815260200190565b6001600160601b038681168252851660208201526001600160401b03841660408201526001600160a01b038316606082015260a060808201819052600090615bcb90830184615707565b979650505050505050565b6000808335601e19843603018112615bed57600080fd5b8301803591506001600160401b03821115615c0757600080fd5b60200191503681900382131561503f57600080fd5b604080519081016001600160401b0381118282101715615c3e57615c3e615e98565b60405290565b60405160c081016001600160401b0381118282101715615c3e57615c3e615e98565b60405161012081016001600160401b0381118282101715615c3e57615c3e615e98565b604051601f8201601f191681016001600160401b0381118282101715615cb157615cb1615e98565b604052919050565b60008085851115615cc957600080fd5b83861115615cd657600080fd5b5050820193919092039150565b60008219821115615cf657615cf6615e40565b500190565b60006001600160401b03828116848216808303821115615d1d57615d1d615e40565b01949350505050565b60006001600160601b03828116848216808303821115615d1d57615d1d615e40565b600082615d5757615d57615e56565b500490565b6000816000190483118215151615615d7657615d76615e40565b500290565b600082821015615d8d57615d8d615e40565b500390565b60006001600160601b0383811690831681811015615db257615db2615e40565b039392505050565b6001600160e01b03198135818116916004851015615de25780818660040360031b1b83161692505b505092915050565b6000600019821415615dfe57615dfe615e40565b5060010190565b60006001600160401b0382811680821415615e2257615e22615e40565b6001019392505050565b600082615e3b57615e3b615e56565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461232457600080fd5b801515811461232457600080fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transferredValue\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"expectedValue\",\"type\":\"uint96\"}],\"name\":\"InvalidNativeBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"requestVersion\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"expectedVersion\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubscriptionIDCollisionFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountNative\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldNativeBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNativeBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithNative\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedData\",\"type\":\"bytes\"}],\"name\":\"onMigration\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverNativeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b50604051620060b9380380620060b9833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615ede620001db600039600081816104eb01526136f60152615ede6000f3fe6080604052600436106102015760003560e01c806201229114610206578063043bd6ae14610233578063088070f5146102575780630ae09540146102d757806315c48b84146102f957806318e3dd27146103215780631b6b6d2314610360578063294926571461038d578063294daa49146103ad578063330987b3146103c9578063405b84fa146103e957806340d6bb821461040957806341af6c87146104345780635d06b4ab1461046457806364d51a2a14610484578063659827441461049957806366316d8d146104b9578063689c4517146104d95780636b6feccc1461050d5780636f64f03f1461054357806372e9d5651461056357806379ba5097146105835780638402595e1461059857806386fe91c7146105b85780638da5cb5b146105d857806395b55cfc146105f65780639b1c385e146106095780639d40a6fd14610629578063a21a23e414610656578063a4c0ed361461066b578063aa433aff1461068b578063aefb212f146106ab578063b08c8795146106d8578063b2a7cac5146106f8578063bec4c08c14610718578063caf70c4a14610738578063cb63179714610758578063ce3f471914610778578063d98e620e1461078b578063da2f2610146107ab578063dac83d29146107e1578063dc311dd314610801578063e72f6e3014610832578063ee9d2d3814610852578063f2fde38b1461087f575b600080fd5b34801561021257600080fd5b5061021b61089f565b60405161022a939291906159d4565b60405180910390f35b34801561023f57600080fd5b5061024960115481565b60405190815260200161022a565b34801561026357600080fd5b50600d5461029f9061ffff81169063ffffffff62010000820481169160ff600160301b82041691600160381b8204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a00161022a565b3480156102e357600080fd5b506102f76102f2366004615655565b61091b565b005b34801561030557600080fd5b5061030e60c881565b60405161ffff909116815260200161022a565b34801561032d57600080fd5b50600a5461034890600160601b90046001600160601b031681565b6040516001600160601b03909116815260200161022a565b34801561036c57600080fd5b50600254610380906001600160a01b031681565b60405161022a9190615878565b34801561039957600080fd5b506102f76103a83660046151c7565b6109e9565b3480156103b957600080fd5b506040516001815260200161022a565b3480156103d557600080fd5b506103486103e43660046153c3565b610b66565b3480156103f557600080fd5b506102f7610404366004615655565b611041565b34801561041557600080fd5b5061041f6101f481565b60405163ffffffff909116815260200161022a565b34801561044057600080fd5b5061045461044f366004615305565b61142c565b604051901515815260200161022a565b34801561047057600080fd5b506102f761047f3660046151aa565b6115cd565b34801561049057600080fd5b5061030e606481565b3480156104a557600080fd5b506102f76104b43660046151fc565b611684565b3480156104c557600080fd5b506102f76104d43660046151c7565b6116e4565b3480156104e557600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b34801561051957600080fd5b506012546105359063ffffffff80821691600160201b90041682565b60405161022a929190615b56565b34801561054f57600080fd5b506102f761055e366004615235565b6118ac565b34801561056f57600080fd5b50600354610380906001600160a01b031681565b34801561058f57600080fd5b506102f76119b3565b3480156105a457600080fd5b506102f76105b33660046151aa565b611a5d565b3480156105c457600080fd5b50600a54610348906001600160601b031681565b3480156105e457600080fd5b506000546001600160a01b0316610380565b6102f7610604366004615305565b611b69565b34801561061557600080fd5b506102496106243660046154a0565b611cad565b34801561063557600080fd5b50600754610649906001600160401b031681565b60405161022a9190615b6d565b34801561066257600080fd5b5061024961201d565b34801561067757600080fd5b506102f7610686366004615271565b61226b565b34801561069757600080fd5b506102f76106a6366004615305565b612408565b3480156106b757600080fd5b506106cb6106c636600461567a565b61246b565b60405161022a91906158ef565b3480156106e457600080fd5b506102f76106f33660046155b7565b61256c565b34801561070457600080fd5b506102f7610713366004615305565b6126e0565b34801561072457600080fd5b506102f7610733366004615655565b612804565b34801561074457600080fd5b506102496107533660046152cc565b61299b565b34801561076457600080fd5b506102f7610773366004615655565b6129cb565b6102f7610786366004615337565b612cb8565b34801561079757600080fd5b506102496107a6366004615305565b612fc9565b3480156107b757600080fd5b506103806107c6366004615305565b600e602052600090815260409020546001600160a01b031681565b3480156107ed57600080fd5b506102f76107fc366004615655565b612fea565b34801561080d57600080fd5b5061082161081c366004615305565b6130fa565b60405161022a959493929190615b81565b34801561083e57600080fd5b506102f761084d3660046151aa565b6131f5565b34801561085e57600080fd5b5061024961086d366004615305565b60106020526000908152604090205481565b34801561088b57600080fd5b506102f761089a3660046151aa565b6133d0565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561090957602002820191906000526020600020905b8154815260200190600101908083116108f5575b50505050509050925092509250909192565b60008281526005602052604090205482906001600160a01b03168061095357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146109875780604051636c51fda960e11b815260040161097e9190615878565b60405180910390fd5b600d54600160301b900460ff16156109b25760405163769dd35360e11b815260040160405180910390fd5b6109bb8461142c565b156109d957604051631685ecdd60e31b815260040160405180910390fd5b6109e384846133e1565b50505050565b600d54600160301b900460ff1615610a145760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610a5057604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610a789084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610ac09190615d92565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b5050905080610b615760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff1615610b945760405163769dd35360e11b815260040160405180910390fd5b60005a90506000610ba5858561359c565b90506000846060015163ffffffff166001600160401b03811115610bcb57610bcb615e98565b604051908082528060200260200182016040528015610bf4578160200160208202803683370190505b50905060005b856060015163ffffffff16811015610c6b57826040015181604051602001610c23929190615902565b6040516020818303038152906040528051906020012060001c828281518110610c4e57610c4e615e82565b602090810291909101015280610c6381615dea565b915050610bfa565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b91610ca391908690602401615a5e565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805460ff60301b1916600160301b179055908801516080890151919250600091610d089163ffffffff16908461380f565b600d805460ff60301b19169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b0316610d48816001615cfb565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a01518051610d9590600190615d7b565b81518110610da557610da5615e82565b602091010151600d5460f89190911c6001149150600090610dd6908a90600160581b900463ffffffff163a8561385d565b90508115610edf576020808c01516000908152600690915260409020546001600160601b03808316600160601b909204161015610e2657604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c90610e5d908490600160601b90046001600160601b0316615d92565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c909152812080548594509092610eb691859116615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550610fcb565b6020808c01516000908152600690915260409020546001600160601b0380831691161015610f2057604051631e9acf1760e31b815260040160405180910390fd5b6020808c015160009081526006909152604081208054839290610f4d9084906001600160601b0316615d92565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b909152812080548594509092610fa691859116615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a604001518488604051611028939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff161561106c5760405163769dd35360e11b815260040160405180910390fd5b611075816138ac565b6110945780604051635428d44960e01b815260040161097e9190615878565b6000806000806110a3866130fa565b945094505093509350336001600160a01b0316826001600160a01b0316146111065760405162461bcd60e51b81526020600482015260166024820152752737ba1039bab139b1b934b83a34b7b71037bbb732b960511b604482015260640161097e565b61110f8661142c565b156111555760405162461bcd60e51b815260206004820152601660248201527550656e64696e6720726571756573742065786973747360501b604482015260640161097e565b60006040518060c0016040528061116a600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b031681525090506000816040516020016111be9190615941565b60405160208183030381529060405290506111d888613916565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b0388169061121190859060040161592e565b6000604051808303818588803b15801561122a57600080fd5b505af115801561123e573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611267905057506001600160601b03861615155b156113315760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061129e908a908a906004016158bf565b602060405180830381600087803b1580156112b857600080fd5b505af11580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f091906152e8565b6113315760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015260640161097e565b600d805460ff60301b1916600160301b17905560005b83518110156113da5783818151811061136257611362615e82565b60200260200101516001600160a01b0316638ea98117896040518263ffffffff1660e01b81526004016113959190615878565b600060405180830381600087803b1580156113af57600080fd5b505af11580156113c3573d6000803e3d6000fd5b5050505080806113d290615dea565b915050611347565b50600d805460ff60301b191690556040517fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be41879061141a9089908b9061588c565b60405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287969395860193909291908301828280156114b657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611498575b505050505081525050905060005b8160400151518110156115c35760005b600f548110156115b0576000611579600f83815481106114f6576114f6615e82565b90600052602060002001548560400151858151811061151757611517615e82565b602002602001015188600460008960400151898151811061153a5761153a615e82565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208d82529092529020546001600160401b0316613b64565b506000818152601060205260409020549091501561159d5750600195945050505050565b50806115a881615dea565b9150506114d4565b50806115bb81615dea565b9150506114c4565b5060009392505050565b6115d5613bed565b6115de816138ac565b156115fe578060405163ac8a27ef60e01b815260040161097e9190615878565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383161790556040517fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af0162590611679908390615878565b60405180910390a150565b61168c613bed565b6002546001600160a01b0316156116b657604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff161561170f5760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03166117385760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b038083169116101561177457604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b60205260408120805483929061179c9084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b03166117e49190615d92565b82546001600160601b039182166101009390930a92830291909202199091161790555060025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061183990859085906004016158bf565b602060405180830381600087803b15801561185357600080fd5b505af1158015611867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188b91906152e8565b6118a857604051631e9acf1760e31b815260040160405180910390fd5b5050565b6118b4613bed565b6040805180820182526000916118e391908490600290839083908082843760009201919091525061299b915050565b6000818152600e60205260409020549091506001600160a01b03161561191f57604051634a0b8fa760e01b81526004810182905260240161097e565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b8910160405180910390a2505050565b6001546001600160a01b03163314611a065760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015260640161097e565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611a65613bed565b600a544790600160601b90046001600160601b031681811115611a9f5780826040516354ced18160e11b815260040161097e929190615902565b81811015610b61576000611ab38284615d7b565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114611b02576040519150601f19603f3d011682016040523d82523d6000602084013e611b07565b606091505b5050905080611b295760405163950b247960e01b815260040160405180910390fd5b7f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c8583604051611b5a92919061588c565b60405180910390a15050505050565b600d54600160301b900460ff1615611b945760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316611bc957604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c611bf88385615d26565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b0316611c409190615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902823484611c939190615ce3565b604051611ca1929190615902565b60405180910390a25050565b600d54600090600160301b900460ff1615611cdb5760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b0316611d1657604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b031680611d63578260200135336040516379bfd40160e01b815260040161097e929190615a33565b600d5461ffff16611d7a606085016040860161559c565b61ffff161080611d9d575060c8611d97606085016040860161559c565b61ffff16115b15611dd757611db2606084016040850161559c565b600d5460405163539c34bb60e11b815261097e929161ffff169060c8906004016159b6565b600d5462010000900463ffffffff16611df6608085016060860161569c565b63ffffffff161115611e3c57611e12608084016060850161569c565b600d54604051637aebf00f60e11b815261097e929162010000900463ffffffff1690600401615b56565b6101f4611e4f60a085016080860161569c565b63ffffffff161115611e8957611e6b60a084016080850161569c565b6101f46040516311ce1afb60e21b815260040161097e929190615b56565b6000611e96826001615cfb565b9050600080611eac863533602089013586613b64565b90925090506000611ec8611ec360a0890189615bd6565b613c42565b90506000611ed582613cbf565b905083611ee0613d30565b60208a0135611ef560808c0160608d0161569c565b611f0560a08d0160808e0161569c565b3386604051602001611f1d9796959493929190615ab6565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d6040016020810190611f94919061559c565b8e6060016020810190611fa7919061569c565b8f6080016020810190611fba919061569c565b89604051611fcd96959493929190615a77565b60405180910390a45050336000908152600460209081526040808320898301358452909152902080546001600160401b0319166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561204b5760405163769dd35360e11b815260040160405180910390fd5b600033612059600143615d7b565b600754604051606093841b6001600160601b03199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006120d383615e05565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b0381111561211257612112615e98565b60405190808252806020026020018201604052801561213b578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b03928316178355925160018301805490941691161790915592518051949550909361221c9260028501920190614e1b565b5061222c91506008905083613dc9565b50817f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d3360405161225d9190615878565b60405180910390a250905090565b600d54600160301b900460ff16156122965760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b031633146122c1576040516344b0e3c360e01b815260040160405180910390fd5b602081146122e257604051638129bbcd60e01b815260040160405180910390fd5b60006122f082840184615305565b6000818152600560205260409020549091506001600160a01b031661232857604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b03169186919061234f8385615d26565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166123979190615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846123ea9190615ce3565b6040516123f8929190615902565b60405180910390a2505050505050565b612410613bed565b6000818152600560205260409020546001600160a01b031661244557604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020546124689082906001600160a01b03166133e1565b50565b606060006124796008613dd5565b905080841061249b57604051631390f2a160e01b815260040160405180910390fd5b60006124a78486615ce3565b9050818111806124b5575083155b6124bf57806124c1565b815b905060006124cf8683615d7b565b6001600160401b038111156124e6576124e6615e98565b60405190808252806020026020018201604052801561250f578160200160208202803683370190505b50905060005b81518110156125625761253361252b8883615ce3565b600890613ddf565b82828151811061254557612545615e82565b60209081029190910101528061255a81615dea565b915050612515565b5095945050505050565b612574613bed565b60c861ffff871611156125a157858660c860405163539c34bb60e11b815260040161097e939291906159b6565b600082136125c5576040516321ea67b360e11b81526004810183905260240161097e565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff1916881762010000870217600160301b600160781b031916600160381b850263ffffffff60581b191617600160581b83021790558a51601280548d8701519289166001600160401b031990911617600160201b92891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff161561270b5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661274057604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612797576000818152600560205260409081902060010154905163d084e97560e01b815261097e916001600160a01b031690600401615878565b6000818152600560205260409081902080546001600160a01b031980821633908117845560019093018054909116905591516001600160a01b039092169183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691611ca19185916158a5565b60008281526005602052604090205482906001600160a01b03168061283c57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146128675780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff16156128925760405163769dd35360e11b815260040160405180910390fd5b600084815260056020526040902060020154606414156128c5576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316156128fc576109e3565b6001600160a01b0383166000818152600460209081526040808320888452825280832080546001600160401b031916600190811790915560058352818420600201805491820181558452919092200180546001600160a01b0319169092179091555184907f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e19061298d908690615878565b60405180910390a250505050565b6000816040516020016129ae91906158e1565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b031680612a0357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612a2e5780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff1615612a595760405163769dd35360e11b815260040160405180910390fd5b612a628461142c565b15612a8057604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316612ace5783836040516379bfd40160e01b815260040161097e929190615a33565b600084815260056020908152604080832060020180548251818502810185019093528083529192909190830182828015612b3157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612b13575b50505050509050600060018251612b489190615d7b565b905060005b8251811015612c5457856001600160a01b0316838281518110612b7257612b72615e82565b60200260200101516001600160a01b03161415612c42576000838381518110612b9d57612b9d615e82565b6020026020010151905080600560008a81526020019081526020016000206002018381548110612bcf57612bcf615e82565b600091825260208083209190910180546001600160a01b0319166001600160a01b039490941693909317909255898152600590915260409020600201805480612c1a57612c1a615e6c565b600082815260209020810160001990810180546001600160a01b031916905501905550612c54565b80612c4c81615dea565b915050612b4d565b506001600160a01b03851660009081526004602090815260408083208984529091529081902080546001600160401b03191690555186907f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7906123f8908890615878565b6000612cc6828401846154da565b9050806000015160ff16600114612cff57805160405163237d181f60e21b815260ff90911660048201526001602482015260440161097e565b8060a001516001600160601b03163414612d435760a08101516040516306acf13560e41b81523460048201526001600160601b03909116602482015260440161097e565b6020808201516000908152600590915260409020546001600160a01b031615612d7f576040516326afa43560e11b815260040160405180910390fd5b60005b816060015151811015612e1f5760016004600084606001518481518110612dab57612dab615e82565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008460200151815260200190815260200160002060006101000a8154816001600160401b0302191690836001600160401b031602179055508080612e1790615dea565b915050612d82565b50604080516060808201835260808401516001600160601b03908116835260a0850151811660208085019182526000858701818152828901805183526006845288832097518854955192516001600160401b0316600160c01b026001600160c01b03938816600160601b026001600160c01b0319909716919097161794909417169390931790945584518084018652868601516001600160a01b03908116825281860184815294880151828801908152925184526005865295909220825181549087166001600160a01b0319918216178255935160018201805491909716941693909317909455925180519192612f1e92600285019290910190614e1b565b5050506080810151600a8054600090612f419084906001600160601b0316615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055508060a00151600a600c8282829054906101000a90046001600160601b0316612f8d9190615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506109e381602001516008613dc990919063ffffffff16565b600f8181548110612fd957600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061302257604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461304d5780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff16156130785760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b038481169116146109e3576000848152600560205260409081902060010180546001600160a01b0319166001600160a01b0386161790555184907f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19061298d90339087906158a5565b6000818152600560205260408120548190819081906060906001600160a01b031661313857604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156131db57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116131bd575b505050505090509450945094509450945091939590929450565b6131fd613bed565b6002546001600160a01b03166132265760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190613257903090600401615878565b60206040518083038186803b15801561326f57600080fd5b505afa158015613283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132a7919061531e565b600a549091506001600160601b0316818111156132db5780826040516354ced18160e11b815260040161097e929190615902565b81811015610b615760006132ef8284615d7b565b60025460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb90613322908790859060040161588c565b602060405180830381600087803b15801561333c57600080fd5b505af1158015613350573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061337491906152e8565b61339157604051631f01ff1360e21b815260040160405180910390fd5b7f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b43660084826040516133c292919061588c565b60405180910390a150505050565b6133d8613bed565b61246881613deb565b6000806133ed84613916565b60025491935091506001600160a01b03161580159061341457506001600160601b03821615155b156134c35760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906134549086906001600160601b0387169060040161588c565b602060405180830381600087803b15801561346e57600080fd5b505af1158015613482573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134a691906152e8565b6134c357604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613519576040519150601f19603f3d011682016040523d82523d6000602084013e61351e565b606091505b50509050806135405760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006135c8846000015161299b565b6000818152600e60205260409020549091506001600160a01b03168061360457604051631dfd6e1360e21b81526004810183905260240161097e565b600082866080015160405160200161361d929190615902565b60408051601f198184030181529181528151602092830120600081815260109093529120549091508061366357604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613692978a979096959101615b02565b6040516020818303038152906040528051906020012081146136c75760405163354a450b60e21b815260040160405180910390fd5b60006136d68760000151613e8f565b90508061379d578651604051631d2827a760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163e9413d389161372a9190600401615b6d565b60206040518083038186803b15801561374257600080fd5b505afa158015613756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061377a919061531e565b90508061379d57865160405163175dadad60e01b815261097e9190600401615b6d565b60008860800151826040516020016137bf929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905060006137e68a83613f82565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a61138881101561382157600080fd5b61138881039050846040820482031161383957600080fd5b50823b61384557600080fd5b60008083516020850160008789f190505b9392505050565b6000811561388a576012546138839086908690600160201b900463ffffffff1686613fed565b90506138a4565b6012546138a1908690869063ffffffff1686614057565b90505b949350505050565b6000805b60135481101561390d57826001600160a01b0316601382815481106138d7576138d7615e82565b6000918252602090912001546001600160a01b031614156138fb5750600192915050565b8061390581615dea565b9150506138b0565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879687969495948601939192908301828280156139a257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613984575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613a7e576004600084604001518381518110613a2e57613a2e615e82565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902080546001600160401b031916905580613a7681615dea565b915050613a07565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613ab66002830182614e80565b5050600085815260066020526040812055613ad2600886614144565b50600a8054859190600090613af19084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613b399190615d92565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081018690526001600160a01b03851691810191909152606081018390526001600160401b03821660808201526000908190819060a00160408051601f198184030181529082905280516020918201209250613bc9918991849101615902565b60408051808303601f19018152919052805160209091012097909650945050505050565b6000546001600160a01b03163314613c405760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b604482015260640161097e565b565b60408051602081019091526000815281613c6b575060408051602081019091526000815261103b565b63125fa26760e31b613c7d8385615dba565b6001600160e01b03191614613ca557604051632923fee760e11b815260040160405180910390fd5b613cb28260048186615cb9565b8101906138569190615378565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613cf891511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b60004661a4b1811480613d45575062066eed81145b15613dc25760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d8457600080fd5b505afa158015613d98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dbc919061531e565b91505090565b4391505090565b60006138568383614150565b600061103b825490565b6000613856838361419f565b6001600160a01b038116331415613e3e5760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b604482015260640161097e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60004661a4b1811480613ea4575062066eed81145b80613eb1575062066eee81145b15613f7357610100836001600160401b0316613ecb613d30565b613ed59190615d7b565b1180613ef15750613ee4613d30565b836001600160401b031610155b15613eff5750600092915050565b6040516315a03d4160e11b8152606490632b407a8290613f23908690600401615b6d565b60206040518083038186803b158015613f3b57600080fd5b505afa158015613f4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613856919061531e565b50506001600160401b03164090565b6000613fb68360000151846020015185604001518660600151868860a001518960c001518a60e001518b61010001516141c9565b60038360200151604051602001613fce929190615a4a565b60408051601f1981840301815291905280516020909101209392505050565b600080613ff86143e4565b905060005a6140078888615ce3565b6140119190615d7b565b61401b9085615d5c565b9050600061403463ffffffff871664e8d4a51000615d5c565b9050826140418284615ce3565b61404b9190615ce3565b98975050505050505050565b600080614062614440565b905060008113614088576040516321ea67b360e11b81526004810182905260240161097e565b60006140926143e4565b9050600082825a6140a38b8b615ce3565b6140ad9190615d7b565b6140b79088615d5c565b6140c19190615ce3565b6140d390670de0b6b3a7640000615d5c565b6140dd9190615d48565b905060006140f663ffffffff881664e8d4a51000615d5c565b905061410d81676765c793fa10079d601b1b615d7b565b82111561412d5760405163e80fa38160e01b815260040160405180910390fd5b6141378183615ce3565b9998505050505050505050565b6000613856838361450b565b60008181526001830160205260408120546141975750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561103b565b50600061103b565b60008260000182815481106141b6576141b6615e82565b9060005260206000200154905092915050565b6141d2896145fe565b61421b5760405162461bcd60e51b815260206004820152601a6024820152797075626c6963206b6579206973206e6f74206f6e20637572766560301b604482015260640161097e565b614224886145fe565b6142685760405162461bcd60e51b815260206004820152601560248201527467616d6d61206973206e6f74206f6e20637572766560581b604482015260640161097e565b614271836145fe565b6142bd5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e206375727665000000604482015260640161097e565b6142c6826145fe565b6143115760405162461bcd60e51b815260206004820152601c60248201527b73486173685769746e657373206973206e6f74206f6e20637572766560201b604482015260640161097e565b61431d878a88876146c1565b6143655760405162461bcd60e51b81526020600482015260196024820152786164647228632a706b2b732a6729213d5f755769746e65737360381b604482015260640161097e565b60006143718a876147d5565b90506000614384898b878b868989614839565b90506000614395838d8d8a8661494c565b9050808a146143d65760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b604482015260640161097e565b505050505050505050505050565b60004661a4b18114806143f9575062066eed81145b1561443857606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d8457600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093600160381b900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561449e57600080fd5b505afa1580156144b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144d691906156b7565b5094509092508491505080156144fa57506144f18242615d7b565b8463ffffffff16105b156138a45750601154949350505050565b600081815260018301602052604081205480156145f457600061452f600183615d7b565b855490915060009061454390600190615d7b565b90508181146145a857600086600001828154811061456357614563615e82565b906000526020600020015490508087600001848154811061458657614586615e82565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145b9576145b9615e6c565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061103b565b600091505061103b565b80516000906401000003d0191161464c5760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420782d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d0191161469a5760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420792d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d0199080096146ba8360005b602002015161498c565b1492915050565b60006001600160a01b0382166147075760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b604482015260640161097e565b60208401516000906001161561471e57601c614721565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe199182039250600091908909875160408051600080825260209091019182905292935060019161478b91869188918790615910565b6020604051602081039080840390855afa1580156147ad573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b6147dd614e9e565b61480a600184846040516020016147f693929190615857565b6040516020818303038152906040526149b0565b90505b614816816145fe565b61103b57805160408051602081019290925261483291016147f6565b905061480d565b614841614e9e565b825186516401000003d01990819006910614156148a05760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e63740000604482015260640161097e565b6148ab8789886149fe565b6148f05760405162461bcd60e51b8152602060048201526016602482015275119a5c9cdd081b5d5b0818da1958dac819985a5b195960521b604482015260640161097e565b6148fb8486856149fe565b6149415760405162461bcd60e51b815260206004820152601760248201527614d958dbdb99081b5d5b0818da1958dac819985a5b1959604a1b604482015260640161097e565b61404b868484614b19565b60006002868686858760405160200161496a969594939291906157fd565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b6149b8614e9e565b6149c182614bdc565b81526149d66149d18260006146b0565b614c17565b602082018190526002900660011415612018576020810180516401000003d019039052919050565b600082614a3b5760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b604482015260640161097e565b83516020850151600090614a5190600290615e2c565b15614a5d57601c614a60565b601b5b9050600070014551231950b75fc4402da1732fc9bebe19838709604080516000808252602090910191829052919250600190614aa3908390869088908790615910565b6020604051602081039080840390855afa158015614ac5573d6000803e3d6000fd5b505050602060405103519050600086604051602001614ae491906157eb565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614b21614e9e565b835160208086015185519186015160009384938493614b4293909190614c37565b919450925090506401000003d019858209600114614b9e5760405162461bcd60e51b815260206004820152601960248201527834b73b2d1036bab9ba1031329034b73b32b939b29037b3103d60391b604482015260640161097e565b60405180604001604052806401000003d01980614bbd57614bbd615e56565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d019811061201857604080516020808201939093528151808203840181529082019091528051910120614be4565b600061103b826002614c306401000003d0196001615ce3565b901c614d17565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614c7783838585614dae565b9098509050614c8888828e88614dd2565b9098509050614c9988828c87614dd2565b90985090506000614cac8d878b85614dd2565b9098509050614cbd88828686614dae565b9098509050614cce88828e89614dd2565b9098509050818114614d03576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614d07565b8196505b5050505050509450945094915050565b600080614d22614ebc565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614d54614eda565b60208160c0846005600019fa925082614da45760405162461bcd60e51b81526020600482015260126024820152716269674d6f64457870206661696c7572652160701b604482015260640161097e565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614e70579160200282015b82811115614e7057825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614e3b565b50614e7c929150614ef8565b5090565b50805460008255906000526020600020908101906124689190614ef8565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614e7c5760008155600101614ef9565b803561201881615eae565b600082601f830112614f2957600080fd5b813560206001600160401b03821115614f4457614f44615e98565b8160051b614f53828201615c89565b838152828101908684018388018501891015614f6e57600080fd5b600093505b85841015614f9a578035614f8681615eae565b835260019390930192918401918401614f73565b50979650505050505050565b600082601f830112614fb757600080fd5b614fbf615c1c565b808385604086011115614fd157600080fd5b60005b6002811015614ff3578135845260209384019390910190600101614fd4565b509095945050505050565b60008083601f84011261501057600080fd5b5081356001600160401b0381111561502757600080fd5b60208301915083602082850101111561503f57600080fd5b9250929050565b600082601f83011261505757600080fd5b81356001600160401b0381111561507057615070615e98565b615083601f8201601f1916602001615c89565b81815284602083860101111561509857600080fd5b816020850160208301376000918101602001919091529392505050565b600060c082840312156150c757600080fd5b6150cf615c44565b905081356001600160401b0380821682146150e957600080fd5b8183526020840135602084015261510260408501615168565b604084015261511360608501615168565b606084015261512460808501614f0d565b608084015260a084013591508082111561513d57600080fd5b5061514a84828501615046565b60a08301525092915050565b803561ffff8116811461201857600080fd5b803563ffffffff8116811461201857600080fd5b80516001600160501b038116811461201857600080fd5b80356001600160601b038116811461201857600080fd5b6000602082840312156151bc57600080fd5b813561385681615eae565b600080604083850312156151da57600080fd5b82356151e581615eae565b91506151f360208401615193565b90509250929050565b6000806040838503121561520f57600080fd5b823561521a81615eae565b9150602083013561522a81615eae565b809150509250929050565b6000806060838503121561524857600080fd5b823561525381615eae565b91506060830184101561526557600080fd5b50926020919091019150565b6000806000806060858703121561528757600080fd5b843561529281615eae565b93506020850135925060408501356001600160401b038111156152b457600080fd5b6152c087828801614ffe565b95989497509550505050565b6000604082840312156152de57600080fd5b6138568383614fa6565b6000602082840312156152fa57600080fd5b815161385681615ec3565b60006020828403121561531757600080fd5b5035919050565b60006020828403121561533057600080fd5b5051919050565b6000806020838503121561534a57600080fd5b82356001600160401b0381111561536057600080fd5b61536c85828601614ffe565b90969095509350505050565b60006020828403121561538a57600080fd5b604051602081016001600160401b03811182821017156153ac576153ac615e98565b60405282356153ba81615ec3565b81529392505050565b6000808284036101c08112156153d857600080fd5b6101a0808212156153e857600080fd5b6153f0615c66565b91506153fc8686614fa6565b825261540b8660408701614fa6565b60208301526080850135604083015260a0850135606083015260c0850135608083015261543a60e08601614f0d565b60a083015261010061544e87828801614fa6565b60c0840152615461876101408801614fa6565b60e0840152610180860135908301529092508301356001600160401b0381111561548a57600080fd5b615496858286016150b5565b9150509250929050565b6000602082840312156154b257600080fd5b81356001600160401b038111156154c857600080fd5b820160c0818503121561385657600080fd5b6000602082840312156154ec57600080fd5b81356001600160401b038082111561550357600080fd5b9083019060c0828603121561551757600080fd5b61551f615c44565b823560ff8116811461553057600080fd5b81526020838101359082015261554860408401614f0d565b604082015260608301358281111561555f57600080fd5b61556b87828601614f18565b60608301525061557d60808401615193565b608082015261558e60a08401615193565b60a082015295945050505050565b6000602082840312156155ae57600080fd5b61385682615156565b60008060008060008086880360e08112156155d157600080fd5b6155da88615156565b96506155e860208901615168565b95506155f660408901615168565b945061560460608901615168565b9350608088013592506040609f198201121561561f57600080fd5b50615628615c1c565b61563460a08901615168565b815261564260c08901615168565b6020820152809150509295509295509295565b6000806040838503121561566857600080fd5b82359150602083013561522a81615eae565b6000806040838503121561568d57600080fd5b50508035926020909101359150565b6000602082840312156156ae57600080fd5b61385682615168565b600080600080600060a086880312156156cf57600080fd5b6156d88661517c565b94506020860151935060408601519250606086015191506156fb6080870161517c565b90509295509295909350565b600081518084526020808501945080840160005b838110156157405781516001600160a01b03168752958201959082019060010161571b565b509495945050505050565b8060005b60028110156109e357815184526020938401939091019060010161574f565b600081518084526020808501945080840160005b8381101561574057815187529582019590820190600101615782565b6000815180845260005b818110156157c4576020818501810151868301820152016157a8565b818111156157d6576000602083870101525b50601f01601f19169290920160200192915050565b6157f5818361574b565b604001919050565b86815261580d602082018761574b565b61581a606082018661574b565b61582760a082018561574b565b61583460e082018461574b565b60609190911b6001600160601b0319166101208201526101340195945050505050565b838152615867602082018461574b565b606081019190915260800192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039290921682526001600160601b0316602082015260400190565b6040810161103b828461574b565b602081526000613856602083018461576e565b918252602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b602081526000613856602083018461579e565b6020815260ff82511660208201526020820151604082015260018060a01b0360408301511660608201526000606083015160c0608084015261598660e0840182615707565b60808501516001600160601b0390811660a0868101919091529095015190941660c0909301929092525090919050565b61ffff93841681529183166020830152909116604082015260600190565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615a2557845183529383019391830191600101615a09565b509098975050505050505050565b9182526001600160a01b0316602082015260400190565b82815260608101613856602083018461574b565b8281526040602082015260006138a4604083018461576e565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261404b60c083018461579e565b878152602081018790526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c082018190526000906141379083018461579e565b8781526001600160401b03871660208201526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c082018190526000906141379083018461579e565b63ffffffff92831681529116602082015260400190565b6001600160401b0391909116815260200190565b6001600160601b038681168252851660208201526001600160401b03841660408201526001600160a01b038316606082015260a060808201819052600090615bcb90830184615707565b979650505050505050565b6000808335601e19843603018112615bed57600080fd5b8301803591506001600160401b03821115615c0757600080fd5b60200191503681900382131561503f57600080fd5b604080519081016001600160401b0381118282101715615c3e57615c3e615e98565b60405290565b60405160c081016001600160401b0381118282101715615c3e57615c3e615e98565b60405161012081016001600160401b0381118282101715615c3e57615c3e615e98565b604051601f8201601f191681016001600160401b0381118282101715615cb157615cb1615e98565b604052919050565b60008085851115615cc957600080fd5b83861115615cd657600080fd5b5050820193919092039150565b60008219821115615cf657615cf6615e40565b500190565b60006001600160401b03828116848216808303821115615d1d57615d1d615e40565b01949350505050565b60006001600160601b03828116848216808303821115615d1d57615d1d615e40565b600082615d5757615d57615e56565b500490565b6000816000190483118215151615615d7657615d76615e40565b500290565b600082821015615d8d57615d8d615e40565b500390565b60006001600160601b0383811690831681811015615db257615db2615e40565b039392505050565b6001600160e01b03198135818116916004851015615de25780818660040360031b1b83161692505b505092915050565b6000600019821415615dfe57615dfe615e40565b5060010190565b60006001600160401b0382811680821415615e2257615e22615e40565b6001019392505050565b600082615e3b57615e3b615e56565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461246857600080fd5b801515811461246857600080fdfea164736f6c6343000806000a", } var VRFCoordinatorV2PlusUpgradedVersionABI = VRFCoordinatorV2PlusUpgradedVersionMetaData.ABI @@ -250,9 +250,9 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionC return _VRFCoordinatorV2PlusUpgradedVersion.Contract.LINK(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) LINKETHFEED(opts *bind.CallOpts) (common.Address, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) LINKNATIVEFEED(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "LINK_ETH_FEED") + err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "LINK_NATIVE_FEED") if err != nil { return *new(common.Address), err @@ -264,12 +264,12 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionC } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) LINKETHFEED() (common.Address, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.LINKETHFEED(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) LINKNATIVEFEED() (common.Address, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.LINKNATIVEFEED(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCallerSession) LINKETHFEED() (common.Address, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.LINKETHFEED(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCallerSession) LINKNATIVEFEED() (common.Address, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.LINKNATIVEFEED(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) } func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) { @@ -396,7 +396,7 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionC } outstruct.Balance = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.EthBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.NativeBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) outstruct.ReqCount = *abi.ConvertType(out[2], new(uint64)).(*uint64) outstruct.Owner = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) outstruct.Consumers = *abi.ConvertType(out[4], new([]common.Address)).(*[]common.Address) @@ -594,7 +594,7 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionC } outstruct.FulfillmentFlatFeeLinkPPM = *abi.ConvertType(out[0], new(uint32)).(*uint32) - outstruct.FulfillmentFlatFeeEthPPM = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.FulfillmentFlatFeeNativePPM = *abi.ConvertType(out[1], new(uint32)).(*uint32) return *outstruct, err @@ -700,9 +700,9 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionC return _VRFCoordinatorV2PlusUpgradedVersion.Contract.STotalBalance(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) STotalEthBalance(opts *bind.CallOpts) (*big.Int, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) STotalNativeBalance(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "s_totalEthBalance") + err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "s_totalNativeBalance") if err != nil { return *new(*big.Int), err @@ -714,12 +714,12 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionC } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) STotalEthBalance() (*big.Int, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.STotalEthBalance(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) STotalNativeBalance() (*big.Int, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.STotalNativeBalance(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCallerSession) STotalEthBalance() (*big.Int, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.STotalEthBalance(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCallerSession) STotalNativeBalance() (*big.Int, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.STotalNativeBalance(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) } func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { @@ -794,16 +794,16 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionT return _VRFCoordinatorV2PlusUpgradedVersion.Contract.FulfillRandomWords(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, proof, rc) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) FundSubscriptionWithEth(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "fundSubscriptionWithEth", subId) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) FundSubscriptionWithNative(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "fundSubscriptionWithNative", subId) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) FundSubscriptionWithEth(subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.FundSubscriptionWithEth(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, subId) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) FundSubscriptionWithNative(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.FundSubscriptionWithNative(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, subId) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactorSession) FundSubscriptionWithEth(subId *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.FundSubscriptionWithEth(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, subId) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactorSession) FundSubscriptionWithNative(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.FundSubscriptionWithNative(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, subId) } func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) Migrate(opts *bind.TransactOpts, subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { @@ -854,16 +854,16 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionT return _VRFCoordinatorV2PlusUpgradedVersion.Contract.OracleWithdraw(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, recipient, amount) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) OracleWithdrawEth(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "oracleWithdrawEth", recipient, amount) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) OracleWithdrawNative(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "oracleWithdrawNative", recipient, amount) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) OracleWithdrawEth(recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.OracleWithdrawEth(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, recipient, amount) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) OracleWithdrawNative(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.OracleWithdrawNative(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, recipient, amount) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactorSession) OracleWithdrawEth(recipient common.Address, amount *big.Int) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.OracleWithdrawEth(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, recipient, amount) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactorSession) OracleWithdrawNative(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.OracleWithdrawNative(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, recipient, amount) } func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) OwnerCancelSubscription(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { @@ -878,18 +878,6 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionT return _VRFCoordinatorV2PlusUpgradedVersion.Contract.OwnerCancelSubscription(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, subId) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) RecoverEthFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "recoverEthFunds", to) -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) RecoverEthFunds(to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.RecoverEthFunds(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, to) -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactorSession) RecoverEthFunds(to common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.RecoverEthFunds(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, to) -} - func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "recoverFunds", to) } @@ -902,6 +890,18 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionT return _VRFCoordinatorV2PlusUpgradedVersion.Contract.RecoverFunds(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, to) } +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) RecoverNativeFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "recoverNativeFunds", to) +} + +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) RecoverNativeFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.RecoverNativeFunds(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, to) +} + +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactorSession) RecoverNativeFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.RecoverNativeFunds(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, to) +} + func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) RegisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) { return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "registerMigratableCoordinator", target) } @@ -974,16 +974,16 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionT return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SetConfig(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) SetLINKAndLINKETHFeed(opts *bind.TransactOpts, link common.Address, linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "setLINKAndLINKETHFeed", link, linkEthFeed) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) SetLINKAndLINKNativeFeed(opts *bind.TransactOpts, link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.contract.Transact(opts, "setLINKAndLINKNativeFeed", link, linkNativeFeed) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) SetLINKAndLINKETHFeed(link common.Address, linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SetLINKAndLINKETHFeed(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, link, linkEthFeed) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) SetLINKAndLINKNativeFeed(link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SetLINKAndLINKNativeFeed(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, link, linkNativeFeed) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactorSession) SetLINKAndLINKETHFeed(link common.Address, linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SetLINKAndLINKETHFeed(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, link, linkEthFeed) +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactorSession) SetLINKAndLINKNativeFeed(link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SetLINKAndLINKNativeFeed(&_VRFCoordinatorV2PlusUpgradedVersion.TransactOpts, link, linkNativeFeed) } func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { @@ -1237,8 +1237,8 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF return event, nil } -type VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator struct { - Event *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered +type VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator struct { + Event *VRFCoordinatorV2PlusUpgradedVersionFundsRecovered contract *bind.BoundContract event string @@ -1249,7 +1249,7 @@ type VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator struct { fail error } -func (it *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator) Next() bool { +func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Next() bool { if it.fail != nil { return false @@ -1258,7 +1258,7 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator) Next() b if it.done { select { case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered) + it.Event = new(VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1273,7 +1273,7 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator) Next() b select { case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered) + it.Event = new(VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1288,33 +1288,33 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator) Next() b } } -func (it *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator) Error() error { +func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Error() error { return it.fail } -func (it *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator) Close() error { +func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Close() error { it.sub.Unsubscribe() return nil } -type VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered struct { +type VRFCoordinatorV2PlusUpgradedVersionFundsRecovered struct { To common.Address Amount *big.Int Raw types.Log } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterEthFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator, error) { - logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.FilterLogs(opts, "EthFundsRecovered") + logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.FilterLogs(opts, "FundsRecovered") if err != nil { return nil, err } - return &VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator{contract: _VRFCoordinatorV2PlusUpgradedVersion.contract, event: "EthFundsRecovered", logs: logs, sub: sub}, nil + return &VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator{contract: _VRFCoordinatorV2PlusUpgradedVersion.contract, event: "FundsRecovered", logs: logs, sub: sub}, nil } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) WatchEthFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered) (event.Subscription, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) (event.Subscription, error) { - logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.WatchLogs(opts, "EthFundsRecovered") + logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.WatchLogs(opts, "FundsRecovered") if err != nil { return nil, err } @@ -1324,8 +1324,8 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF select { case log := <-logs: - event := new(VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered) - if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "EthFundsRecovered", log); err != nil { + event := new(VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) + if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "FundsRecovered", log); err != nil { return err } event.Raw = log @@ -1346,17 +1346,17 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF }), nil } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) ParseEthFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered, error) { - event := new(VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered) - if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "EthFundsRecovered", log); err != nil { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) ParseFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionFundsRecovered, error) { + event := new(VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) + if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "FundsRecovered", log); err != nil { return nil, err } event.Raw = log return event, nil } -type VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator struct { - Event *VRFCoordinatorV2PlusUpgradedVersionFundsRecovered +type VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator struct { + Event *VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted contract *bind.BoundContract event string @@ -1367,7 +1367,7 @@ type VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator struct { fail error } -func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Next() bool { +func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Next() bool { if it.fail != nil { return false @@ -1376,7 +1376,7 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Next() bool if it.done { select { case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) + it.Event = new(VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1391,7 +1391,7 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Next() bool select { case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) + it.Event = new(VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1406,33 +1406,33 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Next() bool } } -func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Error() error { +func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Error() error { return it.fail } -func (it *VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator) Close() error { +func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Close() error { it.sub.Unsubscribe() return nil } -type VRFCoordinatorV2PlusUpgradedVersionFundsRecovered struct { - To common.Address - Amount *big.Int - Raw types.Log +type VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted struct { + NewCoordinator common.Address + SubId *big.Int + Raw types.Log } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterMigrationCompleted(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator, error) { - logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.FilterLogs(opts, "FundsRecovered") + logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.FilterLogs(opts, "MigrationCompleted") if err != nil { return nil, err } - return &VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator{contract: _VRFCoordinatorV2PlusUpgradedVersion.contract, event: "FundsRecovered", logs: logs, sub: sub}, nil + return &VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator{contract: _VRFCoordinatorV2PlusUpgradedVersion.contract, event: "MigrationCompleted", logs: logs, sub: sub}, nil } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) (event.Subscription, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) WatchMigrationCompleted(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) (event.Subscription, error) { - logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.WatchLogs(opts, "FundsRecovered") + logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.WatchLogs(opts, "MigrationCompleted") if err != nil { return nil, err } @@ -1442,8 +1442,8 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF select { case log := <-logs: - event := new(VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) - if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "FundsRecovered", log); err != nil { + event := new(VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) + if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { return err } event.Raw = log @@ -1464,17 +1464,17 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF }), nil } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) ParseFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionFundsRecovered, error) { - event := new(VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) - if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "FundsRecovered", log); err != nil { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) ParseMigrationCompleted(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted, error) { + event := new(VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) + if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { return nil, err } event.Raw = log return event, nil } -type VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator struct { - Event *VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted +type VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecoveredIterator struct { + Event *VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered contract *bind.BoundContract event string @@ -1485,7 +1485,7 @@ type VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator struct { fail error } -func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Next() bool { +func (it *VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecoveredIterator) Next() bool { if it.fail != nil { return false @@ -1494,7 +1494,7 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Next() if it.done { select { case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) + it.Event = new(VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1509,7 +1509,7 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Next() select { case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) + it.Event = new(VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1524,33 +1524,33 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Next() } } -func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Error() error { +func (it *VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecoveredIterator) Error() error { return it.fail } -func (it *VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator) Close() error { +func (it *VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecoveredIterator) Close() error { it.sub.Unsubscribe() return nil } -type VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted struct { - NewCoordinator common.Address - SubId *big.Int - Raw types.Log +type VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered struct { + To common.Address + Amount *big.Int + Raw types.Log } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterMigrationCompleted(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterNativeFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecoveredIterator, error) { - logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.FilterLogs(opts, "MigrationCompleted") + logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.FilterLogs(opts, "NativeFundsRecovered") if err != nil { return nil, err } - return &VRFCoordinatorV2PlusUpgradedVersionMigrationCompletedIterator{contract: _VRFCoordinatorV2PlusUpgradedVersion.contract, event: "MigrationCompleted", logs: logs, sub: sub}, nil + return &VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecoveredIterator{contract: _VRFCoordinatorV2PlusUpgradedVersion.contract, event: "NativeFundsRecovered", logs: logs, sub: sub}, nil } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) WatchMigrationCompleted(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) (event.Subscription, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) WatchNativeFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered) (event.Subscription, error) { - logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.WatchLogs(opts, "MigrationCompleted") + logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.WatchLogs(opts, "NativeFundsRecovered") if err != nil { return nil, err } @@ -1560,8 +1560,8 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF select { case log := <-logs: - event := new(VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) - if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { + event := new(VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered) + if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "NativeFundsRecovered", log); err != nil { return err } event.Raw = log @@ -1582,9 +1582,9 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF }), nil } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) ParseMigrationCompleted(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted, error) { - event := new(VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) - if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) ParseNativeFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered, error) { + event := new(VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered) + if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "NativeFundsRecovered", log); err != nil { return nil, err } event.Raw = log @@ -2348,11 +2348,11 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionCanceledIterator) Close } type VRFCoordinatorV2PlusUpgradedVersionSubscriptionCanceled struct { - SubId *big.Int - To common.Address - AmountLink *big.Int - AmountEth *big.Int - Raw types.Log + SubId *big.Int + To common.Address + AmountLink *big.Int + AmountNative *big.Int + Raw types.Log } func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterSubscriptionCanceled(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionCanceledIterator, error) { @@ -2930,8 +2930,8 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF return event, nil } -type VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator struct { - Event *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth +type VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNativeIterator struct { + Event *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative contract *bind.BoundContract event string @@ -2942,7 +2942,7 @@ type VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator struct fail error } -func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator) Next() bool { +func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNativeIterator) Next() bool { if it.fail != nil { return false @@ -2951,7 +2951,7 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator) if it.done { select { case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth) + it.Event = new(VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2966,7 +2966,7 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator) select { case log := <-it.logs: - it.Event = new(VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth) + it.Event = new(VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2981,44 +2981,44 @@ func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator) } } -func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator) Error() error { +func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNativeIterator) Error() error { return it.fail } -func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator) Close() error { +func (it *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNativeIterator) Close() error { it.sub.Unsubscribe() return nil } -type VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth struct { - SubId *big.Int - OldEthBalance *big.Int - NewEthBalance *big.Int - Raw types.Log +type VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative struct { + SubId *big.Int + OldNativeBalance *big.Int + NewNativeBalance *big.Int + Raw types.Log } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterSubscriptionFundedWithEth(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) FilterSubscriptionFundedWithNative(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNativeIterator, error) { var subIdRule []interface{} for _, subIdItem := range subId { subIdRule = append(subIdRule, subIdItem) } - logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.FilterLogs(opts, "SubscriptionFundedWithEth", subIdRule) + logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.FilterLogs(opts, "SubscriptionFundedWithNative", subIdRule) if err != nil { return nil, err } - return &VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator{contract: _VRFCoordinatorV2PlusUpgradedVersion.contract, event: "SubscriptionFundedWithEth", logs: logs, sub: sub}, nil + return &VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNativeIterator{contract: _VRFCoordinatorV2PlusUpgradedVersion.contract, event: "SubscriptionFundedWithNative", logs: logs, sub: sub}, nil } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) WatchSubscriptionFundedWithEth(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth, subId []*big.Int) (event.Subscription, error) { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) WatchSubscriptionFundedWithNative(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative, subId []*big.Int) (event.Subscription, error) { var subIdRule []interface{} for _, subIdItem := range subId { subIdRule = append(subIdRule, subIdItem) } - logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.WatchLogs(opts, "SubscriptionFundedWithEth", subIdRule) + logs, sub, err := _VRFCoordinatorV2PlusUpgradedVersion.contract.WatchLogs(opts, "SubscriptionFundedWithNative", subIdRule) if err != nil { return nil, err } @@ -3028,8 +3028,8 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF select { case log := <-logs: - event := new(VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth) - if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "SubscriptionFundedWithEth", log); err != nil { + event := new(VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative) + if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "SubscriptionFundedWithNative", log); err != nil { return err } event.Raw = log @@ -3050,9 +3050,9 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF }), nil } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) ParseSubscriptionFundedWithEth(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth, error) { - event := new(VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth) - if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "SubscriptionFundedWithEth", log); err != nil { +func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionFilterer) ParseSubscriptionFundedWithNative(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative, error) { + event := new(VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative) + if err := _VRFCoordinatorV2PlusUpgradedVersion.contract.UnpackLog(event, "SubscriptionFundedWithNative", log); err != nil { return nil, err } event.Raw = log @@ -3318,11 +3318,11 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionF } type GetSubscription struct { - Balance *big.Int - EthBalance *big.Int - ReqCount uint64 - Owner common.Address - Consumers []common.Address + Balance *big.Int + NativeBalance *big.Int + ReqCount uint64 + Owner common.Address + Consumers []common.Address } type SConfig struct { MinimumRequestConfirmations uint16 @@ -3332,8 +3332,8 @@ type SConfig struct { GasAfterPaymentCalculation uint32 } type SFeeConfig struct { - FulfillmentFlatFeeLinkPPM uint32 - FulfillmentFlatFeeEthPPM uint32 + FulfillmentFlatFeeLinkPPM uint32 + FulfillmentFlatFeeNativePPM uint32 } func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersion) ParseLog(log types.Log) (generated.AbigenLog, error) { @@ -3342,12 +3342,12 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersion) return _VRFCoordinatorV2PlusUpgradedVersion.ParseConfigSet(log) case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["CoordinatorRegistered"].ID: return _VRFCoordinatorV2PlusUpgradedVersion.ParseCoordinatorRegistered(log) - case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["EthFundsRecovered"].ID: - return _VRFCoordinatorV2PlusUpgradedVersion.ParseEthFundsRecovered(log) case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["FundsRecovered"].ID: return _VRFCoordinatorV2PlusUpgradedVersion.ParseFundsRecovered(log) case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["MigrationCompleted"].ID: return _VRFCoordinatorV2PlusUpgradedVersion.ParseMigrationCompleted(log) + case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["NativeFundsRecovered"].ID: + return _VRFCoordinatorV2PlusUpgradedVersion.ParseNativeFundsRecovered(log) case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["OwnershipTransferRequested"].ID: return _VRFCoordinatorV2PlusUpgradedVersion.ParseOwnershipTransferRequested(log) case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["OwnershipTransferred"].ID: @@ -3368,8 +3368,8 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersion) return _VRFCoordinatorV2PlusUpgradedVersion.ParseSubscriptionCreated(log) case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["SubscriptionFunded"].ID: return _VRFCoordinatorV2PlusUpgradedVersion.ParseSubscriptionFunded(log) - case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["SubscriptionFundedWithEth"].ID: - return _VRFCoordinatorV2PlusUpgradedVersion.ParseSubscriptionFundedWithEth(log) + case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["SubscriptionFundedWithNative"].ID: + return _VRFCoordinatorV2PlusUpgradedVersion.ParseSubscriptionFundedWithNative(log) case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["SubscriptionOwnerTransferRequested"].ID: return _VRFCoordinatorV2PlusUpgradedVersion.ParseSubscriptionOwnerTransferRequested(log) case _VRFCoordinatorV2PlusUpgradedVersion.abi.Events["SubscriptionOwnerTransferred"].ID: @@ -3388,10 +3388,6 @@ func (VRFCoordinatorV2PlusUpgradedVersionCoordinatorRegistered) Topic() common.H return common.HexToHash("0xb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af01625") } -func (VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered) Topic() common.Hash { - return common.HexToHash("0x879c9ea2b9d5345b84ccd12610b032602808517cebdb795007f3dcb4df377317") -} - func (VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) Topic() common.Hash { return common.HexToHash("0x59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600") } @@ -3400,6 +3396,10 @@ func (VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted) Topic() common.Hash return common.HexToHash("0xd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187") } +func (VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered) Topic() common.Hash { + return common.HexToHash("0x4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c") +} + func (VRFCoordinatorV2PlusUpgradedVersionOwnershipTransferRequested) Topic() common.Hash { return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") } @@ -3440,8 +3440,8 @@ func (VRFCoordinatorV2PlusUpgradedVersionSubscriptionFunded) Topic() common.Hash return common.HexToHash("0x1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a") } -func (VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth) Topic() common.Hash { - return common.HexToHash("0x3f1ddc3ab1bdb39001ad76ca51a0e6f57ce6627c69f251d1de41622847721cde") +func (VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative) Topic() common.Hash { + return common.HexToHash("0x7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902") } func (VRFCoordinatorV2PlusUpgradedVersionSubscriptionOwnerTransferRequested) Topic() common.Hash { @@ -3461,7 +3461,7 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { LINK(opts *bind.CallOpts) (common.Address, error) - LINKETHFEED(opts *bind.CallOpts) (common.Address, error) + LINKNATIVEFEED(opts *bind.CallOpts) (common.Address, error) MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) @@ -3505,7 +3505,7 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { STotalBalance(opts *bind.CallOpts) (*big.Int, error) - STotalEthBalance(opts *bind.CallOpts) (*big.Int, error) + STotalNativeBalance(opts *bind.CallOpts) (*big.Int, error) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) @@ -3519,7 +3519,7 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { FulfillRandomWords(opts *bind.TransactOpts, proof VRFProof, rc VRFCoordinatorV2PlusUpgradedVersionRequestCommitment) (*types.Transaction, error) - FundSubscriptionWithEth(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + FundSubscriptionWithNative(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) Migrate(opts *bind.TransactOpts, subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) @@ -3529,14 +3529,14 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { OracleWithdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) - OracleWithdrawEth(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) + OracleWithdrawNative(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) OwnerCancelSubscription(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) - RecoverEthFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + RecoverNativeFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + RegisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) RegisterProvingKey(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) @@ -3549,7 +3549,7 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { SetConfig(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig VRFCoordinatorV2PlusUpgradedVersionFeeConfig) (*types.Transaction, error) - SetLINKAndLINKETHFeed(opts *bind.TransactOpts, link common.Address, linkEthFeed common.Address) (*types.Transaction, error) + SetLINKAndLINKNativeFeed(opts *bind.TransactOpts, link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) @@ -3565,12 +3565,6 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { ParseCoordinatorRegistered(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionCoordinatorRegistered, error) - FilterEthFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionEthFundsRecoveredIterator, error) - - WatchEthFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered) (event.Subscription, error) - - ParseEthFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionEthFundsRecovered, error) - FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionFundsRecoveredIterator, error) WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionFundsRecovered) (event.Subscription, error) @@ -3583,6 +3577,12 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { ParseMigrationCompleted(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionMigrationCompleted, error) + FilterNativeFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecoveredIterator, error) + + WatchNativeFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered) (event.Subscription, error) + + ParseNativeFundsRecovered(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionNativeFundsRecovered, error) + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorV2PlusUpgradedVersionOwnershipTransferRequestedIterator, error) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) @@ -3643,11 +3643,11 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { ParseSubscriptionFunded(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFunded, error) - FilterSubscriptionFundedWithEth(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEthIterator, error) + FilterSubscriptionFundedWithNative(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNativeIterator, error) - WatchSubscriptionFundedWithEth(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth, subId []*big.Int) (event.Subscription, error) + WatchSubscriptionFundedWithNative(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative, subId []*big.Int) (event.Subscription, error) - ParseSubscriptionFundedWithEth(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithEth, error) + ParseSubscriptionFundedWithNative(log types.Log) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionFundedWithNative, error) FilterSubscriptionOwnerTransferRequested(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorV2PlusUpgradedVersionSubscriptionOwnerTransferRequestedIterator, error) diff --git a/core/gethwrappers/generated/vrfv2plus_consumer_example/vrfv2plus_consumer_example.go b/core/gethwrappers/generated/vrfv2plus_consumer_example/vrfv2plus_consumer_example.go index 694a9a6f417..2ad412a1223 100644 --- a/core/gethwrappers/generated/vrfv2plus_consumer_example/vrfv2plus_consumer_example.go +++ b/core/gethwrappers/generated/vrfv2plus_consumer_example/vrfv2plus_consumer_example.go @@ -31,8 +31,8 @@ var ( ) var VRFV2PlusConsumerExampleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"createSubscriptionAndFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscriptionAndFundNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"getRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomWord\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkToken\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_recentRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_subId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFMigratableCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinatorApiV1\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"setSubId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"topUpSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"topUpSubscriptionNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"name\":\"updateSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60806040523480156200001157600080fd5b50604051620019c6380380620019c68339810160408190526200003491620001cc565b8133806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000103565b5050600280546001600160a01b03199081166001600160a01b0394851617909155600580548216958416959095179094555060038054909316911617905562000204565b6001600160a01b0381163314156200015e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001c757600080fd5b919050565b60008060408385031215620001e057600080fd5b620001eb83620001af565b9150620001fb60208401620001af565b90509250929050565b6117b280620002146000396000f3fe6080604052600436106101445760003560e01c806380980043116100c0578063b96dbba711610074578063de367c8e11610059578063de367c8e146103c0578063eff27017146103ed578063f2fde38b1461040d57600080fd5b8063b96dbba714610398578063cf62c8ab146103a057600080fd5b80638ea98117116100a55780638ea98117146102c45780639eccacf6146102e4578063a168fa891461031157600080fd5b806380980043146102795780638da5cb5b1461029957600080fd5b806336bfffed11610117578063706da1ca116100fc578063706da1ca146101fc5780637725135b1461021257806379ba50971461026457600080fd5b806336bfffed146101c65780635d7d53e3146101e657600080fd5b80631d2b2afd146101495780631fe543e31461015357806329e5d831146101735780632fa4e442146101a6575b600080fd5b61015161042d565b005b34801561015f57600080fd5b5061015161016e3660046113eb565b610528565b34801561017f57600080fd5b5061019361018e36600461148f565b6105a9565b6040519081526020015b60405180910390f35b3480156101b257600080fd5b506101516101c136600461151c565b6106e6565b3480156101d257600080fd5b506101516101e13660046112f8565b610808565b3480156101f257600080fd5b5061019360045481565b34801561020857600080fd5b5061019360065481565b34801561021e57600080fd5b5060035461023f9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019d565b34801561027057600080fd5b50610151610940565b34801561028557600080fd5b506101516102943660046113b9565b600655565b3480156102a557600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661023f565b3480156102d057600080fd5b506101516102df3660046112d6565b610a3d565b3480156102f057600080fd5b5060025461023f9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561031d57600080fd5b5061036661032c3660046113b9565b6007602052600090815260409020805460019091015460ff821691610100900473ffffffffffffffffffffffffffffffffffffffff169083565b60408051931515845273ffffffffffffffffffffffffffffffffffffffff90921660208401529082015260600161019d565b610151610b48565b3480156103ac57600080fd5b506101516103bb36600461151c565b610bae565b3480156103cc57600080fd5b5060055461023f9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103f957600080fd5b506101516104083660046114b1565b610bf5565b34801561041957600080fd5b506101516104283660046112d6565b610de0565b60065461049b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f737562206e6f742073657400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6005546006546040517fe8509bff000000000000000000000000000000000000000000000000000000008152600481019190915273ffffffffffffffffffffffffffffffffffffffff9091169063e8509bff9034906024015b6000604051808303818588803b15801561050d57600080fd5b505af1158015610521573d6000803e3d6000fd5b5050505050565b60025473ffffffffffffffffffffffffffffffffffffffff16331461059b576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610492565b6105a58282610df4565b5050565b60008281526007602090815260408083208151608081018352815460ff811615158252610100900473ffffffffffffffffffffffffffffffffffffffff16818501526001820154818401526002820180548451818702810187019095528085528695929460608601939092919083018282801561064557602002820191906000526020600020905b815481526020019060010190808311610631575b50505050508152505090508060400151600014156106bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265717565737420494420697320696e636f72726563740000000000000000006044820152606401610492565b806060015183815181106106d5576106d5611739565b602002602001015191505092915050565b60065461074f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f737562206e6f74207365740000000000000000000000000000000000000000006044820152606401610492565b60035460025460065460408051602081019290925273ffffffffffffffffffffffffffffffffffffffff93841693634000aea09316918591015b6040516020818303038152906040526040518463ffffffff1660e01b81526004016107b6939291906115b5565b602060405180830381600087803b1580156107d057600080fd5b505af11580156107e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a5919061139c565b600654610871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f7375624944206e6f7420736574000000000000000000000000000000000000006044820152606401610492565b60005b81518110156105a557600554600654835173ffffffffffffffffffffffffffffffffffffffff9092169163bec4c08c91908590859081106108b7576108b7611739565b60200260200101516040518363ffffffff1660e01b81526004016108fb92919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b600060405180830381600087803b15801561091557600080fd5b505af1158015610929573d6000803e3d6000fd5b505050508080610938906116d9565b915050610874565b60015473ffffffffffffffffffffffffffffffffffffffff1633146109c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610492565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590610a7d575060025473ffffffffffffffffffffffffffffffffffffffff163314155b15610b015733610aa260005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610492565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610b50610ebf565b506005546006546040517fe8509bff000000000000000000000000000000000000000000000000000000008152600481019190915273ffffffffffffffffffffffffffffffffffffffff9091169063e8509bff9034906024016104f4565b610bb6610ebf565b5060035460025460065460408051602081019290925273ffffffffffffffffffffffffffffffffffffffff93841693634000aea0931691859101610789565b60006040518060c0016040528084815260200160065481526020018661ffff1681526020018763ffffffff1681526020018563ffffffff168152602001610c4b6040518060200160405280861515815250611004565b90526002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e90610ca9908590600401611601565b602060405180830381600087803b158015610cc357600080fd5b505af1158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb91906113d2565b604080516080810182526000808252336020808401918252838501868152855184815280830187526060860190815287855260078352959093208451815493517fffffffffffffffffffffff0000000000000000000000000000000000000000009094169015157fffffffffffffffffffffff0000000000000000000000000000000000000000ff161761010073ffffffffffffffffffffffffffffffffffffffff9094169390930292909217825591516001820155925180519495509193849392610dce926002850192910190611239565b50505060049190915550505050505050565b610de86110c0565b610df181611143565b50565b6004548214610e5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265717565737420494420697320696e636f72726563740000000000000000006044820152606401610492565b60008281526007602090815260409091208251610e8492600290920191840190611239565b5050600090815260076020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b600060065460001415610ffd57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610f3657600080fd5b505af1158015610f4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6e91906113d2565b60068190556005546040517fbec4c08c000000000000000000000000000000000000000000000000000000008152600481019290925230602483015273ffffffffffffffffffffffffffffffffffffffff169063bec4c08c90604401600060405180830381600087803b158015610fe457600080fd5b505af1158015610ff8573d6000803e3d6000fd5b505050505b5060065490565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161103d91511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610492565b565b73ffffffffffffffffffffffffffffffffffffffff81163314156111c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610492565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215611274579160200282015b82811115611274578251825591602001919060010190611259565b50611280929150611284565b5090565b5b808211156112805760008155600101611285565b803573ffffffffffffffffffffffffffffffffffffffff811681146112bd57600080fd5b919050565b803563ffffffff811681146112bd57600080fd5b6000602082840312156112e857600080fd5b6112f182611299565b9392505050565b6000602080838503121561130b57600080fd5b823567ffffffffffffffff81111561132257600080fd5b8301601f8101851361133357600080fd5b8035611346611341826116b5565b611666565b80828252848201915084840188868560051b870101111561136657600080fd5b600094505b838510156113905761137c81611299565b83526001949094019391850191850161136b565b50979650505050505050565b6000602082840312156113ae57600080fd5b81516112f181611797565b6000602082840312156113cb57600080fd5b5035919050565b6000602082840312156113e457600080fd5b5051919050565b600080604083850312156113fe57600080fd5b8235915060208084013567ffffffffffffffff81111561141d57600080fd5b8401601f8101861361142e57600080fd5b803561143c611341826116b5565b80828252848201915084840189868560051b870101111561145c57600080fd5b600094505b8385101561147f578035835260019490940193918501918501611461565b5080955050505050509250929050565b600080604083850312156114a257600080fd5b50508035926020909101359150565b600080600080600060a086880312156114c957600080fd5b6114d2866112c2565b9450602086013561ffff811681146114e957600080fd5b93506114f7604087016112c2565b925060608601359150608086013561150e81611797565b809150509295509295909350565b60006020828403121561152e57600080fd5b81356bffffffffffffffffffffffff811681146112f157600080fd5b6000815180845260005b8181101561157057602081850181015186830182015201611554565b81811115611582576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff841681526bffffffffffffffffffffffff831660208201526060604082015260006115f8606083018461154a565b95945050505050565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c08084015261165e60e084018261154a565b949350505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156116ad576116ad611768565b604052919050565b600067ffffffffffffffff8211156116cf576116cf611768565b5060051b60200190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611732577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114610df157600080fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"createSubscriptionAndFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscriptionAndFundNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"getRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomWord\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkToken\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_recentRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_subId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinatorApiV1\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"setSubId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"topUpSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"topUpSubscriptionNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"name\":\"updateSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60806040523480156200001157600080fd5b50604051620019c6380380620019c68339810160408190526200003491620001cc565b8133806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000103565b5050600280546001600160a01b03199081166001600160a01b0394851617909155600580548216958416959095179094555060038054909316911617905562000204565b6001600160a01b0381163314156200015e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001c757600080fd5b919050565b60008060408385031215620001e057600080fd5b620001eb83620001af565b9150620001fb60208401620001af565b90509250929050565b6117b280620002146000396000f3fe6080604052600436106101445760003560e01c806380980043116100c0578063b96dbba711610074578063de367c8e11610059578063de367c8e146103c0578063eff27017146103ed578063f2fde38b1461040d57600080fd5b8063b96dbba714610398578063cf62c8ab146103a057600080fd5b80638ea98117116100a55780638ea98117146102c45780639eccacf6146102e4578063a168fa891461031157600080fd5b806380980043146102795780638da5cb5b1461029957600080fd5b806336bfffed11610117578063706da1ca116100fc578063706da1ca146101fc5780637725135b1461021257806379ba50971461026457600080fd5b806336bfffed146101c65780635d7d53e3146101e657600080fd5b80631d2b2afd146101495780631fe543e31461015357806329e5d831146101735780632fa4e442146101a6575b600080fd5b61015161042d565b005b34801561015f57600080fd5b5061015161016e3660046113eb565b610528565b34801561017f57600080fd5b5061019361018e36600461148f565b6105a9565b6040519081526020015b60405180910390f35b3480156101b257600080fd5b506101516101c136600461151c565b6106e6565b3480156101d257600080fd5b506101516101e13660046112f8565b610808565b3480156101f257600080fd5b5061019360045481565b34801561020857600080fd5b5061019360065481565b34801561021e57600080fd5b5060035461023f9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019d565b34801561027057600080fd5b50610151610940565b34801561028557600080fd5b506101516102943660046113b9565b600655565b3480156102a557600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661023f565b3480156102d057600080fd5b506101516102df3660046112d6565b610a3d565b3480156102f057600080fd5b5060025461023f9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561031d57600080fd5b5061036661032c3660046113b9565b6007602052600090815260409020805460019091015460ff821691610100900473ffffffffffffffffffffffffffffffffffffffff169083565b60408051931515845273ffffffffffffffffffffffffffffffffffffffff90921660208401529082015260600161019d565b610151610b48565b3480156103ac57600080fd5b506101516103bb36600461151c565b610bae565b3480156103cc57600080fd5b5060055461023f9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103f957600080fd5b506101516104083660046114b1565b610bf5565b34801561041957600080fd5b506101516104283660046112d6565b610de0565b60065461049b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f737562206e6f742073657400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6005546006546040517f95b55cfc000000000000000000000000000000000000000000000000000000008152600481019190915273ffffffffffffffffffffffffffffffffffffffff909116906395b55cfc9034906024015b6000604051808303818588803b15801561050d57600080fd5b505af1158015610521573d6000803e3d6000fd5b5050505050565b60025473ffffffffffffffffffffffffffffffffffffffff16331461059b576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610492565b6105a58282610df4565b5050565b60008281526007602090815260408083208151608081018352815460ff811615158252610100900473ffffffffffffffffffffffffffffffffffffffff16818501526001820154818401526002820180548451818702810187019095528085528695929460608601939092919083018282801561064557602002820191906000526020600020905b815481526020019060010190808311610631575b50505050508152505090508060400151600014156106bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265717565737420494420697320696e636f72726563740000000000000000006044820152606401610492565b806060015183815181106106d5576106d5611739565b602002602001015191505092915050565b60065461074f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f737562206e6f74207365740000000000000000000000000000000000000000006044820152606401610492565b60035460025460065460408051602081019290925273ffffffffffffffffffffffffffffffffffffffff93841693634000aea09316918591015b6040516020818303038152906040526040518463ffffffff1660e01b81526004016107b6939291906115b5565b602060405180830381600087803b1580156107d057600080fd5b505af11580156107e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a5919061139c565b600654610871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f7375624944206e6f7420736574000000000000000000000000000000000000006044820152606401610492565b60005b81518110156105a557600554600654835173ffffffffffffffffffffffffffffffffffffffff9092169163bec4c08c91908590859081106108b7576108b7611739565b60200260200101516040518363ffffffff1660e01b81526004016108fb92919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b600060405180830381600087803b15801561091557600080fd5b505af1158015610929573d6000803e3d6000fd5b505050508080610938906116d9565b915050610874565b60015473ffffffffffffffffffffffffffffffffffffffff1633146109c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610492565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590610a7d575060025473ffffffffffffffffffffffffffffffffffffffff163314155b15610b015733610aa260005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610492565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610b50610ebf565b506005546006546040517f95b55cfc000000000000000000000000000000000000000000000000000000008152600481019190915273ffffffffffffffffffffffffffffffffffffffff909116906395b55cfc9034906024016104f4565b610bb6610ebf565b5060035460025460065460408051602081019290925273ffffffffffffffffffffffffffffffffffffffff93841693634000aea0931691859101610789565b60006040518060c0016040528084815260200160065481526020018661ffff1681526020018763ffffffff1681526020018563ffffffff168152602001610c4b6040518060200160405280861515815250611004565b90526002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e90610ca9908590600401611601565b602060405180830381600087803b158015610cc357600080fd5b505af1158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb91906113d2565b604080516080810182526000808252336020808401918252838501868152855184815280830187526060860190815287855260078352959093208451815493517fffffffffffffffffffffff0000000000000000000000000000000000000000009094169015157fffffffffffffffffffffff0000000000000000000000000000000000000000ff161761010073ffffffffffffffffffffffffffffffffffffffff9094169390930292909217825591516001820155925180519495509193849392610dce926002850192910190611239565b50505060049190915550505050505050565b610de86110c0565b610df181611143565b50565b6004548214610e5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265717565737420494420697320696e636f72726563740000000000000000006044820152606401610492565b60008281526007602090815260409091208251610e8492600290920191840190611239565b5050600090815260076020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b600060065460001415610ffd57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610f3657600080fd5b505af1158015610f4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6e91906113d2565b60068190556005546040517fbec4c08c000000000000000000000000000000000000000000000000000000008152600481019290925230602483015273ffffffffffffffffffffffffffffffffffffffff169063bec4c08c90604401600060405180830381600087803b158015610fe457600080fd5b505af1158015610ff8573d6000803e3d6000fd5b505050505b5060065490565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161103d91511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610492565b565b73ffffffffffffffffffffffffffffffffffffffff81163314156111c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610492565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215611274579160200282015b82811115611274578251825591602001919060010190611259565b50611280929150611284565b5090565b5b808211156112805760008155600101611285565b803573ffffffffffffffffffffffffffffffffffffffff811681146112bd57600080fd5b919050565b803563ffffffff811681146112bd57600080fd5b6000602082840312156112e857600080fd5b6112f182611299565b9392505050565b6000602080838503121561130b57600080fd5b823567ffffffffffffffff81111561132257600080fd5b8301601f8101851361133357600080fd5b8035611346611341826116b5565b611666565b80828252848201915084840188868560051b870101111561136657600080fd5b600094505b838510156113905761137c81611299565b83526001949094019391850191850161136b565b50979650505050505050565b6000602082840312156113ae57600080fd5b81516112f181611797565b6000602082840312156113cb57600080fd5b5035919050565b6000602082840312156113e457600080fd5b5051919050565b600080604083850312156113fe57600080fd5b8235915060208084013567ffffffffffffffff81111561141d57600080fd5b8401601f8101861361142e57600080fd5b803561143c611341826116b5565b80828252848201915084840189868560051b870101111561145c57600080fd5b600094505b8385101561147f578035835260019490940193918501918501611461565b5080955050505050509250929050565b600080604083850312156114a257600080fd5b50508035926020909101359150565b600080600080600060a086880312156114c957600080fd5b6114d2866112c2565b9450602086013561ffff811681146114e957600080fd5b93506114f7604087016112c2565b925060608601359150608086013561150e81611797565b809150509295509295909350565b60006020828403121561152e57600080fd5b81356bffffffffffffffffffffffff811681146112f157600080fd5b6000815180845260005b8181101561157057602081850181015186830182015201611554565b81811115611582576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff841681526bffffffffffffffffffffffff831660208201526060604082015260006115f8606083018461154a565b95945050505050565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c08084015261165e60e084018261154a565b949350505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156116ad576116ad611768565b604052919050565b600067ffffffffffffffff8211156116cf576116cf611768565b5060051b60200190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611732577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114610df157600080fdfea164736f6c6343000806000a", } var VRFV2PlusConsumerExampleABI = VRFV2PlusConsumerExampleMetaData.ABI diff --git a/core/gethwrappers/generated/vrfv2plus_reverting_example/vrfv2plus_reverting_example.go b/core/gethwrappers/generated/vrfv2plus_reverting_example/vrfv2plus_reverting_example.go index 413f3e52b28..d5a58fa0f9a 100644 --- a/core/gethwrappers/generated/vrfv2plus_reverting_example/vrfv2plus_reverting_example.go +++ b/core/gethwrappers/generated/vrfv2plus_reverting_example/vrfv2plus_reverting_example.go @@ -31,7 +31,7 @@ var ( ) var VRFV2PlusRevertingExampleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"createSubscriptionAndFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"minReqConfs\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_gasAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_randomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_subId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFMigratableCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"topUpSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"name\":\"updateSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"createSubscriptionAndFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"minReqConfs\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_gasAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_randomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_subId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"topUpSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"name\":\"updateSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x60806040523480156200001157600080fd5b506040516200121f3803806200121f8339810160408190526200003491620001cc565b8133806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000103565b5050600280546001600160a01b03199081166001600160a01b0394851617909155600580548216958416959095179094555060068054909316911617905562000204565b6001600160a01b0381163314156200015e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001c757600080fd5b919050565b60008060408385031215620001e057600080fd5b620001eb83620001af565b9150620001fb60208401620001af565b90509250929050565b61100b80620002146000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638ea981171161008c578063e89e106a11610066578063e89e106a146101e6578063f08c5daa146101ef578063f2fde38b146101f8578063f6eaffc81461020b57600080fd5b80638ea98117146101a05780639eccacf6146101b3578063cf62c8ab146101d357600080fd5b806336bfffed116100c857806336bfffed1461013d578063706da1ca1461015057806379ba5097146101595780638da5cb5b1461016157600080fd5b80631fe543e3146100ef5780632e75964e146101045780632fa4e4421461012a575b600080fd5b6101026100fd366004610cdf565b61021e565b005b610117610112366004610c4d565b6102a4565b6040519081526020015b60405180910390f35b610102610138366004610d83565b6103a1565b61010261014b366004610b87565b6104c3565b61011760075481565b6101026105fb565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610121565b6101026101ae366004610b65565b6106f8565b60025461017b9073ffffffffffffffffffffffffffffffffffffffff1681565b6101026101e1366004610d83565b610803565b61011760045481565b61011760085481565b610102610206366004610b65565b61097a565b610117610219366004610cad565b61098e565b60025473ffffffffffffffffffffffffffffffffffffffff163314610296576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b6102a08282600080fd5b5050565b6040805160c081018252868152602080820187905261ffff86168284015263ffffffff80861660608401528416608083015282519081018352600080825260a083019190915260055492517f9b1c385e000000000000000000000000000000000000000000000000000000008152909273ffffffffffffffffffffffffffffffffffffffff1690639b1c385e9061033f908490600401610e68565b602060405180830381600087803b15801561035957600080fd5b505af115801561036d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103919190610cc6565b6004819055979650505050505050565b60075461040a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f737562206e6f7420736574000000000000000000000000000000000000000000604482015260640161028d565b60065460055460075460408051602081019290925273ffffffffffffffffffffffffffffffffffffffff93841693634000aea09316918591015b6040516020818303038152906040526040518463ffffffff1660e01b815260040161047193929190610e1c565b602060405180830381600087803b15801561048b57600080fd5b505af115801561049f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a09190610c2b565b60075461052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f7375624944206e6f742073657400000000000000000000000000000000000000604482015260640161028d565b60005b81518110156102a057600554600754835173ffffffffffffffffffffffffffffffffffffffff9092169163bec4c08c919085908590811061057257610572610fa0565b60200260200101516040518363ffffffff1660e01b81526004016105b692919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b600060405180830381600087803b1580156105d057600080fd5b505af11580156105e4573d6000803e3d6000fd5b5050505080806105f390610f40565b91505061052f565b60015473ffffffffffffffffffffffffffffffffffffffff16331461067c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161028d565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590610738575060025473ffffffffffffffffffffffffffffffffffffffff163314155b156107bc573361075d60005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015291909116604482015260640161028d565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60075461040a57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561087457600080fd5b505af1158015610888573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ac9190610cc6565b60078190556005546040517fbec4c08c000000000000000000000000000000000000000000000000000000008152600481019290925230602483015273ffffffffffffffffffffffffffffffffffffffff169063bec4c08c90604401600060405180830381600087803b15801561092257600080fd5b505af1158015610936573d6000803e3d6000fd5b5050505060065460055460075460405173ffffffffffffffffffffffffffffffffffffffff93841693634000aea09316918591610444919060200190815260200190565b6109826109af565b61098b81610a32565b50565b6003818154811061099e57600080fd5b600091825260209091200154905081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161028d565b565b73ffffffffffffffffffffffffffffffffffffffff8116331415610ab2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161028d565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b4c57600080fd5b919050565b803563ffffffff81168114610b4c57600080fd5b600060208284031215610b7757600080fd5b610b8082610b28565b9392505050565b60006020808385031215610b9a57600080fd5b823567ffffffffffffffff811115610bb157600080fd5b8301601f81018513610bc257600080fd5b8035610bd5610bd082610f1c565b610ecd565b80828252848201915084840188868560051b8701011115610bf557600080fd5b600094505b83851015610c1f57610c0b81610b28565b835260019490940193918501918501610bfa565b50979650505050505050565b600060208284031215610c3d57600080fd5b81518015158114610b8057600080fd5b600080600080600060a08688031215610c6557600080fd5b8535945060208601359350604086013561ffff81168114610c8557600080fd5b9250610c9360608701610b51565b9150610ca160808701610b51565b90509295509295909350565b600060208284031215610cbf57600080fd5b5035919050565b600060208284031215610cd857600080fd5b5051919050565b60008060408385031215610cf257600080fd5b8235915060208084013567ffffffffffffffff811115610d1157600080fd5b8401601f81018613610d2257600080fd5b8035610d30610bd082610f1c565b80828252848201915084840189868560051b8701011115610d5057600080fd5b600094505b83851015610d73578035835260019490940193918501918501610d55565b5080955050505050509250929050565b600060208284031215610d9557600080fd5b81356bffffffffffffffffffffffff81168114610b8057600080fd5b6000815180845260005b81811015610dd757602081850181015186830182015201610dbb565b81811115610de9576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff841681526bffffffffffffffffffffffff83166020820152606060408201526000610e5f6060830184610db1565b95945050505050565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c080840152610ec560e0840182610db1565b949350505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610f1457610f14610fcf565b604052919050565b600067ffffffffffffffff821115610f3657610f36610fcf565b5060051b60200190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610f99577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go index 26f471725ca..0fa54876b7c 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go @@ -31,15 +31,15 @@ var ( ) var VRFV2PlusWrapperMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkEthFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractExtendedVRFCoordinatorV2PlusInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"requestGasPrice\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkEthFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFMigratableCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkEthFeed\",\"type\":\"address\"}],\"name\":\"setLinkEthFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60c06040526004805463ffffffff60a01b1916609160a21b1790553480156200002757600080fd5b50604051620030e7380380620030e78339810160408190526200004a9162000317565b803380600081620000a25760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d557620000d5816200024e565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200011857600380546001600160a01b0319166001600160a01b0385161790555b6001600160a01b038216156200014457600480546001600160a01b0319166001600160a01b0384161790555b806001600160a01b03166080816001600160a01b031660601b815250506000816001600160a01b031663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156200019f57600080fd5b505af1158015620001b4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001da919062000361565b60a0819052604051632fb1302360e21b8152600481018290523060248201529091506001600160a01b0383169063bec4c08c90604401600060405180830381600087803b1580156200022b57600080fd5b505af115801562000240573d6000803e3d6000fd5b50505050505050506200037b565b6001600160a01b038116331415620002a95760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000099565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031257600080fd5b919050565b6000806000606084860312156200032d57600080fd5b6200033884620002fa565b92506200034860208501620002fa565b91506200035860408501620002fa565b90509250925092565b6000602082840312156200037457600080fd5b5051919050565b60805160601c60a051612d12620003d5600039600081816101ef01528181610d2301526115e40152600081816102f901528181610ded0152818161166b0152818161197301528181611a540152611aef0152612d126000f3fe6080604052600436106101d85760003560e01c80638da5cb5b11610102578063bf17e55911610095578063da4f5e6d11610064578063da4f5e6d146106ff578063f2fde38b1461072c578063f3fef3a31461074c578063fc2a88c31461076c57600080fd5b8063bf17e559146105cd578063c15ce4d7146105ed578063c3f909d41461060d578063cdd8d885146106b557600080fd5b8063a02e0616116100d1578063a02e061614610559578063a3907d7114610579578063a4c0ed361461058e578063a608a1e1146105ae57600080fd5b80638da5cb5b146104c15780638ea98117146104ec578063981837d51461050c5780639eccacf61461052c57600080fd5b80634306d3541161017a57806361d386661161014957806361d386661461044c57806362a504fc1461047957806379ba50971461048c5780637fb5d19d146104a157600080fd5b80634306d3541461034057806348baa1c5146103605780634b1609351461040257806357a8070a1461042257600080fd5b80631fe543e3116101b65780631fe543e3146102925780632f2770db146102b25780633255c456146102c75780633b2bcbf1146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f36600461263a565b610782565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612aa8565b34801561029e57600080fd5b506102446102ad36600461279e565b61085e565b3480156102be57600080fd5b506102446108df565b3480156102d357600080fd5b506102116102e236600461293f565b610915565b3480156102f357600080fd5b5061031b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b34801561034c57600080fd5b5061021161035b3660046128d7565b610a0d565b34801561036c57600080fd5b506103cb61037b366004612785565b600b602052600090815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff82169174010000000000000000000000000000000000000000900463ffffffff169083565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff90921660208401529082015260600161021b565b34801561040e57600080fd5b5061021161041d3660046128d7565b610b14565b34801561042e57600080fd5b5060065461043c9060ff1681565b604051901515815260200161021b565b34801561045857600080fd5b5060045461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b6102116104873660046128f4565b610c0b565b34801561049857600080fd5b50610244610f1d565b3480156104ad57600080fd5b506102116104bc36600461293f565b61101a565b3480156104cd57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661031b565b3480156104f857600080fd5b5061024461050736600461261f565b611120565b34801561051857600080fd5b5061024461052736600461261f565b61122b565b34801561053857600080fd5b5060025461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561056557600080fd5b5061024461057436600461261f565b61127a565b34801561058557600080fd5b50610244611319565b34801561059a57600080fd5b506102446105a9366004612664565b61134b565b3480156105ba57600080fd5b5060065461043c90610100900460ff1681565b3480156105d957600080fd5b506102446105e83660046128d7565b6117cb565b3480156105f957600080fd5b50610244610608366004612997565b611822565b34801561061957600080fd5b50600754600854600954600a546040805194855263ffffffff808516602087015264010000000085048116918601919091526c01000000000000000000000000840481166060860152700100000000000000000000000000000000840416608085015260ff74010000000000000000000000000000000000000000909304831660a085015260c08401919091521660e08201526101000161021b565b3480156106c157600080fd5b506004546106ea9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b34801561070b57600080fd5b5060035461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561073857600080fd5b5061024461074736600461261f565b611bfe565b34801561075857600080fd5b5061024461076736600461263a565b611c12565b34801561077857600080fd5b5061021160055481565b61078a611cfc565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107e4576040519150601f19603f3d011682016040523d82523d6000602084013e6107e9565b606091505b5050905080610859576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108d1576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610850565b6108db8282611d7f565b5050565b6108e7611cfc565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60065460009060ff16610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff16156109f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b610a068363ffffffff1683611f6b565b9392505050565b60065460009060ff16610a7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615610aee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b6000610af861207c565b9050610b0b8363ffffffff163a836121cb565b9150505b919050565b60065460009060ff16610b83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615610bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b610c058263ffffffff163a611f6b565b92915050565b600080610c17856122f8565b90506000610c2b8663ffffffff163a611f6b565b905080341015610c97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610850565b600a5460ff1663ffffffff85161115610d0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610850565b60006040518060c0016040528060095481526020017f000000000000000000000000000000000000000000000000000000000000000081526020018761ffff1681526020016008600c9054906101000a900463ffffffff16858a610d709190612b7e565b610d7a9190612b7e565b63ffffffff1681526020018663ffffffff168152602001610dab604051806020016040528060011515815250612310565b90526040517f9b1c385e00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b1c385e90610e22908490600401612abb565b602060405180830381600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e74919061270d565b6040805160608101825233815263ffffffff808b1660208084019182523a8486019081526000878152600b90925294902092518354915190921674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090911673ffffffffffffffffffffffffffffffffffffffff9290921691909117178155905160019091015593505050509392505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610f9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610850565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60065460009060ff16611089576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff16156110fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b600061110561207c565b90506111188463ffffffff1684836121cb565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590611160575060025473ffffffffffffffffffffffffffffffffffffffff163314155b156111e4573361118560005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610850565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611233611cfc565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611282611cfc565b60035473ffffffffffffffffffffffffffffffffffffffff16156112d2576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611321611cfc565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60065460ff166113b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615611429576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b60035473ffffffffffffffffffffffffffffffffffffffff1633146114aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610850565b600080806114ba848601866128f4565b92509250925060006114cb846122f8565b905060006114d761207c565b905060006114ec8663ffffffff163a846121cb565b905080891015611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610850565b600a5460ff1663ffffffff851611156115cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610850565b60006040518060c0016040528060095481526020017f000000000000000000000000000000000000000000000000000000000000000081526020018761ffff1681526020016008600c9054906101000a900463ffffffff16868a6116319190612b7e565b61163b9190612b7e565b63ffffffff1681526020018663ffffffff16815260200160405180602001604052806000815250815250905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016116c29190612abb565b602060405180830381600087803b1580156116dc57600080fd5b505af11580156116f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611714919061270d565b6040805160608101825273ffffffffffffffffffffffffffffffffffffffff9e8f16815263ffffffff9a8b1660208083019182523a8385019081526000868152600b909252939020915182549151909c1674010000000000000000000000000000000000000000027fffffffffffffffff0000000000000000000000000000000000000000000000009091169b909f169a909a179d909d1789559b5160019098019790975550505060059790975550505050505050565b6117d3611cfc565b6004805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b61182a611cfc565b6008805460ff80861674010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff63ffffffff898116700100000000000000000000000000000000027fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff918c166c0100000000000000000000000002919091167fffffffffffffffffffffffff0000000000000000ffffffffffffffffffffffff909516949094179390931792909216919091179091556009839055600a80549183167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00928316179055600680549091166001179055604080517f088070f5000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163088070f5916004828101926080929190829003018186803b1580156119b957600080fd5b505afa1580156119cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f19190612726565b50600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f043bd6ae00000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163043bd6ae916004808301926020929190829003018186803b158015611aaf57600080fd5b505afa158015611ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae7919061270d565b6007819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636b6feccc6040518163ffffffff1660e01b8152600401604080518083038186803b158015611b5257600080fd5b505afa158015611b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8a919061295d565b600880547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff166801000000000000000063ffffffff938416027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff161764010000000093909216929092021790555050505050565b611c06611cfc565b611c0f816123cc565b50565b611c1a611cfc565b6003546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b158015611c8e57600080fd5b505af1158015611ca2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc691906126eb565b6108db576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611d7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610850565b565b6000828152600b602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008304168387015260018401805495840195909552898852959094527fffffffffffffffff000000000000000000000000000000000000000000000000909316905592909255815116611e7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610850565b600080631fe543e360e01b8585604051602401611e9b929190612b18565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611f15846020015163ffffffff168560000151846124c2565b905080611f6357835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6004546000908190611f9a9074010000000000000000000000000000000000000000900463ffffffff1661250e565b60085463ffffffff7001000000000000000000000000000000008204811691611fd5916c010000000000000000000000009091041687612b66565b611fdf9190612b66565b611fe99085612c02565b611ff39190612b66565b60085490915081906000906064906120269074010000000000000000000000000000000000000000900460ff1682612ba6565b6120339060ff1684612c02565b61203d9190612bcb565b6008549091506000906120679068010000000000000000900463ffffffff1664e8d4a51000612c02565b6120719083612b66565b979650505050505050565b60085460048054604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009463ffffffff161515938593849373ffffffffffffffffffffffffffffffffffffffff9091169263feaf968c928281019260a0929190829003018186803b1580156120f857600080fd5b505afa15801561210c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213091906129f9565b509450909250849150508015612156575061214b8242612c3f565b60085463ffffffff16105b1561216057506007545b6000811215610a06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610850565b60045460009081906121fa9074010000000000000000000000000000000000000000900463ffffffff1661250e565b60085463ffffffff7001000000000000000000000000000000008204811691612235916c010000000000000000000000009091041688612b66565b61223f9190612b66565b6122499086612c02565b6122539190612b66565b905060008361226a83670de0b6b3a7640000612c02565b6122749190612bcb565b6008549091506000906064906122a59074010000000000000000000000000000000000000000900460ff1682612ba6565b6122b29060ff1684612c02565b6122bc9190612bcb565b6008549091506000906122e290640100000000900463ffffffff1664e8d4a51000612c02565b6122ec9083612b66565b98975050505050505050565b6000612305603f83612bdf565b610c05906001612b7e565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161234991511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff811633141561244c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610850565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a6113888110156124d457600080fd5b6113888103905084604082048203116124ec57600080fd5b50823b6124f857600080fd5b60008083516020850160008789f1949350505050565b60004661a4b1811480612523575062066eed81145b156125c7576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561257157600080fd5b505afa158015612585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a9919061288d565b5050505091505083608c6125bd9190612b66565b6111189082612c02565b50600092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b0f57600080fd5b803560ff81168114610b0f57600080fd5b805169ffffffffffffffffffff81168114610b0f57600080fd5b60006020828403121561263157600080fd5b610a06826125d0565b6000806040838503121561264d57600080fd5b612656836125d0565b946020939093013593505050565b6000806000806060858703121561267a57600080fd5b612683856125d0565b935060208501359250604085013567ffffffffffffffff808211156126a757600080fd5b818701915087601f8301126126bb57600080fd5b8135818111156126ca57600080fd5b8860208285010111156126dc57600080fd5b95989497505060200194505050565b6000602082840312156126fd57600080fd5b81518015158114610a0657600080fd5b60006020828403121561271f57600080fd5b5051919050565b6000806000806080858703121561273c57600080fd5b845161274781612ce3565b602086015190945061275881612cf3565b604086015190935061276981612cf3565b606086015190925061277a81612cf3565b939692955090935050565b60006020828403121561279757600080fd5b5035919050565b600080604083850312156127b157600080fd5b8235915060208084013567ffffffffffffffff808211156127d157600080fd5b818601915086601f8301126127e557600080fd5b8135818111156127f7576127f7612cb4565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561283a5761283a612cb4565b604052828152858101935084860182860187018b101561285957600080fd5b600095505b8386101561287c57803585526001959095019493860193860161285e565b508096505050505050509250929050565b60008060008060008060c087890312156128a657600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b6000602082840312156128e957600080fd5b8135610a0681612cf3565b60008060006060848603121561290957600080fd5b833561291481612cf3565b9250602084013561292481612ce3565b9150604084013561293481612cf3565b809150509250925092565b6000806040838503121561295257600080fd5b823561265681612cf3565b6000806040838503121561297057600080fd5b825161297b81612cf3565b602084015190925061298c81612cf3565b809150509250929050565b600080600080600060a086880312156129af57600080fd5b85356129ba81612cf3565b945060208601356129ca81612cf3565b93506129d8604087016125f4565b9250606086013591506129ed608087016125f4565b90509295509295909350565b600080600080600060a08688031215612a1157600080fd5b612a1a86612605565b94506020860151935060408601519250606086015191506129ed60808701612605565b6000815180845260005b81811015612a6357602081850181015186830182015201612a47565b81811115612a75576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a066020830184612a3d565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c08084015261111860e0840182612a3d565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612b5957845183529383019391830191600101612b3d565b5090979650505050505050565b60008219821115612b7957612b79612c56565b500190565b600063ffffffff808316818516808303821115612b9d57612b9d612c56565b01949350505050565b600060ff821660ff84168060ff03821115612bc357612bc3612c56565b019392505050565b600082612bda57612bda612c85565b500490565b600063ffffffff80841680612bf657612bf6612c85565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c3a57612c3a612c56565b500290565b600082821015612c5157612c51612c56565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff81168114611c0f57600080fd5b63ffffffff81168114611c0f57600080fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractExtendedVRFCoordinatorV2PlusInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"requestGasPrice\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60c06040526004805463ffffffff60a01b1916609160a21b1790553480156200002757600080fd5b50604051620030e7380380620030e78339810160408190526200004a9162000317565b803380600081620000a25760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d557620000d5816200024e565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200011857600380546001600160a01b0319166001600160a01b0385161790555b6001600160a01b038216156200014457600480546001600160a01b0319166001600160a01b0384161790555b806001600160a01b03166080816001600160a01b031660601b815250506000816001600160a01b031663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156200019f57600080fd5b505af1158015620001b4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001da919062000361565b60a0819052604051632fb1302360e21b8152600481018290523060248201529091506001600160a01b0383169063bec4c08c90604401600060405180830381600087803b1580156200022b57600080fd5b505af115801562000240573d6000803e3d6000fd5b50505050505050506200037b565b6001600160a01b038116331415620002a95760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000099565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031257600080fd5b919050565b6000806000606084860312156200032d57600080fd5b6200033884620002fa565b92506200034860208501620002fa565b91506200035860408501620002fa565b90509250925092565b6000602082840312156200037457600080fd5b5051919050565b60805160601c60a051612d12620003d5600039600081816101ef01528181610d2301526115e40152600081816102f901528181610ded0152818161166b0152818161197301528181611a540152611aef0152612d126000f3fe6080604052600436106101d85760003560e01c80638da5cb5b11610102578063c15ce4d711610095578063f254bdc711610064578063f254bdc7146106ff578063f2fde38b1461072c578063f3fef3a31461074c578063fc2a88c31461076c57600080fd5b8063c15ce4d7146105c0578063c3f909d4146105e0578063cdd8d88514610688578063da4f5e6d146106d257600080fd5b8063a3907d71116100d1578063a3907d711461054c578063a4c0ed3614610561578063a608a1e114610581578063bf17e559146105a057600080fd5b80638da5cb5b146104b45780638ea98117146104df5780639eccacf6146104ff578063a02e06161461052c57600080fd5b80634306d3541161017a57806362a504fc1161014957806362a504fc1461044c578063650596541461045f57806379ba50971461047f5780637fb5d19d1461049457600080fd5b80634306d3541461034057806348baa1c5146103605780634b1609351461040257806357a8070a1461042257600080fd5b80631fe543e3116101b65780631fe543e3146102925780632f2770db146102b25780633255c456146102c75780633b2bcbf1146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f36600461263a565b610782565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612aa8565b34801561029e57600080fd5b506102446102ad36600461279e565b61085e565b3480156102be57600080fd5b506102446108df565b3480156102d357600080fd5b506102116102e236600461293f565b610915565b3480156102f357600080fd5b5061031b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b34801561034c57600080fd5b5061021161035b3660046128d7565b610a0d565b34801561036c57600080fd5b506103cb61037b366004612785565b600b602052600090815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff82169174010000000000000000000000000000000000000000900463ffffffff169083565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff90921660208401529082015260600161021b565b34801561040e57600080fd5b5061021161041d3660046128d7565b610b14565b34801561042e57600080fd5b5060065461043c9060ff1681565b604051901515815260200161021b565b61021161045a3660046128f4565b610c0b565b34801561046b57600080fd5b5061024461047a36600461261f565b610f1d565b34801561048b57600080fd5b50610244610f6c565b3480156104a057600080fd5b506102116104af36600461293f565b611069565b3480156104c057600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661031b565b3480156104eb57600080fd5b506102446104fa36600461261f565b61116f565b34801561050b57600080fd5b5060025461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561053857600080fd5b5061024461054736600461261f565b61127a565b34801561055857600080fd5b50610244611319565b34801561056d57600080fd5b5061024461057c366004612664565b61134b565b34801561058d57600080fd5b5060065461043c90610100900460ff1681565b3480156105ac57600080fd5b506102446105bb3660046128d7565b6117cb565b3480156105cc57600080fd5b506102446105db366004612997565b611822565b3480156105ec57600080fd5b50600754600854600954600a546040805194855263ffffffff808516602087015264010000000085048116918601919091526c01000000000000000000000000840481166060860152700100000000000000000000000000000000840416608085015260ff74010000000000000000000000000000000000000000909304831660a085015260c08401919091521660e08201526101000161021b565b34801561069457600080fd5b506004546106bd9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106de57600080fd5b5060035461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561070b57600080fd5b5060045461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561073857600080fd5b5061024461074736600461261f565b611bfe565b34801561075857600080fd5b5061024461076736600461263a565b611c12565b34801561077857600080fd5b5061021160055481565b61078a611cfc565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107e4576040519150601f19603f3d011682016040523d82523d6000602084013e6107e9565b606091505b5050905080610859576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108d1576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610850565b6108db8282611d7f565b5050565b6108e7611cfc565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60065460009060ff16610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff16156109f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b610a068363ffffffff1683611f6b565b9392505050565b60065460009060ff16610a7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615610aee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b6000610af861207c565b9050610b0b8363ffffffff163a836121cb565b9150505b919050565b60065460009060ff16610b83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615610bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b610c058263ffffffff163a611f6b565b92915050565b600080610c17856122f8565b90506000610c2b8663ffffffff163a611f6b565b905080341015610c97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610850565b600a5460ff1663ffffffff85161115610d0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610850565b60006040518060c0016040528060095481526020017f000000000000000000000000000000000000000000000000000000000000000081526020018761ffff1681526020016008600c9054906101000a900463ffffffff16858a610d709190612b7e565b610d7a9190612b7e565b63ffffffff1681526020018663ffffffff168152602001610dab604051806020016040528060011515815250612310565b90526040517f9b1c385e00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b1c385e90610e22908490600401612abb565b602060405180830381600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e74919061270d565b6040805160608101825233815263ffffffff808b1660208084019182523a8486019081526000878152600b90925294902092518354915190921674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090911673ffffffffffffffffffffffffffffffffffffffff9290921691909117178155905160019091015593505050509392505050565b610f25611cfc565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610fed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610850565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60065460009060ff166110d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff161561114a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b600061115461207c565b90506111678463ffffffff1684836121cb565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906111af575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561123357336111d460005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610850565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611282611cfc565b60035473ffffffffffffffffffffffffffffffffffffffff16156112d2576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611321611cfc565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60065460ff166113b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615611429576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b60035473ffffffffffffffffffffffffffffffffffffffff1633146114aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610850565b600080806114ba848601866128f4565b92509250925060006114cb846122f8565b905060006114d761207c565b905060006114ec8663ffffffff163a846121cb565b905080891015611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610850565b600a5460ff1663ffffffff851611156115cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610850565b60006040518060c0016040528060095481526020017f000000000000000000000000000000000000000000000000000000000000000081526020018761ffff1681526020016008600c9054906101000a900463ffffffff16868a6116319190612b7e565b61163b9190612b7e565b63ffffffff1681526020018663ffffffff16815260200160405180602001604052806000815250815250905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016116c29190612abb565b602060405180830381600087803b1580156116dc57600080fd5b505af11580156116f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611714919061270d565b6040805160608101825273ffffffffffffffffffffffffffffffffffffffff9e8f16815263ffffffff9a8b1660208083019182523a8385019081526000868152600b909252939020915182549151909c1674010000000000000000000000000000000000000000027fffffffffffffffff0000000000000000000000000000000000000000000000009091169b909f169a909a179d909d1789559b5160019098019790975550505060059790975550505050505050565b6117d3611cfc565b6004805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b61182a611cfc565b6008805460ff80861674010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff63ffffffff898116700100000000000000000000000000000000027fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff918c166c0100000000000000000000000002919091167fffffffffffffffffffffffff0000000000000000ffffffffffffffffffffffff909516949094179390931792909216919091179091556009839055600a80549183167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00928316179055600680549091166001179055604080517f088070f5000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163088070f5916004828101926080929190829003018186803b1580156119b957600080fd5b505afa1580156119cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f19190612726565b50600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f043bd6ae00000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163043bd6ae916004808301926020929190829003018186803b158015611aaf57600080fd5b505afa158015611ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae7919061270d565b6007819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636b6feccc6040518163ffffffff1660e01b8152600401604080518083038186803b158015611b5257600080fd5b505afa158015611b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8a919061295d565b600880547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff166801000000000000000063ffffffff938416027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff161764010000000093909216929092021790555050505050565b611c06611cfc565b611c0f816123cc565b50565b611c1a611cfc565b6003546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b158015611c8e57600080fd5b505af1158015611ca2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc691906126eb565b6108db576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611d7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610850565b565b6000828152600b602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008304168387015260018401805495840195909552898852959094527fffffffffffffffff000000000000000000000000000000000000000000000000909316905592909255815116611e7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610850565b600080631fe543e360e01b8585604051602401611e9b929190612b18565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611f15846020015163ffffffff168560000151846124c2565b905080611f6357835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6004546000908190611f9a9074010000000000000000000000000000000000000000900463ffffffff1661250e565b60085463ffffffff7001000000000000000000000000000000008204811691611fd5916c010000000000000000000000009091041687612b66565b611fdf9190612b66565b611fe99085612c02565b611ff39190612b66565b60085490915081906000906064906120269074010000000000000000000000000000000000000000900460ff1682612ba6565b6120339060ff1684612c02565b61203d9190612bcb565b6008549091506000906120679068010000000000000000900463ffffffff1664e8d4a51000612c02565b6120719083612b66565b979650505050505050565b60085460048054604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009463ffffffff161515938593849373ffffffffffffffffffffffffffffffffffffffff9091169263feaf968c928281019260a0929190829003018186803b1580156120f857600080fd5b505afa15801561210c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213091906129f9565b509450909250849150508015612156575061214b8242612c3f565b60085463ffffffff16105b1561216057506007545b6000811215610a06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610850565b60045460009081906121fa9074010000000000000000000000000000000000000000900463ffffffff1661250e565b60085463ffffffff7001000000000000000000000000000000008204811691612235916c010000000000000000000000009091041688612b66565b61223f9190612b66565b6122499086612c02565b6122539190612b66565b905060008361226a83670de0b6b3a7640000612c02565b6122749190612bcb565b6008549091506000906064906122a59074010000000000000000000000000000000000000000900460ff1682612ba6565b6122b29060ff1684612c02565b6122bc9190612bcb565b6008549091506000906122e290640100000000900463ffffffff1664e8d4a51000612c02565b6122ec9083612b66565b98975050505050505050565b6000612305603f83612bdf565b610c05906001612b7e565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161234991511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff811633141561244c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610850565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a6113888110156124d457600080fd5b6113888103905084604082048203116124ec57600080fd5b50823b6124f857600080fd5b60008083516020850160008789f1949350505050565b60004661a4b1811480612523575062066eed81145b156125c7576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561257157600080fd5b505afa158015612585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a9919061288d565b5050505091505083608c6125bd9190612b66565b6111679082612c02565b50600092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b0f57600080fd5b803560ff81168114610b0f57600080fd5b805169ffffffffffffffffffff81168114610b0f57600080fd5b60006020828403121561263157600080fd5b610a06826125d0565b6000806040838503121561264d57600080fd5b612656836125d0565b946020939093013593505050565b6000806000806060858703121561267a57600080fd5b612683856125d0565b935060208501359250604085013567ffffffffffffffff808211156126a757600080fd5b818701915087601f8301126126bb57600080fd5b8135818111156126ca57600080fd5b8860208285010111156126dc57600080fd5b95989497505060200194505050565b6000602082840312156126fd57600080fd5b81518015158114610a0657600080fd5b60006020828403121561271f57600080fd5b5051919050565b6000806000806080858703121561273c57600080fd5b845161274781612ce3565b602086015190945061275881612cf3565b604086015190935061276981612cf3565b606086015190925061277a81612cf3565b939692955090935050565b60006020828403121561279757600080fd5b5035919050565b600080604083850312156127b157600080fd5b8235915060208084013567ffffffffffffffff808211156127d157600080fd5b818601915086601f8301126127e557600080fd5b8135818111156127f7576127f7612cb4565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561283a5761283a612cb4565b604052828152858101935084860182860187018b101561285957600080fd5b600095505b8386101561287c57803585526001959095019493860193860161285e565b508096505050505050509250929050565b60008060008060008060c087890312156128a657600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b6000602082840312156128e957600080fd5b8135610a0681612cf3565b60008060006060848603121561290957600080fd5b833561291481612cf3565b9250602084013561292481612ce3565b9150604084013561293481612cf3565b809150509250925092565b6000806040838503121561295257600080fd5b823561265681612cf3565b6000806040838503121561297057600080fd5b825161297b81612cf3565b602084015190925061298c81612cf3565b809150509250929050565b600080600080600060a086880312156129af57600080fd5b85356129ba81612cf3565b945060208601356129ca81612cf3565b93506129d8604087016125f4565b9250606086013591506129ed608087016125f4565b90509295509295909350565b600080600080600060a08688031215612a1157600080fd5b612a1a86612605565b94506020860151935060408601519250606086015191506129ed60808701612605565b6000815180845260005b81811015612a6357602081850181015186830182015201612a47565b81811115612a75576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a066020830184612a3d565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c08084015261116760e0840182612a3d565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612b5957845183529383019391830191600101612b3d565b5090979650505050505050565b60008219821115612b7957612b79612c56565b500190565b600063ffffffff808316818516808303821115612b9d57612b9d612c56565b01949350505050565b600060ff821660ff84168060ff03821115612bc357612bc3612c56565b019392505050565b600082612bda57612bda612c85565b500490565b600063ffffffff80841680612bf657612bf6612c85565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c3a57612c3a612c56565b500290565b600082821015612c5157612c51612c56565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff81168114611c0f57600080fd5b63ffffffff81168114611c0f57600080fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperABI = VRFV2PlusWrapperMetaData.ABI var VRFV2PlusWrapperBin = VRFV2PlusWrapperMetaData.Bin -func DeployVRFV2PlusWrapper(auth *bind.TransactOpts, backend bind.ContractBackend, _link common.Address, _linkEthFeed common.Address, _coordinator common.Address) (common.Address, *types.Transaction, *VRFV2PlusWrapper, error) { +func DeployVRFV2PlusWrapper(auth *bind.TransactOpts, backend bind.ContractBackend, _link common.Address, _linkNativeFeed common.Address, _coordinator common.Address) (common.Address, *types.Transaction, *VRFV2PlusWrapper, error) { parsed, err := VRFV2PlusWrapperMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -48,7 +48,7 @@ func DeployVRFV2PlusWrapper(auth *bind.TransactOpts, backend bind.ContractBacken return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(VRFV2PlusWrapperBin), backend, _link, _linkEthFeed, _coordinator) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(VRFV2PlusWrapperBin), backend, _link, _linkNativeFeed, _coordinator) if err != nil { return common.Address{}, nil, nil, err } @@ -502,9 +502,9 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperCallerSession) SLink() (common.Address, return _VRFV2PlusWrapper.Contract.SLink(&_VRFV2PlusWrapper.CallOpts) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) SLinkEthFeed(opts *bind.CallOpts) (common.Address, error) { +func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) SLinkNativeFeed(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _VRFV2PlusWrapper.contract.Call(opts, &out, "s_linkEthFeed") + err := _VRFV2PlusWrapper.contract.Call(opts, &out, "s_linkNativeFeed") if err != nil { return *new(common.Address), err @@ -516,12 +516,12 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) SLinkEthFeed(opts *bind.CallOpt } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) SLinkEthFeed() (common.Address, error) { - return _VRFV2PlusWrapper.Contract.SLinkEthFeed(&_VRFV2PlusWrapper.CallOpts) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) SLinkNativeFeed() (common.Address, error) { + return _VRFV2PlusWrapper.Contract.SLinkNativeFeed(&_VRFV2PlusWrapper.CallOpts) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperCallerSession) SLinkEthFeed() (common.Address, error) { - return _VRFV2PlusWrapper.Contract.SLinkEthFeed(&_VRFV2PlusWrapper.CallOpts) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperCallerSession) SLinkNativeFeed() (common.Address, error) { + return _VRFV2PlusWrapper.Contract.SLinkNativeFeed(&_VRFV2PlusWrapper.CallOpts) } func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) SVrfCoordinator(opts *bind.CallOpts) (common.Address, error) { @@ -688,16 +688,16 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) SetLINK(link common. return _VRFV2PlusWrapper.Contract.SetLINK(&_VRFV2PlusWrapper.TransactOpts, link) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) SetLinkEthFeed(opts *bind.TransactOpts, linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFV2PlusWrapper.contract.Transact(opts, "setLinkEthFeed", linkEthFeed) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) SetLinkNativeFeed(opts *bind.TransactOpts, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFV2PlusWrapper.contract.Transact(opts, "setLinkNativeFeed", linkNativeFeed) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) SetLinkEthFeed(linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFV2PlusWrapper.Contract.SetLinkEthFeed(&_VRFV2PlusWrapper.TransactOpts, linkEthFeed) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) SetLinkNativeFeed(linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFV2PlusWrapper.Contract.SetLinkNativeFeed(&_VRFV2PlusWrapper.TransactOpts, linkNativeFeed) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) SetLinkEthFeed(linkEthFeed common.Address) (*types.Transaction, error) { - return _VRFV2PlusWrapper.Contract.SetLinkEthFeed(&_VRFV2PlusWrapper.TransactOpts, linkEthFeed) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) SetLinkNativeFeed(linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFV2PlusWrapper.Contract.SetLinkNativeFeed(&_VRFV2PlusWrapper.TransactOpts, linkNativeFeed) } func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { @@ -1223,7 +1223,7 @@ type VRFV2PlusWrapperInterface interface { SLink(opts *bind.CallOpts) (common.Address, error) - SLinkEthFeed(opts *bind.CallOpts) (common.Address, error) + SLinkNativeFeed(opts *bind.CallOpts) (common.Address, error) SVrfCoordinator(opts *bind.CallOpts) (common.Address, error) @@ -1249,7 +1249,7 @@ type VRFV2PlusWrapperInterface interface { SetLINK(opts *bind.TransactOpts, link common.Address) (*types.Transaction, error) - SetLinkEthFeed(opts *bind.TransactOpts, linkEthFeed common.Address) (*types.Transaction, error) + SetLinkNativeFeed(opts *bind.TransactOpts, linkNativeFeed common.Address) (*types.Transaction, error) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 146b87b43cb..da24539bf05 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -73,22 +73,24 @@ vrf_consumer_v2_plus_upgradeable_example: ../../contracts/solc/v0.8.6/VRFConsume vrf_consumer_v2_upgradeable_example: ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample.abi ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample.bin f1790a9a2f2a04c730593e483459709cb89e897f8a19d7a3ac0cfe6a97265e6e vrf_coordinator_mock: ../../contracts/solc/v0.8.6/VRFCoordinatorMock.abi ../../contracts/solc/v0.8.6/VRFCoordinatorMock.bin 5c495cf8df1f46d8736b9150cdf174cce358cb8352f60f0d5bb9581e23920501 vrf_coordinator_v2: ../../contracts/solc/v0.8.6/VRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2.bin 906e8155db28513c64c6f828d5b8eaf586b873de4369c77c0a19b6c5adf623c1 -vrf_coordinator_v2_plus_v2_example: ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus_V2Example.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus_V2Example.bin 50d881ecf2551c0e56b84cb932f068b703b38b00c73eb05d4e4b80754ecf6b6d +vrf_coordinator_v2_5: ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.bin b3b2ed681837264ec3f180d180ef6fb4d6f4f89136673268b57d540b0d682618 +vrf_coordinator_v2_plus_v2_example: ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus_V2Example.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus_V2Example.bin 4a5b86701983b1b65f0a8dfa116b3f6d75f8f706fa274004b57bdf5992e4cec3 vrf_coordinator_v2plus: ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus.bin e4409bbe361258273458a5c99408b3d7f0cc57a2560dee91c0596cc6d6f738be +vrf_coordinator_v2plus_interface: ../../contracts/solc/v0.8.6/IVRFCoordinatorV2PlusInternal.abi ../../contracts/solc/v0.8.6/IVRFCoordinatorV2PlusInternal.bin 834a2ce0e83276372a0e1446593fd89798f4cf6dc95d4be0113e99fadf61558b vrf_external_sub_owner_example: ../../contracts/solc/v0.8.6/VRFExternalSubOwnerExample.abi ../../contracts/solc/v0.8.6/VRFExternalSubOwnerExample.bin 14f888eb313930b50233a6f01ea31eba0206b7f41a41f6311670da8bb8a26963 vrf_load_test_external_sub_owner: ../../contracts/solc/v0.8.6/VRFLoadTestExternalSubOwner.abi ../../contracts/solc/v0.8.6/VRFLoadTestExternalSubOwner.bin 2097faa70265e420036cc8a3efb1f1e0836ad2d7323b295b9a26a125dbbe6c7d vrf_load_test_ownerless_consumer: ../../contracts/solc/v0.8.6/VRFLoadTestOwnerlessConsumer.abi ../../contracts/solc/v0.8.6/VRFLoadTestOwnerlessConsumer.bin 74f914843cbc70b9c3079c3e1c709382ce415225e8bb40113e7ac018bfcb0f5c vrf_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2LoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2LoadTestWithMetrics.bin 6c8f08fe8ae9254ae0607dffa5faf2d554488850aa788795b0445938488ad9ce vrf_malicious_consumer_v2: ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2.abi ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2.bin 9755fa8ffc7f5f0b337d5d413d77b0c9f6cd6f68c31727d49acdf9d4a51bc522 -vrf_malicious_consumer_v2_plus: ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2Plus.abi ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2Plus.bin 9cfe6f12a086b459f1b841aa21144367a146bbaec3e850a6cd10ba0f1b141a71 +vrf_malicious_consumer_v2_plus: ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2Plus.abi ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2Plus.bin f8d8cd2a9287f7f98541027cfdddeea209c5a17184ee37204181c97897a52c41 vrf_owner: ../../contracts/solc/v0.8.6/VRFOwner.abi ../../contracts/solc/v0.8.6/VRFOwner.bin eccfae5ee295b5850e22f61240c469f79752b8d9a3bac5d64aec7ac8def2f6cb vrf_owner_test_consumer: ../../contracts/solc/v0.8.6/VRFV2OwnerTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2OwnerTestConsumer.bin 9a53f1f6d23f6f9bd9781284d8406e4b0741d59d13da2bdf4a9e0a8754c88101 vrf_ownerless_consumer_example: ../../contracts/solc/v0.8.6/VRFOwnerlessConsumerExample.abi ../../contracts/solc/v0.8.6/VRFOwnerlessConsumerExample.bin 9893b3805863273917fb282eed32274e32aa3d5c2a67a911510133e1218132be vrf_single_consumer_example: ../../contracts/solc/v0.8.6/VRFSingleConsumerExample.abi ../../contracts/solc/v0.8.6/VRFSingleConsumerExample.bin 892a5ed35da2e933f7fd7835cd6f7f70ef3aa63a9c03a22c5b1fd026711b0ece -vrf_v2plus_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.bin d880273009b88832eac6a83339e7dd0ac81a3f9ff9d601ce06efee7a8fa32cdb -vrf_v2plus_single_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusSingleConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusSingleConsumerExample.bin 5f05457ad1ece35b7cd5730bb2dee6c349484bfc58aefc61d643d1409b17f22b -vrf_v2plus_sub_owner: ../../contracts/solc/v0.8.6/VRFV2PlusExternalSubOwnerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusExternalSubOwnerExample.bin 42e3aa5421a4898ad3eef1d5ec472d22a1ace259237263e4df582114d4437d0a -vrf_v2plus_upgraded_version: ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.bin 44bf27a0a9044e95be7c5467ede40ec5bb647f5e0bcbe82c27b252fb650b9265 +vrf_v2plus_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.bin 41a6c14753817ef6143716082754a30653a36b1902b596f695afc1b56940c0ae +vrf_v2plus_single_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusSingleConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusSingleConsumerExample.bin e2aa4cfef91b1d1869ec1f517b4d41049884e0e25345384c2fccbe08cda3e603 +vrf_v2plus_sub_owner: ../../contracts/solc/v0.8.6/VRFV2PlusExternalSubOwnerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusExternalSubOwnerExample.bin 8bc4a8b74d302b9a7a37556d3746105f487c4d3555643721748533d01b1ae5a4 +vrf_v2plus_upgraded_version: ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.bin 24850318f2af4ad0fab64bc42f0d815bc41388902eba190720e33e4c11f2f0b9 vrfv2_proxy_admin: ../../contracts/solc/v0.8.6/VRFV2ProxyAdmin.abi ../../contracts/solc/v0.8.6/VRFV2ProxyAdmin.bin 30b6d1af9c4ae05daddda2afdab1877d857ab5321afe3540a01e94d5ded9bcef vrfv2_reverting_example: ../../contracts/solc/v0.8.6/VRFV2RevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2RevertingExample.bin 1ae46f80351d428bd85ba58b9041b2a608a1845300d79a8fed83edf96606de87 vrfv2_transparent_upgradeable_proxy: ../../contracts/solc/v0.8.6/VRFV2TransparentUpgradeableProxy.abi ../../contracts/solc/v0.8.6/VRFV2TransparentUpgradeableProxy.bin 84be44ffac513ef5b009d53846b76d3247ceb9fa0545dec2a0dd11606a915850 @@ -96,9 +98,9 @@ vrfv2_wrapper: ../../contracts/solc/v0.8.6/VRFV2Wrapper.abi ../../contracts/solc vrfv2_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample.bin 3c5c9f1c501e697a7e77e959b48767e2a0bb1372393fd7686f7aaef3eb794231 vrfv2_wrapper_interface: ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.abi ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.bin ff8560169de171a68b360b7438d13863682d07040d984fd0fb096b2379421003 vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contracts/solc/v0.8.6/VRFV2PlusClient.bin bec10896851c433bb5997c96d96d9871b335924a59a8ab07d7062fcbc3992c6e -vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 4d1b1830b411592c7469e3928ad191fed25afc714f1e9947ccd41a5b528cc0ae +vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 2c480a6d7955d33a00690fdd943486d95802e48a03f3cc243df314448e4ddb2c vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin e5ae923d5fdfa916303cd7150b8474ccd912e14bafe950c6431f6ec94821f642 -vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin d8f9b537f4f75535e3fca943d5f2d5b891fc63f38eb04e0c219fee28033883ae -vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin d30c6232e24e7f6007bd9e46c23534d8da17fbf332f9dfd6485a476ef1be0af9 +vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 +vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 9099bc6d78c20ba502e2265d88825225649fa8a3402cb238f24f344ff239231a vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin d4ddf86da21b87c013f551b2563ab68712ea9d4724894664d5778f6b124f4e78 vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 8212afe0f981cd0820f46f1e2e98219ce5d1b1eeae502730dbb52b8638f9ad44 diff --git a/core/gethwrappers/go_generate.go b/core/gethwrappers/go_generate.go index 06fd624b0f2..6b1f952961a 100644 --- a/core/gethwrappers/go_generate.go +++ b/core/gethwrappers/go_generate.go @@ -106,10 +106,11 @@ package gethwrappers //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/KeepersVRFConsumer.abi ../../contracts/solc/v0.8.6/KeepersVRFConsumer.bin KeepersVRFConsumer keepers_vrf_consumer // VRF V2Plus +//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/IVRFCoordinatorV2PlusInternal.abi ../../contracts/solc/v0.8.6/IVRFCoordinatorV2PlusInternal.bin IVRFCoordinatorV2PlusInternal vrf_coordinator_v2plus_interface //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2Plus.abi ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2Plus.bin BatchVRFCoordinatorV2Plus batch_vrf_coordinator_v2plus //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/TrustedBlockhashStore.abi ../../contracts/solc/v0.8.6/TrustedBlockhashStore.bin TrustedBlockhashStore trusted_blockhash_store //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin VRFV2PlusConsumerExample vrfv2plus_consumer_example -//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus.bin VRFCoordinatorV2Plus vrf_coordinator_v2plus +//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.bin VRFCoordinatorV2_5 vrf_coordinator_v2_5 //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin VRFV2PlusWrapper vrfv2plus_wrapper //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin VRFV2PlusWrapperConsumerExample vrfv2plus_wrapper_consumer_example //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2Plus.abi ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2Plus.bin VRFMaliciousConsumerV2Plus vrf_malicious_consumer_v2_plus diff --git a/core/scripts/vrfv2plus/testnet/main.go b/core/scripts/vrfv2plus/testnet/main.go index 75f6e7341a7..7bc64108669 100644 --- a/core/scripts/vrfv2plus/testnet/main.go +++ b/core/scripts/vrfv2plus/testnet/main.go @@ -11,6 +11,8 @@ import ( "os" "strings" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" "github.com/ethereum/go-ethereum" @@ -30,7 +32,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/trusted_blockhash_store" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_load_test_external_sub_owner" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_single_consumer" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_sub_owner" @@ -47,7 +48,7 @@ import ( var ( batchCoordinatorV2PlusABI = evmtypes.MustGetABI(batch_vrf_coordinator_v2plus.BatchVRFCoordinatorV2PlusABI) - coordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus.VRFCoordinatorV2PlusABI) + coordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalABI) ) func main() { @@ -95,8 +96,8 @@ func main() { helpers.ConfirmTXMined(context.Background(), e.Ec, signedTx, e.ChainID, fmt.Sprintf("manual fulfillment %d", i+1)) } case "topics": - randomWordsRequested := vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested{}.Topic() - randomWordsFulfilled := vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled{}.Topic() + randomWordsRequested := vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested{}.Topic() + randomWordsFulfilled := vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled{}.Topic() fmt.Println("RandomWordsRequested:", randomWordsRequested.String(), "RandomWordsFulfilled:", randomWordsFulfilled.String()) case "batch-coordinatorv2plus-deploy": @@ -237,7 +238,7 @@ func main() { "subid", "cbgaslimit", "numwords", "sender", ) - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddr), e.Ec) + coordinator, err := vrf_coordinator_v2plus_interface.NewIVRFCoordinatorV2PlusInternal(common.HexToAddress(*coordinatorAddr), e.Ec) helpers.PanicErr(err) db := sqlx.MustOpen("postgres", *dbURL) @@ -479,7 +480,7 @@ func main() { coordinatorAddress := cmd.String("coordinator-address", "", "coordinator address") helpers.ParseArgs(cmd, os.Args[2:], "coordinator-address") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) printCoordinatorConfig(coordinator) @@ -495,7 +496,7 @@ func main() { flatFeeEthPPM := cmd.Int64("flat-fee-eth-ppm", 500, "fulfillment flat fee ETH ppm") helpers.ParseArgs(cmd, os.Args[2:], "coordinator-address", "fallback-wei-per-unit-link") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*setConfigAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*setConfigAddress), e.Ec) helpers.PanicErr(err) setCoordinatorConfig( @@ -506,9 +507,9 @@ func main() { uint32(*stalenessSeconds), uint32(*gasAfterPayment), decimal.RequireFromString(*fallbackWeiPerUnitLink).BigInt(), - vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig{ - FulfillmentFlatFeeLinkPPM: uint32(*flatFeeLinkPPM), - FulfillmentFlatFeeEthPPM: uint32(*flatFeeEthPPM), + vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: uint32(*flatFeeLinkPPM), + FulfillmentFlatFeeNativePPM: uint32(*flatFeeEthPPM), }, ) case "coordinator-register-key": @@ -517,7 +518,7 @@ func main() { registerKeyUncompressedPubKey := coordinatorRegisterKey.String("pubkey", "", "uncompressed pubkey") registerKeyOracleAddress := coordinatorRegisterKey.String("oracle-address", "", "oracle address") helpers.ParseArgs(coordinatorRegisterKey, os.Args[2:], "address", "pubkey", "oracle-address") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*registerKeyAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*registerKeyAddress), e.Ec) helpers.PanicErr(err) // Put key in ECDSA format @@ -531,7 +532,7 @@ func main() { deregisterKeyAddress := coordinatorDeregisterKey.String("address", "", "coordinator address") deregisterKeyUncompressedPubKey := coordinatorDeregisterKey.String("pubkey", "", "uncompressed pubkey") helpers.ParseArgs(coordinatorDeregisterKey, os.Args[2:], "address", "pubkey") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*deregisterKeyAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*deregisterKeyAddress), e.Ec) helpers.PanicErr(err) // Put key in ECDSA format @@ -550,7 +551,7 @@ func main() { address := coordinatorSub.String("address", "", "coordinator address") subID := coordinatorSub.String("sub-id", "", "sub-id") helpers.ParseArgs(coordinatorSub, os.Args[2:], "address", "sub-id") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*address), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*address), e.Ec) helpers.PanicErr(err) fmt.Println("sub-id", *subID, "address", *address, coordinator.Address()) parsedSubID := parseSubID(*subID) @@ -694,7 +695,7 @@ func main() { createSubCmd := flag.NewFlagSet("eoa-create-sub", flag.ExitOnError) coordinatorAddress := createSubCmd.String("coordinator-address", "", "coordinator address") helpers.ParseArgs(createSubCmd, os.Args[2:], "coordinator-address") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) eoaCreateSub(e, *coordinator) case "eoa-add-sub-consumer": @@ -703,7 +704,7 @@ func main() { subID := addSubConsCmd.String("sub-id", "", "sub-id") consumerAddress := addSubConsCmd.String("consumer-address", "", "consumer address") helpers.ParseArgs(addSubConsCmd, os.Args[2:], "coordinator-address", "sub-id", "consumer-address") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) parsedSubID := parseSubID(*subID) eoaAddConsumerToSub(e, *coordinator, parsedSubID, *consumerAddress) @@ -719,14 +720,14 @@ func main() { if !s { panic(fmt.Sprintf("failed to parse top up amount '%s'", *amountStr)) } - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) fmt.Println(amount, consumerLinkAddress) txcreate, err := coordinator.CreateSubscription(e.Owner) helpers.PanicErr(err) fmt.Println("Create sub", "TX", helpers.ExplorerLink(e.ChainID, txcreate.Hash())) helpers.ConfirmTXMined(context.Background(), e.Ec, txcreate, e.ChainID) - sub := make(chan *vrf_coordinator_v2plus.VRFCoordinatorV2PlusSubscriptionCreated) + sub := make(chan *vrf_coordinator_v2_5.VRFCoordinatorV25SubscriptionCreated) subscription, err := coordinator.WatchSubscriptionCreated(nil, sub, nil) helpers.PanicErr(err) defer subscription.Unsubscribe() @@ -742,7 +743,7 @@ func main() { tx, err := linkToken.TransferAndCall(e.Owner, coordinator.Address(), amount, b) helpers.PanicErr(err) helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID, fmt.Sprintf("Sub id: %d", created.SubId)) - subFunded := make(chan *vrf_coordinator_v2plus.VRFCoordinatorV2PlusSubscriptionFunded) + subFunded := make(chan *vrf_coordinator_v2_5.VRFCoordinatorV25SubscriptionFunded) fundSub, err := coordinator.WatchSubscriptionFunded(nil, subFunded, []*big.Int{created.SubId}) helpers.PanicErr(err) defer fundSub.Unsubscribe() @@ -887,7 +888,7 @@ func main() { subID := trans.String("sub-id", "", "sub-id") to := trans.String("to", "", "to") helpers.ParseArgs(trans, os.Args[2:], "coordinator-address", "sub-id", "to") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) tx, err := coordinator.RequestSubscriptionOwnerTransfer(e.Owner, parseSubID(*subID), common.HexToAddress(*to)) helpers.PanicErr(err) @@ -897,7 +898,7 @@ func main() { coordinatorAddress := accept.String("coordinator-address", "", "coordinator address") subID := accept.String("sub-id", "", "sub-id") helpers.ParseArgs(accept, os.Args[2:], "coordinator-address", "sub-id") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) tx, err := coordinator.AcceptSubscriptionOwnerTransfer(e.Owner, parseSubID(*subID)) helpers.PanicErr(err) @@ -907,7 +908,7 @@ func main() { coordinatorAddress := cancel.String("coordinator-address", "", "coordinator address") subID := cancel.String("sub-id", "", "sub-id") helpers.ParseArgs(cancel, os.Args[2:], "coordinator-address", "sub-id") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) tx, err := coordinator.CancelSubscription(e.Owner, parseSubID(*subID), e.Owner.From) helpers.PanicErr(err) @@ -922,10 +923,10 @@ func main() { if !s { panic(fmt.Sprintf("failed to parse top up amount '%s'", *amountStr)) } - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) e.Owner.Value = amount - tx, err := coordinator.FundSubscriptionWithEth(e.Owner, parseSubID(*subID)) + tx, err := coordinator.FundSubscriptionWithNative(e.Owner, parseSubID(*subID)) helpers.PanicErr(err) helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID) case "eoa-fund-sub": @@ -939,7 +940,7 @@ func main() { if !s { panic(fmt.Sprintf("failed to parse top up amount '%s'", *amountStr)) } - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) eoaFundSubscription(e, *coordinator, *consumerLinkAddress, amount, parseSubID(*subID)) @@ -961,7 +962,7 @@ func main() { coordinatorAddress := cancel.String("coordinator-address", "", "coordinator address") subID := cancel.String("sub-id", "", "sub-id") helpers.ParseArgs(cancel, os.Args[2:], "coordinator-address", "sub-id") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) tx, err := coordinator.OwnerCancelSubscription(e.Owner, parseSubID(*subID)) helpers.PanicErr(err) @@ -971,7 +972,7 @@ func main() { coordinatorAddress := consumerBalanceCmd.String("coordinator-address", "", "coordinator address") subID := consumerBalanceCmd.String("sub-id", "", "subscription id") helpers.ParseArgs(consumerBalanceCmd, os.Args[2:], "coordinator-address", "sub-id") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) resp, err := coordinator.GetSubscription(nil, parseSubID(*subID)) helpers.PanicErr(err) @@ -985,7 +986,7 @@ func main() { coordinatorAddress := common.HexToAddress(*coordinator) oracleAddress := common.HexToAddress(*oracle) - abi, err := vrf_coordinator_v2plus.VRFCoordinatorV2PlusMetaData.GetAbi() + abi, err := vrf_coordinator_v2_5.VRFCoordinatorV25MetaData.GetAbi() helpers.PanicErr(err) isWithdrawable := func(amount *big.Int) bool { @@ -1015,7 +1016,7 @@ func main() { newOwner := cmd.String("new-owner", "", "new owner address") helpers.ParseArgs(cmd, os.Args[2:], "coordinator-address", "new-owner") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) tx, err := coordinator.TransferOwnership(e.Owner, common.HexToAddress(*newOwner)) @@ -1030,7 +1031,7 @@ func main() { skipDeregister := coordinatorReregisterKey.Bool("skip-deregister", false, "if true, key will not be deregistered") helpers.ParseArgs(coordinatorReregisterKey, os.Args[2:], "coordinator-address", "pubkey", "new-oracle-address") - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) // Put key in ECDSA format diff --git a/core/scripts/vrfv2plus/testnet/super_scripts.go b/core/scripts/vrfv2plus/testnet/super_scripts.go index ad67b874bb0..f9efde8f148 100644 --- a/core/scripts/vrfv2plus/testnet/super_scripts.go +++ b/core/scripts/vrfv2plus/testnet/super_scripts.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_sub_owner" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" @@ -141,7 +141,7 @@ func smokeTestVRF(e helpers.Environment) { coordinatorAddress = common.HexToAddress(*coordinatorAddressStr) } - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(coordinatorAddress, e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(coordinatorAddress, e.Ec) helpers.PanicErr(err) var batchCoordinatorAddress common.Address @@ -162,9 +162,9 @@ func smokeTestVRF(e helpers.Environment) { uint32(*stalenessSeconds), uint32(*gasAfterPayment), fallbackWeiPerUnitLink, - vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig{ - FulfillmentFlatFeeLinkPPM: uint32(*flatFeeLinkPPM), - FulfillmentFlatFeeEthPPM: uint32(*flatFeeEthPPM), + vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: uint32(*flatFeeLinkPPM), + FulfillmentFlatFeeNativePPM: uint32(*flatFeeEthPPM), }, ) } @@ -221,7 +221,7 @@ func smokeTestVRF(e helpers.Environment) { tx, err := coordinator.RegisterProvingKey(e.Owner, e.Owner.From, [2]*big.Int{x, y}) helpers.PanicErr(err) registerReceipt := helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID, "register proving key on", coordinatorAddress.String()) - var provingKeyRegisteredLog *vrf_coordinator_v2plus.VRFCoordinatorV2PlusProvingKeyRegistered + var provingKeyRegisteredLog *vrf_coordinator_v2_5.VRFCoordinatorV25ProvingKeyRegistered for _, log := range registerReceipt.Logs { if log.Address == coordinatorAddress { var err error @@ -294,7 +294,7 @@ func smokeTestVRF(e helpers.Environment) { fmt.Println("request blockhash:", receipt.BlockHash) // extract the RandomWordsRequested log from the receipt logs - var rwrLog *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested + var rwrLog *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested for _, log := range receipt.Logs { if log.Address == coordinatorAddress { var err error @@ -558,7 +558,7 @@ func deployUniverse(e helpers.Environment) { fmt.Println("\nDeploying Coordinator...") coordinatorAddress = deployCoordinator(e, *linkAddress, bhsContractAddress.String(), *linkEthAddress) - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(coordinatorAddress, e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(coordinatorAddress, e.Ec) helpers.PanicErr(err) fmt.Println("\nDeploying Batch Coordinator...") @@ -573,9 +573,9 @@ func deployUniverse(e helpers.Environment) { uint32(*stalenessSeconds), uint32(*gasAfterPayment), fallbackWeiPerUnitLink, - vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig{ - FulfillmentFlatFeeLinkPPM: uint32(*flatFeeLinkPPM), - FulfillmentFlatFeeEthPPM: uint32(*flatFeeEthPPM), + vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: uint32(*flatFeeLinkPPM), + FulfillmentFlatFeeNativePPM: uint32(*flatFeeEthPPM), }, ) @@ -690,7 +690,7 @@ func deployWrapperUniverse(e helpers.Environment) { common.HexToAddress(*linkAddress), wrapper) - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(common.HexToAddress(*coordinatorAddress), e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) eoaFundSubscription(e, *coordinator, *linkAddress, amount, subID) diff --git a/core/scripts/vrfv2plus/testnet/util.go b/core/scripts/vrfv2plus/testnet/util.go index d002b8c03b4..904a3f6ba4f 100644 --- a/core/scripts/vrfv2plus/testnet/util.go +++ b/core/scripts/vrfv2plus/testnet/util.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_vrf_coordinator_v2plus" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_sub_owner" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_consumer_example" @@ -40,7 +40,7 @@ func deployCoordinator( bhsAddress string, linkEthAddress string, ) (coordinatorAddress common.Address) { - _, tx, _, err := vrf_coordinator_v2plus.DeployVRFCoordinatorV2Plus( + _, tx, _, err := vrf_coordinator_v2_5.DeployVRFCoordinatorV25( e.Owner, e.Ec, common.HexToAddress(bhsAddress)) @@ -48,10 +48,10 @@ func deployCoordinator( coordinatorAddress = helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) // Set LINK and LINK ETH - coordinator, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(coordinatorAddress, e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(coordinatorAddress, e.Ec) helpers.PanicErr(err) - linkTx, err := coordinator.SetLINKAndLINKETHFeed(e.Owner, + linkTx, err := coordinator.SetLINKAndLINKNativeFeed(e.Owner, common.HexToAddress(linkAddress), common.HexToAddress(linkEthAddress)) helpers.PanicErr(err) helpers.ConfirmTXMined(context.Background(), e.Ec, linkTx, e.ChainID) @@ -65,20 +65,20 @@ func deployBatchCoordinatorV2(e helpers.Environment, coordinatorAddress common.A } func eoaAddConsumerToSub(e helpers.Environment, - coordinator vrf_coordinator_v2plus.VRFCoordinatorV2Plus, subID *big.Int, consumerAddress string) { + coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, subID *big.Int, consumerAddress string) { txadd, err := coordinator.AddConsumer(e.Owner, subID, common.HexToAddress(consumerAddress)) helpers.PanicErr(err) helpers.ConfirmTXMined(context.Background(), e.Ec, txadd, e.ChainID) } -func eoaCreateSub(e helpers.Environment, coordinator vrf_coordinator_v2plus.VRFCoordinatorV2Plus) { +func eoaCreateSub(e helpers.Environment, coordinator vrf_coordinator_v2_5.VRFCoordinatorV25) { tx, err := coordinator.CreateSubscription(e.Owner) helpers.PanicErr(err) helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID) } // returns subscription ID that belongs to the given owner. Returns result found first -func findSubscriptionID(e helpers.Environment, coordinator *vrf_coordinator_v2plus.VRFCoordinatorV2Plus) *big.Int { +func findSubscriptionID(e helpers.Environment, coordinator *vrf_coordinator_v2_5.VRFCoordinatorV25) *big.Int { // Use most recent 500 blocks as search window. head, err := e.Ec.BlockNumber(context.Background()) helpers.PanicErr(err) @@ -109,7 +109,7 @@ func eoaDeployConsumer(e helpers.Environment, } func eoaFundSubscription(e helpers.Environment, - coordinator vrf_coordinator_v2plus.VRFCoordinatorV2Plus, linkAddress string, amount, subID *big.Int) { + coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, linkAddress string, amount, subID *big.Int) { linkToken, err := link_token_interface.NewLinkToken(common.HexToAddress(linkAddress), e.Ec) helpers.PanicErr(err) bal, err := linkToken.BalanceOf(nil, e.Owner.From) @@ -122,7 +122,7 @@ func eoaFundSubscription(e helpers.Environment, helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID, fmt.Sprintf("sub ID: %d", subID)) } -func printCoordinatorConfig(coordinator *vrf_coordinator_v2plus.VRFCoordinatorV2Plus) { +func printCoordinatorConfig(coordinator *vrf_coordinator_v2_5.VRFCoordinatorV25) { cfg, err := coordinator.SConfig(nil) helpers.PanicErr(err) @@ -135,13 +135,13 @@ func printCoordinatorConfig(coordinator *vrf_coordinator_v2plus.VRFCoordinatorV2 func setCoordinatorConfig( e helpers.Environment, - coordinator vrf_coordinator_v2plus.VRFCoordinatorV2Plus, + coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, minConfs uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPayment uint32, fallbackWeiPerUnitLink *big.Int, - feeConfig vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig, + feeConfig vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig, ) { tx, err := coordinator.SetConfig( e.Owner, @@ -157,7 +157,7 @@ func setCoordinatorConfig( } func registerCoordinatorProvingKey(e helpers.Environment, - coordinator vrf_coordinator_v2plus.VRFCoordinatorV2Plus, uncompressed string, oracleAddress string) { + coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, uncompressed string, oracleAddress string) { pubBytes, err := hex.DecodeString(uncompressed) helpers.PanicErr(err) pk, err := crypto.UnmarshalPubkey(pubBytes) diff --git a/core/services/blockhashstore/coordinators.go b/core/services/blockhashstore/coordinators.go index 1a8588dbbb6..ff5aff1f5e5 100644 --- a/core/services/blockhashstore/coordinators.go +++ b/core/services/blockhashstore/coordinators.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" v1 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" v2 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - v2plus "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + v2plus "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/services/pg" ) @@ -246,17 +246,17 @@ func (v *V2Coordinator) Fulfillments(ctx context.Context, fromBlock uint64) ([]E // V2PlusCoordinator fetches request and fulfillment logs from a VRF V2Plus coordinator contract. type V2PlusCoordinator struct { - c v2plus.VRFCoordinatorV2PlusInterface + c v2plus.IVRFCoordinatorV2PlusInternalInterface lp logpoller.LogPoller } // NewV2Coordinator creates a new V2Coordinator from the given contract. -func NewV2PlusCoordinator(c v2plus.VRFCoordinatorV2PlusInterface, lp logpoller.LogPoller) (*V2PlusCoordinator, error) { +func NewV2PlusCoordinator(c v2plus.IVRFCoordinatorV2PlusInternalInterface, lp logpoller.LogPoller) (*V2PlusCoordinator, error) { err := lp.RegisterFilter(logpoller.Filter{ Name: logpoller.FilterName("VRFv2PlusCoordinatorFeeder", c.Address()), EventSigs: []common.Hash{ - v2plus.VRFCoordinatorV2PlusRandomWordsRequested{}.Topic(), - v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled{}.Topic(), + v2plus.IVRFCoordinatorV2PlusInternalRandomWordsRequested{}.Topic(), + v2plus.IVRFCoordinatorV2PlusInternalRandomWordsFulfilled{}.Topic(), }, Addresses: []common.Address{c.Address()}, }) @@ -277,7 +277,7 @@ func (v *V2PlusCoordinator) Requests( int64(fromBlock), int64(toBlock), []common.Hash{ - v2plus.VRFCoordinatorV2PlusRandomWordsRequested{}.Topic(), + v2plus.IVRFCoordinatorV2PlusInternalRandomWordsRequested{}.Topic(), }, v.c.Address(), pg.WithParentCtx(ctx)) @@ -291,7 +291,7 @@ func (v *V2PlusCoordinator) Requests( if err != nil { continue // malformed log should not break flow } - request, ok := requestLog.(*v2plus.VRFCoordinatorV2PlusRandomWordsRequested) + request, ok := requestLog.(*v2plus.IVRFCoordinatorV2PlusInternalRandomWordsRequested) if !ok { continue // malformed log should not break flow } @@ -312,7 +312,7 @@ func (v *V2PlusCoordinator) Fulfillments(ctx context.Context, fromBlock uint64) int64(fromBlock), int64(toBlock), []common.Hash{ - v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled{}.Topic(), + v2plus.IVRFCoordinatorV2PlusInternalRandomWordsFulfilled{}.Topic(), }, v.c.Address(), pg.WithParentCtx(ctx)) @@ -326,7 +326,7 @@ func (v *V2PlusCoordinator) Fulfillments(ctx context.Context, fromBlock uint64) if err != nil { continue // malformed log should not break flow } - request, ok := requestLog.(*v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled) + request, ok := requestLog.(*v2plus.IVRFCoordinatorV2PlusInternalRandomWordsFulfilled) if !ok { continue // malformed log should not break flow } diff --git a/core/services/blockhashstore/delegate.go b/core/services/blockhashstore/delegate.go index e8646c53f2e..ccd4d3463f5 100644 --- a/core/services/blockhashstore/delegate.go +++ b/core/services/blockhashstore/delegate.go @@ -13,7 +13,7 @@ import ( v1 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/trusted_blockhash_store" v2 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - v2plus "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + v2plus "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" @@ -128,8 +128,8 @@ func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceC coordinators = append(coordinators, coord) } if jb.BlockhashStoreSpec.CoordinatorV2PlusAddress != nil { - var c *v2plus.VRFCoordinatorV2Plus - if c, err = v2plus.NewVRFCoordinatorV2Plus( + var c v2plus.IVRFCoordinatorV2PlusInternalInterface + if c, err = v2plus.NewIVRFCoordinatorV2PlusInternal( jb.BlockhashStoreSpec.CoordinatorV2PlusAddress.Address(), chain.Client()); err != nil { return nil, errors.Wrap(err, "building V2Plus coordinator") diff --git a/core/services/blockhashstore/feeder_test.go b/core/services/blockhashstore/feeder_test.go index d9e2c1bacdb..3145a9fd76d 100644 --- a/core/services/blockhashstore/feeder_test.go +++ b/core/services/blockhashstore/feeder_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" loggermocks "github.com/smartcontractkit/chainlink/v2/core/logger/mocks" @@ -40,7 +40,7 @@ const ( ) var ( - vrfCoordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus.VRFCoordinatorV2PlusMetaData.ABI) + vrfCoordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalMetaData.ABI) vrfCoordinatorV2ABI = evmtypes.MustGetABI(vrf_coordinator_v2.VRFCoordinatorV2MetaData.ABI) vrfCoordinatorV1ABI = evmtypes.MustGetABI(solidity_vrf_coordinator_interface.VRFCoordinatorMetaData.ABI) @@ -602,7 +602,7 @@ func (test testCase) testFeederWithLogPollerVRFv2Plus(t *testing.T) { // Instantiate log poller & coordinator. lp := &mocklp.LogPoller{} lp.On("RegisterFilter", mock.Anything).Return(nil) - c, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(coordinatorAddress, nil) + c, err := vrf_coordinator_v2plus_interface.NewIVRFCoordinatorV2PlusInternal(coordinatorAddress, nil) require.NoError(t, err) coordinator := &V2PlusCoordinator{ c: c, @@ -647,7 +647,7 @@ func (test testCase) testFeederWithLogPollerVRFv2Plus(t *testing.T) { fromBlock, toBlock, []common.Hash{ - vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested{}.Topic(), + vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRandomWordsRequested{}.Topic(), }, coordinatorAddress, mock.Anything, @@ -657,7 +657,7 @@ func (test testCase) testFeederWithLogPollerVRFv2Plus(t *testing.T) { fromBlock, latest, []common.Hash{ - vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled{}.Topic(), + vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRandomWordsFulfilled{}.Topic(), }, coordinatorAddress, mock.Anything, @@ -967,7 +967,7 @@ func newRandomnessRequestedLogV2Plus( requestID *big.Int, coordinatorAddress common.Address, ) logpoller.Log { - e := vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested{ + e := vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRandomWordsRequested{ RequestId: requestID, PreSeed: big.NewInt(0), MinimumRequestConfirmations: 0, @@ -1055,7 +1055,7 @@ func newRandomnessFulfilledLogV2Plus( requestID *big.Int, coordinatorAddress common.Address, ) logpoller.Log { - e := vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled{ + e := vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRandomWordsFulfilled{ RequestId: requestID, OutputSeed: big.NewInt(0), Payment: big.NewInt(0), @@ -1063,7 +1063,7 @@ func newRandomnessFulfilledLogV2Plus( Raw: types.Log{ BlockNumber: requestBlock, }, - SubID: big.NewInt(0), + SubId: big.NewInt(0), } var unindexed abi.Arguments for _, a := range vrfCoordinatorV2PlusABI.Events[randomWordsFulfilledV2Plus].Inputs { @@ -1096,7 +1096,7 @@ func newRandomnessFulfilledLogV2Plus( topic1, err := requestIdArg.Pack(e.RequestId) require.NoError(t, err) - topic2, err := subIdArg.Pack(e.SubID) + topic2, err := subIdArg.Pack(e.SubId) require.NoError(t, err) topic0 := vrfCoordinatorV2PlusABI.Events[randomWordsFulfilledV2Plus].ID diff --git a/core/services/blockheaderfeeder/delegate.go b/core/services/blockheaderfeeder/delegate.go index 2e80a874e5e..2f37991f741 100644 --- a/core/services/blockheaderfeeder/delegate.go +++ b/core/services/blockheaderfeeder/delegate.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" v1 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" v2 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - v2plus "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + v2plus "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/blockhashstore" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -124,8 +124,8 @@ func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceC coordinators = append(coordinators, coord) } if jb.BlockHeaderFeederSpec.CoordinatorV2PlusAddress != nil { - var c *v2plus.VRFCoordinatorV2Plus - if c, err = v2plus.NewVRFCoordinatorV2Plus( + var c v2plus.IVRFCoordinatorV2PlusInternalInterface + if c, err = v2plus.NewIVRFCoordinatorV2PlusInternal( jb.BlockHeaderFeederSpec.CoordinatorV2PlusAddress.Address(), chain.Client()); err != nil { return nil, errors.Wrap(err, "building V2 plus coordinator") diff --git a/core/services/pipeline/task.vrfv2plus.go b/core/services/pipeline/task.vrfv2plus.go index c998a48d740..a596bfa3092 100644 --- a/core/services/pipeline/task.vrfv2plus.go +++ b/core/services/pipeline/task.vrfv2plus.go @@ -13,14 +13,14 @@ import ( "go.uber.org/multierr" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) var ( - vrfCoordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus.VRFCoordinatorV2PlusABI) + vrfCoordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalABI) ) // VRFTaskV2Plus is identical to VRFTaskV2 except that it uses the V2Plus VRF diff --git a/core/services/vrf/delegate.go b/core/services/vrf/delegate.go index cc6c05cacdd..b5fe6cda76f 100644 --- a/core/services/vrf/delegate.go +++ b/core/services/vrf/delegate.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_vrf_coordinator_v2" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_owner" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -94,7 +94,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceC if err != nil { return nil, err } - coordinatorV2Plus, err := vrf_coordinator_v2plus.NewVRFCoordinatorV2Plus(jb.VRFSpec.CoordinatorAddress.Address(), chain.Client()) + coordinatorV2Plus, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(jb.VRFSpec.CoordinatorAddress.Address(), chain.Client()) if err != nil { return nil, err } @@ -144,11 +144,11 @@ func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceC if vrfOwner != nil { return nil, errors.New("VRF Owner is not supported for VRF V2 Plus") } - linkEthFeedAddress, err := coordinatorV2Plus.LINKETHFEED(nil) + linkNativeFeedAddress, err := coordinatorV2Plus.LINKNATIVEFEED(nil) if err != nil { - return nil, errors.Wrap(err, "LINKETHFEED") + return nil, errors.Wrap(err, "LINKNATIVEFEED") } - aggregator, err := aggregator_v3_interface.NewAggregatorV3Interface(linkEthFeedAddress, chain.Client()) + aggregator, err := aggregator_v3_interface.NewAggregatorV3Interface(linkNativeFeedAddress, chain.Client()) if err != nil { return nil, errors.Wrap(err, "NewAggregatorV3Interface") } @@ -161,7 +161,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceC chain.ID(), chain.LogBroadcaster(), d.q, - v2.NewCoordinatorV2Plus(coordinatorV2Plus), + v2.NewCoordinatorV2_5(coordinatorV2Plus), batchCoordinatorV2, vrfOwner, aggregator, diff --git a/core/services/vrf/proof/proof_response.go b/core/services/vrf/proof/proof_response.go index 6d62e18a4f4..4cb58d921a4 100644 --- a/core/services/vrf/proof/proof_response.go +++ b/core/services/vrf/proof/proof_response.go @@ -7,7 +7,7 @@ import ( "math/big" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/ethereum/go-ethereum/common" @@ -138,11 +138,11 @@ func GenerateProofResponseFromProofV2(p vrfkey.Proof, s PreSeedDataV2) (vrf_coor func GenerateProofResponseFromProofV2Plus( p vrfkey.Proof, s PreSeedDataV2Plus) ( - vrf_coordinator_v2plus.VRFProof, - vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment, + vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof, + vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment, error) { - var proof vrf_coordinator_v2plus.VRFProof - var rc vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment + var proof vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof + var rc vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment solidityProof, err := SolidityPrecalculations(&p) if err != nil { return proof, rc, errors.Wrap(err, @@ -153,7 +153,7 @@ func GenerateProofResponseFromProofV2Plus( gx, gy := secp256k1.Coordinates(solidityProof.P.Gamma) cgx, cgy := secp256k1.Coordinates(solidityProof.CGammaWitness) shx, shy := secp256k1.Coordinates(solidityProof.SHashWitness) - return vrf_coordinator_v2plus.VRFProof{ + return vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof{ Pk: [2]*big.Int{x, y}, Gamma: [2]*big.Int{gx, gy}, C: solidityProof.P.C, @@ -163,7 +163,7 @@ func GenerateProofResponseFromProofV2Plus( CGammaWitness: [2]*big.Int{cgx, cgy}, SHashWitness: [2]*big.Int{shx, shy}, ZInv: solidityProof.ZInv, - }, vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment{ + }, vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment{ BlockNum: s.BlockNum, SubId: s.SubId, CallbackGasLimit: s.CallbackGasLimit, @@ -195,12 +195,12 @@ func GenerateProofResponseV2(keystore keystore.VRF, id string, s PreSeedDataV2) } func GenerateProofResponseV2Plus(keystore keystore.VRF, id string, s PreSeedDataV2Plus) ( - vrf_coordinator_v2plus.VRFProof, vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment, error) { + vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof, vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment, error) { seedHashMsg := append(s.PreSeed[:], s.BlockHash.Bytes()...) seed := utils.MustHash(string(seedHashMsg)).Big() proof, err := keystore.GenerateProof(id, seed) if err != nil { - return vrf_coordinator_v2plus.VRFProof{}, vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment{}, err + return vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof{}, vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment{}, err } return GenerateProofResponseFromProofV2Plus(proof, s) } diff --git a/core/services/vrf/v2/coordinator_v2x_interface.go b/core/services/vrf/v2/coordinator_v2x_interface.go index 8e2942ea927..b090c4ad5af 100644 --- a/core/services/vrf/v2/coordinator_v2x_interface.go +++ b/core/services/vrf/v2/coordinator_v2x_interface.go @@ -12,14 +12,15 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/extraargs" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" ) var ( _ CoordinatorV2_X = (*coordinatorV2)(nil) - _ CoordinatorV2_X = (*coordinatorV2Plus)(nil) + _ CoordinatorV2_X = (*coordinatorV2_5)(nil) ) // CoordinatorV2_X is an interface that allows us to use the same code for @@ -45,7 +46,7 @@ type CoordinatorV2_X interface { CancelSubscription(opts *bind.TransactOpts, subID *big.Int, to common.Address) (*types.Transaction, error) GetCommitment(opts *bind.CallOpts, requestID *big.Int) ([32]byte, error) Migrate(opts *bind.TransactOpts, subID *big.Int, newCoordinator common.Address) (*types.Transaction, error) - FundSubscriptionWithEth(opts *bind.TransactOpts, subID *big.Int, amount *big.Int) (*types.Transaction, error) + FundSubscriptionWithNative(opts *bind.TransactOpts, subID *big.Int, amount *big.Int) (*types.Transaction, error) } type coordinatorV2 struct { @@ -170,40 +171,40 @@ func (c *coordinatorV2) Migrate(opts *bind.TransactOpts, subID *big.Int, newCoor panic("migrate not implemented for v2") } -func (c *coordinatorV2) FundSubscriptionWithEth(opts *bind.TransactOpts, subID *big.Int, amount *big.Int) (*types.Transaction, error) { +func (c *coordinatorV2) FundSubscriptionWithNative(opts *bind.TransactOpts, subID *big.Int, amount *big.Int) (*types.Transaction, error) { panic("fund subscription with Eth not implemented for v2") } -type coordinatorV2Plus struct { +type coordinatorV2_5 struct { vrfVersion vrfcommon.Version - coordinator *vrf_coordinator_v2plus.VRFCoordinatorV2Plus + coordinator vrf_coordinator_v2_5.VRFCoordinatorV25Interface } -func NewCoordinatorV2Plus(c *vrf_coordinator_v2plus.VRFCoordinatorV2Plus) CoordinatorV2_X { - return &coordinatorV2Plus{ +func NewCoordinatorV2_5(c vrf_coordinator_v2_5.VRFCoordinatorV25Interface) CoordinatorV2_X { + return &coordinatorV2_5{ vrfVersion: vrfcommon.V2Plus, coordinator: c, } } -func (c *coordinatorV2Plus) Address() common.Address { +func (c *coordinatorV2_5) Address() common.Address { return c.coordinator.Address() } -func (c *coordinatorV2Plus) ParseRandomWordsRequested(log types.Log) (RandomWordsRequested, error) { +func (c *coordinatorV2_5) ParseRandomWordsRequested(log types.Log) (RandomWordsRequested, error) { parsed, err := c.coordinator.ParseRandomWordsRequested(log) if err != nil { return nil, err } - return NewV2PlusRandomWordsRequested(parsed), nil + return NewV2_5RandomWordsRequested(parsed), nil } -func (c *coordinatorV2Plus) RequestRandomWords(opts *bind.TransactOpts, keyHash [32]byte, subID *big.Int, requestConfirmations uint16, callbackGasLimit uint32, numWords uint32, payInEth bool) (*types.Transaction, error) { +func (c *coordinatorV2_5) RequestRandomWords(opts *bind.TransactOpts, keyHash [32]byte, subID *big.Int, requestConfirmations uint16, callbackGasLimit uint32, numWords uint32, payInEth bool) (*types.Transaction, error) { extraArgs, err := extraargs.ExtraArgsV1(payInEth) if err != nil { return nil, err } - req := vrf_coordinator_v2plus.VRFV2PlusClientRandomWordsRequest{ + req := vrf_coordinator_v2_5.VRFV2PlusClientRandomWordsRequest{ KeyHash: keyHash, SubId: subID, RequestConfirmations: requestConfirmations, @@ -214,41 +215,41 @@ func (c *coordinatorV2Plus) RequestRandomWords(opts *bind.TransactOpts, keyHash return c.coordinator.RequestRandomWords(opts, req) } -func (c *coordinatorV2Plus) AddConsumer(opts *bind.TransactOpts, subID *big.Int, consumer common.Address) (*types.Transaction, error) { +func (c *coordinatorV2_5) AddConsumer(opts *bind.TransactOpts, subID *big.Int, consumer common.Address) (*types.Transaction, error) { return c.coordinator.AddConsumer(opts, subID, consumer) } -func (c *coordinatorV2Plus) CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) { +func (c *coordinatorV2_5) CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) { return c.coordinator.CreateSubscription(opts) } -func (c *coordinatorV2Plus) GetSubscription(opts *bind.CallOpts, subID *big.Int) (Subscription, error) { +func (c *coordinatorV2_5) GetSubscription(opts *bind.CallOpts, subID *big.Int) (Subscription, error) { sub, err := c.coordinator.GetSubscription(opts, subID) if err != nil { return nil, err } - return NewV2PlusSubscription(sub), nil + return NewV2_5Subscription(sub), nil } -func (c *coordinatorV2Plus) GetConfig(opts *bind.CallOpts) (Config, error) { +func (c *coordinatorV2_5) GetConfig(opts *bind.CallOpts) (Config, error) { config, err := c.coordinator.SConfig(opts) if err != nil { return nil, err } - return NewV2PlusConfig(config), nil + return NewV2_5Config(config), nil } -func (c *coordinatorV2Plus) ParseLog(log types.Log) (generated.AbigenLog, error) { +func (c *coordinatorV2_5) ParseLog(log types.Log) (generated.AbigenLog, error) { return c.coordinator.ParseLog(log) } -func (c *coordinatorV2Plus) OracleWithdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { +func (c *coordinatorV2_5) OracleWithdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return c.coordinator.OracleWithdraw(opts, recipient, amount) } -func (c *coordinatorV2Plus) LogsWithTopics(keyHash common.Hash) map[common.Hash][][]log.Topic { +func (c *coordinatorV2_5) LogsWithTopics(keyHash common.Hash) map[common.Hash][][]log.Topic { return map[common.Hash][][]log.Topic{ - vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested{}.Topic(): { + vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested{}.Topic(): { { log.Topic(keyHash), }, @@ -256,70 +257,70 @@ func (c *coordinatorV2Plus) LogsWithTopics(keyHash common.Hash) map[common.Hash] } } -func (c *coordinatorV2Plus) Version() vrfcommon.Version { +func (c *coordinatorV2_5) Version() vrfcommon.Version { return c.vrfVersion } -func (c *coordinatorV2Plus) RegisterProvingKey(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { +func (c *coordinatorV2_5) RegisterProvingKey(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { return c.coordinator.RegisterProvingKey(opts, oracle, publicProvingKey) } -func (c *coordinatorV2Plus) FilterSubscriptionCreated(opts *bind.FilterOpts, subID []*big.Int) (SubscriptionCreatedIterator, error) { +func (c *coordinatorV2_5) FilterSubscriptionCreated(opts *bind.FilterOpts, subID []*big.Int) (SubscriptionCreatedIterator, error) { it, err := c.coordinator.FilterSubscriptionCreated(opts, subID) if err != nil { return nil, err } - return NewV2PlusSubscriptionCreatedIterator(it), nil + return NewV2_5SubscriptionCreatedIterator(it), nil } -func (c *coordinatorV2Plus) FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subID []*big.Int, sender []common.Address) (RandomWordsRequestedIterator, error) { +func (c *coordinatorV2_5) FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subID []*big.Int, sender []common.Address) (RandomWordsRequestedIterator, error) { it, err := c.coordinator.FilterRandomWordsRequested(opts, keyHash, subID, sender) if err != nil { return nil, err } - return NewV2PlusRandomWordsRequestedIterator(it), nil + return NewV2_5RandomWordsRequestedIterator(it), nil } -func (c *coordinatorV2Plus) FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestID []*big.Int, subID []*big.Int) (RandomWordsFulfilledIterator, error) { +func (c *coordinatorV2_5) FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestID []*big.Int, subID []*big.Int) (RandomWordsFulfilledIterator, error) { it, err := c.coordinator.FilterRandomWordsFulfilled(opts, requestID, subID) if err != nil { return nil, err } - return NewV2PlusRandomWordsFulfilledIterator(it), nil + return NewV2_5RandomWordsFulfilledIterator(it), nil } -func (c *coordinatorV2Plus) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { +func (c *coordinatorV2_5) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { return c.coordinator.TransferOwnership(opts, to) } -func (c *coordinatorV2Plus) RemoveConsumer(opts *bind.TransactOpts, subID *big.Int, consumer common.Address) (*types.Transaction, error) { +func (c *coordinatorV2_5) RemoveConsumer(opts *bind.TransactOpts, subID *big.Int, consumer common.Address) (*types.Transaction, error) { return c.coordinator.RemoveConsumer(opts, subID, consumer) } -func (c *coordinatorV2Plus) CancelSubscription(opts *bind.TransactOpts, subID *big.Int, to common.Address) (*types.Transaction, error) { +func (c *coordinatorV2_5) CancelSubscription(opts *bind.TransactOpts, subID *big.Int, to common.Address) (*types.Transaction, error) { return c.coordinator.CancelSubscription(opts, subID, to) } -func (c *coordinatorV2Plus) GetCommitment(opts *bind.CallOpts, requestID *big.Int) ([32]byte, error) { +func (c *coordinatorV2_5) GetCommitment(opts *bind.CallOpts, requestID *big.Int) ([32]byte, error) { return c.coordinator.SRequestCommitments(opts, requestID) } -func (c *coordinatorV2Plus) Migrate(opts *bind.TransactOpts, subID *big.Int, newCoordinator common.Address) (*types.Transaction, error) { +func (c *coordinatorV2_5) Migrate(opts *bind.TransactOpts, subID *big.Int, newCoordinator common.Address) (*types.Transaction, error) { return c.coordinator.Migrate(opts, subID, newCoordinator) } -func (c *coordinatorV2Plus) FundSubscriptionWithEth(opts *bind.TransactOpts, subID *big.Int, amount *big.Int) (*types.Transaction, error) { +func (c *coordinatorV2_5) FundSubscriptionWithNative(opts *bind.TransactOpts, subID *big.Int, amount *big.Int) (*types.Transaction, error) { if opts == nil { return nil, errors.New("*bind.TransactOpts cannot be nil") } o := *opts o.Value = amount - return c.coordinator.FundSubscriptionWithEth(&o, subID) + return c.coordinator.FundSubscriptionWithNative(&o, subID) } var ( _ RandomWordsRequestedIterator = (*v2RandomWordsRequestedIterator)(nil) - _ RandomWordsRequestedIterator = (*v2PlusRandomWordsRequestedIterator)(nil) + _ RandomWordsRequestedIterator = (*v2_5RandomWordsRequestedIterator)(nil) ) type RandomWordsRequestedIterator interface { @@ -357,37 +358,37 @@ func (it *v2RandomWordsRequestedIterator) Event() RandomWordsRequested { return NewV2RandomWordsRequested(it.iterator.Event) } -type v2PlusRandomWordsRequestedIterator struct { +type v2_5RandomWordsRequestedIterator struct { vrfVersion vrfcommon.Version - iterator *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequestedIterator + iterator *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequestedIterator } -func NewV2PlusRandomWordsRequestedIterator(it *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequestedIterator) RandomWordsRequestedIterator { - return &v2PlusRandomWordsRequestedIterator{ +func NewV2_5RandomWordsRequestedIterator(it *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequestedIterator) RandomWordsRequestedIterator { + return &v2_5RandomWordsRequestedIterator{ vrfVersion: vrfcommon.V2Plus, iterator: it, } } -func (it *v2PlusRandomWordsRequestedIterator) Next() bool { +func (it *v2_5RandomWordsRequestedIterator) Next() bool { return it.iterator.Next() } -func (it *v2PlusRandomWordsRequestedIterator) Error() error { +func (it *v2_5RandomWordsRequestedIterator) Error() error { return it.iterator.Error() } -func (it *v2PlusRandomWordsRequestedIterator) Close() error { +func (it *v2_5RandomWordsRequestedIterator) Close() error { return it.iterator.Close() } -func (it *v2PlusRandomWordsRequestedIterator) Event() RandomWordsRequested { - return NewV2PlusRandomWordsRequested(it.iterator.Event) +func (it *v2_5RandomWordsRequestedIterator) Event() RandomWordsRequested { + return NewV2_5RandomWordsRequested(it.iterator.Event) } var ( _ RandomWordsRequested = (*v2RandomWordsRequested)(nil) - _ RandomWordsRequested = (*v2PlusRandomWordsRequested)(nil) + _ RandomWordsRequested = (*v2_5RandomWordsRequested)(nil) ) type RandomWordsRequested interface { @@ -455,55 +456,55 @@ func (r *v2RandomWordsRequested) NativePayment() bool { return false } -type v2PlusRandomWordsRequested struct { +type v2_5RandomWordsRequested struct { vrfVersion vrfcommon.Version - event *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested + event *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested } -func NewV2PlusRandomWordsRequested(event *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested) RandomWordsRequested { - return &v2PlusRandomWordsRequested{ +func NewV2_5RandomWordsRequested(event *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested) RandomWordsRequested { + return &v2_5RandomWordsRequested{ vrfVersion: vrfcommon.V2Plus, event: event, } } -func (r *v2PlusRandomWordsRequested) Raw() types.Log { +func (r *v2_5RandomWordsRequested) Raw() types.Log { return r.event.Raw } -func (r *v2PlusRandomWordsRequested) NumWords() uint32 { +func (r *v2_5RandomWordsRequested) NumWords() uint32 { return r.event.NumWords } -func (r *v2PlusRandomWordsRequested) SubID() *big.Int { +func (r *v2_5RandomWordsRequested) SubID() *big.Int { return r.event.SubId } -func (r *v2PlusRandomWordsRequested) MinimumRequestConfirmations() uint16 { +func (r *v2_5RandomWordsRequested) MinimumRequestConfirmations() uint16 { return r.event.MinimumRequestConfirmations } -func (r *v2PlusRandomWordsRequested) KeyHash() [32]byte { +func (r *v2_5RandomWordsRequested) KeyHash() [32]byte { return r.event.KeyHash } -func (r *v2PlusRandomWordsRequested) RequestID() *big.Int { +func (r *v2_5RandomWordsRequested) RequestID() *big.Int { return r.event.RequestId } -func (r *v2PlusRandomWordsRequested) PreSeed() *big.Int { +func (r *v2_5RandomWordsRequested) PreSeed() *big.Int { return r.event.PreSeed } -func (r *v2PlusRandomWordsRequested) Sender() common.Address { +func (r *v2_5RandomWordsRequested) Sender() common.Address { return r.event.Sender } -func (r *v2PlusRandomWordsRequested) CallbackGasLimit() uint32 { +func (r *v2_5RandomWordsRequested) CallbackGasLimit() uint32 { return r.event.CallbackGasLimit } -func (r *v2PlusRandomWordsRequested) NativePayment() bool { +func (r *v2_5RandomWordsRequested) NativePayment() bool { nativePayment, err := extraargs.FromExtraArgsV1(r.event.ExtraArgs) if err != nil { panic(err) @@ -513,7 +514,7 @@ func (r *v2PlusRandomWordsRequested) NativePayment() bool { var ( _ RandomWordsFulfilledIterator = (*v2RandomWordsFulfilledIterator)(nil) - _ RandomWordsFulfilledIterator = (*v2PlusRandomWordsFulfilledIterator)(nil) + _ RandomWordsFulfilledIterator = (*v2_5RandomWordsFulfilledIterator)(nil) ) type RandomWordsFulfilledIterator interface { @@ -551,37 +552,37 @@ func (it *v2RandomWordsFulfilledIterator) Event() RandomWordsFulfilled { return NewV2RandomWordsFulfilled(it.iterator.Event) } -type v2PlusRandomWordsFulfilledIterator struct { +type v2_5RandomWordsFulfilledIterator struct { vrfVersion vrfcommon.Version - iterator *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilledIterator + iterator *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilledIterator } -func NewV2PlusRandomWordsFulfilledIterator(it *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilledIterator) RandomWordsFulfilledIterator { - return &v2PlusRandomWordsFulfilledIterator{ +func NewV2_5RandomWordsFulfilledIterator(it *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilledIterator) RandomWordsFulfilledIterator { + return &v2_5RandomWordsFulfilledIterator{ vrfVersion: vrfcommon.V2Plus, iterator: it, } } -func (it *v2PlusRandomWordsFulfilledIterator) Next() bool { +func (it *v2_5RandomWordsFulfilledIterator) Next() bool { return it.iterator.Next() } -func (it *v2PlusRandomWordsFulfilledIterator) Error() error { +func (it *v2_5RandomWordsFulfilledIterator) Error() error { return it.iterator.Error() } -func (it *v2PlusRandomWordsFulfilledIterator) Close() error { +func (it *v2_5RandomWordsFulfilledIterator) Close() error { return it.iterator.Close() } -func (it *v2PlusRandomWordsFulfilledIterator) Event() RandomWordsFulfilled { - return NewV2PlusRandomWordsFulfilled(it.iterator.Event) +func (it *v2_5RandomWordsFulfilledIterator) Event() RandomWordsFulfilled { + return NewV2_5RandomWordsFulfilled(it.iterator.Event) } var ( _ RandomWordsFulfilled = (*v2RandomWordsFulfilled)(nil) - _ RandomWordsFulfilled = (*v2PlusRandomWordsFulfilled)(nil) + _ RandomWordsFulfilled = (*v2_5RandomWordsFulfilled)(nil) ) type RandomWordsFulfilled interface { @@ -628,41 +629,41 @@ func (rwf *v2RandomWordsFulfilled) Raw() types.Log { return rwf.event.Raw } -type v2PlusRandomWordsFulfilled struct { +type v2_5RandomWordsFulfilled struct { vrfVersion vrfcommon.Version - event *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled + event *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled } -func NewV2PlusRandomWordsFulfilled(event *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled) RandomWordsFulfilled { - return &v2PlusRandomWordsFulfilled{ +func NewV2_5RandomWordsFulfilled(event *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled) RandomWordsFulfilled { + return &v2_5RandomWordsFulfilled{ vrfVersion: vrfcommon.V2Plus, event: event, } } -func (rwf *v2PlusRandomWordsFulfilled) RequestID() *big.Int { +func (rwf *v2_5RandomWordsFulfilled) RequestID() *big.Int { return rwf.event.RequestId } -func (rwf *v2PlusRandomWordsFulfilled) Success() bool { +func (rwf *v2_5RandomWordsFulfilled) Success() bool { return rwf.event.Success } -func (rwf *v2PlusRandomWordsFulfilled) SubID() *big.Int { - return rwf.event.SubID +func (rwf *v2_5RandomWordsFulfilled) SubID() *big.Int { + return rwf.event.SubId } -func (rwf *v2PlusRandomWordsFulfilled) Payment() *big.Int { +func (rwf *v2_5RandomWordsFulfilled) Payment() *big.Int { return rwf.event.Payment } -func (rwf *v2PlusRandomWordsFulfilled) Raw() types.Log { +func (rwf *v2_5RandomWordsFulfilled) Raw() types.Log { return rwf.event.Raw } var ( _ SubscriptionCreatedIterator = (*v2SubscriptionCreatedIterator)(nil) - _ SubscriptionCreatedIterator = (*v2PlusSubscriptionCreatedIterator)(nil) + _ SubscriptionCreatedIterator = (*v2_5SubscriptionCreatedIterator)(nil) ) type SubscriptionCreatedIterator interface { @@ -700,37 +701,37 @@ func (it *v2SubscriptionCreatedIterator) Event() SubscriptionCreated { return NewV2SubscriptionCreated(it.iterator.Event) } -type v2PlusSubscriptionCreatedIterator struct { +type v2_5SubscriptionCreatedIterator struct { vrfVersion vrfcommon.Version - iterator *vrf_coordinator_v2plus.VRFCoordinatorV2PlusSubscriptionCreatedIterator + iterator *vrf_coordinator_v2_5.VRFCoordinatorV25SubscriptionCreatedIterator } -func NewV2PlusSubscriptionCreatedIterator(it *vrf_coordinator_v2plus.VRFCoordinatorV2PlusSubscriptionCreatedIterator) SubscriptionCreatedIterator { - return &v2PlusSubscriptionCreatedIterator{ +func NewV2_5SubscriptionCreatedIterator(it *vrf_coordinator_v2_5.VRFCoordinatorV25SubscriptionCreatedIterator) SubscriptionCreatedIterator { + return &v2_5SubscriptionCreatedIterator{ vrfVersion: vrfcommon.V2Plus, iterator: it, } } -func (it *v2PlusSubscriptionCreatedIterator) Next() bool { +func (it *v2_5SubscriptionCreatedIterator) Next() bool { return it.iterator.Next() } -func (it *v2PlusSubscriptionCreatedIterator) Error() error { +func (it *v2_5SubscriptionCreatedIterator) Error() error { return it.iterator.Error() } -func (it *v2PlusSubscriptionCreatedIterator) Close() error { +func (it *v2_5SubscriptionCreatedIterator) Close() error { return it.iterator.Close() } -func (it *v2PlusSubscriptionCreatedIterator) Event() SubscriptionCreated { - return NewV2PlusSubscriptionCreated(it.iterator.Event) +func (it *v2_5SubscriptionCreatedIterator) Event() SubscriptionCreated { + return NewV2_5SubscriptionCreated(it.iterator.Event) } var ( _ SubscriptionCreated = (*v2SubscriptionCreated)(nil) - _ SubscriptionCreated = (*v2PlusSubscriptionCreated)(nil) + _ SubscriptionCreated = (*v2_5SubscriptionCreated)(nil) ) type SubscriptionCreated interface { @@ -758,34 +759,34 @@ func (sc *v2SubscriptionCreated) SubID() *big.Int { return new(big.Int).SetUint64(sc.event.SubId) } -type v2PlusSubscriptionCreated struct { +type v2_5SubscriptionCreated struct { vrfVersion vrfcommon.Version - event *vrf_coordinator_v2plus.VRFCoordinatorV2PlusSubscriptionCreated + event *vrf_coordinator_v2_5.VRFCoordinatorV25SubscriptionCreated } -func NewV2PlusSubscriptionCreated(event *vrf_coordinator_v2plus.VRFCoordinatorV2PlusSubscriptionCreated) SubscriptionCreated { - return &v2PlusSubscriptionCreated{ +func NewV2_5SubscriptionCreated(event *vrf_coordinator_v2_5.VRFCoordinatorV25SubscriptionCreated) SubscriptionCreated { + return &v2_5SubscriptionCreated{ vrfVersion: vrfcommon.V2Plus, event: event, } } -func (sc *v2PlusSubscriptionCreated) Owner() common.Address { +func (sc *v2_5SubscriptionCreated) Owner() common.Address { return sc.event.Owner } -func (sc *v2PlusSubscriptionCreated) SubID() *big.Int { +func (sc *v2_5SubscriptionCreated) SubID() *big.Int { return sc.event.SubId } var ( _ Subscription = (*v2Subscription)(nil) - _ Subscription = (*v2PlusSubscription)(nil) + _ Subscription = (*v2_5Subscription)(nil) ) type Subscription interface { Balance() *big.Int - EthBalance() *big.Int + NativeBalance() *big.Int Owner() common.Address Consumers() []common.Address Version() vrfcommon.Version @@ -807,7 +808,7 @@ func (s v2Subscription) Balance() *big.Int { return s.event.Balance } -func (s v2Subscription) EthBalance() *big.Int { +func (s v2Subscription) NativeBalance() *big.Int { panic("EthBalance not supported on V2") } @@ -823,41 +824,41 @@ func (s v2Subscription) Version() vrfcommon.Version { return s.vrfVersion } -type v2PlusSubscription struct { +type v2_5Subscription struct { vrfVersion vrfcommon.Version - event vrf_coordinator_v2plus.GetSubscription + event vrf_coordinator_v2_5.GetSubscription } -func NewV2PlusSubscription(event vrf_coordinator_v2plus.GetSubscription) Subscription { - return &v2PlusSubscription{ +func NewV2_5Subscription(event vrf_coordinator_v2_5.GetSubscription) Subscription { + return &v2_5Subscription{ vrfVersion: vrfcommon.V2Plus, event: event, } } -func (s *v2PlusSubscription) Balance() *big.Int { +func (s *v2_5Subscription) Balance() *big.Int { return s.event.Balance } -func (s *v2PlusSubscription) EthBalance() *big.Int { - return s.event.EthBalance +func (s *v2_5Subscription) NativeBalance() *big.Int { + return s.event.NativeBalance } -func (s *v2PlusSubscription) Owner() common.Address { +func (s *v2_5Subscription) Owner() common.Address { return s.event.Owner } -func (s *v2PlusSubscription) Consumers() []common.Address { +func (s *v2_5Subscription) Consumers() []common.Address { return s.event.Consumers } -func (s *v2PlusSubscription) Version() vrfcommon.Version { +func (s *v2_5Subscription) Version() vrfcommon.Version { return s.vrfVersion } var ( _ Config = (*v2Config)(nil) - _ Config = (*v2PlusConfig)(nil) + _ Config = (*v2_5Config)(nil) ) type Config interface { @@ -895,38 +896,38 @@ func (c *v2Config) StalenessSeconds() uint32 { return c.config.StalenessSeconds } -type v2PlusConfig struct { +type v2_5Config struct { vrfVersion vrfcommon.Version - config vrf_coordinator_v2plus.SConfig + config vrf_coordinator_v2_5.SConfig } -func NewV2PlusConfig(config vrf_coordinator_v2plus.SConfig) Config { - return &v2PlusConfig{ +func NewV2_5Config(config vrf_coordinator_v2_5.SConfig) Config { + return &v2_5Config{ vrfVersion: vrfcommon.V2Plus, config: config, } } -func (c *v2PlusConfig) MinimumRequestConfirmations() uint16 { +func (c *v2_5Config) MinimumRequestConfirmations() uint16 { return c.config.MinimumRequestConfirmations } -func (c *v2PlusConfig) MaxGasLimit() uint32 { +func (c *v2_5Config) MaxGasLimit() uint32 { return c.config.MaxGasLimit } -func (c *v2PlusConfig) GasAfterPaymentCalculation() uint32 { +func (c *v2_5Config) GasAfterPaymentCalculation() uint32 { return c.config.GasAfterPaymentCalculation } -func (c *v2PlusConfig) StalenessSeconds() uint32 { +func (c *v2_5Config) StalenessSeconds() uint32 { return c.config.StalenessSeconds } type VRFProof struct { VRFVersion vrfcommon.Version V2 vrf_coordinator_v2.VRFProof - V2Plus vrf_coordinator_v2plus.VRFProof + V2Plus vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof } func FromV2Proof(proof vrf_coordinator_v2.VRFProof) VRFProof { @@ -936,7 +937,7 @@ func FromV2Proof(proof vrf_coordinator_v2.VRFProof) VRFProof { } } -func FromV2PlusProof(proof vrf_coordinator_v2plus.VRFProof) VRFProof { +func FromV2PlusProof(proof vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof) VRFProof { return VRFProof{ VRFVersion: vrfcommon.V2Plus, V2Plus: proof, @@ -951,8 +952,8 @@ func ToV2Proofs(proofs []VRFProof) []vrf_coordinator_v2.VRFProof { return v2Proofs } -func ToV2PlusProofs(proofs []VRFProof) []vrf_coordinator_v2plus.VRFProof { - v2Proofs := make([]vrf_coordinator_v2plus.VRFProof, len(proofs)) +func ToV2PlusProofs(proofs []VRFProof) []vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof { + v2Proofs := make([]vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof, len(proofs)) for i, proof := range proofs { v2Proofs[i] = proof.V2Plus } @@ -962,7 +963,7 @@ func ToV2PlusProofs(proofs []VRFProof) []vrf_coordinator_v2plus.VRFProof { type RequestCommitment struct { VRFVersion vrfcommon.Version V2 vrf_coordinator_v2.VRFCoordinatorV2RequestCommitment - V2Plus vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment + V2Plus vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment } func ToV2Commitments(commitments []RequestCommitment) []vrf_coordinator_v2.VRFCoordinatorV2RequestCommitment { @@ -973,8 +974,8 @@ func ToV2Commitments(commitments []RequestCommitment) []vrf_coordinator_v2.VRFCo return v2Commitments } -func ToV2PlusCommitments(commitments []RequestCommitment) []vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment { - v2PlusCommitments := make([]vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment, len(commitments)) +func ToV2PlusCommitments(commitments []RequestCommitment) []vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment { + v2PlusCommitments := make([]vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment, len(commitments)) for i, commitment := range commitments { v2PlusCommitments[i] = commitment.V2Plus } @@ -985,7 +986,7 @@ func NewRequestCommitment(val any) RequestCommitment { switch val := val.(type) { case vrf_coordinator_v2.VRFCoordinatorV2RequestCommitment: return RequestCommitment{VRFVersion: vrfcommon.V2, V2: val} - case vrf_coordinator_v2plus.VRFCoordinatorV2PlusRequestCommitment: + case vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRequestCommitment: return RequestCommitment{VRFVersion: vrfcommon.V2Plus, V2Plus: val} default: panic(fmt.Sprintf("NewRequestCommitment: unknown type %T", val)) diff --git a/core/services/vrf/v2/integration_v2_plus_test.go b/core/services/vrf/v2/integration_v2_plus_test.go index 7e05c5b347c..2f20842aa57 100644 --- a/core/services/vrf/v2/integration_v2_plus_test.go +++ b/core/services/vrf/v2/integration_v2_plus_test.go @@ -28,8 +28,9 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/trusted_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_consumer_v2_plus_upgradeable_example" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_consumer_v2_upgradeable_example" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_plus_v2_example" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_malicious_consumer_v2_plus" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_single_consumer" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_sub_owner" @@ -104,7 +105,7 @@ func newVRFCoordinatorV2PlusUniverse(t *testing.T, key ethkey.KeyV2, numConsumer vrfv2plus_consumer_example.VRFV2PlusConsumerExampleABI)) require.NoError(t, err) coordinatorABI, err := abi.JSON(strings.NewReader( - vrf_coordinator_v2plus.VRFCoordinatorV2PlusABI)) + vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalABI)) require.NoError(t, err) backend := cltest.NewSimulatedBackend(t, genesisData, gasLimit) // Deploy link @@ -136,12 +137,12 @@ func newVRFCoordinatorV2PlusUniverse(t *testing.T, key ethkey.KeyV2, numConsumer bhsAddr = trustedBHSAddress } coordinatorAddress, _, coordinatorContract, err := - vrf_coordinator_v2plus.DeployVRFCoordinatorV2Plus( + vrf_coordinator_v2_5.DeployVRFCoordinatorV25( neil, backend, bhsAddr) require.NoError(t, err, "failed to deploy VRFCoordinatorV2 contract to simulated ethereum blockchain") backend.Commit() - _, err = coordinatorContract.SetLINKAndLINKETHFeed(neil, linkAddress, linkEthFeed) + _, err = coordinatorContract.SetLINKAndLINKNativeFeed(neil, linkAddress, linkEthFeed) require.NoError(t, err) backend.Commit() @@ -251,9 +252,9 @@ func newVRFCoordinatorV2PlusUniverse(t *testing.T, key ethkey.KeyV2, numConsumer uint32(60*60*24), // stalenessSeconds uint32(v22.GasAfterPaymentCalculation), // gasAfterPaymentCalculation big.NewInt(1e16), // 0.01 eth per link fallbackLinkPrice - vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig{ - FulfillmentFlatFeeLinkPPM: uint32(1000), // 0.001 LINK premium - FulfillmentFlatFeeEthPPM: uint32(5), // 0.000005 ETH premium + vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: uint32(1000), // 0.001 LINK premium + FulfillmentFlatFeeNativePPM: uint32(5), // 0.000005 ETH premium }, ) require.NoError(t, err, "failed to set coordinator configuration") @@ -272,7 +273,7 @@ func newVRFCoordinatorV2PlusUniverse(t *testing.T, key ethkey.KeyV2, numConsumer consumerProxyContractAddress: proxiedConsumer.Address(), proxyAdminAddress: proxyAdminAddress, - rootContract: v22.NewCoordinatorV2Plus(coordinatorContract), + rootContract: v22.NewCoordinatorV2_5(coordinatorContract), rootContractAddress: coordinatorAddress, linkContract: linkContract, linkContractAddress: linkAddress, @@ -717,16 +718,16 @@ func TestVRFV2PlusIntegration_ExternalOwnerConsumerExample(t *testing.T) { require.NoError(t, err) backend.Commit() coordinatorAddress, _, coordinator, err := - vrf_coordinator_v2plus.DeployVRFCoordinatorV2Plus( + vrf_coordinator_v2_5.DeployVRFCoordinatorV25( owner, backend, common.Address{}) //bhs not needed for this test require.NoError(t, err) - _, err = coordinator.SetConfig(owner, uint16(1), uint32(10000), 1, 1, big.NewInt(10), vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig{ - FulfillmentFlatFeeLinkPPM: 0, - FulfillmentFlatFeeEthPPM: 0, + _, err = coordinator.SetConfig(owner, uint16(1), uint32(10000), 1, 1, big.NewInt(10), vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: 0, + FulfillmentFlatFeeNativePPM: 0, }) require.NoError(t, err) backend.Commit() - _, err = coordinator.SetLINKAndLINKETHFeed(owner, linkAddress, linkEthFeed) + _, err = coordinator.SetLINKAndLINKNativeFeed(owner, linkAddress, linkEthFeed) require.NoError(t, err) backend.Commit() consumerAddress, _, consumer, err := vrf_v2plus_sub_owner.DeployVRFV2PlusExternalSubOwnerExample(owner, backend, coordinatorAddress, linkAddress) @@ -787,11 +788,11 @@ func TestVRFV2PlusIntegration_SimpleConsumerExample(t *testing.T) { require.NoError(t, err) backend.Commit() coordinatorAddress, _, coordinator, err := - vrf_coordinator_v2plus.DeployVRFCoordinatorV2Plus( + vrf_coordinator_v2_5.DeployVRFCoordinatorV25( owner, backend, common.Address{}) // bhs not needed for this test require.NoError(t, err) backend.Commit() - _, err = coordinator.SetLINKAndLINKETHFeed(owner, linkAddress, linkEthFeed) + _, err = coordinator.SetLINKAndLINKNativeFeed(owner, linkAddress, linkEthFeed) require.NoError(t, err) backend.Commit() consumerAddress, _, consumer, err := vrf_v2plus_single_consumer.DeployVRFV2PlusSingleConsumerExample(owner, backend, coordinatorAddress, linkAddress, 1, 1, 1, [32]byte{}, false) @@ -1137,7 +1138,7 @@ func setupSubscriptionAndFund( require.NoError(t, err, "failed to fund sub") uni.backend.Commit() - _, err = uni.rootContract.FundSubscriptionWithEth(consumer, subID, nativeAmount) + _, err = uni.rootContract.FundSubscriptionWithNative(consumer, subID, nativeAmount) require.NoError(t, err, "failed to fund sub with native") uni.backend.Commit() @@ -1238,12 +1239,12 @@ func TestVRFV2PlusIntegration_Migration(t *testing.T) { require.NoError(t, err) require.Equal(t, subV1.Balance(), totalLinkBalance) - require.Equal(t, subV1.EthBalance(), totalNativeBalance) + require.Equal(t, subV1.NativeBalance(), totalNativeBalance) require.Equal(t, subV1.Balance(), linkContractBalance) - require.Equal(t, subV1.EthBalance(), balance) + require.Equal(t, subV1.NativeBalance(), balance) require.Equal(t, subV1.Balance(), subV2.LinkBalance) - require.Equal(t, subV1.EthBalance(), subV2.NativeBalance) + require.Equal(t, subV1.NativeBalance(), subV2.NativeBalance) require.Equal(t, subV1.Owner(), subV2.Owner) require.Equal(t, len(subV1.Consumers()), len(subV2.Consumers)) for i, c := range subV1.Consumers() { diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index 33e613733d5..1f6a9dd3f92 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -497,7 +497,7 @@ func subscribeVRF( require.NoError(t, err) if nativePayment { - require.Equal(t, fundingAmount.String(), sub.EthBalance().String()) + require.Equal(t, fundingAmount.String(), sub.NativeBalance().String()) } else { require.Equal(t, fundingAmount.String(), sub.Balance().String()) } diff --git a/core/services/vrf/v2/listener_v2.go b/core/services/vrf/v2/listener_v2.go index ff915fba34e..6a1ad3e8b2e 100644 --- a/core/services/vrf/v2/listener_v2.go +++ b/core/services/vrf/v2/listener_v2.go @@ -34,7 +34,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_vrf_coordinator_v2" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_vrf_coordinator_v2plus" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_owner" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -50,7 +50,7 @@ var ( _ log.Listener = &listenerV2{} _ job.ServiceCtx = &listenerV2{} coordinatorV2ABI = evmtypes.MustGetABI(vrf_coordinator_v2.VRFCoordinatorV2ABI) - coordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus.VRFCoordinatorV2PlusABI) + coordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalABI) batchCoordinatorV2ABI = evmtypes.MustGetABI(batch_vrf_coordinator_v2.BatchVRFCoordinatorV2ABI) batchCoordinatorV2PlusABI = evmtypes.MustGetABI(batch_vrf_coordinator_v2plus.BatchVRFCoordinatorV2PlusABI) vrfOwnerABI = evmtypes.MustGetABI(vrf_owner.VRFOwnerMetaData.ABI) @@ -493,7 +493,7 @@ func (lsn *listenerV2) processPendingVRFRequests(ctx context.Context) { // Happy path - sub is active. startLinkBalance = sub.Balance() if sub.Version() == vrfcommon.V2Plus { - startEthBalance = sub.EthBalance() + startEthBalance = sub.NativeBalance() } subIsActive = true } @@ -1496,7 +1496,7 @@ func (lsn *listenerV2) simulateFulfillment( if trr.Task.Type() == pipeline.TaskTypeVRFV2Plus { m := trr.Result.Value.(map[string]interface{}) res.payload = m["output"].(string) - res.proof = FromV2PlusProof(m["proof"].(vrf_coordinator_v2plus.VRFProof)) + res.proof = FromV2PlusProof(m["proof"].(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof)) res.reqCommitment = NewRequestCommitment(m["requestCommitment"]) } @@ -1598,7 +1598,7 @@ func (lsn *listenerV2) handleLog(lb log.Broadcast, minConfs uint32) { return } - if v, ok := lb.DecodedLog().(*vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled); ok { + if v, ok := lb.DecodedLog().(*vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRandomWordsFulfilled); ok { lsn.l.Debugw("Received fulfilled log", "reqID", v.RequestId, "success", v.Success) consumed, err := lsn.logBroadcaster.WasAlreadyConsumed(lb) if err != nil { diff --git a/core/services/vrf/v2/listener_v2_test.go b/core/services/vrf/v2/listener_v2_test.go index 4da20a2a7e8..77e279d8f7c 100644 --- a/core/services/vrf/v2/listener_v2_test.go +++ b/core/services/vrf/v2/listener_v2_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/sqlx" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" @@ -468,7 +468,7 @@ func TestListener_handleLog(tt *testing.T) { FromAddresses: []string{"0xF2982b7Ef6E3D8BB738f8Ea20502229781f6Ad97"}, }).Toml()) require.NoError(t, err) - fulfilledLog := vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled{ + fulfilledLog := vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalRandomWordsFulfilled{ RequestId: big.NewInt(requestID), Raw: types.Log{BlockNumber: blockNumber}, } diff --git a/core/services/vrf/v2/listener_v2_types_test.go b/core/services/vrf/v2/listener_v2_types_test.go index 11bb7c98769..5391e18589b 100644 --- a/core/services/vrf/v2/listener_v2_types_test.go +++ b/core/services/vrf/v2/listener_v2_types_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log/mocks" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" @@ -64,7 +64,7 @@ func Test_BatchFulfillments_AddRun_V2Plus(t *testing.T) { bfs.addRun(vrfPipelineResult{ gasLimit: 500, req: pendingRequest{ - req: NewV2PlusRandomWordsRequested(&vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested{ + req: NewV2_5RandomWordsRequested(&vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested{ RequestId: big.NewInt(1), Raw: types.Log{ TxHash: common.HexToHash("0xd8d7ecc4800d25fa53ce0372f13a416d98907a7ef3d8d3bdd79cf4fe75529c65"), @@ -83,7 +83,7 @@ func Test_BatchFulfillments_AddRun_V2Plus(t *testing.T) { bfs.addRun(vrfPipelineResult{ gasLimit: 500, req: pendingRequest{ - req: NewV2PlusRandomWordsRequested(&vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested{ + req: NewV2_5RandomWordsRequested(&vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested{ RequestId: big.NewInt(1), Raw: types.Log{ TxHash: common.HexToHash("0xd8d7ecc4800d25fa53ce0372f13a416d98907a7ef3d8d3bdd79cf4fe75529c65"), diff --git a/integration-tests/actions/vrfv2plus/vrfv2plus_constants/constants.go b/integration-tests/actions/vrfv2plus/vrfv2plus_constants/constants.go index 926943c18c7..bb266e7c2c5 100644 --- a/integration-tests/actions/vrfv2plus/vrfv2plus_constants/constants.go +++ b/integration-tests/actions/vrfv2plus/vrfv2plus_constants/constants.go @@ -1,32 +1,33 @@ package vrfv2plus_constants import ( - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" "math/big" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" ) var ( - LinkEthFeedResponse = big.NewInt(1e18) + LinkNativeFeedResponse = big.NewInt(1e18) MinimumConfirmations = uint16(3) RandomnessRequestCountPerRequest = uint16(1) VRFSubscriptionFundingAmountLink = big.NewInt(10) VRFSubscriptionFundingAmountNativeToken = big.NewInt(1) - ChainlinkNodeFundingAmountEth = big.NewFloat(0.1) + ChainlinkNodeFundingAmountNative = big.NewFloat(0.1) NumberOfWords = uint32(3) CallbackGasLimit = uint32(1000000) MaxGasLimitVRFCoordinatorConfig = uint32(2.5e6) StalenessSeconds = uint32(86400) GasAfterPaymentCalculation = uint32(33825) - VRFCoordinatorV2PlusFeeConfig = vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig{ - FulfillmentFlatFeeLinkPPM: 500, - FulfillmentFlatFeeEthPPM: 500, + VRFCoordinatorV2_5FeeConfig = vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: 500, + FulfillmentFlatFeeNativePPM: 500, } VRFCoordinatorV2PlusUpgradedVersionFeeConfig = vrf_v2plus_upgraded_version.VRFCoordinatorV2PlusUpgradedVersionFeeConfig{ - FulfillmentFlatFeeLinkPPM: 500, - FulfillmentFlatFeeEthPPM: 500, + FulfillmentFlatFeeLinkPPM: 500, + FulfillmentFlatFeeNativePPM: 500, } WrapperGasOverhead = uint32(50_000) diff --git a/integration-tests/actions/vrfv2plus/vrfv2plus_models.go b/integration-tests/actions/vrfv2plus/vrfv2plus_models.go index e83dfebc64e..c227d490eb9 100644 --- a/integration-tests/actions/vrfv2plus/vrfv2plus_models.go +++ b/integration-tests/actions/vrfv2plus/vrfv2plus_models.go @@ -23,8 +23,8 @@ type VRFV2PlusData struct { ChainID *big.Int } -type VRFV2PlusContracts struct { - Coordinator contracts.VRFCoordinatorV2Plus +type VRFV2_5Contracts struct { + Coordinator contracts.VRFCoordinatorV2_5 BHS contracts.BlockHashStore LoadTestConsumers []contracts.VRFv2PlusLoadTestConsumer } diff --git a/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go b/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go index c850d4bdf6f..8c3c2a733ac 100644 --- a/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go +++ b/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go @@ -3,6 +3,9 @@ package vrfv2plus import ( "context" "fmt" + "math/big" + "time" + "github.com/ethereum/go-ethereum/common" "github.com/google/uuid" "github.com/pkg/errors" @@ -14,11 +17,9 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" chainlinkutils "github.com/smartcontractkit/chainlink/v2/core/utils" - "math/big" - "time" ) var ( @@ -35,13 +36,13 @@ var ( ErrSendingLinkToken = "error sending Link token" ErrCreatingVRFv2PlusJob = "error creating VRFv2Plus job" ErrParseJob = "error parsing job definition" - ErrDeployVRFV2PlusContracts = "error deploying VRFV2Plus contracts" + ErrDeployVRFV2_5Contracts = "error deploying VRFV2_5 contracts" ErrSetVRFCoordinatorConfig = "error setting config for VRF Coordinator contract" ErrCreateVRFSubscription = "error creating VRF Subscription" ErrFindSubID = "error finding created subscription ID" ErrAddConsumerToSub = "error adding consumer to VRF Subscription" ErrFundSubWithNativeToken = "error funding subscription with native token" - ErrSetLinkETHLinkFeed = "error setting Link and ETH/LINK feed for VRF Coordinator contract" + ErrSetLinkNativeLinkFeed = "error setting Link and ETH/LINK feed for VRF Coordinator contract" ErrFundSubWithLinkToken = "error funding subscription with Link tokens" ErrCreateVRFV2PlusJobs = "error creating VRF V2 Plus Jobs" ErrGetPrimaryKey = "error getting primary ETH key address" @@ -58,11 +59,11 @@ var ( ErrDeployWrapper = "error deploying VRFV2PlusWrapper" ) -func DeployVRFV2PlusContracts( +func DeployVRFV2_5Contracts( contractDeployer contracts.ContractDeployer, chainClient blockchain.EVMClient, consumerContractsAmount int, -) (*VRFV2PlusContracts, error) { +) (*VRFV2_5Contracts, error) { bhs, err := contractDeployer.DeployBlockhashStore() if err != nil { return nil, errors.Wrap(err, ErrDeployBlockHashStore) @@ -71,7 +72,7 @@ func DeployVRFV2PlusContracts( if err != nil { return nil, errors.Wrap(err, ErrWaitTXsComplete) } - coordinator, err := contractDeployer.DeployVRFCoordinatorV2Plus(bhs.Address()) + coordinator, err := contractDeployer.DeployVRFCoordinatorV2_5(bhs.Address()) if err != nil { return nil, errors.Wrap(err, ErrDeployCoordinator) } @@ -87,7 +88,7 @@ func DeployVRFV2PlusContracts( if err != nil { return nil, errors.Wrap(err, ErrWaitTXsComplete) } - return &VRFV2PlusContracts{coordinator, bhs, consumers}, nil + return &VRFV2_5Contracts{coordinator, bhs, consumers}, nil } func DeployVRFV2PlusDirectFundingContracts( @@ -95,7 +96,7 @@ func DeployVRFV2PlusDirectFundingContracts( chainClient blockchain.EVMClient, linkTokenAddress string, linkEthFeedAddress string, - coordinator contracts.VRFCoordinatorV2Plus, + coordinator contracts.VRFCoordinatorV2_5, consumerContractsAmount int, ) (*VRFV2PlusWrapperContracts, error) { @@ -119,7 +120,7 @@ func DeployVRFV2PlusDirectFundingContracts( return &VRFV2PlusWrapperContracts{vrfv2PlusWrapper, consumers}, nil } -func DeployVRFV2PlusConsumers(contractDeployer contracts.ContractDeployer, coordinator contracts.VRFCoordinatorV2Plus, consumerContractsAmount int) ([]contracts.VRFv2PlusLoadTestConsumer, error) { +func DeployVRFV2PlusConsumers(contractDeployer contracts.ContractDeployer, coordinator contracts.VRFCoordinatorV2_5, consumerContractsAmount int) ([]contracts.VRFv2PlusLoadTestConsumer, error) { var consumers []contracts.VRFv2PlusLoadTestConsumer for i := 1; i <= consumerContractsAmount; i++ { loadTestConsumer, err := contractDeployer.DeployVRFv2PlusLoadTestConsumer(coordinator.Address()) @@ -178,10 +179,10 @@ func CreateVRFV2PlusJob( return job, nil } -func VRFV2PlusRegisterProvingKey( +func VRFV2_5RegisterProvingKey( vrfKey *client.VRFKey, oracleAddress string, - coordinator contracts.VRFCoordinatorV2Plus, + coordinator contracts.VRFCoordinatorV2_5, ) (VRFV2PlusEncodedProvingKey, error) { provingKey, err := actions.EncodeOnChainVRFProvingKey(*vrfKey) if err != nil { @@ -216,7 +217,7 @@ func VRFV2PlusUpgradedVersionRegisterProvingKey( return provingKey, nil } -func FundVRFCoordinatorV2PlusSubscription(linkToken contracts.LinkToken, coordinator contracts.VRFCoordinatorV2Plus, chainClient blockchain.EVMClient, subscriptionID *big.Int, linkFundingAmount *big.Int) error { +func FundVRFCoordinatorV2_5Subscription(linkToken contracts.LinkToken, coordinator contracts.VRFCoordinatorV2_5, chainClient blockchain.EVMClient, subscriptionID *big.Int, linkFundingAmount *big.Int) error { encodedSubId, err := chainlinkutils.ABIEncode(`[{"type":"uint256"}]`, subscriptionID) if err != nil { return errors.Wrap(err, ErrABIEncodingFunding) @@ -228,31 +229,31 @@ func FundVRFCoordinatorV2PlusSubscription(linkToken contracts.LinkToken, coordin return chainClient.WaitForEvents() } -func SetupVRFV2PlusEnvironment( +func SetupVRFV2_5Environment( env *test_env.CLClusterTestEnv, linkToken contracts.LinkToken, - mockETHLinkFeed contracts.MockETHLINKFeed, + mockNativeLINKFeed contracts.MockETHLINKFeed, consumerContractsAmount int, -) (*VRFV2PlusContracts, *big.Int, *VRFV2PlusData, error) { +) (*VRFV2_5Contracts, *big.Int, *VRFV2PlusData, error) { - vrfv2PlusContracts, err := DeployVRFV2PlusContracts(env.ContractDeployer, env.EVMClient, consumerContractsAmount) + vrfv2_5Contracts, err := DeployVRFV2_5Contracts(env.ContractDeployer, env.EVMClient, consumerContractsAmount) if err != nil { - return nil, nil, nil, errors.Wrap(err, ErrDeployVRFV2PlusContracts) + return nil, nil, nil, errors.Wrap(err, ErrDeployVRFV2_5Contracts) } - err = vrfv2PlusContracts.Coordinator.SetConfig( + err = vrfv2_5Contracts.Coordinator.SetConfig( vrfv2plus_constants.MinimumConfirmations, vrfv2plus_constants.MaxGasLimitVRFCoordinatorConfig, vrfv2plus_constants.StalenessSeconds, vrfv2plus_constants.GasAfterPaymentCalculation, - vrfv2plus_constants.LinkEthFeedResponse, - vrfv2plus_constants.VRFCoordinatorV2PlusFeeConfig, + vrfv2plus_constants.LinkNativeFeedResponse, + vrfv2plus_constants.VRFCoordinatorV2_5FeeConfig, ) if err != nil { return nil, nil, nil, errors.Wrap(err, ErrSetVRFCoordinatorConfig) } - subID, err := CreateSubAndFindSubID(env, vrfv2PlusContracts.Coordinator) + subID, err := CreateSubAndFindSubID(env, vrfv2_5Contracts.Coordinator) if err != nil { return nil, nil, nil, err } @@ -261,22 +262,22 @@ func SetupVRFV2PlusEnvironment( if err != nil { return nil, nil, nil, errors.Wrap(err, ErrWaitTXsComplete) } - for _, consumer := range vrfv2PlusContracts.LoadTestConsumers { - err = vrfv2PlusContracts.Coordinator.AddConsumer(subID, consumer.Address()) + for _, consumer := range vrfv2_5Contracts.LoadTestConsumers { + err = vrfv2_5Contracts.Coordinator.AddConsumer(subID, consumer.Address()) if err != nil { return nil, nil, nil, errors.Wrap(err, ErrAddConsumerToSub) } } - err = vrfv2PlusContracts.Coordinator.SetLINKAndLINKETHFeed(linkToken.Address(), mockETHLinkFeed.Address()) + err = vrfv2_5Contracts.Coordinator.SetLINKAndLINKNativeFeed(linkToken.Address(), mockNativeLINKFeed.Address()) if err != nil { - return nil, nil, nil, errors.Wrap(err, ErrSetLinkETHLinkFeed) + return nil, nil, nil, errors.Wrap(err, ErrSetLinkNativeLinkFeed) } err = env.EVMClient.WaitForEvents() if err != nil { return nil, nil, nil, errors.Wrap(err, ErrWaitTXsComplete) } - err = FundSubscription(env, linkToken, vrfv2PlusContracts.Coordinator, subID) + err = FundSubscription(env, linkToken, vrfv2_5Contracts.Coordinator, subID) if err != nil { return nil, nil, nil, err } @@ -291,11 +292,11 @@ func SetupVRFV2PlusEnvironment( if err != nil { return nil, nil, nil, errors.Wrap(err, ErrNodePrimaryKey) } - provingKey, err := VRFV2PlusRegisterProvingKey(vrfKey, nativeTokenPrimaryKeyAddress, vrfv2PlusContracts.Coordinator) + provingKey, err := VRFV2_5RegisterProvingKey(vrfKey, nativeTokenPrimaryKeyAddress, vrfv2_5Contracts.Coordinator) if err != nil { return nil, nil, nil, errors.Wrap(err, ErrRegisteringProvingKey) } - keyHash, err := vrfv2PlusContracts.Coordinator.HashOfKey(context.Background(), provingKey) + keyHash, err := vrfv2_5Contracts.Coordinator.HashOfKey(context.Background(), provingKey) if err != nil { return nil, nil, nil, errors.Wrap(err, ErrCreatingProvingKeyHash) } @@ -304,7 +305,7 @@ func SetupVRFV2PlusEnvironment( job, err := CreateVRFV2PlusJob( env.GetAPIs()[0], - vrfv2PlusContracts.Coordinator.Address(), + vrfv2_5Contracts.Coordinator.Address(), nativeTokenPrimaryKeyAddress, pubKeyCompressed, chainID.String(), @@ -342,14 +343,14 @@ func SetupVRFV2PlusEnvironment( chainID, } - return vrfv2PlusContracts, subID, &data, nil + return vrfv2_5Contracts, subID, &data, nil } func SetupVRFV2PlusWrapperEnvironment( env *test_env.CLClusterTestEnv, linkToken contracts.LinkToken, - mockETHLinkFeed contracts.MockETHLINKFeed, - coordinator contracts.VRFCoordinatorV2Plus, + mockNativeLINKFeed contracts.MockETHLINKFeed, + coordinator contracts.VRFCoordinatorV2_5, keyHash [32]byte, wrapperConsumerContractsAmount int, ) (*VRFV2PlusWrapperContracts, *big.Int, error) { @@ -358,7 +359,7 @@ func SetupVRFV2PlusWrapperEnvironment( env.ContractDeployer, env.EVMClient, linkToken.Address(), - mockETHLinkFeed.Address(), + mockNativeLINKFeed.Address(), coordinator, wrapperConsumerContractsAmount, ) @@ -428,7 +429,7 @@ func SetupVRFV2PlusWrapperEnvironment( } return wrapperContracts, wrapperSubID, nil } -func CreateSubAndFindSubID(env *test_env.CLClusterTestEnv, coordinator contracts.VRFCoordinatorV2Plus) (*big.Int, error) { +func CreateSubAndFindSubID(env *test_env.CLClusterTestEnv, coordinator contracts.VRFCoordinatorV2_5) (*big.Int, error) { err := coordinator.CreateSubscription() if err != nil { return nil, errors.Wrap(err, ErrCreateVRFSubscription) @@ -456,7 +457,7 @@ func GetUpgradedCoordinatorTotalBalance(coordinator contracts.VRFCoordinatorV2Pl return } -func GetCoordinatorTotalBalance(coordinator contracts.VRFCoordinatorV2Plus) (linkTotalBalance *big.Int, nativeTokenTotalBalance *big.Int, err error) { +func GetCoordinatorTotalBalance(coordinator contracts.VRFCoordinatorV2_5) (linkTotalBalance *big.Int, nativeTokenTotalBalance *big.Int, err error) { linkTotalBalance, err = coordinator.GetLinkTotalBalance(context.Background()) if err != nil { return nil, nil, errors.Wrap(err, ErrLinkTotalBalance) @@ -468,14 +469,14 @@ func GetCoordinatorTotalBalance(coordinator contracts.VRFCoordinatorV2Plus) (lin return } -func FundSubscription(env *test_env.CLClusterTestEnv, linkAddress contracts.LinkToken, coordinator contracts.VRFCoordinatorV2Plus, subID *big.Int) error { +func FundSubscription(env *test_env.CLClusterTestEnv, linkAddress contracts.LinkToken, coordinator contracts.VRFCoordinatorV2_5, subID *big.Int) error { //Native Billing - err := coordinator.FundSubscriptionWithEth(subID, big.NewInt(0).Mul(vrfv2plus_constants.VRFSubscriptionFundingAmountNativeToken, big.NewInt(1e18))) + err := coordinator.FundSubscriptionWithNative(subID, big.NewInt(0).Mul(vrfv2plus_constants.VRFSubscriptionFundingAmountNativeToken, big.NewInt(1e18))) if err != nil { return errors.Wrap(err, ErrFundSubWithNativeToken) } - err = FundVRFCoordinatorV2PlusSubscription(linkAddress, coordinator, env.EVMClient, subID, vrfv2plus_constants.VRFSubscriptionFundingAmountLink) + err = FundVRFCoordinatorV2_5Subscription(linkAddress, coordinator, env.EVMClient, subID, vrfv2plus_constants.VRFSubscriptionFundingAmountLink) if err != nil { return errors.Wrap(err, ErrFundSubWithLinkToken) } @@ -489,12 +490,12 @@ func FundSubscription(env *test_env.CLClusterTestEnv, linkAddress contracts.Link func RequestRandomnessAndWaitForFulfillment( consumer contracts.VRFv2PlusLoadTestConsumer, - coordinator contracts.VRFCoordinatorV2Plus, + coordinator contracts.VRFCoordinatorV2_5, vrfv2PlusData *VRFV2PlusData, subID *big.Int, isNativeBilling bool, l zerolog.Logger, -) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled, error) { +) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled, error) { _, err := consumer.RequestRandomness( vrfv2PlusData.KeyHash, subID, @@ -573,12 +574,12 @@ func RequestRandomnessAndWaitForFulfillmentUpgraded( func DirectFundingRequestRandomnessAndWaitForFulfillment( consumer contracts.VRFv2PlusWrapperLoadTestConsumer, - coordinator contracts.VRFCoordinatorV2Plus, + coordinator contracts.VRFCoordinatorV2_5, vrfv2PlusData *VRFV2PlusData, subID *big.Int, isNativeBilling bool, l zerolog.Logger, -) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled, error) { +) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled, error) { if isNativeBilling { _, err := consumer.RequestRandomnessNative( vrfv2plus_constants.MinimumConfirmations, @@ -609,11 +610,11 @@ func DirectFundingRequestRandomnessAndWaitForFulfillment( func WaitForRequestAndFulfillmentEvents( consumerAddress string, - coordinator contracts.VRFCoordinatorV2Plus, + coordinator contracts.VRFCoordinatorV2_5, vrfv2PlusData *VRFV2PlusData, subID *big.Int, l zerolog.Logger, -) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled, error) { +) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled, error) { randomWordsRequestedEvent, err := coordinator.WaitForRandomWordsRequestedEvent( [][32]byte{vrfv2PlusData.KeyHash}, []*big.Int{subID}, @@ -646,7 +647,7 @@ func WaitForRequestAndFulfillmentEvents( l.Debug(). Str("Total Payment in Juels", randomWordsFulfilledEvent.Payment.String()). Str("TX Hash", randomWordsFulfilledEvent.Raw.TxHash.String()). - Str("Subscription ID", randomWordsFulfilledEvent.SubID.String()). + Str("Subscription ID", randomWordsFulfilledEvent.SubId.String()). Str("Request ID", randomWordsFulfilledEvent.RequestId.String()). Bool("Success", randomWordsFulfilledEvent.Success). Msg("RandomWordsFulfilled Event (TX metadata)") diff --git a/integration-tests/contracts/contract_deployer.go b/integration-tests/contracts/contract_deployer.go index e8f98231110..dcf81edede7 100644 --- a/integration-tests/contracts/contract_deployer.go +++ b/integration-tests/contracts/contract_deployer.go @@ -94,7 +94,7 @@ type ContractDeployer interface { DeployVRFV2PlusWrapperLoadTestConsumer(linkAddr string, vrfV2PlusWrapperAddr string) (VRFv2PlusWrapperLoadTestConsumer, error) DeployVRFCoordinator(linkAddr string, bhsAddr string) (VRFCoordinator, error) DeployVRFCoordinatorV2(linkAddr string, bhsAddr string, linkEthFeedAddr string) (VRFCoordinatorV2, error) - DeployVRFCoordinatorV2Plus(bhsAddr string) (VRFCoordinatorV2Plus, error) + DeployVRFCoordinatorV2_5(bhsAddr string) (VRFCoordinatorV2_5, error) DeployVRFCoordinatorV2PlusUpgradedVersion(bhsAddr string) (VRFCoordinatorV2PlusUpgradedVersion, error) DeployVRFV2PlusWrapper(linkAddr string, linkEthFeedAddr string, coordinatorAddr string) (VRFV2PlusWrapper, error) DeployDKG() (DKG, error) diff --git a/integration-tests/contracts/contract_vrf_models.go b/integration-tests/contracts/contract_vrf_models.go index b2634406388..0d302215bea 100644 --- a/integration-tests/contracts/contract_vrf_models.go +++ b/integration-tests/contracts/contract_vrf_models.go @@ -2,12 +2,14 @@ package contracts import ( "context" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + + "math/big" + "time" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer" - "math/big" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -54,10 +56,10 @@ type VRFCoordinatorV2 interface { GetSubscription(ctx context.Context, subID uint64) (vrf_coordinator_v2.GetSubscription, error) } -type VRFCoordinatorV2Plus interface { - SetLINKAndLINKETHFeed( +type VRFCoordinatorV2_5 interface { + SetLINKAndLINKNativeFeed( link string, - linkEthFeed string, + linkNativeFeed string, ) error SetConfig( minimumRequestConfirmations uint16, @@ -65,7 +67,7 @@ type VRFCoordinatorV2Plus interface { stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, - feeConfig vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig, + feeConfig vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig, ) error RegisterProvingKey( oracleAddr string, @@ -77,21 +79,21 @@ type VRFCoordinatorV2Plus interface { Migrate(subId *big.Int, coordinatorAddress string) error RegisterMigratableCoordinator(migratableCoordinatorAddress string) error AddConsumer(subId *big.Int, consumerAddress string) error - FundSubscriptionWithEth(subId *big.Int, nativeTokenAmount *big.Int) error + FundSubscriptionWithNative(subId *big.Int, nativeTokenAmount *big.Int) error Address() string - GetSubscription(ctx context.Context, subID *big.Int) (vrf_coordinator_v2plus.GetSubscription, error) + GetSubscription(ctx context.Context, subID *big.Int) (vrf_coordinator_v2_5.GetSubscription, error) GetNativeTokenTotalBalance(ctx context.Context) (*big.Int, error) GetLinkTotalBalance(ctx context.Context) (*big.Int, error) FindSubscriptionID() (*big.Int, error) - WaitForRandomWordsFulfilledEvent(subID []*big.Int, requestID []*big.Int, timeout time.Duration) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled, error) - WaitForRandomWordsRequestedEvent(keyHash [][32]byte, subID []*big.Int, sender []common.Address, timeout time.Duration) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested, error) - WaitForMigrationCompletedEvent(timeout time.Duration) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusMigrationCompleted, error) + WaitForRandomWordsFulfilledEvent(subID []*big.Int, requestID []*big.Int, timeout time.Duration) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled, error) + WaitForRandomWordsRequestedEvent(keyHash [][32]byte, subID []*big.Int, sender []common.Address, timeout time.Duration) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested, error) + WaitForMigrationCompletedEvent(timeout time.Duration) (*vrf_coordinator_v2_5.VRFCoordinatorV25MigrationCompleted, error) } type VRFCoordinatorV2PlusUpgradedVersion interface { - SetLINKAndLINKETHFeed( + SetLINKAndLINKNativeFeed( link string, - linkEthFeed string, + linkNativeFeed string, ) error SetConfig( minimumRequestConfirmations uint16, @@ -112,7 +114,7 @@ type VRFCoordinatorV2PlusUpgradedVersion interface { Migrate(subId *big.Int, coordinatorAddress string) error RegisterMigratableCoordinator(migratableCoordinatorAddress string) error AddConsumer(subId *big.Int, consumerAddress string) error - FundSubscriptionWithEth(subId *big.Int, nativeTokenAmount *big.Int) error + FundSubscriptionWithNative(subId *big.Int, nativeTokenAmount *big.Int) error Address() string GetSubscription(ctx context.Context, subID *big.Int) (vrf_v2plus_upgraded_version.GetSubscription, error) GetActiveSubscriptionIds(ctx context.Context, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) diff --git a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go index 59d7137c231..d07492d0df1 100644 --- a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go @@ -3,24 +3,25 @@ package contracts import ( "context" "fmt" + "math/big" + "time" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer" - "math/big" - "time" ) -type EthereumVRFCoordinatorV2Plus struct { +type EthereumVRFCoordinatorV2_5 struct { address *common.Address client blockchain.EVMClient - coordinator *vrf_coordinator_v2plus.VRFCoordinatorV2Plus + coordinator vrf_coordinator_v2_5.VRFCoordinatorV25Interface } type EthereumVRFCoordinatorV2PlusUpgradedVersion struct { @@ -48,29 +49,29 @@ type EthereumVRFV2PlusWrapper struct { wrapper *vrfv2plus_wrapper.VRFV2PlusWrapper } -// DeployVRFCoordinatorV2Plus deploys VRFV2Plus coordinator contract -func (e *EthereumContractDeployer) DeployVRFCoordinatorV2Plus(bhsAddr string) (VRFCoordinatorV2Plus, error) { +// DeployVRFCoordinatorV2_5 deploys VRFV2_5 coordinator contract +func (e *EthereumContractDeployer) DeployVRFCoordinatorV2_5(bhsAddr string) (VRFCoordinatorV2_5, error) { address, _, instance, err := e.client.DeployContract("VRFCoordinatorV2Plus", func( auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrf_coordinator_v2plus.DeployVRFCoordinatorV2Plus(auth, backend, common.HexToAddress(bhsAddr)) + return vrf_coordinator_v2_5.DeployVRFCoordinatorV25(auth, backend, common.HexToAddress(bhsAddr)) }) if err != nil { return nil, err } - return &EthereumVRFCoordinatorV2Plus{ + return &EthereumVRFCoordinatorV2_5{ client: e.client, - coordinator: instance.(*vrf_coordinator_v2plus.VRFCoordinatorV2Plus), + coordinator: instance.(*vrf_coordinator_v2_5.VRFCoordinatorV25), address: address, }, err } -func (v *EthereumVRFCoordinatorV2Plus) Address() string { +func (v *EthereumVRFCoordinatorV2_5) Address() string { return v.address.Hex() } -func (v *EthereumVRFCoordinatorV2Plus) HashOfKey(ctx context.Context, pubKey [2]*big.Int) ([32]byte, error) { +func (v *EthereumVRFCoordinatorV2_5) HashOfKey(ctx context.Context, pubKey [2]*big.Int) ([32]byte, error) { opts := &bind.CallOpts{ From: common.HexToAddress(v.client.GetDefaultWallet().Address()), Context: ctx, @@ -82,7 +83,7 @@ func (v *EthereumVRFCoordinatorV2Plus) HashOfKey(ctx context.Context, pubKey [2] return hash, nil } -func (v *EthereumVRFCoordinatorV2Plus) GetActiveSubscriptionIds(ctx context.Context, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { +func (v *EthereumVRFCoordinatorV2_5) GetActiveSubscriptionIds(ctx context.Context, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { opts := &bind.CallOpts{ From: common.HexToAddress(v.client.GetDefaultWallet().Address()), Context: ctx, @@ -94,19 +95,19 @@ func (v *EthereumVRFCoordinatorV2Plus) GetActiveSubscriptionIds(ctx context.Cont return activeSubscriptionIds, nil } -func (v *EthereumVRFCoordinatorV2Plus) GetSubscription(ctx context.Context, subID *big.Int) (vrf_coordinator_v2plus.GetSubscription, error) { +func (v *EthereumVRFCoordinatorV2_5) GetSubscription(ctx context.Context, subID *big.Int) (vrf_coordinator_v2_5.GetSubscription, error) { opts := &bind.CallOpts{ From: common.HexToAddress(v.client.GetDefaultWallet().Address()), Context: ctx, } subscription, err := v.coordinator.GetSubscription(opts, subID) if err != nil { - return vrf_coordinator_v2plus.GetSubscription{}, err + return vrf_coordinator_v2_5.GetSubscription{}, err } return subscription, nil } -func (v *EthereumVRFCoordinatorV2Plus) GetLinkTotalBalance(ctx context.Context) (*big.Int, error) { +func (v *EthereumVRFCoordinatorV2_5) GetLinkTotalBalance(ctx context.Context) (*big.Int, error) { opts := &bind.CallOpts{ From: common.HexToAddress(v.client.GetDefaultWallet().Address()), Context: ctx, @@ -117,19 +118,19 @@ func (v *EthereumVRFCoordinatorV2Plus) GetLinkTotalBalance(ctx context.Context) } return totalBalance, nil } -func (v *EthereumVRFCoordinatorV2Plus) GetNativeTokenTotalBalance(ctx context.Context) (*big.Int, error) { +func (v *EthereumVRFCoordinatorV2_5) GetNativeTokenTotalBalance(ctx context.Context) (*big.Int, error) { opts := &bind.CallOpts{ From: common.HexToAddress(v.client.GetDefaultWallet().Address()), Context: ctx, } - totalBalance, err := v.coordinator.STotalEthBalance(opts) + totalBalance, err := v.coordinator.STotalNativeBalance(opts) if err != nil { return nil, err } return totalBalance, nil } -func (v *EthereumVRFCoordinatorV2Plus) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig vrf_coordinator_v2plus.VRFCoordinatorV2PlusFeeConfig) error { +func (v *EthereumVRFCoordinatorV2_5) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err @@ -149,15 +150,15 @@ func (v *EthereumVRFCoordinatorV2Plus) SetConfig(minimumRequestConfirmations uin return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2Plus) SetLINKAndLINKETHFeed(linkAddress string, linkEthFeedAddress string) error { +func (v *EthereumVRFCoordinatorV2_5) SetLINKAndLINKNativeFeed(linkAddress string, linkNativeFeedAddress string) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err } - tx, err := v.coordinator.SetLINKAndLINKETHFeed( + tx, err := v.coordinator.SetLINKAndLINKNativeFeed( opts, common.HexToAddress(linkAddress), - common.HexToAddress(linkEthFeedAddress), + common.HexToAddress(linkNativeFeedAddress), ) if err != nil { return err @@ -165,7 +166,7 @@ func (v *EthereumVRFCoordinatorV2Plus) SetLINKAndLINKETHFeed(linkAddress string, return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2Plus) RegisterProvingKey( +func (v *EthereumVRFCoordinatorV2_5) RegisterProvingKey( oracleAddr string, publicProvingKey [2]*big.Int, ) error { @@ -180,7 +181,7 @@ func (v *EthereumVRFCoordinatorV2Plus) RegisterProvingKey( return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2Plus) CreateSubscription() error { +func (v *EthereumVRFCoordinatorV2_5) CreateSubscription() error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err @@ -192,7 +193,7 @@ func (v *EthereumVRFCoordinatorV2Plus) CreateSubscription() error { return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2Plus) Migrate(subId *big.Int, coordinatorAddress string) error { +func (v *EthereumVRFCoordinatorV2_5) Migrate(subId *big.Int, coordinatorAddress string) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err @@ -204,7 +205,7 @@ func (v *EthereumVRFCoordinatorV2Plus) Migrate(subId *big.Int, coordinatorAddres return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2Plus) RegisterMigratableCoordinator(migratableCoordinatorAddress string) error { +func (v *EthereumVRFCoordinatorV2_5) RegisterMigratableCoordinator(migratableCoordinatorAddress string) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err @@ -216,7 +217,7 @@ func (v *EthereumVRFCoordinatorV2Plus) RegisterMigratableCoordinator(migratableC return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2Plus) AddConsumer(subId *big.Int, consumerAddress string) error { +func (v *EthereumVRFCoordinatorV2_5) AddConsumer(subId *big.Int, consumerAddress string) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err @@ -232,13 +233,13 @@ func (v *EthereumVRFCoordinatorV2Plus) AddConsumer(subId *big.Int, consumerAddre return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2Plus) FundSubscriptionWithEth(subId *big.Int, nativeTokenAmount *big.Int) error { +func (v *EthereumVRFCoordinatorV2_5) FundSubscriptionWithNative(subId *big.Int, nativeTokenAmount *big.Int) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err } opts.Value = nativeTokenAmount - tx, err := v.coordinator.FundSubscriptionWithEth( + tx, err := v.coordinator.FundSubscriptionWithNative( opts, subId, ) @@ -248,7 +249,7 @@ func (v *EthereumVRFCoordinatorV2Plus) FundSubscriptionWithEth(subId *big.Int, n return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2Plus) FindSubscriptionID() (*big.Int, error) { +func (v *EthereumVRFCoordinatorV2_5) FindSubscriptionID() (*big.Int, error) { owner := v.client.GetDefaultWallet().Address() subscriptionIterator, err := v.coordinator.FilterSubscriptionCreated( nil, @@ -265,8 +266,8 @@ func (v *EthereumVRFCoordinatorV2Plus) FindSubscriptionID() (*big.Int, error) { return subscriptionIterator.Event.SubId, nil } -func (v *EthereumVRFCoordinatorV2Plus) WaitForRandomWordsFulfilledEvent(subID []*big.Int, requestID []*big.Int, timeout time.Duration) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled, error) { - randomWordsFulfilledEventsChannel := make(chan *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsFulfilled) +func (v *EthereumVRFCoordinatorV2_5) WaitForRandomWordsFulfilledEvent(subID []*big.Int, requestID []*big.Int, timeout time.Duration) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled, error) { + randomWordsFulfilledEventsChannel := make(chan *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled) subscription, err := v.coordinator.WatchRandomWordsFulfilled(nil, randomWordsFulfilledEventsChannel, requestID, subID) if err != nil { return nil, err @@ -285,8 +286,8 @@ func (v *EthereumVRFCoordinatorV2Plus) WaitForRandomWordsFulfilledEvent(subID [] } } -func (v *EthereumVRFCoordinatorV2Plus) WaitForRandomWordsRequestedEvent(keyHash [][32]byte, subID []*big.Int, sender []common.Address, timeout time.Duration) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested, error) { - randomWordsFulfilledEventsChannel := make(chan *vrf_coordinator_v2plus.VRFCoordinatorV2PlusRandomWordsRequested) +func (v *EthereumVRFCoordinatorV2_5) WaitForRandomWordsRequestedEvent(keyHash [][32]byte, subID []*big.Int, sender []common.Address, timeout time.Duration) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested, error) { + randomWordsFulfilledEventsChannel := make(chan *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsRequested) subscription, err := v.coordinator.WatchRandomWordsRequested(nil, randomWordsFulfilledEventsChannel, keyHash, subID, sender) if err != nil { return nil, err @@ -305,8 +306,8 @@ func (v *EthereumVRFCoordinatorV2Plus) WaitForRandomWordsRequestedEvent(keyHash } } -func (v *EthereumVRFCoordinatorV2Plus) WaitForMigrationCompletedEvent(timeout time.Duration) (*vrf_coordinator_v2plus.VRFCoordinatorV2PlusMigrationCompleted, error) { - eventsChannel := make(chan *vrf_coordinator_v2plus.VRFCoordinatorV2PlusMigrationCompleted) +func (v *EthereumVRFCoordinatorV2_5) WaitForMigrationCompletedEvent(timeout time.Duration) (*vrf_coordinator_v2_5.VRFCoordinatorV25MigrationCompleted, error) { + eventsChannel := make(chan *vrf_coordinator_v2_5.VRFCoordinatorV25MigrationCompleted) subscription, err := v.coordinator.WatchMigrationCompleted(nil, eventsChannel) if err != nil { return nil, err @@ -486,15 +487,15 @@ func (v *EthereumVRFCoordinatorV2PlusUpgradedVersion) SetConfig(minimumRequestCo return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2PlusUpgradedVersion) SetLINKAndLINKETHFeed(linkAddress string, linkEthFeedAddress string) error { +func (v *EthereumVRFCoordinatorV2PlusUpgradedVersion) SetLINKAndLINKNativeFeed(linkAddress string, linkNativeFeedAddress string) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err } - tx, err := v.coordinator.SetLINKAndLINKETHFeed( + tx, err := v.coordinator.SetLINKAndLINKNativeFeed( opts, common.HexToAddress(linkAddress), - common.HexToAddress(linkEthFeedAddress), + common.HexToAddress(linkNativeFeedAddress), ) if err != nil { return err @@ -545,7 +546,7 @@ func (v *EthereumVRFCoordinatorV2PlusUpgradedVersion) GetNativeTokenTotalBalance From: common.HexToAddress(v.client.GetDefaultWallet().Address()), Context: ctx, } - totalBalance, err := v.coordinator.STotalEthBalance(opts) + totalBalance, err := v.coordinator.STotalNativeBalance(opts) if err != nil { return nil, err } @@ -592,13 +593,13 @@ func (v *EthereumVRFCoordinatorV2PlusUpgradedVersion) AddConsumer(subId *big.Int return v.client.ProcessTransaction(tx) } -func (v *EthereumVRFCoordinatorV2PlusUpgradedVersion) FundSubscriptionWithEth(subId *big.Int, nativeTokenAmount *big.Int) error { +func (v *EthereumVRFCoordinatorV2PlusUpgradedVersion) FundSubscriptionWithNative(subId *big.Int, nativeTokenAmount *big.Int) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err } opts.Value = nativeTokenAmount - tx, err := v.coordinator.FundSubscriptionWithEth( + tx, err := v.coordinator.FundSubscriptionWithNative( opts, subId, ) diff --git a/integration-tests/smoke/vrfv2plus_test.go b/integration-tests/smoke/vrfv2plus_test.go index d895e74f9b9..e26a4ed6b1f 100644 --- a/integration-tests/smoke/vrfv2plus_test.go +++ b/integration-tests/smoke/vrfv2plus_test.go @@ -2,12 +2,13 @@ package smoke import ( "context" - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" "math/big" "testing" "time" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-testing-framework/logging" @@ -26,7 +27,7 @@ func TestVRFv2PlusBilling(t *testing.T) { WithTestLogger(t). WithGeth(). WithCLNodes(1). - WithFunding(vrfv2plus_constants.ChainlinkNodeFundingAmountEth). + WithFunding(vrfv2plus_constants.ChainlinkNodeFundingAmountNative). Build() require.NoError(t, err, "error creating test env") t.Cleanup(func() { @@ -37,21 +38,21 @@ func TestVRFv2PlusBilling(t *testing.T) { env.ParallelTransactions(true) - mockETHLinkFeed, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, vrfv2plus_constants.LinkEthFeedResponse) + mockETHLinkFeed, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, vrfv2plus_constants.LinkNativeFeedResponse) require.NoError(t, err, "error deploying mock ETH/LINK feed") linkToken, err := actions.DeployLINKToken(env.ContractDeployer) require.NoError(t, err, "error deploying LINK contract") - vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2PlusEnvironment(env, linkToken, mockETHLinkFeed, 1) - require.NoError(t, err, "error setting up VRF v2 Plus env") + vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2_5Environment(env, linkToken, mockETHLinkFeed, 1) + require.NoError(t, err, "error setting up VRF v2_5 env") subscription, err := vrfv2PlusContracts.Coordinator.GetSubscription(context.Background(), subID) require.NoError(t, err, "error getting subscription information") l.Debug(). Str("Juels Balance", subscription.Balance.String()). - Str("Native Token Balance", subscription.EthBalance.String()). + Str("Native Token Balance", subscription.NativeBalance.String()). Str("Subscription ID", subID.String()). Str("Subscription Owner", subscription.Owner.String()). Interface("Subscription Consumers", subscription.Consumers). @@ -99,7 +100,7 @@ func TestVRFv2PlusBilling(t *testing.T) { t.Run("VRFV2 Plus With Native Billing", func(t *testing.T) { var isNativeBilling = true - subNativeTokenBalanceBeforeRequest := subscription.EthBalance + subNativeTokenBalanceBeforeRequest := subscription.NativeBalance jobRunsBeforeTest, err := env.CLNodes[0].API.MustReadRunsByJob(vrfv2PlusData.VRFJob.Data.ID) require.NoError(t, err, "error reading job runs") @@ -117,7 +118,7 @@ func TestVRFv2PlusBilling(t *testing.T) { expectedSubBalanceWei := new(big.Int).Sub(subNativeTokenBalanceBeforeRequest, randomWordsFulfilledEvent.Payment) subscription, err = vrfv2PlusContracts.Coordinator.GetSubscription(context.Background(), subID) require.NoError(t, err) - subBalanceAfterRequest := subscription.EthBalance + subBalanceAfterRequest := subscription.NativeBalance require.Equal(t, expectedSubBalanceWei, subBalanceAfterRequest) jobRuns, err := env.CLNodes[0].API.MustReadRunsByJob(vrfv2PlusData.VRFJob.Data.ID) @@ -212,7 +213,7 @@ func TestVRFv2PlusBilling(t *testing.T) { wrapperSubscription, err := vrfv2PlusContracts.Coordinator.GetSubscription(context.Background(), wrapperSubID) require.NoError(t, err, "error getting subscription information") - subBalanceBeforeRequest := wrapperSubscription.EthBalance + subBalanceBeforeRequest := wrapperSubscription.NativeBalance randomWordsFulfilledEvent, err := vrfv2plus.DirectFundingRequestRandomnessAndWaitForFulfillment( wrapperContracts.LoadTestConsumers[0], @@ -227,7 +228,7 @@ func TestVRFv2PlusBilling(t *testing.T) { expectedSubBalanceWei := new(big.Int).Sub(subBalanceBeforeRequest, randomWordsFulfilledEvent.Payment) wrapperSubscription, err = vrfv2PlusContracts.Coordinator.GetSubscription(context.Background(), wrapperSubID) require.NoError(t, err, "error getting subscription information") - subBalanceAfterRequest := wrapperSubscription.EthBalance + subBalanceAfterRequest := wrapperSubscription.NativeBalance require.Equal(t, expectedSubBalanceWei, subBalanceAfterRequest) consumerStatus, err := wrapperContracts.LoadTestConsumers[0].GetRequestStatus(context.Background(), randomWordsFulfilledEvent.RequestId) @@ -271,7 +272,7 @@ func TestVRFv2PlusMigration(t *testing.T) { WithTestLogger(t). WithGeth(). WithCLNodes(1). - WithFunding(vrfv2plus_constants.ChainlinkNodeFundingAmountEth). + WithFunding(vrfv2plus_constants.ChainlinkNodeFundingAmountNative). Build() require.NoError(t, err, "error creating test env") t.Cleanup(func() { @@ -282,21 +283,21 @@ func TestVRFv2PlusMigration(t *testing.T) { env.ParallelTransactions(true) - mockETHLinkFeedAddress, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, vrfv2plus_constants.LinkEthFeedResponse) + mockETHLinkFeedAddress, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, vrfv2plus_constants.LinkNativeFeedResponse) require.NoError(t, err, "error deploying mock ETH/LINK feed") linkAddress, err := actions.DeployLINKToken(env.ContractDeployer) require.NoError(t, err, "error deploying LINK contract") - vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2PlusEnvironment(env, linkAddress, mockETHLinkFeedAddress, 2) - require.NoError(t, err, "error setting up VRF v2 Plus env") + vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2_5Environment(env, linkAddress, mockETHLinkFeedAddress, 2) + require.NoError(t, err, "error setting up VRF v2_5 env") subscription, err := vrfv2PlusContracts.Coordinator.GetSubscription(context.Background(), subID) require.NoError(t, err, "error getting subscription information") l.Debug(). Str("Juels Balance", subscription.Balance.String()). - Str("Native Token Balance", subscription.EthBalance.String()). + Str("Native Token Balance", subscription.NativeBalance.String()). Str("Subscription ID", subID.String()). Str("Subscription Owner", subscription.Owner.String()). Interface("Subscription Consumers", subscription.Consumers). @@ -325,12 +326,12 @@ func TestVRFv2PlusMigration(t *testing.T) { vrfv2plus_constants.MaxGasLimitVRFCoordinatorConfig, vrfv2plus_constants.StalenessSeconds, vrfv2plus_constants.GasAfterPaymentCalculation, - vrfv2plus_constants.LinkEthFeedResponse, + vrfv2plus_constants.LinkNativeFeedResponse, vrfv2plus_constants.VRFCoordinatorV2PlusUpgradedVersionFeeConfig, ) - err = newCoordinator.SetLINKAndLINKETHFeed(linkAddress.Address(), mockETHLinkFeedAddress.Address()) - require.NoError(t, err, vrfv2plus.ErrSetLinkETHLinkFeed) + err = newCoordinator.SetLINKAndLINKNativeFeed(linkAddress.Address(), mockETHLinkFeedAddress.Address()) + require.NoError(t, err, vrfv2plus.ErrSetLinkNativeLinkFeed) err = env.EVMClient.WaitForEvents() require.NoError(t, err, vrfv2plus.ErrWaitTXsComplete) @@ -385,7 +386,7 @@ func TestVRFv2PlusMigration(t *testing.T) { Str("New Coordinator", newCoordinator.Address()). Str("Subscription ID", subID.String()). Str("Juels Balance", migratedSubscription.Balance.String()). - Str("Native Token Balance", migratedSubscription.EthBalance.String()). + Str("Native Token Balance", migratedSubscription.NativeBalance.String()). Str("Subscription Owner", migratedSubscription.Owner.String()). Interface("Subscription Consumers", migratedSubscription.Consumers). Msg("Subscription Data After Migration to New Coordinator") @@ -402,7 +403,7 @@ func TestVRFv2PlusMigration(t *testing.T) { } //Verify old and migrated subs - require.Equal(t, oldSubscriptionBeforeMigration.EthBalance, migratedSubscription.EthBalance) + require.Equal(t, oldSubscriptionBeforeMigration.NativeBalance, migratedSubscription.NativeBalance) require.Equal(t, oldSubscriptionBeforeMigration.Balance, migratedSubscription.Balance) require.Equal(t, oldSubscriptionBeforeMigration.Owner, migratedSubscription.Owner) require.Equal(t, oldSubscriptionBeforeMigration.Consumers, migratedSubscription.Consumers) @@ -421,10 +422,10 @@ func TestVRFv2PlusMigration(t *testing.T) { //Verify that total balances changed for Link and Eth for new and old coordinator expectedLinkTotalBalanceForMigratedCoordinator := new(big.Int).Add(oldSubscriptionBeforeMigration.Balance, migratedCoordinatorLinkTotalBalanceBeforeMigration) - expectedEthTotalBalanceForMigratedCoordinator := new(big.Int).Add(oldSubscriptionBeforeMigration.EthBalance, migratedCoordinatorEthTotalBalanceBeforeMigration) + expectedEthTotalBalanceForMigratedCoordinator := new(big.Int).Add(oldSubscriptionBeforeMigration.NativeBalance, migratedCoordinatorEthTotalBalanceBeforeMigration) expectedLinkTotalBalanceForOldCoordinator := new(big.Int).Sub(oldCoordinatorLinkTotalBalanceBeforeMigration, oldSubscriptionBeforeMigration.Balance) - expectedEthTotalBalanceForOldCoordinator := new(big.Int).Sub(oldCoordinatorEthTotalBalanceBeforeMigration, oldSubscriptionBeforeMigration.EthBalance) + expectedEthTotalBalanceForOldCoordinator := new(big.Int).Sub(oldCoordinatorEthTotalBalanceBeforeMigration, oldSubscriptionBeforeMigration.NativeBalance) require.Equal(t, expectedLinkTotalBalanceForMigratedCoordinator, migratedCoordinatorLinkTotalBalanceAfterMigration) require.Equal(t, expectedEthTotalBalanceForMigratedCoordinator, migratedCoordinatorEthTotalBalanceAfterMigration) require.Equal(t, expectedLinkTotalBalanceForOldCoordinator, oldCoordinatorLinkTotalBalanceAfterMigration) From 739bfae1f100f0fff92cdb11030b13f58262fe89 Mon Sep 17 00:00:00 2001 From: Bolek <1416262+bolekk@users.noreply.github.com> Date: Mon, 25 Sep 2023 20:19:16 -0700 Subject: [PATCH 05/84] [Functions] Improved listener log message (#10787) --- core/services/functions/listener.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/services/functions/listener.go b/core/services/functions/listener.go index d9272aca3aa..084d1530a76 100644 --- a/core/services/functions/listener.go +++ b/core/services/functions/listener.go @@ -724,7 +724,7 @@ func (l *FunctionsListener) getSecrets(ctx context.Context, eaClient ExternalAda Version: donSecrets.Version, }) if err != nil { - return "", errors.Wrap(err, "failed to fetch S4 record for a secret"), nil + return "", errors.Wrap(err, "failed to fetch DONHosted secrets"), nil } secrets = record.Payload } From 95989d7da1d333baebec27319c4cf29ac93e82ec Mon Sep 17 00:00:00 2001 From: Bolek <1416262+bolekk@users.noreply.github.com> Date: Mon, 25 Sep 2023 22:48:59 -0700 Subject: [PATCH 06/84] [Gateway] Simple healthcheck endpoint (#10786) --- core/services/gateway/network/httpserver.go | 14 ++++++++++++++ core/services/gateway/network/httpserver_test.go | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/core/services/gateway/network/httpserver.go b/core/services/gateway/network/httpserver.go index 26b9126da3b..d9d3e5ee7e4 100644 --- a/core/services/gateway/network/httpserver.go +++ b/core/services/gateway/network/httpserver.go @@ -54,6 +54,11 @@ type httpServer struct { lggr logger.Logger } +const ( + HealthCheckPath = "/health" + HealthCheckResponse = "OK" +) + func NewHttpServer(config *HTTPServerConfig, lggr logger.Logger) HttpServer { baseCtx, cancelBaseCtx := context.WithCancel(context.Background()) server := &httpServer{ @@ -64,6 +69,7 @@ func NewHttpServer(config *HTTPServerConfig, lggr logger.Logger) HttpServer { } mux := http.NewServeMux() mux.Handle(config.Path, http.HandlerFunc(server.handleRequest)) + mux.Handle(HealthCheckPath, http.HandlerFunc(server.handleHealthCheck)) server.server = &http.Server{ Addr: fmt.Sprintf("%s:%d", config.Host, config.Port), Handler: mux, @@ -75,6 +81,14 @@ func NewHttpServer(config *HTTPServerConfig, lggr logger.Logger) HttpServer { return server } +func (s *httpServer) handleHealthCheck(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + _, err := w.Write([]byte(HealthCheckResponse)) + if err != nil { + s.lggr.Debug("error when writing response for healthcheck", err) + } +} + func (s *httpServer) handleRequest(w http.ResponseWriter, r *http.Request) { source := http.MaxBytesReader(nil, r.Body, s.config.MaxRequestBytes) rawMessage, err := io.ReadAll(source) diff --git a/core/services/gateway/network/httpserver_test.go b/core/services/gateway/network/httpserver_test.go index 2e20957cf34..92215245e20 100644 --- a/core/services/gateway/network/httpserver_test.go +++ b/core/services/gateway/network/httpserver_test.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "net/http" + "strings" "testing" "github.com/stretchr/testify/mock" @@ -74,3 +75,15 @@ func TestHTTPServer_HandleRequest_RequestBodyTooBig(t *testing.T) { resp := sendRequest(t, url, []byte("0123456789")) require.Equal(t, http.StatusBadRequest, resp.StatusCode) } + +func TestHTTPServer_HandleHealthCheck(t *testing.T) { + server, _, url := startNewServer(t, 100_000, 100_000) + defer server.Close() + + url = strings.Replace(url, HTTPTestPath, network.HealthCheckPath, 1) + resp := sendRequest(t, url, []byte{}) + respBytes, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Equal(t, http.StatusOK, resp.StatusCode) + require.Equal(t, []byte(network.HealthCheckResponse), respBytes) +} From fa129599d02d045f9ef2b2985b9fa88c81813ae7 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 26 Sep 2023 07:33:34 -0500 Subject: [PATCH 07/84] bump chainlink-relay for logger fix (#10791) --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index f4b21a3773e..bb4b33eb521 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -300,7 +300,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 // indirect - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c // indirect + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 6896a0651f8..571b9b0e8ef 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1454,8 +1454,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 h1:vdieOW3CZGdD2R5zvCSMS+0vksyExPN3/Fa1uVfld/A= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c h1:be/0dJGClO0wS7gngfr0qUQq7RO/i7aJ8e5wG1b6/Ns= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 h1:Db333w+fSm2e18LMikcIQHIZqgxZruW9uCUGJLUC9mI= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= diff --git a/go.mod b/go.mod index 00af8d84c20..d0fd99a8287 100644 --- a/go.mod +++ b/go.mod @@ -67,7 +67,7 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 diff --git a/go.sum b/go.sum index bc2d5b9334b..59356146049 100644 --- a/go.sum +++ b/go.sum @@ -1457,8 +1457,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 h1:vdieOW3CZGdD2R5zvCSMS+0vksyExPN3/Fa1uVfld/A= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c h1:be/0dJGClO0wS7gngfr0qUQq7RO/i7aJ8e5wG1b6/Ns= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 h1:Db333w+fSm2e18LMikcIQHIZqgxZruW9uCUGJLUC9mI= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 49ff6e0c634..9aa09350013 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -384,7 +384,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 // indirect - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c // indirect + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 // indirect github.com/smartcontractkit/sqlx v1.3.5-0.20210805004948-4be295aacbeb // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 507d62baf28..bd4a8b977c0 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2360,8 +2360,8 @@ github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc4 github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8= github.com/smartcontractkit/chainlink-env v0.36.0 h1:CFOjs0c0y3lrHi/fl5qseCH9EQa5W/6CFyOvmhe2VnA= github.com/smartcontractkit/chainlink-env v0.36.0/go.mod h1:NbRExHmJGnKSYXmvNuJx5VErSx26GtE1AEN/CRzYOg8= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c h1:be/0dJGClO0wS7gngfr0qUQq7RO/i7aJ8e5wG1b6/Ns= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230923153757-d0cdb6bea61c/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 h1:Db333w+fSm2e18LMikcIQHIZqgxZruW9uCUGJLUC9mI= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= From 5e4d5f56c4dff208b64fbac755843c9ffb9a0789 Mon Sep 17 00:00:00 2001 From: Danny Skubak <8206446+skubakdj@users.noreply.github.com> Date: Tue, 26 Sep 2023 09:18:27 -0400 Subject: [PATCH 08/84] Remove Explorer from docker-compose setup (#10729) --- tools/docker/README.md | 7 +++---- tools/docker/compose | 12 ------------ tools/docker/dev-secrets.toml | 4 ---- tools/docker/develop.Dockerfile | 2 -- .../docker-compose.explorer-source.yaml | 19 ------------------- tools/docker/docker-compose.explorer.yaml | 16 ---------------- tools/docker/docker-compose.yaml | 17 +---------------- 7 files changed, 4 insertions(+), 73 deletions(-) delete mode 100644 tools/docker/docker-compose.explorer-source.yaml delete mode 100644 tools/docker/docker-compose.explorer.yaml diff --git a/tools/docker/README.md b/tools/docker/README.md index cd2b39307f8..58c1e196699 100644 --- a/tools/docker/README.md +++ b/tools/docker/README.md @@ -25,7 +25,6 @@ Acceptance can be accomplished by using the `acceptance` command. ./compose acceptance ``` -- The explorer can be reached at `http://localhost:8080` - The chainlink node can be reached at `http://localhost:6688` Credentials for logging into the operator-ui can be found [here](../../tools/secrets/apicredentials) @@ -35,7 +34,7 @@ Credentials for logging into the operator-ui can be found [here](../../tools/sec ### Doing local development on the core node Doing quick, iterative changes on the core codebase can still be achieved within the compose setup with the `cld` or `cldo` commands. -The `cld` command will bring up the services that a chainlink node needs to connect to (explorer, parity/geth, postgres), and then attach the users terminal to a docker container containing the host's chainlink repository bind-mounted inside the container at `/usr/local/src/chainlink`. What this means is that any changes made within the host's repository will be synchronized to the container, and vice versa for changes made within the container at `/usr/local/src/chainlink`. +The `cld` command will bring up the services that a chainlink node needs to connect to (parity/geth, postgres), and then attach the users terminal to a docker container containing the host's chainlink repository bind-mounted inside the container at `/usr/local/src/chainlink`. What this means is that any changes made within the host's repository will be synchronized to the container, and vice versa for changes made within the container at `/usr/local/src/chainlink`. This enables a user to make quick changes on either the container or the host, run `cldev` within the attached container, check the new behaviour of the re-built node, and repeat this process until the desired results are achieved. @@ -151,7 +150,7 @@ echo "ALLOW_ORIGINS=http://localhost:1337" > chainlink-variables.env The `logs` command will allow you to follow the logs of any running service. For example: ```bash -./compose up node # starts the node service and all it's dependencies, including devnet, explorer, the DB... +./compose up node # starts the node service and all it's dependencies, including devnet, the DB... ./compose logs devnet # shows the blockchain logs # ^C to exit ./compose logs # shows the combined logs of all running services @@ -217,7 +216,7 @@ The docker env contains direnv, so whatever changes you make locally to your (bi docker build ./tools/docker/ -t chainlink-develop:latest -f ./tools/docker/develop.Dockerfile # create the image docker container create -v /home/ryan/chainlink/chainlink:/root/chainlink --name chainlink-dev chainlink-develop:latest -# if you want to access the db, chain, node, or explorer from the host... expose the relevant ports +# if you want to access the db, chain, node, or from the host... expose the relevant ports # This could also be used in case you want to run some services in the container, and others directly # on the host docker container create -v /home/ryan/chainlink/chainlink:/root/chainlink --name chainlink-dev -p 5432:5432 -p 6688:6688 -p 6689:6689 -p 3000:3000 -p 3001:3001 -p 8545:8545 -p 8546:8546 chainlink-develop:latest diff --git a/tools/docker/compose b/tools/docker/compose index b8150e2c894..b16c1e19332 100755 --- a/tools/docker/compose +++ b/tools/docker/compose @@ -4,11 +4,6 @@ set -ex export DOCKER_BUILDKIT=1 export COMPOSE_DOCKER_CLI_BUILD=1 -# Export Explorer docker tag to be used in docker-compose files -if [ -z $EXPLORER_DOCKER_TAG ]; then - export EXPLORER_DOCKER_TAG="develop" -fi - base_files="-f docker-compose.yaml -f docker-compose.postgres.yaml" # Allow for choosing between geth or parity if [ $GETH_MODE ]; then @@ -17,13 +12,6 @@ else base_files="$base_files -f docker-compose.paritynet.yaml" fi -# Build Explorer from source if path is set -if [ $EXPLORER_SOURCE_PATH ]; then - base_files="$base_files -f docker-compose.explorer-source.yaml" -else - base_files="$base_files -f docker-compose.explorer.yaml" -fi - base="docker-compose $base_files" # base config, used standalone for acceptance dev="$base -f docker-compose.dev.yaml" # config for cldev diff --git a/tools/docker/dev-secrets.toml b/tools/docker/dev-secrets.toml index 41554f9c4f9..b27b8a8a8e3 100644 --- a/tools/docker/dev-secrets.toml +++ b/tools/docker/dev-secrets.toml @@ -2,7 +2,3 @@ [Database] AllowSimplePasswords = true - -[Explorer] -AccessKey = 'u4HULe0pj5xPyuvv' -Secret = 'YDxkVRTmcliehGZPw7f0L2Td3sz3LqutAQyy7sLCEIP6xcWzbO8zgfBWi4DXC6U6' diff --git a/tools/docker/develop.Dockerfile b/tools/docker/develop.Dockerfile index 9ebf82df071..46fad445d66 100644 --- a/tools/docker/develop.Dockerfile +++ b/tools/docker/develop.Dockerfile @@ -29,8 +29,6 @@ RUN echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf RUN /etc/init.d/postgresql start &&\ createdb chainlink_test &&\ createdb node_dev &&\ - createdb explorer_dev &&\ - createdb explorer_test &&\ createuser --superuser --no-password root &&\ psql -c "ALTER USER postgres PASSWORD 'node';" diff --git a/tools/docker/docker-compose.explorer-source.yaml b/tools/docker/docker-compose.explorer-source.yaml deleted file mode 100644 index 25793e7cfe8..00000000000 --- a/tools/docker/docker-compose.explorer-source.yaml +++ /dev/null @@ -1,19 +0,0 @@ -version: '3.5' - -services: - explorer: - container_name: chainlink-explorer - image: chainlink/explorer - build: - context: $EXPLORER_SOURCE_PATH - dockerfile: explorer/Dockerfile - entrypoint: yarn workspace @chainlink/explorer dev:compose - restart: always - ports: - - 3001 - depends_on: - - explorer-db - environment: - - EXPLORER_COOKIE_SECRET - - EXPLORER_SERVER_PORT - - PGPASSWORD=$EXPLORER_PGPASSWORD diff --git a/tools/docker/docker-compose.explorer.yaml b/tools/docker/docker-compose.explorer.yaml deleted file mode 100644 index 85361e15220..00000000000 --- a/tools/docker/docker-compose.explorer.yaml +++ /dev/null @@ -1,16 +0,0 @@ -version: '3.5' - -services: - explorer: - container_name: chainlink-explorer - image: smartcontract/explorer:${EXPLORER_DOCKER_TAG} - entrypoint: yarn workspace @chainlink/explorer dev:compose - restart: always - ports: - - 3001 - depends_on: - - explorer-db - environment: - - EXPLORER_COOKIE_SECRET - - EXPLORER_SERVER_PORT - - PGPASSWORD=$EXPLORER_PGPASSWORD diff --git a/tools/docker/docker-compose.yaml b/tools/docker/docker-compose.yaml index 19f8026b203..4d3ef7def20 100644 --- a/tools/docker/docker-compose.yaml +++ b/tools/docker/docker-compose.yaml @@ -24,8 +24,6 @@ services: - keystore - config - secrets - depends_on: - - explorer node-2: container_name: chainlink-node-2 @@ -48,20 +46,9 @@ services: - config - secrets - explorer-db: - container_name: chainlink-explorer-db - image: postgres:11.6 - volumes: - - explorer-db-data:/var/lib/postgresql/data - ports: - - 5433:5432 - environment: - POSTGRES_DB: $EXPLORER_DB_NAME - POSTGRES_PASSWORD: $EXPLORER_PGPASSWORD - # TODO # - replace clroot with secrets -# - extract explorer and tools into separate docker-compose files +# - extract tools into separate docker-compose files secrets: node_password: @@ -75,5 +62,3 @@ secrets: secrets: file: dev-secrets.toml -volumes: - explorer-db-data: From b0940c06e53dc07e99be64d7436ed15b8e951b17 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 26 Sep 2023 10:36:52 -0300 Subject: [PATCH 09/84] fix/BCF-2601-simple-passwords: reverting simple passwords notification. Use of simple passwords in production builds is now a breaking change (#10794) --- core/cmd/shell.go | 9 ++------- core/cmd/shell_local.go | 10 ++-------- docs/CHANGELOG.md | 1 + 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/core/cmd/shell.go b/core/cmd/shell.go index 20ad3dec107..8532f2f5431 100644 --- a/core/cmd/shell.go +++ b/core/cmd/shell.go @@ -109,14 +109,9 @@ func (s *Shell) errorOut(err error) cli.ExitCoder { func (s *Shell) configExitErr(validateFn func() error) cli.ExitCoder { err := validateFn() if err != nil { - if err.Error() != "invalid secrets: Database.AllowSimplePasswords: invalid value (true): insecure configs are not allowed on secure builds" { - fmt.Println("Invalid configuration:", err) - fmt.Println() - return s.errorOut(errors.New("invalid configuration")) - } - fmt.Printf("Notification for upcoming configuration change: %v\n", err) - fmt.Println("This configuration will be disallowed in future production releases.") + fmt.Println("Invalid configuration:", err) fmt.Println() + return s.errorOut(errors.New("invalid configuration")) } return nil } diff --git a/core/cmd/shell_local.go b/core/cmd/shell_local.go index af8c1528de8..372aad01384 100644 --- a/core/cmd/shell_local.go +++ b/core/cmd/shell_local.go @@ -294,10 +294,7 @@ func (s *Shell) runNode(c *cli.Context) error { err := s.Config.Validate() if err != nil { - if err.Error() != "invalid secrets: Database.AllowSimplePasswords: invalid value (true): insecure configs are not allowed on secure builds" { - return errors.Wrap(err, "config validation failed") - } - lggr.Errorf("Notification for upcoming configuration change: %v", err) + return errors.Wrap(err, "config validation failed") } lggr.Infow(fmt.Sprintf("Starting Chainlink Node %s at commit %s", static.Version, static.Sha), "Version", static.Version, "SHA", static.Sha) @@ -622,10 +619,7 @@ func (s *Shell) RebroadcastTransactions(c *cli.Context) (err error) { err = s.Config.Validate() if err != nil { - if err.Error() != "invalid secrets: Database.AllowSimplePasswords: invalid value (true): insecure configs are not allowed on secure builds" { - return s.errorOut(fmt.Errorf("error validating configuration: %+v", err)) - } - lggr.Errorf("Notification for required upcoming configuration change: %v", err) + return s.errorOut(fmt.Errorf("error validating configuration: %+v", err)) } err = keyStore.Unlock(s.Config.Password().Keystore()) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6836e168543..7f0b80ebcfe 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Simple password use in production builds is now disallowed - nodes with this configuration will not boot and will not pass config validation. - Helper migrations function for injecting env vars into goose migrations. This was done to inject chainID into evm chain id not null in specs migrations. - OCR2 jobs now support querying the state contract for configurations if it has been deployed. This can help on chains such as BSC which "manage" state bloat by arbitrarily deleting logs older than a certain date. In this case, if logs are missing we will query the contract directly and retrieve the latest config from chain state. Chainlink will perform no extra RPC calls unless the job spec has this feature explicitly enabled. On chains that require this, nops may see an increase in RPC calls. This can be enabled for OCR2 jobs by specifying `ConfigContractAddress` in the relay config TOML. From b63399b9de1a4a3b2358a00f18e7249342ea4542 Mon Sep 17 00:00:00 2001 From: Bolek <1416262+bolekk@users.noreply.github.com> Date: Tue, 26 Sep 2023 06:46:24 -0700 Subject: [PATCH 10/84] [Gateway] Add extra checks (#10788) --- core/services/gateway/common/utils.go | 3 +++ core/services/gateway/common/utils_test.go | 4 ++++ core/services/gateway/connector/connector.go | 2 +- core/services/gateway/gateway.go | 3 +++ core/services/gateway/network/wsclient.go | 5 +++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/core/services/gateway/common/utils.go b/core/services/gateway/common/utils.go index 7501504f87b..2e5033432bb 100644 --- a/core/services/gateway/common/utils.go +++ b/core/services/gateway/common/utils.go @@ -28,6 +28,9 @@ func StringToAlignedBytes(input string, size int) []byte { func AlignedBytesToString(data []byte) string { idx := slices.IndexFunc(data, func(b byte) bool { return b == 0 }) + if idx == -1 { + return string(data) + } return string(data[:idx]) } diff --git a/core/services/gateway/common/utils_test.go b/core/services/gateway/common/utils_test.go index e223ba1e9fc..f3ed6a0dfbb 100644 --- a/core/services/gateway/common/utils_test.go +++ b/core/services/gateway/common/utils_test.go @@ -26,6 +26,10 @@ func TestUtils_StringAlignedBytesConversions(t *testing.T) { data := common.StringToAlignedBytes(val, 40) require.Equal(t, val, common.AlignedBytesToString(data)) + val = "0123456789" + data = common.StringToAlignedBytes(val, 10) + require.Equal(t, val, common.AlignedBytesToString(data)) + val = "世界" data = common.StringToAlignedBytes(val, 40) require.Equal(t, val, common.AlignedBytesToString(data)) diff --git a/core/services/gateway/connector/connector.go b/core/services/gateway/connector/connector.go index be544a6d94b..4cc84d37490 100644 --- a/core/services/gateway/connector/connector.go +++ b/core/services/gateway/connector/connector.go @@ -79,7 +79,7 @@ type gatewayState struct { } func NewGatewayConnector(config *ConnectorConfig, signer Signer, handler GatewayConnectorHandler, clock utils.Clock, lggr logger.Logger) (GatewayConnector, error) { - if signer == nil || handler == nil || clock == nil { + if config == nil || signer == nil || handler == nil || clock == nil || lggr == nil { return nil, errors.New("nil dependency") } if len(config.DonId) == 0 || len(config.DonId) > int(network.HandshakeDonIdLen) { diff --git a/core/services/gateway/gateway.go b/core/services/gateway/gateway.go index b97bed71ee1..fb38ae10de9 100644 --- a/core/services/gateway/gateway.go +++ b/core/services/gateway/gateway.go @@ -132,6 +132,9 @@ func (g *gateway) ProcessRequest(ctx context.Context, rawRequest []byte) (rawRes if err != nil { return newError(g.codec, "", api.UserMessageParseError, err.Error()) } + if msg == nil { + return newError(g.codec, "", api.UserMessageParseError, "nil message") + } if err = msg.Validate(); err != nil { return newError(g.codec, msg.Body.MessageId, api.UserMessageParseError, err.Error()) } diff --git a/core/services/gateway/network/wsclient.go b/core/services/gateway/network/wsclient.go index 04b6fe3f338..bc248d202ac 100644 --- a/core/services/gateway/network/wsclient.go +++ b/core/services/gateway/network/wsclient.go @@ -57,6 +57,11 @@ func (c *webSocketClient) Connect(ctx context.Context, url *url.URL) (*websocket } challengeStr := resp.Header.Get(WsServerHandshakeChallengeHeaderName) + if challengeStr == "" { + c.lggr.Error("WebSocketClient: empty challenge") + c.tryCloseConn(conn) + return nil, err + } challenge, err := base64.StdEncoding.DecodeString(challengeStr) if err != nil { c.lggr.Errorf("WebSocketClient: couldn't decode challenge: %s: %v", challengeStr, err) From 3aa7a8d693797dcd63aeeaecc638830ec912d1a0 Mon Sep 17 00:00:00 2001 From: Andrei Smirnov Date: Tue, 26 Sep 2023 17:24:26 +0300 Subject: [PATCH 11/84] S4 improvements and fixing bugs (#10789) Co-authored-by: Bolek <1416262+bolekk@users.noreply.github.com> --- core/services/s4/address_range.go | 15 +++++++++------ core/services/s4/address_range_test.go | 3 ++- core/services/s4/storage.go | 8 ++++++-- core/services/s4/storage_test.go | 3 ++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/core/services/s4/address_range.go b/core/services/s4/address_range.go index bd818798faa..679bb3b846a 100644 --- a/core/services/s4/address_range.go +++ b/core/services/s4/address_range.go @@ -33,11 +33,14 @@ func NewFullAddressRange() *AddressRange { } // NewSingleAddressRange creates AddressRange for a single address. -func NewSingleAddressRange(address *utils.Big) *AddressRange { +func NewSingleAddressRange(address *utils.Big) (*AddressRange, error) { + if address == nil || address.Cmp(MinAddress) < 0 || address.Cmp(MaxAddress) > 0 { + return nil, errors.New("invalid address") + } return &AddressRange{ MinAddress: address, MaxAddress: address, - } + }, nil } // NewInitialAddressRangeForIntervals splits the full address space with intervals, @@ -75,14 +78,14 @@ func (r *AddressRange) Advance() { r.MinAddress = r.MinAddress.Add(interval) r.MaxAddress = r.MaxAddress.Add(interval) - if r.MaxAddress.Cmp(MaxAddress) > 0 { - r.MaxAddress = MaxAddress - } - if r.MinAddress.Cmp(MaxAddress) >= 0 { r.MinAddress = MinAddress r.MaxAddress = MinAddress.Add(interval).Sub(utils.NewBigI(1)) } + + if r.MaxAddress.Cmp(MaxAddress) > 0 { + r.MaxAddress = MaxAddress + } } // Contains returns true if the given address belongs to the range. diff --git a/core/services/s4/address_range_test.go b/core/services/s4/address_range_test.go index e276b45b575..bbd4d3baa54 100644 --- a/core/services/s4/address_range_test.go +++ b/core/services/s4/address_range_test.go @@ -27,7 +27,8 @@ func TestAddressRange_NewSingleAddressRange(t *testing.T) { t.Parallel() addr := utils.NewBigI(0x123) - sar := s4.NewSingleAddressRange(addr) + sar, err := s4.NewSingleAddressRange(addr) + assert.NoError(t, err) assert.Equal(t, addr, sar.MinAddress) assert.Equal(t, addr, sar.MaxAddress) assert.True(t, sar.Contains(addr)) diff --git a/core/services/s4/storage.go b/core/services/s4/storage.go index 2a2a4ffcdd4..65aa2f4bab5 100644 --- a/core/services/s4/storage.go +++ b/core/services/s4/storage.go @@ -98,7 +98,7 @@ func (s *storage) Get(ctx context.Context, key *Key) (*Record, *Metadata, error) return nil, nil, err } - if row.Expiration <= s.clock.Now().UnixMilli() { + if row.Version != key.Version || row.Expiration <= s.clock.Now().UnixMilli() { return nil, nil, ErrNotFound } @@ -119,7 +119,11 @@ func (s *storage) Get(ctx context.Context, key *Key) (*Record, *Metadata, error) func (s *storage) List(ctx context.Context, address common.Address) ([]*SnapshotRow, error) { bigAddress := utils.NewBig(address.Big()) - return s.orm.GetSnapshot(NewSingleAddressRange(bigAddress), pg.WithParentCtx(ctx)) + sar, err := NewSingleAddressRange(bigAddress) + if err != nil { + return nil, err + } + return s.orm.GetSnapshot(sar, pg.WithParentCtx(ctx)) } func (s *storage) Put(ctx context.Context, key *Key, record *Record, signature []byte) error { diff --git a/core/services/s4/storage_test.go b/core/services/s4/storage_test.go index 6c384d493bf..11a8f6544ce 100644 --- a/core/services/s4/storage_test.go +++ b/core/services/s4/storage_test.go @@ -217,7 +217,8 @@ func TestStorage_List(t *testing.T) { }, } - addressRange := s4.NewSingleAddressRange(utils.NewBig(address.Big())) + addressRange, err := s4.NewSingleAddressRange(utils.NewBig(address.Big())) + assert.NoError(t, err) ormMock.On("GetSnapshot", addressRange, mock.Anything).Return(ormRows, nil) rows, err := storage.List(testutils.Context(t), address) From 539591d0b2947691a9415af64e7d1f03173c7be1 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 26 Sep 2023 11:02:16 -0400 Subject: [PATCH 12/84] Parse chain ID as 64-bit integer (#10795) --- core/chains/evm/config/toml/config.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/chains/evm/config/toml/config.go b/core/chains/evm/config/toml/config.go index a94e45ae894..a62c554a21e 100644 --- a/core/chains/evm/config/toml/config.go +++ b/core/chains/evm/config/toml/config.go @@ -804,9 +804,5 @@ func (n *Node) SetFrom(f *Node) { } func ChainIDInt64(cid relay.ChainID) (int64, error) { - i, err := strconv.Atoi(cid) - if err != nil { - return int64(0), err - } - return int64(i), nil + return strconv.ParseInt(cid, 10, 64) } From 0b463beb2c87f1f22afd3a89a27ac53f2478f8cf Mon Sep 17 00:00:00 2001 From: Bolek <1416262+bolekk@users.noreply.github.com> Date: Tue, 26 Sep 2023 09:53:18 -0700 Subject: [PATCH 13/84] [Gateway] Don't save node responses with incorrect method name (#10796) --- core/services/gateway/handlers/functions/handler.functions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/services/gateway/handlers/functions/handler.functions.go b/core/services/gateway/handlers/functions/handler.functions.go index 82d4976db2b..7eb15ef6ffd 100644 --- a/core/services/gateway/handlers/functions/handler.functions.go +++ b/core/services/gateway/handlers/functions/handler.functions.go @@ -230,10 +230,10 @@ func (h *functionsHandler) processSecretsResponse(response *api.Message, respons if _, exists := responseData.responses[response.Body.Sender]; exists { return nil, nil, errors.New("duplicate response") } - responseData.responses[response.Body.Sender] = response if response.Body.Method != responseData.request.Body.Method { return nil, responseData, errors.New("invalid method") } + responseData.responses[response.Body.Sender] = response var responsePayload SecretsResponseBase err := json.Unmarshal(response.Body.Payload, &responsePayload) if err != nil { From c384d14bcb5cb2143dad79d05d9e926e8e6e13ab Mon Sep 17 00:00:00 2001 From: "app-token-issuer-infra-releng[bot]" <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:22:44 -0400 Subject: [PATCH 14/84] Update Operator UI from v0.8.0-197331a to v0.8.0-a8fbbb3 (#10693) --- operator_ui/TAG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator_ui/TAG b/operator_ui/TAG index 10da1e7ab25..6762dd4e0f7 100644 --- a/operator_ui/TAG +++ b/operator_ui/TAG @@ -1 +1 @@ -v0.8.0-197331a +v0.8.0-a8fbbb3 From 702d0c8fa6f89797ccce7b03e06cace56ae07e6e Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:06:39 -0400 Subject: [PATCH 15/84] Bump version and update CHANGELOG for core v2.6.0 (#10804) (cherry picked from commit 6b0124e981b66685b5751d4f8081378e4f296d1f) --- VERSION | 2 +- docs/CHANGELOG.md | 35 +++++++++++++++++------------------ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/VERSION b/VERSION index 437459cd94c..e70b4523ae7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.0 +2.6.0 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7f0b80ebcfe..299e248428c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,27 +9,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [dev] +... + +## 2.6.0 - UNRELEASED + ### Added -- Simple password use in production builds is now disallowed - nodes with this configuration will not boot and will not pass config validation. +- Simple password use in production builds is now disallowed - nodes with this configuration will not boot and will not pass config validation. - Helper migrations function for injecting env vars into goose migrations. This was done to inject chainID into evm chain id not null in specs migrations. - OCR2 jobs now support querying the state contract for configurations if it has been deployed. This can help on chains such as BSC which "manage" state bloat by arbitrarily deleting logs older than a certain date. In this case, if logs are missing we will query the contract directly and retrieve the latest config from chain state. Chainlink will perform no extra RPC calls unless the job spec has this feature explicitly enabled. On chains that require this, nops may see an increase in RPC calls. This can be enabled for OCR2 jobs by specifying `ConfigContractAddress` in the relay config TOML. ### Removed -- Removed support for sending telemetry to the deprecated Explorer service. All nodes will have to remove `Explorer` related keys from TOML configuration and env vars. +- Removed support for sending telemetry to the deprecated Explorer service. All nodes will have to remove `Explorer` related keys from TOML configuration and env vars. - Removed default evmChainID logic where evmChainID was implicitly injected into the jobspecs based on node EVM chainID toml configuration. All newly created jobs(that have evmChainID field) will have to explicitly define evmChainID in the jobspec. - Removed keyset migration that migrated v1 keys to v2 keys. All keys should've been migrated by now, and we don't permit creation of new v1 keys anymore - All nodes will have to remove the following secret configurations: - * `Explorer.AccessKey` - * `Explorer.Secret` - - All nodes will have to remove the following configuration field: `ExplorerURL` +All nodes will have to remove the following secret configurations: + +- `Explorer.AccessKey` +- `Explorer.Secret` + +All nodes will have to remove the following configuration field: `ExplorerURL` ### Fixed + - Unauthenticated users executing CLI commands previously generated a confusing error log, which is now removed: -```[ERROR] Error in transaction, rolling back: session missing or expired, please login again pg/transaction.go:118 ``` + `[ERROR] Error in transaction, rolling back: session missing or expired, please login again pg/transaction.go:118 ` - Fixed a bug that was preventing job runs to be displayed when the job `chainID` was disabled. - `chainlink txs evm create` returns a transaction hash for the attempted transaction in the CLI. Previously only the sender, recipient and `unstarted` state were returned. - Fixed a bug where `evmChainId` is requested instead of `id` or `evm-chain-id` in CLI error verbatim @@ -40,19 +46,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 2.5.0 - 2023-09-13 -- Unauthenticated users executing CLI commands previously generated a confusing error log, which is now removed: - ``` - [ERROR] Error in transaction, rolling back: session missing or expired, please login again pg/transaction.go:118 - ``` -- Fixed a bug that was preventing job runs to be displayed when the job `chainID` was disabled. -- `chainlink txs evm create` returns a transaction hash for the attempted transaction in the CLI. Previously only the sender, receipient and `unstarted` state were returned. - ### Added - New prometheus metrics for mercury: - - `mercury_price_feed_missing` - - `mercury_price_feed_errors` - Nops may wish to add alerting on these. + - `mercury_price_feed_missing` + - `mercury_price_feed_errors` + Nops may wish to add alerting on these. ### Upcoming Required Configuration Change From f67d7e393b0c8b2bc908c80a3312d3cb75310d39 Mon Sep 17 00:00:00 2001 From: Bolek <1416262+bolekk@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:59:44 -0700 Subject: [PATCH 16/84] [Functions] Add extra expiration check in storage plugin (#10805) --- core/services/ocr2/plugins/s4/plugin.go | 10 ++++++++++ core/services/ocr2/plugins/s4/plugin_test.go | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/core/services/ocr2/plugins/s4/plugin.go b/core/services/ocr2/plugins/s4/plugin.go index 7e4b91be97e..68bd9fd2142 100644 --- a/core/services/ocr2/plugins/s4/plugin.go +++ b/core/services/ocr2/plugins/s4/plugin.go @@ -253,6 +253,16 @@ func (c *plugin) ShouldAcceptFinalizedReport(ctx context.Context, ts types.Repor Confirmed: true, Signature: row.Signature, } + + now := time.Now().UnixMilli() + if now > ormRow.Expiration { + c.logger.Error("Received an expired entry in a report, not saving", commontypes.LogFields{ + "expirationTs": ormRow.Expiration, + "nowTs": now, + }) + continue + } + err = c.orm.Update(ormRow, pg.WithParentCtx(ctx)) if err != nil && !errors.Is(err, s4.ErrVersionTooLow) { c.logger.Error("Failed to Update a row in ShouldAcceptFinalizedReport()", commontypes.LogFields{"err": err}) diff --git a/core/services/ocr2/plugins/s4/plugin_test.go b/core/services/ocr2/plugins/s4/plugin_test.go index b85ba053122..94c876a4f7f 100644 --- a/core/services/ocr2/plugins/s4/plugin_test.go +++ b/core/services/ocr2/plugins/s4/plugin_test.go @@ -235,6 +235,21 @@ func TestPlugin_ShouldAcceptFinalizedReport(t *testing.T) { assert.NoError(t, err) // errors just logged assert.False(t, should) }) + + t.Run("don't save expired", func(t *testing.T) { + ormRows := make([]*s4_svc.Row, 0) + rows := generateTestRows(t, 2, -time.Minute) + + report, err := proto.Marshal(&s4.Rows{ + Rows: rows, + }) + assert.NoError(t, err) + + should, err := plugin.ShouldAcceptFinalizedReport(testutils.Context(t), types.ReportTimestamp{}, report) + assert.NoError(t, err) + assert.False(t, should) + assert.Equal(t, 0, len(ormRows)) + }) } func TestPlugin_Query(t *testing.T) { From c19d64872c650cc382e8bac0cb7376d7121c2436 Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Wed, 27 Sep 2023 11:19:55 +0200 Subject: [PATCH 17/84] CCIP-1053 Replace filtering by created_at with filtering by block_timestamp (#10743) * Replace filtering by created_at with filtering by block_timestamp * Adding index to speeds up filtering by block_timestamp * Minor fix * Minor changes * Benchmarks for new query * Post merge fixes --------- Co-authored-by: Domino Valdano <2644901+reductionista@users.noreply.github.com> --- core/chains/evm/logpoller/log_poller.go | 2 +- core/chains/evm/logpoller/log_poller_test.go | 69 ++++++++--- core/chains/evm/logpoller/orm.go | 55 +++++++-- core/chains/evm/logpoller/orm_test.go | 109 ++++++++++++++++-- core/internal/cltest/heavyweight/orm.go | 8 +- .../0198_add_block_timestamp_index.sql | 5 + 6 files changed, 205 insertions(+), 43 deletions(-) create mode 100644 core/store/migrate/migrations/0198_add_block_timestamp_index.sql diff --git a/core/chains/evm/logpoller/log_poller.go b/core/chains/evm/logpoller/log_poller.go index d6e55286029..b9d1ba2e98a 100644 --- a/core/chains/evm/logpoller/log_poller.go +++ b/core/chains/evm/logpoller/log_poller.go @@ -945,7 +945,7 @@ func (lp *logPoller) LogsWithSigs(start, end int64, eventSigs []common.Hash, add } func (lp *logPoller) LogsCreatedAfter(eventSig common.Hash, address common.Address, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectLogsCreatedAfter(eventSig[:], address, after, confs, qopts...) + return lp.orm.SelectLogsCreatedAfter(address, eventSig, after, confs, qopts...) } // IndexedLogs finds all the logs that have a topic value in topicValues at index topicIndex. diff --git a/core/chains/evm/logpoller/log_poller_test.go b/core/chains/evm/logpoller/log_poller_test.go index c434d18c999..3d4218d6ffd 100644 --- a/core/chains/evm/logpoller/log_poller_test.go +++ b/core/chains/evm/logpoller/log_poller_test.go @@ -39,23 +39,17 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func logRuntime(t *testing.T, start time.Time) { +func logRuntime(t testing.TB, start time.Time) { t.Log("runtime", time.Since(start)) } -func TestPopulateLoadedDB(t *testing.T) { - t.Skip("Only for local load testing and query analysis") - lggr := logger.TestLogger(t) - _, db := heavyweight.FullTestDBV2(t, "logs_scale", nil) - chainID := big.NewInt(137) - - o := logpoller.NewORM(big.NewInt(137), db, lggr, pgtest.NewQConfig(true)) +func populateDatabase(t testing.TB, o *logpoller.ORM, chainID *big.Int) (common.Hash, common.Address, common.Address) { event1 := EmitterABI.Events["Log1"].ID address1 := common.HexToAddress("0x2ab9a2Dc53736b361b72d900CdF9F78F9406fbbb") address2 := common.HexToAddress("0x6E225058950f237371261C985Db6bDe26df2200E") + startDate := time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC) - // We start at 1 just so block number > 0 - for j := 1; j < 1000; j++ { + for j := 1; j < 100; j++ { var logs []logpoller.Log // Max we can insert per batch for i := 0; i < 1000; i++ { @@ -63,20 +57,57 @@ func TestPopulateLoadedDB(t *testing.T) { if (i+(1000*j))%2 == 0 { addr = address2 } + blockNumber := int64(i + (1000 * j)) + blockTimestamp := startDate.Add(time.Duration(j*1000) * time.Hour) + logs = append(logs, logpoller.Log{ - EvmChainId: utils.NewBig(chainID), - LogIndex: 1, - BlockHash: common.HexToHash(fmt.Sprintf("0x%d", i+(1000*j))), - BlockNumber: int64(i + (1000 * j)), - EventSig: event1, - Topics: [][]byte{event1[:], logpoller.EvmWord(uint64(i + 1000*j)).Bytes()}, - Address: addr, - TxHash: common.HexToHash("0x1234"), - Data: logpoller.EvmWord(uint64(i + 1000*j)).Bytes(), + EvmChainId: utils.NewBig(chainID), + LogIndex: 1, + BlockHash: common.HexToHash(fmt.Sprintf("0x%d", i+(1000*j))), + BlockNumber: blockNumber, + BlockTimestamp: blockTimestamp, + EventSig: event1, + Topics: [][]byte{event1[:], logpoller.EvmWord(uint64(i + 1000*j)).Bytes()}, + Address: addr, + TxHash: utils.RandomAddress().Hash(), + Data: logpoller.EvmWord(uint64(i + 1000*j)).Bytes(), + CreatedAt: blockTimestamp, }) + } require.NoError(t, o.InsertLogs(logs)) + require.NoError(t, o.InsertBlock(utils.RandomAddress().Hash(), int64((j+1)*1000-1), startDate.Add(time.Duration(j*1000)*time.Hour))) } + + return event1, address1, address2 +} + +func BenchmarkSelectLogsCreatedAfter(b *testing.B) { + chainId := big.NewInt(137) + _, db := heavyweight.FullTestDBV2(b, "logs_scale", nil) + o := logpoller.NewORM(chainId, db, logger.TestLogger(b), pgtest.NewQConfig(false)) + event, address, _ := populateDatabase(b, o, chainId) + + // Setting searchDate to pick around 5k logs + searchDate := time.Date(2020, 1, 1, 12, 12, 12, 0, time.UTC) + + b.ResetTimer() + + for i := 0; i < b.N; i++ { + logs, err := o.SelectLogsCreatedAfter(address, event, searchDate, 500) + require.NotZero(b, len(logs)) + require.NoError(b, err) + } +} + +func TestPopulateLoadedDB(t *testing.T) { + t.Skip("Only for local load testing and query analysis") + _, db := heavyweight.FullTestDBV2(t, "logs_scale", nil) + chainID := big.NewInt(137) + + o := logpoller.NewORM(big.NewInt(137), db, logger.TestLogger(t), pgtest.NewQConfig(true)) + event1, address1, address2 := populateDatabase(t, o, chainID) + func() { defer logRuntime(t, time.Now()) _, err1 := o.SelectLogsByBlockRangeFilter(750000, 800000, address1, event1) diff --git a/core/chains/evm/logpoller/orm.go b/core/chains/evm/logpoller/orm.go index c062ef3e080..b26c4ac7df6 100644 --- a/core/chains/evm/logpoller/orm.go +++ b/core/chains/evm/logpoller/orm.go @@ -122,7 +122,7 @@ func (o *ORM) SelectLatestLogEventSigWithConfs(eventSig common.Hash, address com WHERE evm_chain_id = $1 AND event_sig = $2 AND address = $3 - AND (block_number + $4) <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) + AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $4 ORDER BY (block_number, log_index) DESC LIMIT 1`, utils.NewBig(o.chainID), eventSig, address, confs); err != nil { return nil, err } @@ -231,17 +231,22 @@ func (o *ORM) SelectLogsByBlockRangeFilter(start, end int64, address common.Addr } // SelectLogsCreatedAfter finds logs created after some timestamp. -func (o *ORM) SelectLogsCreatedAfter(eventSig []byte, address common.Address, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { + minBlock, maxBlock, err := o.blocksRangeAfterTimestamp(after, confs, qopts...) + if err != nil { + return nil, err + } + var logs []Log q := o.q.WithOpts(qopts...) - err := q.Select(&logs, ` + err = q.Select(&logs, ` SELECT * FROM evm.logs WHERE evm_chain_id = $1 AND address = $2 AND event_sig = $3 - AND created_at > $4 - AND (block_number + $5) <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - ORDER BY created_at ASC`, utils.NewBig(o.chainID), address, eventSig, after, confs) + AND block_number > $4 + AND block_number <= $5 + ORDER BY (block_number, log_index)`, utils.NewBig(o.chainID), address, eventSig, minBlock, maxBlock) if err != nil { return nil, err } @@ -498,18 +503,24 @@ func validateTopicIndex(index int) error { } func (o *ORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { - q := o.q.WithOpts(qopts...) + minBlock, maxBlock, err := o.blocksRangeAfterTimestamp(after, confs, qopts...) + if err != nil { + return nil, err + } + var logs []Log + q := o.q.WithOpts(qopts...) topicValuesBytes := concatBytes(topicValues) // Add 1 since postgresql arrays are 1-indexed. - err := q.Select(&logs, ` + err = q.Select(&logs, ` SELECT * FROM evm.logs WHERE evm.logs.evm_chain_id = $1 - AND address = $2 AND event_sig = $3 + AND address = $2 + AND event_sig = $3 AND topics[$4] = ANY($5) - AND created_at > $6 - AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $7 - ORDER BY created_at ASC`, utils.NewBig(o.chainID), address, eventSig.Bytes(), topicIndex+1, topicValuesBytes, after, confs) + AND block_number > $6 + AND block_number <= $7 + ORDER BY (block_number, log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), topicIndex+1, topicValuesBytes, minBlock, maxBlock) if err != nil { return nil, err } @@ -569,7 +580,27 @@ func (o *ORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIn return nil, err } return logs, nil +} +func (o *ORM) blocksRangeAfterTimestamp(after time.Time, confs int, qopts ...pg.QOpt) (int64, int64, error) { + type blockRange struct { + MinBlockNumber int64 `db:"min_block"` + MaxBlockNumber int64 `db:"max_block"` + } + + var br blockRange + q := o.q.WithOpts(qopts...) + err := q.Get(&br, ` + SELECT + coalesce(min(block_number), 0) as min_block, + coalesce(max(block_number), 0) as max_block + FROM evm.log_poller_blocks + WHERE evm_chain_id = $1 + AND block_timestamp > $2`, utils.NewBig(o.chainID), after) + if err != nil { + return 0, 0, err + } + return br.MinBlockNumber, br.MaxBlockNumber - int64(confs), nil } type bytesProducer interface { diff --git a/core/chains/evm/logpoller/orm_test.go b/core/chains/evm/logpoller/orm_test.go index 28f3e8da8e6..f9b51000bb1 100644 --- a/core/chains/evm/logpoller/orm_test.go +++ b/core/chains/evm/logpoller/orm_test.go @@ -1087,16 +1087,16 @@ func TestSelectLatestBlockNumberEventSigsAddrsWithConfs(t *testing.T) { th := SetupTH(t, 2, 3, 2) event1 := EmitterABI.Events["Log1"].ID event2 := EmitterABI.Events["Log2"].ID - address1 := common.HexToAddress("0xA") - address2 := common.HexToAddress("0xB") + address1 := utils.RandomAddress() + address2 := utils.RandomAddress() require.NoError(t, th.ORM.InsertLogs([]logpoller.Log{ - GenLog(th.ChainID, 1, 1, "0x1", event1[:], address1), - GenLog(th.ChainID, 2, 1, "0x2", event2[:], address2), - GenLog(th.ChainID, 2, 2, "0x4", event2[:], address2), - GenLog(th.ChainID, 2, 3, "0x6", event2[:], address2), + GenLog(th.ChainID, 1, 1, utils.RandomAddress().String(), event1[:], address1), + GenLog(th.ChainID, 2, 1, utils.RandomAddress().String(), event2[:], address2), + GenLog(th.ChainID, 2, 2, utils.RandomAddress().String(), event2[:], address2), + GenLog(th.ChainID, 2, 3, utils.RandomAddress().String(), event2[:], address2), })) - require.NoError(t, th.ORM.InsertBlock(common.HexToHash("0x1"), 3, time.Now())) + require.NoError(t, th.ORM.InsertBlock(utils.RandomAddress().Hash(), 3, time.Now())) tests := []struct { name string @@ -1171,3 +1171,98 @@ func TestSelectLatestBlockNumberEventSigsAddrsWithConfs(t *testing.T) { }) } } + +func TestSelectLogsCreatedAfter(t *testing.T) { + th := SetupTH(t, 2, 3, 2) + event := EmitterABI.Events["Log1"].ID + address := utils.RandomAddress() + + past := time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC) + now := time.Date(2020, 1, 1, 12, 12, 12, 0, time.UTC) + future := time.Date(2030, 1, 1, 12, 12, 12, 0, time.UTC) + + require.NoError(t, th.ORM.InsertLogs([]logpoller.Log{ + GenLog(th.ChainID, 1, 1, utils.RandomAddress().String(), event[:], address), + GenLog(th.ChainID, 1, 2, utils.RandomAddress().String(), event[:], address), + GenLog(th.ChainID, 2, 2, utils.RandomAddress().String(), event[:], address), + GenLog(th.ChainID, 1, 3, utils.RandomAddress().String(), event[:], address), + })) + require.NoError(t, th.ORM.InsertBlock(utils.RandomAddress().Hash(), 1, past)) + require.NoError(t, th.ORM.InsertBlock(utils.RandomAddress().Hash(), 2, now)) + require.NoError(t, th.ORM.InsertBlock(utils.RandomAddress().Hash(), 3, future)) + + type expectedLog struct { + block int64 + log int64 + } + + tests := []struct { + name string + confs int + after time.Time + expectedLogs []expectedLog + }{ + { + name: "picks logs after block 1", + confs: 0, + after: past.Add(-time.Hour), + expectedLogs: []expectedLog{ + {block: 2, log: 1}, + {block: 2, log: 2}, + {block: 3, log: 1}, + }, + }, + { + name: "skips blocks with not enough confirmations", + confs: 1, + after: past.Add(-time.Hour), + expectedLogs: []expectedLog{ + {block: 2, log: 1}, + {block: 2, log: 2}, + }, + }, + { + name: "limits number of blocks by block_timestamp", + confs: 0, + after: now.Add(-time.Hour), + expectedLogs: []expectedLog{ + {block: 3, log: 1}, + }, + }, + { + name: "returns empty dataset for future timestamp", + confs: 0, + after: future, + expectedLogs: []expectedLog{}, + }, + { + name: "returns empty dataset when too many confirmations are required", + confs: 3, + after: past.Add(-time.Hour), + expectedLogs: []expectedLog{}, + }, + } + for _, tt := range tests { + t.Run("SelectLogsCreatedAfter"+tt.name, func(t *testing.T) { + logs, err := th.ORM.SelectLogsCreatedAfter(address, event, tt.after, tt.confs) + require.NoError(t, err) + assert.Len(t, logs, len(tt.expectedLogs)) + + for i, log := range logs { + assert.Equal(t, tt.expectedLogs[i].block, log.BlockNumber) + assert.Equal(t, tt.expectedLogs[i].log, log.LogIndex) + } + }) + + t.Run("SelectIndexedLogsCreatedAfter"+tt.name, func(t *testing.T) { + logs, err := th.ORM.SelectIndexedLogsCreatedAfter(address, event, 0, []common.Hash{event}, tt.after, tt.confs) + require.NoError(t, err) + assert.Len(t, logs, len(tt.expectedLogs)) + + for i, log := range logs { + assert.Equal(t, tt.expectedLogs[i].block, log.BlockNumber) + assert.Equal(t, tt.expectedLogs[i].log, log.LogIndex) + } + }) + } +} diff --git a/core/internal/cltest/heavyweight/orm.go b/core/internal/cltest/heavyweight/orm.go index 3690a986e2e..841901c25aa 100644 --- a/core/internal/cltest/heavyweight/orm.go +++ b/core/internal/cltest/heavyweight/orm.go @@ -29,21 +29,21 @@ import ( // FullTestDBV2 creates a pristine DB which runs in a separate database than the normal // unit tests, so you can do things like use other Postgres connection types with it. -func FullTestDBV2(t *testing.T, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { +func FullTestDBV2(t testing.TB, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { return prepareFullTestDBV2(t, name, false, true, overrideFn) } // FullTestDBNoFixturesV2 is the same as FullTestDB, but it does not load fixtures. -func FullTestDBNoFixturesV2(t *testing.T, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { +func FullTestDBNoFixturesV2(t testing.TB, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { return prepareFullTestDBV2(t, name, false, false, overrideFn) } // FullTestDBEmptyV2 creates an empty DB (without migrations). -func FullTestDBEmptyV2(t *testing.T, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { +func FullTestDBEmptyV2(t testing.TB, name string, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { return prepareFullTestDBV2(t, name, true, false, overrideFn) } -func prepareFullTestDBV2(t *testing.T, name string, empty bool, loadFixtures bool, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { +func prepareFullTestDBV2(t testing.TB, name string, empty bool, loadFixtures bool, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { testutils.SkipShort(t, "FullTestDB") if empty && loadFixtures { diff --git a/core/store/migrate/migrations/0198_add_block_timestamp_index.sql b/core/store/migrate/migrations/0198_add_block_timestamp_index.sql new file mode 100644 index 00000000000..8f20f4d8491 --- /dev/null +++ b/core/store/migrate/migrations/0198_add_block_timestamp_index.sql @@ -0,0 +1,5 @@ +-- +goose Up +create index log_poller_blocks_by_timestamp on evm.log_poller_blocks (evm_chain_id, block_timestamp); + +-- +goose Down +DROP INDEX IF EXISTS evm.log_poller_blocks_by_timestamp; \ No newline at end of file From 05efa5d4d20ca928675ad4b7b2efd6ea312e943a Mon Sep 17 00:00:00 2001 From: Sri Kidambi <1702865+kidambisrinivas@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:45:33 +0100 Subject: [PATCH 18/84] Gas cost optimisations for VRFV2PlusWrapper (#10790) * Gas cost optimisations for VRFV2PlusWrapper by contract state variable packing * Slot Callback struct into a single word * Generated go wrappers * Added comments --------- Co-authored-by: Sri Kidambi --- .../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol | 62 +++++++++++-------- .../vrfv2plus_wrapper/vrfv2plus_wrapper.go | 8 +-- ...rapper-dependency-versions-do-not-edit.txt | 2 +- 3 files changed, 40 insertions(+), 32 deletions(-) diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol index edab249b3c6..f339cce6b4d 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol @@ -21,17 +21,11 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume error LinkAlreadySet(); error FailedToTransferLink(); - LinkTokenInterface public s_link; - AggregatorV3Interface public s_linkNativeFeed; - ExtendedVRFCoordinatorV2PlusInterface public immutable COORDINATOR; + // s_keyHash is the key hash to use when requesting randomness. Fees are paid based on current gas + // fees, so this should be set to the highest gas lane on the network. + bytes32 s_keyHash; + uint256 public immutable SUBSCRIPTION_ID; - /// @dev this is the size of a VRF v2 fulfillment's calldata abi-encoded in bytes. - /// @dev proofSize = 13 words = 13 * 256 = 3328 bits - /// @dev commitmentSize = 5 words = 5 * 256 = 1280 bits - /// @dev dataSize = proofSize + commitmentSize = 4608 bits - /// @dev selector = 32 bits - /// @dev total data size = 4608 bits + 32 bits = 4640 bits = 580 bytes - uint32 public s_fulfillmentTxSizeBytes = 580; // 5k is plenty for an EXTCODESIZE call (2600) + warm CALL (100) // and some arithmetic operations. @@ -41,16 +35,6 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume // should only be relied on within the same transaction the request was made. uint256 public override lastRequestId; - // Configuration fetched from VRFCoordinatorV2 - - // s_configured tracks whether this contract has been configured. If not configured, randomness - // requests cannot be made. - bool public s_configured; - - // s_disabled disables the contract when true. When disabled, new VRF requests cannot be made - // but existing ones can still be fulfilled. - bool public s_disabled; - // s_fallbackWeiPerUnitLink is the backup LINK exchange rate used when the LINK/NATIVE feed is // stale. int256 private s_fallbackWeiPerUnitLink; @@ -67,33 +51,57 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume // charges. uint32 private s_fulfillmentFlatFeeNativePPM; + LinkTokenInterface public s_link; + // Other configuration // s_wrapperGasOverhead reflects the gas overhead of the wrapper's fulfillRandomWords // function. The cost for this gas is passed to the user. uint32 private s_wrapperGasOverhead; + // Configuration fetched from VRFCoordinatorV2 + + /// @dev this is the size of a VRF v2 fulfillment's calldata abi-encoded in bytes. + /// @dev proofSize = 13 words = 13 * 256 = 3328 bits + /// @dev commitmentSize = 5 words = 5 * 256 = 1280 bits + /// @dev dataSize = proofSize + commitmentSize = 4608 bits + /// @dev selector = 32 bits + /// @dev total data size = 4608 bits + 32 bits = 4640 bits = 580 bytes + uint32 public s_fulfillmentTxSizeBytes = 580; + // s_coordinatorGasOverhead reflects the gas overhead of the coordinator's fulfillRandomWords // function. The cost for this gas is billed to the subscription, and must therefor be included // in the pricing for wrapped requests. This includes the gas costs of proof verification and // payment calculation in the coordinator. uint32 private s_coordinatorGasOverhead; + AggregatorV3Interface public s_linkNativeFeed; + + // s_configured tracks whether this contract has been configured. If not configured, randomness + // requests cannot be made. + bool public s_configured; + + // s_disabled disables the contract when true. When disabled, new VRF requests cannot be made + // but existing ones can still be fulfilled. + bool public s_disabled; + // s_wrapperPremiumPercentage is the premium ratio in percentage. For example, a value of 0 // indicates no premium. A value of 15 indicates a 15 percent premium. uint8 private s_wrapperPremiumPercentage; - // s_keyHash is the key hash to use when requesting randomness. Fees are paid based on current gas - // fees, so this should be set to the highest gas lane on the network. - bytes32 s_keyHash; - // s_maxNumWords is the max number of words that can be requested in a single wrapped VRF request. uint8 s_maxNumWords; + ExtendedVRFCoordinatorV2PlusInterface public immutable COORDINATOR; + struct Callback { address callbackAddress; uint32 callbackGasLimit; - uint256 requestGasPrice; + // Reducing requestGasPrice from uint256 to uint64 slots Callback struct + // into a single word, thus saving an entire SSTORE and leading to 21K + // gas cost saving. 18 ETH would be the max gas price we can process. + // GasPrice is unlikely to be more than 14 ETH on most chains + uint64 requestGasPrice; } mapping(uint256 => Callback) /* requestID */ /* callback */ public s_callbacks; @@ -352,7 +360,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume s_callbacks[requestId] = Callback({ callbackAddress: _sender, callbackGasLimit: callbackGasLimit, - requestGasPrice: tx.gasprice + requestGasPrice: uint64(tx.gasprice) }); lastRequestId = requestId; } @@ -378,7 +386,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume s_callbacks[requestId] = Callback({ callbackAddress: msg.sender, callbackGasLimit: _callbackGasLimit, - requestGasPrice: tx.gasprice + requestGasPrice: uint64(tx.gasprice) }); return requestId; diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go index 0fa54876b7c..cee53ca92ff 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go @@ -31,8 +31,8 @@ var ( ) var VRFV2PlusWrapperMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractExtendedVRFCoordinatorV2PlusInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"requestGasPrice\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60c06040526004805463ffffffff60a01b1916609160a21b1790553480156200002757600080fd5b50604051620030e7380380620030e78339810160408190526200004a9162000317565b803380600081620000a25760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d557620000d5816200024e565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200011857600380546001600160a01b0319166001600160a01b0385161790555b6001600160a01b038216156200014457600480546001600160a01b0319166001600160a01b0384161790555b806001600160a01b03166080816001600160a01b031660601b815250506000816001600160a01b031663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156200019f57600080fd5b505af1158015620001b4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001da919062000361565b60a0819052604051632fb1302360e21b8152600481018290523060248201529091506001600160a01b0383169063bec4c08c90604401600060405180830381600087803b1580156200022b57600080fd5b505af115801562000240573d6000803e3d6000fd5b50505050505050506200037b565b6001600160a01b038116331415620002a95760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000099565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031257600080fd5b919050565b6000806000606084860312156200032d57600080fd5b6200033884620002fa565b92506200034860208501620002fa565b91506200035860408501620002fa565b90509250925092565b6000602082840312156200037457600080fd5b5051919050565b60805160601c60a051612d12620003d5600039600081816101ef01528181610d2301526115e40152600081816102f901528181610ded0152818161166b0152818161197301528181611a540152611aef0152612d126000f3fe6080604052600436106101d85760003560e01c80638da5cb5b11610102578063c15ce4d711610095578063f254bdc711610064578063f254bdc7146106ff578063f2fde38b1461072c578063f3fef3a31461074c578063fc2a88c31461076c57600080fd5b8063c15ce4d7146105c0578063c3f909d4146105e0578063cdd8d88514610688578063da4f5e6d146106d257600080fd5b8063a3907d71116100d1578063a3907d711461054c578063a4c0ed3614610561578063a608a1e114610581578063bf17e559146105a057600080fd5b80638da5cb5b146104b45780638ea98117146104df5780639eccacf6146104ff578063a02e06161461052c57600080fd5b80634306d3541161017a57806362a504fc1161014957806362a504fc1461044c578063650596541461045f57806379ba50971461047f5780637fb5d19d1461049457600080fd5b80634306d3541461034057806348baa1c5146103605780634b1609351461040257806357a8070a1461042257600080fd5b80631fe543e3116101b65780631fe543e3146102925780632f2770db146102b25780633255c456146102c75780633b2bcbf1146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f36600461263a565b610782565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612aa8565b34801561029e57600080fd5b506102446102ad36600461279e565b61085e565b3480156102be57600080fd5b506102446108df565b3480156102d357600080fd5b506102116102e236600461293f565b610915565b3480156102f357600080fd5b5061031b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b34801561034c57600080fd5b5061021161035b3660046128d7565b610a0d565b34801561036c57600080fd5b506103cb61037b366004612785565b600b602052600090815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff82169174010000000000000000000000000000000000000000900463ffffffff169083565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff90921660208401529082015260600161021b565b34801561040e57600080fd5b5061021161041d3660046128d7565b610b14565b34801561042e57600080fd5b5060065461043c9060ff1681565b604051901515815260200161021b565b61021161045a3660046128f4565b610c0b565b34801561046b57600080fd5b5061024461047a36600461261f565b610f1d565b34801561048b57600080fd5b50610244610f6c565b3480156104a057600080fd5b506102116104af36600461293f565b611069565b3480156104c057600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661031b565b3480156104eb57600080fd5b506102446104fa36600461261f565b61116f565b34801561050b57600080fd5b5060025461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561053857600080fd5b5061024461054736600461261f565b61127a565b34801561055857600080fd5b50610244611319565b34801561056d57600080fd5b5061024461057c366004612664565b61134b565b34801561058d57600080fd5b5060065461043c90610100900460ff1681565b3480156105ac57600080fd5b506102446105bb3660046128d7565b6117cb565b3480156105cc57600080fd5b506102446105db366004612997565b611822565b3480156105ec57600080fd5b50600754600854600954600a546040805194855263ffffffff808516602087015264010000000085048116918601919091526c01000000000000000000000000840481166060860152700100000000000000000000000000000000840416608085015260ff74010000000000000000000000000000000000000000909304831660a085015260c08401919091521660e08201526101000161021b565b34801561069457600080fd5b506004546106bd9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106de57600080fd5b5060035461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561070b57600080fd5b5060045461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561073857600080fd5b5061024461074736600461261f565b611bfe565b34801561075857600080fd5b5061024461076736600461263a565b611c12565b34801561077857600080fd5b5061021160055481565b61078a611cfc565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107e4576040519150601f19603f3d011682016040523d82523d6000602084013e6107e9565b606091505b5050905080610859576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108d1576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610850565b6108db8282611d7f565b5050565b6108e7611cfc565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60065460009060ff16610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff16156109f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b610a068363ffffffff1683611f6b565b9392505050565b60065460009060ff16610a7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615610aee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b6000610af861207c565b9050610b0b8363ffffffff163a836121cb565b9150505b919050565b60065460009060ff16610b83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615610bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b610c058263ffffffff163a611f6b565b92915050565b600080610c17856122f8565b90506000610c2b8663ffffffff163a611f6b565b905080341015610c97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610850565b600a5460ff1663ffffffff85161115610d0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610850565b60006040518060c0016040528060095481526020017f000000000000000000000000000000000000000000000000000000000000000081526020018761ffff1681526020016008600c9054906101000a900463ffffffff16858a610d709190612b7e565b610d7a9190612b7e565b63ffffffff1681526020018663ffffffff168152602001610dab604051806020016040528060011515815250612310565b90526040517f9b1c385e00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b1c385e90610e22908490600401612abb565b602060405180830381600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e74919061270d565b6040805160608101825233815263ffffffff808b1660208084019182523a8486019081526000878152600b90925294902092518354915190921674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090911673ffffffffffffffffffffffffffffffffffffffff9290921691909117178155905160019091015593505050509392505050565b610f25611cfc565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610fed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610850565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60065460009060ff166110d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff161561114a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b600061115461207c565b90506111678463ffffffff1684836121cb565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906111af575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561123357336111d460005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610850565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611282611cfc565b60035473ffffffffffffffffffffffffffffffffffffffff16156112d2576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611321611cfc565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60065460ff166113b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610850565b600654610100900460ff1615611429576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610850565b60035473ffffffffffffffffffffffffffffffffffffffff1633146114aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610850565b600080806114ba848601866128f4565b92509250925060006114cb846122f8565b905060006114d761207c565b905060006114ec8663ffffffff163a846121cb565b905080891015611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610850565b600a5460ff1663ffffffff851611156115cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610850565b60006040518060c0016040528060095481526020017f000000000000000000000000000000000000000000000000000000000000000081526020018761ffff1681526020016008600c9054906101000a900463ffffffff16868a6116319190612b7e565b61163b9190612b7e565b63ffffffff1681526020018663ffffffff16815260200160405180602001604052806000815250815250905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016116c29190612abb565b602060405180830381600087803b1580156116dc57600080fd5b505af11580156116f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611714919061270d565b6040805160608101825273ffffffffffffffffffffffffffffffffffffffff9e8f16815263ffffffff9a8b1660208083019182523a8385019081526000868152600b909252939020915182549151909c1674010000000000000000000000000000000000000000027fffffffffffffffff0000000000000000000000000000000000000000000000009091169b909f169a909a179d909d1789559b5160019098019790975550505060059790975550505050505050565b6117d3611cfc565b6004805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b61182a611cfc565b6008805460ff80861674010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff63ffffffff898116700100000000000000000000000000000000027fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff918c166c0100000000000000000000000002919091167fffffffffffffffffffffffff0000000000000000ffffffffffffffffffffffff909516949094179390931792909216919091179091556009839055600a80549183167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00928316179055600680549091166001179055604080517f088070f5000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163088070f5916004828101926080929190829003018186803b1580156119b957600080fd5b505afa1580156119cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f19190612726565b50600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f043bd6ae00000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163043bd6ae916004808301926020929190829003018186803b158015611aaf57600080fd5b505afa158015611ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae7919061270d565b6007819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636b6feccc6040518163ffffffff1660e01b8152600401604080518083038186803b158015611b5257600080fd5b505afa158015611b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8a919061295d565b600880547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff166801000000000000000063ffffffff938416027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff161764010000000093909216929092021790555050505050565b611c06611cfc565b611c0f816123cc565b50565b611c1a611cfc565b6003546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b158015611c8e57600080fd5b505af1158015611ca2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc691906126eb565b6108db576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611d7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610850565b565b6000828152600b602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008304168387015260018401805495840195909552898852959094527fffffffffffffffff000000000000000000000000000000000000000000000000909316905592909255815116611e7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610850565b600080631fe543e360e01b8585604051602401611e9b929190612b18565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611f15846020015163ffffffff168560000151846124c2565b905080611f6357835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6004546000908190611f9a9074010000000000000000000000000000000000000000900463ffffffff1661250e565b60085463ffffffff7001000000000000000000000000000000008204811691611fd5916c010000000000000000000000009091041687612b66565b611fdf9190612b66565b611fe99085612c02565b611ff39190612b66565b60085490915081906000906064906120269074010000000000000000000000000000000000000000900460ff1682612ba6565b6120339060ff1684612c02565b61203d9190612bcb565b6008549091506000906120679068010000000000000000900463ffffffff1664e8d4a51000612c02565b6120719083612b66565b979650505050505050565b60085460048054604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009463ffffffff161515938593849373ffffffffffffffffffffffffffffffffffffffff9091169263feaf968c928281019260a0929190829003018186803b1580156120f857600080fd5b505afa15801561210c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213091906129f9565b509450909250849150508015612156575061214b8242612c3f565b60085463ffffffff16105b1561216057506007545b6000811215610a06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610850565b60045460009081906121fa9074010000000000000000000000000000000000000000900463ffffffff1661250e565b60085463ffffffff7001000000000000000000000000000000008204811691612235916c010000000000000000000000009091041688612b66565b61223f9190612b66565b6122499086612c02565b6122539190612b66565b905060008361226a83670de0b6b3a7640000612c02565b6122749190612bcb565b6008549091506000906064906122a59074010000000000000000000000000000000000000000900460ff1682612ba6565b6122b29060ff1684612c02565b6122bc9190612bcb565b6008549091506000906122e290640100000000900463ffffffff1664e8d4a51000612c02565b6122ec9083612b66565b98975050505050505050565b6000612305603f83612bdf565b610c05906001612b7e565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161234991511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff811633141561244c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610850565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a6113888110156124d457600080fd5b6113888103905084604082048203116124ec57600080fd5b50823b6124f857600080fd5b60008083516020850160008789f1949350505050565b60004661a4b1811480612523575062066eed81145b156125c7576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561257157600080fd5b505afa158015612585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a9919061288d565b5050505091505083608c6125bd9190612b66565b6111679082612c02565b50600092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b0f57600080fd5b803560ff81168114610b0f57600080fd5b805169ffffffffffffffffffff81168114610b0f57600080fd5b60006020828403121561263157600080fd5b610a06826125d0565b6000806040838503121561264d57600080fd5b612656836125d0565b946020939093013593505050565b6000806000806060858703121561267a57600080fd5b612683856125d0565b935060208501359250604085013567ffffffffffffffff808211156126a757600080fd5b818701915087601f8301126126bb57600080fd5b8135818111156126ca57600080fd5b8860208285010111156126dc57600080fd5b95989497505060200194505050565b6000602082840312156126fd57600080fd5b81518015158114610a0657600080fd5b60006020828403121561271f57600080fd5b5051919050565b6000806000806080858703121561273c57600080fd5b845161274781612ce3565b602086015190945061275881612cf3565b604086015190935061276981612cf3565b606086015190925061277a81612cf3565b939692955090935050565b60006020828403121561279757600080fd5b5035919050565b600080604083850312156127b157600080fd5b8235915060208084013567ffffffffffffffff808211156127d157600080fd5b818601915086601f8301126127e557600080fd5b8135818111156127f7576127f7612cb4565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561283a5761283a612cb4565b604052828152858101935084860182860187018b101561285957600080fd5b600095505b8386101561287c57803585526001959095019493860193860161285e565b508096505050505050509250929050565b60008060008060008060c087890312156128a657600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b6000602082840312156128e957600080fd5b8135610a0681612cf3565b60008060006060848603121561290957600080fd5b833561291481612cf3565b9250602084013561292481612ce3565b9150604084013561293481612cf3565b809150509250925092565b6000806040838503121561295257600080fd5b823561265681612cf3565b6000806040838503121561297057600080fd5b825161297b81612cf3565b602084015190925061298c81612cf3565b809150509250929050565b600080600080600060a086880312156129af57600080fd5b85356129ba81612cf3565b945060208601356129ca81612cf3565b93506129d8604087016125f4565b9250606086013591506129ed608087016125f4565b90509295509295909350565b600080600080600060a08688031215612a1157600080fd5b612a1a86612605565b94506020860151935060408601519250606086015191506129ed60808701612605565b6000815180845260005b81811015612a6357602081850181015186830182015201612a47565b81811115612a75576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a066020830184612a3d565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c08084015261116760e0840182612a3d565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612b5957845183529383019391830191600101612b3d565b5090979650505050505050565b60008219821115612b7957612b79612c56565b500190565b600063ffffffff808316818516808303821115612b9d57612b9d612c56565b01949350505050565b600060ff821660ff84168060ff03821115612bc357612bc3612c56565b019392505050565b600082612bda57612bda612c85565b500490565b600063ffffffff80841680612bf657612bf6612c85565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c3a57612c3a612c56565b500290565b600082821015612c5157612c51612c56565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff81168114611c0f57600080fd5b63ffffffff81168114611c0f57600080fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractExtendedVRFCoordinatorV2PlusInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60c06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b5060405162003134380380620031348339810160408190526200004c9162000335565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200026c565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b806001600160a01b031660a0816001600160a01b031660601b815250506000816001600160a01b031663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620001bd57600080fd5b505af1158015620001d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f891906200037f565b6080819052604051632fb1302360e21b8152600481018290523060248201529091506001600160a01b0383169063bec4c08c90604401600060405180830381600087803b1580156200024957600080fd5b505af11580156200025e573d6000803e3d6000fd5b505050505050505062000399565b6001600160a01b038116331415620002c75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200033057600080fd5b919050565b6000806000606084860312156200034b57600080fd5b620003568462000318565b9250620003666020850162000318565b9150620003766040850162000318565b90509250925092565b6000602082840312156200039257600080fd5b5051919050565b60805160a05160601c612d41620003f3600039600081816102f901528181610e08015281816116e1015281816119fa01528181611adb0152611b760152600081816101ef01528181610d3f015261165b0152612d416000f3fe6080604052600436106101d85760003560e01c80638da5cb5b11610102578063c15ce4d711610095578063f254bdc711610064578063f254bdc71461070a578063f2fde38b14610747578063f3fef3a314610767578063fc2a88c31461078757600080fd5b8063c15ce4d7146105e9578063c3f909d414610609578063cdd8d88514610693578063da4f5e6d146106cd57600080fd5b8063a3907d71116100d1578063a3907d7114610575578063a4c0ed361461058a578063a608a1e1146105aa578063bf17e559146105c957600080fd5b80638da5cb5b146104dd5780638ea98117146105085780639eccacf614610528578063a02e06161461055557600080fd5b80634306d3541161017a57806362a504fc1161014957806362a504fc14610475578063650596541461048857806379ba5097146104a85780637fb5d19d146104bd57600080fd5b80634306d3541461034057806348baa1c5146103605780634b1609351461042b57806357a8070a1461044b57600080fd5b80631fe543e3116101b65780631fe543e3146102925780632f2770db146102b25780633255c456146102c75780633b2bcbf1146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f366004612669565b61079d565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612ad7565b34801561029e57600080fd5b506102446102ad3660046127cd565b610879565b3480156102be57600080fd5b506102446108fa565b3480156102d357600080fd5b506102116102e236600461296e565b610930565b3480156102f357600080fd5b5061031b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b34801561034c57600080fd5b5061021161035b366004612906565b610a28565b34801561036c57600080fd5b506103ea61037b3660046127b4565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161021b565b34801561043757600080fd5b50610211610446366004612906565b610b2f565b34801561045757600080fd5b506008546104659060ff1681565b604051901515815260200161021b565b610211610483366004612923565b610c26565b34801561049457600080fd5b506102446104a336600461264e565b610f7b565b3480156104b457600080fd5b50610244610fc6565b3480156104c957600080fd5b506102116104d836600461296e565b6110c3565b3480156104e957600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661031b565b34801561051457600080fd5b5061024461052336600461264e565b6111c9565b34801561053457600080fd5b5060025461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561056157600080fd5b5061024461057036600461264e565b6112d4565b34801561058157600080fd5b5061024461137f565b34801561059657600080fd5b506102446105a5366004612693565b6113b1565b3480156105b657600080fd5b5060085461046590610100900460ff1681565b3480156105d557600080fd5b506102446105e4366004612906565b611895565b3480156105f557600080fd5b506102446106043660046129c6565b6118dc565b34801561061557600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e08201526101000161021b565b34801561069f57600080fd5b506007546106b890640100000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106d957600080fd5b5060065461031b906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561071657600080fd5b5060075461031b906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561075357600080fd5b5061024461076236600461264e565b611c85565b34801561077357600080fd5b50610244610782366004612669565b611c99565b34801561079357600080fd5b5061021160045481565b6107a5611d94565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107ff576040519150601f19603f3d011682016040523d82523d6000602084013e610804565b606091505b5050905080610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108ec576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440161086b565b6108f68282611e17565b5050565b610902611d94565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff1661099f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610a11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b610a218363ffffffff1683611fff565b9392505050565b60085460009060ff16610a97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610b09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b6000610b136120d5565b9050610b268363ffffffff163a83612235565b9150505b919050565b60085460009060ff16610b9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610c10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b610c208263ffffffff163a611fff565b92915050565b600080610c3285612327565b90506000610c468663ffffffff163a611fff565b905080341015610cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161086b565b6008546301000000900460ff1663ffffffff85161115610d2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161086b565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff16610d8b868b612bad565b610d959190612bad565b63ffffffff1681526020018663ffffffff168152602001610dc660405180602001604052806001151581525061233f565b90526040517f9b1c385e00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b1c385e90610e3d908490600401612aea565b602060405180830381600087803b158015610e5757600080fd5b505af1158015610e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8f919061273c565b6040805160608101825233815263ffffffff808b16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9190911617179290921691909117905593505050509392505050565b610f83611d94565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314611047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161086b565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16611132576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff16156111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b60006111ae6120d5565b90506111c18463ffffffff168483612235565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590611209575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561128d573361122e60005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015291909116604482015260640161086b565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6112dc611d94565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff161561133c576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611387611d94565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff1661141d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff161561148f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff163314611520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b000000000000000000604482015260640161086b565b6000808061153084860186612923565b925092509250600061154184612327565b9050600061154d6120d5565b905060006115628663ffffffff163a84612235565b9050808910156115ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161086b565b6008546301000000900460ff1663ffffffff8516111561164a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161086b565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff166116a7878b612bad565b6116b19190612bad565b63ffffffff1681526020018663ffffffff16815260200160405180602001604052806000815250815250905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016117389190612aea565b602060405180830381600087803b15801561175257600080fd5b505af1158015611766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178a919061273c565b905060405180606001604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018963ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555090505080600481905550505050505050505050505050565b61189d611d94565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b6118e4611d94565b6007805463ffffffff86811668010000000000000000027fffffffffffffffffffffffffffffffffffffffff00000000ffffffff00000000909216908816171790556008805460038490557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0060ff8481166301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff9188166201000002919091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9093169290921791909117166001179055604080517f088070f5000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163088070f5916004828101926080929190829003018186803b158015611a4057600080fd5b505afa158015611a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a789190612755565b50600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f043bd6ae00000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163043bd6ae916004808301926020929190829003018186803b158015611b3657600080fd5b505afa158015611b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6e919061273c565b6005819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636b6feccc6040518163ffffffff1660e01b8152600401604080518083038186803b158015611bd957600080fd5b505afa158015611bed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c11919061298c565b600680547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff166801000000000000000063ffffffff938416027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff161764010000000093909216929092021790555050505050565b611c8d611d94565b611c96816123fb565b50565b611ca1611d94565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611d2657600080fd5b505af1158015611d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5e919061271a565b6108f6576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161086b565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611f11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e64000000000000000000000000000000604482015260640161086b565b600080631fe543e360e01b8585604051602401611f2f929190612b47565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611fa9846020015163ffffffff168560000151846124f1565b905080611ff757835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b600754600090819061201e90640100000000900463ffffffff1661253d565b60075463ffffffff680100000000000000008204811691612040911687612b95565b61204a9190612b95565b6120549085612c31565b61205e9190612b95565b600854909150819060009060649061207f9062010000900460ff1682612bd5565b61208c9060ff1684612c31565b6120969190612bfa565b6006549091506000906120c09068010000000000000000900463ffffffff1664e8d4a51000612c31565b6120ca9083612b95565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b15801561216257600080fd5b505afa158015612176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219a9190612a28565b5094509092508491505080156121c057506121b58242612c6e565b60065463ffffffff16105b156121ca57506005545b6000811215610a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b2077656920707269636500000000000000000000604482015260640161086b565b600754600090819061225490640100000000900463ffffffff1661253d565b60075463ffffffff680100000000000000008204811691612276911688612b95565b6122809190612b95565b61228a9086612c31565b6122949190612b95565b90506000836122ab83670de0b6b3a7640000612c31565b6122b59190612bfa565b6008549091506000906064906122d49062010000900460ff1682612bd5565b6122e19060ff1684612c31565b6122eb9190612bfa565b60065490915060009061231190640100000000900463ffffffff1664e8d4a51000612c31565b61231b9083612b95565b98975050505050505050565b6000612334603f83612c0e565b610c20906001612bad565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161237891511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff811633141561247b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161086b565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561250357600080fd5b61138881039050846040820482031161251b57600080fd5b50823b61252757600080fd5b60008083516020850160008789f1949350505050565b60004661a4b1811480612552575062066eed81145b156125f6576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b1580156125a057600080fd5b505afa1580156125b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125d891906128bc565b5050505091505083608c6125ec9190612b95565b6111c19082612c31565b50600092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b2a57600080fd5b803560ff81168114610b2a57600080fd5b805169ffffffffffffffffffff81168114610b2a57600080fd5b60006020828403121561266057600080fd5b610a21826125ff565b6000806040838503121561267c57600080fd5b612685836125ff565b946020939093013593505050565b600080600080606085870312156126a957600080fd5b6126b2856125ff565b935060208501359250604085013567ffffffffffffffff808211156126d657600080fd5b818701915087601f8301126126ea57600080fd5b8135818111156126f957600080fd5b88602082850101111561270b57600080fd5b95989497505060200194505050565b60006020828403121561272c57600080fd5b81518015158114610a2157600080fd5b60006020828403121561274e57600080fd5b5051919050565b6000806000806080858703121561276b57600080fd5b845161277681612d12565b602086015190945061278781612d22565b604086015190935061279881612d22565b60608601519092506127a981612d22565b939692955090935050565b6000602082840312156127c657600080fd5b5035919050565b600080604083850312156127e057600080fd5b8235915060208084013567ffffffffffffffff8082111561280057600080fd5b818601915086601f83011261281457600080fd5b81358181111561282657612826612ce3565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561286957612869612ce3565b604052828152858101935084860182860187018b101561288857600080fd5b600095505b838610156128ab57803585526001959095019493860193860161288d565b508096505050505050509250929050565b60008060008060008060c087890312156128d557600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561291857600080fd5b8135610a2181612d22565b60008060006060848603121561293857600080fd5b833561294381612d22565b9250602084013561295381612d12565b9150604084013561296381612d22565b809150509250925092565b6000806040838503121561298157600080fd5b823561268581612d22565b6000806040838503121561299f57600080fd5b82516129aa81612d22565b60208401519092506129bb81612d22565b809150509250929050565b600080600080600060a086880312156129de57600080fd5b85356129e981612d22565b945060208601356129f981612d22565b9350612a0760408701612623565b925060608601359150612a1c60808701612623565b90509295509295909350565b600080600080600060a08688031215612a4057600080fd5b612a4986612634565b9450602086015193506040860151925060608601519150612a1c60808701612634565b6000815180845260005b81811015612a9257602081850181015186830182015201612a76565b81811115612aa4576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a216020830184612a6c565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c0808401526111c160e0840182612a6c565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612b8857845183529383019391830191600101612b6c565b5090979650505050505050565b60008219821115612ba857612ba8612c85565b500190565b600063ffffffff808316818516808303821115612bcc57612bcc612c85565b01949350505050565b600060ff821660ff84168060ff03821115612bf257612bf2612c85565b019392505050565b600082612c0957612c09612cb4565b500490565b600063ffffffff80841680612c2557612c25612cb4565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c6957612c69612c85565b500290565b600082821015612c8057612c80612c85565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff81168114611c9657600080fd5b63ffffffff81168114611c9657600080fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperABI = VRFV2PlusWrapperMetaData.ABI @@ -396,7 +396,7 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) SCallbacks(opts *bind.CallOpts, outstruct.CallbackAddress = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) outstruct.CallbackGasLimit = *abi.ConvertType(out[1], new(uint32)).(*uint32) - outstruct.RequestGasPrice = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.RequestGasPrice = *abi.ConvertType(out[2], new(uint64)).(*uint64) return *outstruct, err @@ -1157,7 +1157,7 @@ type GetConfig struct { type SCallbacks struct { CallbackAddress common.Address CallbackGasLimit uint32 - RequestGasPrice *big.Int + RequestGasPrice uint64 } func (_VRFV2PlusWrapper *VRFV2PlusWrapper) ParseLog(log types.Log) (generated.AbigenLog, error) { diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index da24539bf05..24715dbe527 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -101,6 +101,6 @@ vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contract vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 2c480a6d7955d33a00690fdd943486d95802e48a03f3cc243df314448e4ddb2c vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin e5ae923d5fdfa916303cd7150b8474ccd912e14bafe950c6431f6ec94821f642 vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 -vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 9099bc6d78c20ba502e2265d88825225649fa8a3402cb238f24f344ff239231a +vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 32664596d07d6c1563187496f54ca5e24dc028a0358f9f4dd6cb12a51595c823 vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin d4ddf86da21b87c013f551b2563ab68712ea9d4724894664d5778f6b124f4e78 vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 8212afe0f981cd0820f46f1e2e98219ce5d1b1eeae502730dbb52b8638f9ad44 From 6b1d46552e98c4291f90eb1ba69e2e7dde6b5d78 Mon Sep 17 00:00:00 2001 From: Cedric Date: Wed, 27 Sep 2023 15:02:59 +0100 Subject: [PATCH 19/84] Fix flakey job test (#10807) --- core/cmd/jobs_commands_test.go | 28 +++++++++++++++++-- core/services/job/job_orm_test.go | 21 +++++++++++--- .../tomlspecs/direct-request-spec.toml | 13 --------- core/web/jobs_controller_test.go | 18 +++++++++++- 4 files changed, 59 insertions(+), 21 deletions(-) delete mode 100644 core/testdata/tomlspecs/direct-request-spec.toml diff --git a/core/cmd/jobs_commands_test.go b/core/cmd/jobs_commands_test.go index 29d0d8da706..57489ccb0f4 100644 --- a/core/cmd/jobs_commands_test.go +++ b/core/cmd/jobs_commands_test.go @@ -3,9 +3,11 @@ package cmd_test import ( "bytes" "flag" + "fmt" "testing" "time" + "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/urfave/cli" @@ -293,6 +295,26 @@ func TestJob_ToRows(t *testing.T) { }, job.ToRows()) } +const directRequestSpecTemplate = ` +type = "directrequest" +schemaVersion = 1 +evmChainID = "0" +name = "example eth request event spec" +contractAddress = "0x613a38AC1659769640aaE063C651F48E0250454C" +externalJobID = "%s" +observationSource = """ + ds1 [type=http method=GET url="http://example.com" allowunrestrictednetworkaccess="true"]; + ds1_merge [type=merge left="{}"] + ds1_parse [type=jsonparse path="USD"]; + ds1_multiply [type=multiply times=100]; + ds1 -> ds1_parse -> ds1_multiply; +""" +` + +func getDirectRequestSpec() string { + return fmt.Sprintf(directRequestSpecTemplate, uuid.New()) +} + func TestShell_ListFindJobs(t *testing.T) { t.Parallel() @@ -305,7 +327,7 @@ func TestShell_ListFindJobs(t *testing.T) { fs := flag.NewFlagSet("", flag.ExitOnError) cltest.FlagSetApplyFromAction(client.CreateJob, fs, "") - require.NoError(t, fs.Parse([]string{"../testdata/tomlspecs/direct-request-spec.toml"})) + require.NoError(t, fs.Parse([]string{getDirectRequestSpec()})) err := client.CreateJob(cli.NewContext(nil, fs, nil)) require.NoError(t, err) @@ -331,7 +353,7 @@ func TestShell_ShowJob(t *testing.T) { fs := flag.NewFlagSet("", flag.ExitOnError) cltest.FlagSetApplyFromAction(client.CreateJob, fs, "") - require.NoError(t, fs.Parse([]string{"../testdata/tomlspecs/direct-request-spec.toml"})) + require.NoError(t, fs.Parse([]string{getDirectRequestSpec()})) err := client.CreateJob(cli.NewContext(nil, fs, nil)) require.NoError(t, err) @@ -400,7 +422,7 @@ func TestShell_DeleteJob(t *testing.T) { fs := flag.NewFlagSet("", flag.ExitOnError) cltest.FlagSetApplyFromAction(client.CreateJob, fs, "") - require.NoError(t, fs.Parse([]string{"../testdata/tomlspecs/direct-request-spec.toml"})) + require.NoError(t, fs.Parse([]string{getDirectRequestSpec()})) err := client.CreateJob(cli.NewContext(nil, fs, nil)) require.NoError(t, err) diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index bf81064e6a6..673d4f1e0f6 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -10,7 +10,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/google/uuid" "github.com/lib/pq" - "github.com/pelletier/go-toml" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" @@ -217,9 +216,23 @@ func TestORM(t *testing.T) { }) t.Run("creates a job with a direct request spec", func(t *testing.T) { - tree, err := toml.LoadFile("../../testdata/tomlspecs/direct-request-spec.toml") - require.NoError(t, err) - jb, err := directrequest.ValidatedDirectRequestSpec(tree.String()) + drSpec := fmt.Sprintf(` + type = "directrequest" + schemaVersion = 1 + evmChainID = "0" + name = "example eth request event spec" + contractAddress = "0x613a38AC1659769640aaE063C651F48E0250454C" + externalJobID = "%s" + observationSource = """ + ds1 [type=http method=GET url="http://example.com" allowunrestrictednetworkaccess="true"]; + ds1_merge [type=merge left="{}"] + ds1_parse [type=jsonparse path="USD"]; + ds1_multiply [type=multiply times=100]; + ds1 -> ds1_parse -> ds1_multiply; + """ + `, uuid.New()) + + jb, err := directrequest.ValidatedDirectRequestSpec(drSpec) require.NoError(t, err) err = orm.CreateJob(&jb) require.NoError(t, err) diff --git a/core/testdata/tomlspecs/direct-request-spec.toml b/core/testdata/tomlspecs/direct-request-spec.toml deleted file mode 100644 index 35c0cc9274e..00000000000 --- a/core/testdata/tomlspecs/direct-request-spec.toml +++ /dev/null @@ -1,13 +0,0 @@ -type = "directrequest" -schemaVersion = 1 -evmChainID = "0" -name = "example eth request event spec" -contractAddress = "0x613a38AC1659769640aaE063C651F48E0250454C" -externalJobID = "0EEC7E1D-D0D2-476C-A1A8-72DFB6633F47" -observationSource = """ - ds1 [type=http method=GET url="http://example.com" allowunrestrictednetworkaccess="true"]; - ds1_merge [type=merge left="{}"] - ds1_parse [type=jsonparse path="USD"]; - ds1_multiply [type=multiply times=100]; - ds1 -> ds1_parse -> ds1_multiply; -""" diff --git a/core/web/jobs_controller_test.go b/core/web/jobs_controller_test.go index f18fcdd8c29..ca2bd818a83 100644 --- a/core/web/jobs_controller_test.go +++ b/core/web/jobs_controller_test.go @@ -670,7 +670,23 @@ func setupJobSpecsControllerTestsWithJobs(t *testing.T) (*cltest.TestApplication err = app.AddJobV2(testutils.Context(t), &jb) require.NoError(t, err) - erejb, err := directrequest.ValidatedDirectRequestSpec(string(cltest.MustReadFile(t, "../testdata/tomlspecs/direct-request-spec.toml"))) + drSpec := fmt.Sprintf(` + type = "directrequest" + schemaVersion = 1 + evmChainID = "0" + name = "example eth request event spec" + contractAddress = "0x613a38AC1659769640aaE063C651F48E0250454C" + externalJobID = "%s" + observationSource = """ + ds1 [type=http method=GET url="http://example.com" allowunrestrictednetworkaccess="true"]; + ds1_merge [type=merge left="{}"] + ds1_parse [type=jsonparse path="USD"]; + ds1_multiply [type=multiply times=100]; + ds1 -> ds1_parse -> ds1_multiply; + """ + `, uuid.New()) + + erejb, err := directrequest.ValidatedDirectRequestSpec(drSpec) require.NoError(t, err) err = app.AddJobV2(testutils.Context(t), &erejb) require.NoError(t, err) From 8ed253b8418c7e7b17bf1cfd0eddcbec7511a4d8 Mon Sep 17 00:00:00 2001 From: Makram Date: Wed, 27 Sep 2023 17:38:04 +0300 Subject: [PATCH 20/84] fix: arbitrum chain id check in all ChainSpecificUtil methods (#10756) * fix: arbitrum chain id check in all CSU methods The arbitrum chain id check needs to be the same in all of the methods exported in the ChainSpecificUtil contract. Prior to this change getBlockNumber, getCurrentTxL1GasFees and getL1CalldataGasCost did not correctly check for all possible arbitrum chain ids. To prevent this kind of error in the future, a new private function isArbitrumChainId was created and used in all methods that need to check the chain id. * chore: prettier --- contracts/src/v0.8/ChainSpecificUtil.sol | 22 ++++++++++++------- .../batch_blockhash_store.go | 2 +- .../trusted_blockhash_store.go | 2 +- .../vrf_coordinator_v2/vrf_coordinator_v2.go | 2 +- .../vrf_coordinator_v2_5.go | 2 +- .../vrf_load_test_with_metrics.go | 2 +- .../vrf_owner_test_consumer.go | 2 +- .../vrf_v2plus_load_test_with_metrics.go | 2 +- .../vrf_v2plus_upgraded_version.go | 2 +- .../generated/vrfv2_wrapper/vrfv2_wrapper.go | 2 +- .../vrfv2plus_wrapper/vrfv2plus_wrapper.go | 2 +- .../vrfv2plus_wrapper_load_test_consumer.go | 2 +- ...rapper-dependency-versions-do-not-edit.txt | 22 +++++++++---------- 13 files changed, 36 insertions(+), 30 deletions(-) diff --git a/contracts/src/v0.8/ChainSpecificUtil.sol b/contracts/src/v0.8/ChainSpecificUtil.sol index 324121c9fa5..088ffbd3db8 100644 --- a/contracts/src/v0.8/ChainSpecificUtil.sol +++ b/contracts/src/v0.8/ChainSpecificUtil.sol @@ -18,11 +18,7 @@ library ChainSpecificUtil { function getBlockhash(uint64 blockNumber) internal view returns (bytes32) { uint256 chainid = block.chainid; - if ( - chainid == ARB_MAINNET_CHAIN_ID || - chainid == ARB_GOERLI_TESTNET_CHAIN_ID || - chainid == ARB_SEPOLIA_TESTNET_CHAIN_ID - ) { + if (isArbitrumChainId(chainid)) { if ((getBlockNumber() - blockNumber) > 256 || blockNumber >= getBlockNumber()) { return ""; } @@ -33,7 +29,7 @@ library ChainSpecificUtil { function getBlockNumber() internal view returns (uint256) { uint256 chainid = block.chainid; - if (chainid == ARB_MAINNET_CHAIN_ID || chainid == ARB_GOERLI_TESTNET_CHAIN_ID) { + if (isArbitrumChainId(chainid)) { return ARBSYS.arbBlockNumber(); } return block.number; @@ -41,7 +37,7 @@ library ChainSpecificUtil { function getCurrentTxL1GasFees() internal view returns (uint256) { uint256 chainid = block.chainid; - if (chainid == ARB_MAINNET_CHAIN_ID || chainid == ARB_GOERLI_TESTNET_CHAIN_ID) { + if (isArbitrumChainId(chainid)) { return ARBGAS.getCurrentTxL1GasFees(); } return 0; @@ -53,7 +49,7 @@ library ChainSpecificUtil { */ function getL1CalldataGasCost(uint256 calldataSizeBytes) internal view returns (uint256) { uint256 chainid = block.chainid; - if (chainid == ARB_MAINNET_CHAIN_ID || chainid == ARB_GOERLI_TESTNET_CHAIN_ID) { + if (isArbitrumChainId(chainid)) { (, uint256 l1PricePerByte, , , , ) = ARBGAS.getPricesInWei(); // see https://developer.arbitrum.io/devs-how-tos/how-to-estimate-gas#where-do-we-get-all-this-information-from // for the justification behind the 140 number. @@ -61,4 +57,14 @@ library ChainSpecificUtil { } return 0; } + + /** + * @notice Return true if and only if the provided chain ID is an Arbitrum chain ID. + */ + function isArbitrumChainId(uint256 chainId) internal pure returns (bool) { + return + chainId == ARB_MAINNET_CHAIN_ID || + chainId == ARB_GOERLI_TESTNET_CHAIN_ID || + chainId == ARB_SEPOLIA_TESTNET_CHAIN_ID; + } } diff --git a/core/gethwrappers/generated/batch_blockhash_store/batch_blockhash_store.go b/core/gethwrappers/generated/batch_blockhash_store/batch_blockhash_store.go index 9f799c49376..426c5a2c79d 100644 --- a/core/gethwrappers/generated/batch_blockhash_store/batch_blockhash_store.go +++ b/core/gethwrappers/generated/batch_blockhash_store/batch_blockhash_store.go @@ -30,7 +30,7 @@ var ( var BatchBlockhashStoreMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStoreAddr\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BHS\",\"outputs\":[{\"internalType\":\"contractBlockhashStore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"blockNumbers\",\"type\":\"uint256[]\"}],\"name\":\"getBlockhashes\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"blockNumbers\",\"type\":\"uint256[]\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"blockNumbers\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"headers\",\"type\":\"bytes[]\"}],\"name\":\"storeVerifyHeader\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a060405234801561001057600080fd5b50604051610b81380380610b8183398101604081905261002f91610044565b60601b6001600160601b031916608052610074565b60006020828403121561005657600080fd5b81516001600160a01b038116811461006d57600080fd5b9392505050565b60805160601c610adb6100a66000396000818160a7015281816101270152818161023a01526104290152610adb6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806306bd010d146100515780631f600f86146100665780635d290e211461008f578063f745eafb146100a2575b600080fd5b61006461005f366004610654565b6100ee565b005b610079610074366004610654565b6101e2565b60405161008691906107ff565b60405180910390f35b61006461009d366004610691565b6103ac565b6100c97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610086565b60005b81518110156101de5761011c82828151811061010f5761010f6109ac565b60200260200101516104fe565b610125576101cc565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636057361d838381518110610173576101736109ac565b60200260200101516040518263ffffffff1660e01b815260040161019991815260200190565b600060405180830381600087803b1580156101b357600080fd5b505af11580156101c7573d6000803e3d6000fd5b505050505b806101d681610944565b9150506100f1565b5050565b60606000825167ffffffffffffffff811115610200576102006109db565b604051908082528060200260200182016040528015610229578160200160208202803683370190505b50905060005b83518110156103a5577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e9413d38858381518110610286576102866109ac565b60200260200101516040518263ffffffff1660e01b81526004016102ac91815260200190565b60206040518083038186803b1580156102c457600080fd5b505afa925050508015610312575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261030f918101906107e6565b60015b6103725761031e610a0a565b806308c379a014156103665750610333610a26565b8061033e5750610368565b6000801b838381518110610354576103546109ac565b60200260200101818152505050610393565b505b3d6000803e3d6000fd5b80838381518110610385576103856109ac565b602002602001018181525050505b8061039d81610944565b91505061022f565b5092915050565b805182511461041b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f696e70757420617272617920617267206c656e67746873206d69736d61746368604482015260640160405180910390fd5b60005b82518110156104f9577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663fadff0e1848381518110610475576104756109ac565b602002602001015184848151811061048f5761048f6109ac565b60200260200101516040518363ffffffff1660e01b81526004016104b4929190610843565b600060405180830381600087803b1580156104ce57600080fd5b505af11580156104e2573d6000803e3d6000fd5b5050505080806104f190610944565b91505061041e565b505050565b600061010061050b610537565b111561052e5761010061051c610537565b61052691906108e2565b821015610531565b60015b92915050565b60004661a4b181148061054c575062066eed81145b156105d657606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561059857600080fd5b505afa1580156105ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d091906107e6565b91505090565b4391505090565b600082601f8301126105ee57600080fd5b813560206105fb826108be565b60405161060882826108f9565b8381528281019150858301600585901b8701840188101561062857600080fd5b60005b858110156106475781358452928401929084019060010161062b565b5090979650505050505050565b60006020828403121561066657600080fd5b813567ffffffffffffffff81111561067d57600080fd5b610689848285016105dd565b949350505050565b60008060408084860312156106a557600080fd5b833567ffffffffffffffff808211156106bd57600080fd5b6106c9878388016105dd565b94506020915081860135818111156106e057600080fd5b8601601f810188136106f157600080fd5b80356106fc816108be565b855161070882826108f9565b8281528581019150838601600584901b850187018c101561072857600080fd5b60005b848110156107d45781358781111561074257600080fd5b8601603f81018e1361075357600080fd5b8881013588811115610767576107676109db565b8a5161079a8b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011601826108f9565b8181528f8c8385010111156107ae57600080fd5b818c84018c83013760009181018b0191909152855250928701929087019060010161072b565b50989b909a5098505050505050505050565b6000602082840312156107f857600080fd5b5051919050565b6020808252825182820181905260009190848201906040850190845b818110156108375783518352928401929184019160010161081b565b50909695505050505050565b82815260006020604081840152835180604085015260005b818110156108775785810183015185820160600152820161085b565b81811115610889576000606083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201606001949350505050565b600067ffffffffffffffff8211156108d8576108d86109db565b5060051b60200190565b6000828210156108f4576108f461097d565b500390565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff8211171561093d5761093d6109db565b6040525050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156109765761097661097d565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060033d1115610a235760046000803e5060005160e01c5b90565b600060443d1015610a345790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715610a8257505050505090565b8285019150815181811115610a9a5750505050505090565b843d8701016020828501011115610ab45750505050505090565b610ac3602082860101876108f9565b50909594505050505056fea164736f6c6343000806000a", + Bin: "0x60a060405234801561001057600080fd5b50604051610b9b380380610b9b83398101604081905261002f91610044565b60601b6001600160601b031916608052610074565b60006020828403121561005657600080fd5b81516001600160a01b038116811461006d57600080fd5b9392505050565b60805160601c610af56100a66000396000818160a7015281816101270152818161023a01526104290152610af56000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806306bd010d146100515780631f600f86146100665780635d290e211461008f578063f745eafb146100a2575b600080fd5b61006461005f36600461066e565b6100ee565b005b61007961007436600461066e565b6101e2565b6040516100869190610819565b60405180910390f35b61006461009d3660046106ab565b6103ac565b6100c97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610086565b60005b81518110156101de5761011c82828151811061010f5761010f6109c6565b60200260200101516104fe565b610125576101cc565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636057361d838381518110610173576101736109c6565b60200260200101516040518263ffffffff1660e01b815260040161019991815260200190565b600060405180830381600087803b1580156101b357600080fd5b505af11580156101c7573d6000803e3d6000fd5b505050505b806101d68161095e565b9150506100f1565b5050565b60606000825167ffffffffffffffff811115610200576102006109f5565b604051908082528060200260200182016040528015610229578160200160208202803683370190505b50905060005b83518110156103a5577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e9413d38858381518110610286576102866109c6565b60200260200101516040518263ffffffff1660e01b81526004016102ac91815260200190565b60206040518083038186803b1580156102c457600080fd5b505afa925050508015610312575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261030f91810190610800565b60015b6103725761031e610a24565b806308c379a014156103665750610333610a40565b8061033e5750610368565b6000801b838381518110610354576103546109c6565b60200260200101818152505050610393565b505b3d6000803e3d6000fd5b80838381518110610385576103856109c6565b602002602001018181525050505b8061039d8161095e565b91505061022f565b5092915050565b805182511461041b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f696e70757420617272617920617267206c656e67746873206d69736d61746368604482015260640160405180910390fd5b60005b82518110156104f9577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663fadff0e1848381518110610475576104756109c6565b602002602001015184848151811061048f5761048f6109c6565b60200260200101516040518363ffffffff1660e01b81526004016104b492919061085d565b600060405180830381600087803b1580156104ce57600080fd5b505af11580156104e2573d6000803e3d6000fd5b5050505080806104f19061095e565b91505061041e565b505050565b600061010061050b610537565b111561052e5761010061051c610537565b61052691906108fc565b821015610531565b60015b92915050565b600046610543816105d4565b156105cd57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561058f57600080fd5b505afa1580156105a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c79190610800565b91505090565b4391505090565b600061a4b18214806105e8575062066eed82145b8061053157505062066eee1490565b600082601f83011261060857600080fd5b81356020610615826108d8565b6040516106228282610913565b8381528281019150858301600585901b8701840188101561064257600080fd5b60005b8581101561066157813584529284019290840190600101610645565b5090979650505050505050565b60006020828403121561068057600080fd5b813567ffffffffffffffff81111561069757600080fd5b6106a3848285016105f7565b949350505050565b60008060408084860312156106bf57600080fd5b833567ffffffffffffffff808211156106d757600080fd5b6106e3878388016105f7565b94506020915081860135818111156106fa57600080fd5b8601601f8101881361070b57600080fd5b8035610716816108d8565b85516107228282610913565b8281528581019150838601600584901b850187018c101561074257600080fd5b60005b848110156107ee5781358781111561075c57600080fd5b8601603f81018e1361076d57600080fd5b8881013588811115610781576107816109f5565b8a516107b48b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160182610913565b8181528f8c8385010111156107c857600080fd5b818c84018c83013760009181018b01919091528552509287019290870190600101610745565b50989b909a5098505050505050505050565b60006020828403121561081257600080fd5b5051919050565b6020808252825182820181905260009190848201906040850190845b8181101561085157835183529284019291840191600101610835565b50909695505050505050565b82815260006020604081840152835180604085015260005b8181101561089157858101830151858201606001528201610875565b818111156108a3576000606083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201606001949350505050565b600067ffffffffffffffff8211156108f2576108f26109f5565b5060051b60200190565b60008282101561090e5761090e610997565b500390565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff82111715610957576109576109f5565b6040525050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561099057610990610997565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060033d1115610a3d5760046000803e5060005160e01c5b90565b600060443d1015610a4e5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715610a9c57505050505090565b8285019150815181811115610ab45750505050505090565b843d8701016020828501011115610ace5750505050505090565b610add60208286010187610913565b50909594505050505056fea164736f6c6343000806000a", } var BatchBlockhashStoreABI = BatchBlockhashStoreMetaData.ABI diff --git a/core/gethwrappers/generated/trusted_blockhash_store/trusted_blockhash_store.go b/core/gethwrappers/generated/trusted_blockhash_store/trusted_blockhash_store.go index 27f7c4ebbb5..43ae1a3f5b4 100644 --- a/core/gethwrappers/generated/trusted_blockhash_store/trusted_blockhash_store.go +++ b/core/gethwrappers/generated/trusted_blockhash_store/trusted_blockhash_store.go @@ -32,7 +32,7 @@ var ( var TrustedBlockhashStoreMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"whitelist\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidRecentBlockhash\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTrustedBlockhashes\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInWhitelist\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"getBlockhash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_whitelist\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_whitelistStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"whitelist\",\"type\":\"address[]\"}],\"name\":\"setWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"storeEarliest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"blockNums\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"blockhashes\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"recentBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recentBlockhash\",\"type\":\"bytes32\"}],\"name\":\"storeTrusted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"header\",\"type\":\"bytes\"}],\"name\":\"storeVerifyHeader\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60806040523480156200001157600080fd5b50604051620014e8380380620014e88339810160408190526200003491620003e8565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d9565b505050620000d2816200018560201b60201c565b5062000517565b6001600160a01b038116331415620001345760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6200018f620002ec565b60006004805480602002602001604051908101604052809291908181526020018280548015620001e957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620001ca575b5050855193945062000207936004935060208701925090506200034a565b5060005b81518110156200027757600060036000848481518110620002305762000230620004eb565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806200026e81620004c1565b9150506200020b565b5060005b8251811015620002e757600160036000858481518110620002a057620002a0620004eb565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620002de81620004c1565b9150506200027b565b505050565b6000546001600160a01b03163314620003485760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640162000082565b565b828054828255906000526020600020908101928215620003a2579160200282015b82811115620003a257825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200036b565b50620003b0929150620003b4565b5090565b5b80821115620003b05760008155600101620003b5565b80516001600160a01b0381168114620003e357600080fd5b919050565b60006020808385031215620003fc57600080fd5b82516001600160401b03808211156200041457600080fd5b818501915085601f8301126200042957600080fd5b8151818111156200043e576200043e62000501565b8060051b604051601f19603f8301168101818110858211171562000466576200046662000501565b604052828152858101935084860182860187018a10156200048657600080fd5b600095505b83861015620004b4576200049f81620003cb565b8552600195909501949386019386016200048b565b5098975050505050505050565b6000600019821415620004e457634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b610fc180620005276000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638da5cb5b11610081578063f2fde38b1161005b578063f2fde38b146101b5578063f4217648146101c8578063fadff0e1146101db57600080fd5b80638da5cb5b14610143578063e9413d3814610161578063e9ecc1541461018257600080fd5b80636057361d116100b25780636057361d1461012057806379ba50971461013357806383b6d6b71461013b57600080fd5b80633b69ad60146100ce5780635c7de309146100e3575b600080fd5b6100e16100dc366004610d03565b6101ee565b005b6100f66100f1366004610d9a565b610326565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100e161012e366004610d9a565b61035d565b6100e16103e8565b6100e16104e5565b60005473ffffffffffffffffffffffffffffffffffffffff166100f6565b61017461016f366004610d9a565b6104ff565b604051908152602001610117565b6101a5610190366004610c34565b60036020526000908152604090205460ff1681565b6040519015158152602001610117565b6100e16101c3366004610c34565b61057b565b6100e16101d6366004610c4f565b61058f565b6100e16101e9366004610db3565b610745565b60006101f9836107e8565b9050818114610234576040517fd2f69c9500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526003602052604090205460ff1661027d576040517f5b0aa2ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8584146102b6576040517fbd75093300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8681101561031c578585828181106102d3576102d3610f56565b90506020020135600260008a8a858181106102f0576102f0610f56565b90506020020135815260200190815260200160002081905550808061031490610eee565b9150506102b9565b5050505050505050565b6004818154811061033657600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000610368826107e8565b9050806103d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f626c6f636b68617368286e29206661696c65640000000000000000000000000060448201526064015b60405180910390fd5b60009182526002602052604090912055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016103cd565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6104fd6101006104f3610903565b61012e9190610ed7565b565b60008181526002602052604081205480610575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f626c6f636b68617368206e6f7420666f756e6420696e2073746f72650000000060448201526064016103cd565b92915050565b6105836109a9565b61058c81610a2a565b50565b6105976109a9565b600060048054806020026020016040519081016040528092919081815260200182805480156105fc57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116105d1575b5050855193945061061893600493506020870192509050610b20565b5060005b81518110156106ac5760006003600084848151811061063d5761063d610f56565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055806106a481610eee565b91505061061c565b5060005b8251811015610740576001600360008584815181106106d1576106d1610f56565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558061073881610eee565b9150506106b0565b505050565b60026000610754846001610ebf565b8152602001908152602001600020548180519060200120146107d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6865616465722068617320756e6b6e6f776e20626c6f636b686173680000000060448201526064016103cd565b6024015160009182526002602052604090912055565b60004661a4b18114806107fd575062066eed81145b8061080a575062066eee81145b156108f3576101008367ffffffffffffffff16610825610903565b61082f9190610ed7565b118061084c575061083e610903565b8367ffffffffffffffff1610155b1561085a5750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152606490632b407a829060240160206040518083038186803b1580156108b457600080fd5b505afa1580156108c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ec9190610d81565b9392505050565b505067ffffffffffffffff164090565b60004661a4b1811480610918575062066eed81145b156109a257606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561096457600080fd5b505afa158015610978573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099c9190610d81565b91505090565b4391505090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016103cd565b73ffffffffffffffffffffffffffffffffffffffff8116331415610aaa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016103cd565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610b9a579160200282015b82811115610b9a57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190610b40565b50610ba6929150610baa565b5090565b5b80821115610ba65760008155600101610bab565b803573ffffffffffffffffffffffffffffffffffffffff81168114610be357600080fd5b919050565b60008083601f840112610bfa57600080fd5b50813567ffffffffffffffff811115610c1257600080fd5b6020830191508360208260051b8501011115610c2d57600080fd5b9250929050565b600060208284031215610c4657600080fd5b6108ec82610bbf565b60006020808385031215610c6257600080fd5b823567ffffffffffffffff80821115610c7a57600080fd5b818501915085601f830112610c8e57600080fd5b813581811115610ca057610ca0610f85565b8060051b9150610cb1848301610e70565b8181528481019084860184860187018a1015610ccc57600080fd5b600095505b83861015610cf657610ce281610bbf565b835260019590950194918601918601610cd1565b5098975050505050505050565b60008060008060008060808789031215610d1c57600080fd5b863567ffffffffffffffff80821115610d3457600080fd5b610d408a838b01610be8565b90985096506020890135915080821115610d5957600080fd5b50610d6689828a01610be8565b979a9699509760408101359660609091013595509350505050565b600060208284031215610d9357600080fd5b5051919050565b600060208284031215610dac57600080fd5b5035919050565b60008060408385031215610dc657600080fd5b8235915060208084013567ffffffffffffffff80821115610de657600080fd5b818601915086601f830112610dfa57600080fd5b813581811115610e0c57610e0c610f85565b610e3c847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610e70565b91508082528784828501011115610e5257600080fd5b80848401858401376000848284010152508093505050509250929050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610eb757610eb7610f85565b604052919050565b60008219821115610ed257610ed2610f27565b500190565b600082821015610ee957610ee9610f27565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610f2057610f20610f27565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x60806040523480156200001157600080fd5b50604051620014ec380380620014ec8339810160408190526200003491620003e8565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d9565b505050620000d2816200018560201b60201c565b5062000517565b6001600160a01b038116331415620001345760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6200018f620002ec565b60006004805480602002602001604051908101604052809291908181526020018280548015620001e957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620001ca575b5050855193945062000207936004935060208701925090506200034a565b5060005b81518110156200027757600060036000848481518110620002305762000230620004eb565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806200026e81620004c1565b9150506200020b565b5060005b8251811015620002e757600160036000858481518110620002a057620002a0620004eb565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620002de81620004c1565b9150506200027b565b505050565b6000546001600160a01b03163314620003485760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640162000082565b565b828054828255906000526020600020908101928215620003a2579160200282015b82811115620003a257825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200036b565b50620003b0929150620003b4565b5090565b5b80821115620003b05760008155600101620003b5565b80516001600160a01b0381168114620003e357600080fd5b919050565b60006020808385031215620003fc57600080fd5b82516001600160401b03808211156200041457600080fd5b818501915085601f8301126200042957600080fd5b8151818111156200043e576200043e62000501565b8060051b604051601f19603f8301168101818110858211171562000466576200046662000501565b604052828152858101935084860182860187018a10156200048657600080fd5b600095505b83861015620004b4576200049f81620003cb565b8552600195909501949386019386016200048b565b5098975050505050505050565b6000600019821415620004e457634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b610fc580620005276000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638da5cb5b11610081578063f2fde38b1161005b578063f2fde38b146101b5578063f4217648146101c8578063fadff0e1146101db57600080fd5b80638da5cb5b14610143578063e9413d3814610161578063e9ecc1541461018257600080fd5b80636057361d116100b25780636057361d1461012057806379ba50971461013357806383b6d6b71461013b57600080fd5b80633b69ad60146100ce5780635c7de309146100e3575b600080fd5b6100e16100dc366004610d07565b6101ee565b005b6100f66100f1366004610d9e565b610326565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100e161012e366004610d9e565b61035d565b6100e16103e8565b6100e16104e5565b60005473ffffffffffffffffffffffffffffffffffffffff166100f6565b61017461016f366004610d9e565b6104ff565b604051908152602001610117565b6101a5610190366004610c38565b60036020526000908152604090205460ff1681565b6040519015158152602001610117565b6100e16101c3366004610c38565b61057b565b6100e16101d6366004610c53565b61058f565b6100e16101e9366004610db7565b610745565b60006101f9836107e8565b9050818114610234576040517fd2f69c9500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526003602052604090205460ff1661027d576040517f5b0aa2ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8584146102b6576040517fbd75093300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8681101561031c578585828181106102d3576102d3610f5a565b90506020020135600260008a8a858181106102f0576102f0610f5a565b90506020020135815260200190815260200160002081905550808061031490610ef2565b9150506102b9565b5050505050505050565b6004818154811061033657600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000610368826107e8565b9050806103d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f626c6f636b68617368286e29206661696c65640000000000000000000000000060448201526064015b60405180910390fd5b60009182526002602052604090912055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016103cd565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6104fd6101006104f36108ed565b61012e9190610edb565b565b60008181526002602052604081205480610575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f626c6f636b68617368206e6f7420666f756e6420696e2073746f72650000000060448201526064016103cd565b92915050565b61058361098a565b61058c81610a0b565b50565b61059761098a565b600060048054806020026020016040519081016040528092919081815260200182805480156105fc57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116105d1575b5050855193945061061893600493506020870192509050610b24565b5060005b81518110156106ac5760006003600084848151811061063d5761063d610f5a565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055806106a481610ef2565b91505061061c565b5060005b8251811015610740576001600360008584815181106106d1576106d1610f5a565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558061073881610ef2565b9150506106b0565b505050565b60026000610754846001610ec3565b8152602001908152602001600020548180519060200120146107d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6865616465722068617320756e6b6e6f776e20626c6f636b686173680000000060448201526064016103cd565b6024015160009182526002602052604090912055565b6000466107f481610b01565b156108dd576101008367ffffffffffffffff1661080f6108ed565b6108199190610edb565b118061083657506108286108ed565b8367ffffffffffffffff1610155b156108445750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152606490632b407a829060240160206040518083038186803b15801561089e57600080fd5b505afa1580156108b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d69190610d85565b9392505050565b505067ffffffffffffffff164090565b6000466108f981610b01565b1561098357606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561094557600080fd5b505afa158015610959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097d9190610d85565b91505090565b4391505090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016103cd565b73ffffffffffffffffffffffffffffffffffffffff8116331415610a8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016103cd565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061a4b1821480610b15575062066eed82145b8061057557505062066eee1490565b828054828255906000526020600020908101928215610b9e579160200282015b82811115610b9e57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190610b44565b50610baa929150610bae565b5090565b5b80821115610baa5760008155600101610baf565b803573ffffffffffffffffffffffffffffffffffffffff81168114610be757600080fd5b919050565b60008083601f840112610bfe57600080fd5b50813567ffffffffffffffff811115610c1657600080fd5b6020830191508360208260051b8501011115610c3157600080fd5b9250929050565b600060208284031215610c4a57600080fd5b6108d682610bc3565b60006020808385031215610c6657600080fd5b823567ffffffffffffffff80821115610c7e57600080fd5b818501915085601f830112610c9257600080fd5b813581811115610ca457610ca4610f89565b8060051b9150610cb5848301610e74565b8181528481019084860184860187018a1015610cd057600080fd5b600095505b83861015610cfa57610ce681610bc3565b835260019590950194918601918601610cd5565b5098975050505050505050565b60008060008060008060808789031215610d2057600080fd5b863567ffffffffffffffff80821115610d3857600080fd5b610d448a838b01610bec565b90985096506020890135915080821115610d5d57600080fd5b50610d6a89828a01610bec565b979a9699509760408101359660609091013595509350505050565b600060208284031215610d9757600080fd5b5051919050565b600060208284031215610db057600080fd5b5035919050565b60008060408385031215610dca57600080fd5b8235915060208084013567ffffffffffffffff80821115610dea57600080fd5b818601915086601f830112610dfe57600080fd5b813581811115610e1057610e10610f89565b610e40847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610e74565b91508082528784828501011115610e5657600080fd5b80848401858401376000848284010152508093505050509250929050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610ebb57610ebb610f89565b604052919050565b60008219821115610ed657610ed6610f2b565b500190565b600082821015610eed57610eed610f2b565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610f2457610f24610f2b565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var TrustedBlockhashStoreABI = TrustedBlockhashStoreMetaData.ABI diff --git a/core/gethwrappers/generated/vrf_coordinator_v2/vrf_coordinator_v2.go b/core/gethwrappers/generated/vrf_coordinator_v2/vrf_coordinator_v2.go index 51021b789e7..0a647479174 100644 --- a/core/gethwrappers/generated/vrf_coordinator_v2/vrf_coordinator_v2.go +++ b/core/gethwrappers/generated/vrf_coordinator_v2/vrf_coordinator_v2.go @@ -64,7 +64,7 @@ type VRFProof struct { var VRFCoordinatorV2MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkEthFeed\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier2\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier3\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier4\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier5\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier2\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier3\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier4\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier5\",\"type\":\"uint24\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_ETH_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"deregisterProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"internalType\":\"structVRFCoordinatorV2.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"name\":\"getCommitment\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSubId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier2\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier3\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier4\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier5\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier2\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier3\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier4\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier5\",\"type\":\"uint24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"}],\"name\":\"getFeeTier\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier2\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier3\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier4\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier5\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier2\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier3\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier4\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier5\",\"type\":\"uint24\"}],\"internalType\":\"structVRFCoordinatorV2.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x60e06040523480156200001157600080fd5b50604051620059c1380380620059c18339810160408190526200003491620001b1565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e8565b5050506001600160601b0319606093841b811660805290831b811660a052911b1660c052620001fb565b6001600160a01b038116331415620001435760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001ac57600080fd5b919050565b600080600060608486031215620001c757600080fd5b620001d28462000194565b9250620001e26020850162000194565b9150620001f26040850162000194565b90509250925092565b60805160601c60a05160601c60c05160601c61575c620002656000396000818161051901526138f00152600081816106030152613e0801526000818161036d015281816114da0152818161237701528181612dae01528181612eea015261350f015261575c6000f3fe608060405234801561001057600080fd5b506004361061025b5760003560e01c80636f64f03f11610145578063ad178361116100bd578063d2f9f9a71161008c578063e72f6e3011610071578063e72f6e30146106e0578063e82ad7d4146106f3578063f2fde38b1461071657600080fd5b8063d2f9f9a7146106ba578063d7ae1d30146106cd57600080fd5b8063ad178361146105fe578063af198b9714610625578063c3f909d414610655578063caf70c4a146106a757600080fd5b80638da5cb5b11610114578063a21a23e4116100f9578063a21a23e4146105c0578063a47c7696146105c8578063a4c0ed36146105eb57600080fd5b80638da5cb5b1461059c5780639f87fad7146105ad57600080fd5b80636f64f03f1461055b5780637341c10c1461056e57806379ba509714610581578063823597401461058957600080fd5b8063356dac71116101d85780635fbbc0d2116101a757806366316d8d1161018c57806366316d8d14610501578063689c45171461051457806369bcdb7d1461053b57600080fd5b80635fbbc0d2146103f357806364d51a2a146104f957600080fd5b8063356dac71146103a757806340d6bb82146103af5780634cb48a54146103cd5780635d3b1d30146103e057600080fd5b806308821d581161022f57806315c48b841161021457806315c48b841461030e578063181f5a77146103295780631b6b6d231461036857600080fd5b806308821d58146102cf57806312b58349146102e257600080fd5b80620122911461026057806302bcc5b61461028057806304c357cb1461029557806306bfa637146102a8575b600080fd5b610268610729565b604051610277939291906152a6565b60405180910390f35b61029361028e3660046150f2565b6107a5565b005b6102936102a336600461510d565b610837565b60055467ffffffffffffffff165b60405167ffffffffffffffff9091168152602001610277565b6102936102dd366004614e03565b6109eb565b6005546801000000000000000090046bffffffffffffffffffffffff165b604051908152602001610277565b61031660c881565b60405161ffff9091168152602001610277565b604080518082018252601681527f565246436f6f7264696e61746f72563220312e302e3000000000000000000000602082015290516102779190615251565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610277565b600a54610300565b6103b86101f481565b60405163ffffffff9091168152602001610277565b6102936103db366004614f9c565b610bb0565b6103006103ee366004614e76565b610fa7565b600c546040805163ffffffff80841682526401000000008404811660208301526801000000000000000084048116928201929092526c010000000000000000000000008304821660608201527001000000000000000000000000000000008304909116608082015262ffffff740100000000000000000000000000000000000000008304811660a0830152770100000000000000000000000000000000000000000000008304811660c08301527a0100000000000000000000000000000000000000000000000000008304811660e08301527d01000000000000000000000000000000000000000000000000000000000090920490911661010082015261012001610277565b610316606481565b61029361050f366004614dbb565b611385565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b6103006105493660046150d9565b60009081526009602052604090205490565b610293610569366004614d00565b6115d4565b61029361057c36600461510d565b611704565b610293611951565b6102936105973660046150f2565b611a1a565b6000546001600160a01b031661038f565b6102936105bb36600461510d565b611be0565b6102b661201f565b6105db6105d63660046150f2565b612202565b6040516102779493929190615444565b6102936105f9366004614d34565b612325565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b610638610633366004614ed4565b61257c565b6040516bffffffffffffffffffffffff9091168152602001610277565b600b546040805161ffff8316815263ffffffff6201000084048116602083015267010000000000000084048116928201929092526b010000000000000000000000909204166060820152608001610277565b6103006106b5366004614e1f565b612a16565b6103b86106c83660046150f2565b612a46565b6102936106db36600461510d565b612c3b565b6102936106ee366004614ce5565b612d75565b6107066107013660046150f2565b612fb2565b6040519015158152602001610277565b610293610724366004614ce5565b6131d5565b600b546007805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561079357602002820191906000526020600020905b81548152602001906001019080831161077f575b50505050509050925092509250909192565b6107ad6131e6565b67ffffffffffffffff81166000908152600360205260409020546001600160a01b0316610806576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020546108349082906001600160a01b0316613242565b50565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680610893576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038216146108e5576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024015b60405180910390fd5b600b546601000000000000900460ff161561092c576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff84166000908152600360205260409020600101546001600160a01b038481169116146109e55767ffffffffffffffff841660008181526003602090815260409182902060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091558251338152918201527f69436ea6df009049404f564eff6622cd00522b0bd6a89efd9e52a355c4a879be91015b60405180910390a25b50505050565b6109f36131e6565b604080518082018252600091610a22919084906002908390839080828437600092019190915250612a16915050565b6000818152600660205260409020549091506001600160a01b031680610a77576040517f77f5b84c000000000000000000000000000000000000000000000000000000008152600481018390526024016108dc565b600082815260066020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b600754811015610b67578260078281548110610aca57610aca6156f1565b90600052602060002001541415610b55576007805460009190610aef906001906155ab565b81548110610aff57610aff6156f1565b906000526020600020015490508060078381548110610b2057610b206156f1565b6000918252602090912001556007805480610b3d57610b3d6156c2565b60019003818190600052602060002001600090559055505b80610b5f816155ef565b915050610aac565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610ba391815260200190565b60405180910390a2505050565b610bb86131e6565b60c861ffff87161115610c0b576040517fa738697600000000000000000000000000000000000000000000000000000000815261ffff871660048201819052602482015260c860448201526064016108dc565b60008213610c48576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018390526024016108dc565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001690971762010000909502949094177fffffffffffffffffffffffffffffffffff000000000000000000ffffffffffff166701000000000000009092027fffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffff16919091176b010000000000000000000000909302929092179093558651600c80549489015189890151938a0151978a0151968a015160c08b015160e08c01516101008d01519588167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009099169890981764010000000093881693909302929092177fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff1668010000000000000000958716959095027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff16949094176c0100000000000000000000000098861698909802979097177fffffffffffffffffff00000000000000ffffffffffffffffffffffffffffffff1670010000000000000000000000000000000096909416959095027fffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffff16929092177401000000000000000000000000000000000000000062ffffff92831602177fffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffff1677010000000000000000000000000000000000000000000000958216959095027fffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffff16949094177a01000000000000000000000000000000000000000000000000000092851692909202919091177cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167d0100000000000000000000000000000000000000000000000000000000009390911692909202919091178155600a84905590517fc21e3bd2e0b339d2848f0dd956947a88966c242c0c0c582a33137a5c1ceb5cb291610f97918991899189918991899190615305565b60405180910390a1505050505050565b600b546000906601000000000000900460ff1615610ff1576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff85166000908152600360205260409020546001600160a01b031661104a576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260026020908152604080832067ffffffffffffffff808a16855292529091205416806110ba576040517ff0019fe600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff871660048201523360248201526044016108dc565b600b5461ffff90811690861610806110d6575060c861ffff8616115b1561112657600b546040517fa738697600000000000000000000000000000000000000000000000000000000815261ffff8088166004830152909116602482015260c860448201526064016108dc565b600b5463ffffffff620100009091048116908516111561118d57600b546040517ff5d7e01e00000000000000000000000000000000000000000000000000000000815263ffffffff80871660048301526201000090920490911660248201526044016108dc565b6101f463ffffffff841611156111df576040517f47386bec00000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526101f460248201526044016108dc565b60006111ec826001615507565b6040805160208082018c9052338284015267ffffffffffffffff808c16606084015284166080808401919091528351808403909101815260a08301845280519082012060c083018d905260e080840182905284518085039091018152610100909301909352815191012091925081611262613667565b60408051602081019390935282015267ffffffffffffffff8a16606082015263ffffffff8089166080830152871660a08201523360c082015260e00160408051808303601f19018152828252805160209182012060008681526009835283902055848352820183905261ffff8a169082015263ffffffff808916606083015287166080820152339067ffffffffffffffff8b16908c907f63373d1c4696214b898952999c9aaec57dac1ee2723cec59bea6888f489a97729060a00160405180910390a45033600090815260026020908152604080832067ffffffffffffffff808d16855292529091208054919093167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009091161790915591505095945050505050565b600b546601000000000000900460ff16156113cc576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600860205260409020546bffffffffffffffffffffffff80831691161015611426576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260086020526040812080548392906114539084906bffffffffffffffffffffffff166155c2565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555080600560088282829054906101000a90046bffffffffffffffffffffffff166114aa91906155c2565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb83836040518363ffffffff1660e01b81526004016115489291906001600160a01b039290921682526bffffffffffffffffffffffff16602082015260400190565b602060405180830381600087803b15801561156257600080fd5b505af1158015611576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a9190614e3b565b6115d0576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6115dc6131e6565b60408051808201825260009161160b919084906002908390839080828437600092019190915250612a16915050565b6000818152600660205260409020549091506001600160a01b031615611660576040517f4a0b8fa7000000000000000000000000000000000000000000000000000000008152600481018290526024016108dc565b600081815260066020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091556007805460018101825594527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610ba3565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680611760576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038216146117ad576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff16156117f4576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff84166000908152600360205260409020600201546064141561184b576040517f05a48e0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260026020908152604080832067ffffffffffffffff80891685529252909120541615611885576109e5565b6001600160a01b038316600081815260026020818152604080842067ffffffffffffffff8a1680865290835281852080547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166001908117909155600384528286209094018054948501815585529382902090920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001685179055905192835290917f43dc749a04ac8fb825cbd514f7c0e13f13bc6f2ee66043b76629d51776cff8e091016109dc565b6001546001600160a01b031633146119ab5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108dc565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600b546601000000000000900460ff1615611a61576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020546001600160a01b0316611aba576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020600101546001600160a01b03163314611b425767ffffffffffffffff8116600090815260036020526040908190206001015490517fd084e9750000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016108dc565b67ffffffffffffffff81166000818152600360209081526040918290208054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001909301805490931690925583516001600160a01b03909116808252928101919091529092917f6f1dc65165ffffedfd8e507b4a0f1fcfdada045ed11f6c26ba27cedfe87802f0910160405180910390a25050565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680611c3c576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614611c89576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff1615611cd0576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611cd984612fb2565b15611d10576040517fb42f66e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260026020908152604080832067ffffffffffffffff808916855292529091205416611d91576040517ff0019fe600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff851660048201526001600160a01b03841660248201526044016108dc565b67ffffffffffffffff8416600090815260036020908152604080832060020180548251818502810185019093528083529192909190830182828015611dff57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611de1575b50505050509050600060018251611e1691906155ab565b905060005b8251811015611f8e57856001600160a01b0316838281518110611e4057611e406156f1565b60200260200101516001600160a01b03161415611f7c576000838381518110611e6b57611e6b6156f1565b6020026020010151905080600360008a67ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000206002018381548110611eb157611eb16156f1565b600091825260208083209190910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03949094169390931790925567ffffffffffffffff8a168152600390915260409020600201805480611f1e57611f1e6156c2565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905550611f8e565b80611f86816155ef565b915050611e1b565b506001600160a01b038516600081815260026020908152604080832067ffffffffffffffff8b168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001690555192835290917f182bff9831466789164ca77075fffd84916d35a8180ba73c27e45634549b445b91015b60405180910390a2505050505050565b600b546000906601000000000000900460ff1615612069576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805467ffffffffffffffff1690600061208383615628565b82546101009290920a67ffffffffffffffff8181021990931691831602179091556005541690506000806040519080825280602002602001820160405280156120d6578160200160208202803683370190505b506040805180820182526000808252602080830182815267ffffffffffffffff888116808552600484528685209551865493516bffffffffffffffffffffffff9091167fffffffffffffffffffffffff0000000000000000000000000000000000000000948516176c01000000000000000000000000919093160291909117909455845160608101865233815280830184815281870188815295855260038452959093208351815483166001600160a01b03918216178255955160018201805490931696169590951790559151805194955090936121ba9260028501920190614a3f565b505060405133815267ffffffffffffffff841691507f464722b4166576d3dcbba877b999bc35cf911f4eaf434b7eba68fa113951d0bf9060200160405180910390a250905090565b67ffffffffffffffff8116600090815260036020526040812054819081906060906001600160a01b0316612262576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff80861660009081526004602090815260408083205460038352928190208054600290910180548351818602810186019094528084526bffffffffffffffffffffffff8616966c01000000000000000000000000909604909516946001600160a01b0390921693909291839183018282801561230f57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116122f1575b5050505050905093509350935093509193509193565b600b546601000000000000900460ff161561236c576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146123ce576040517f44b0e3c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208114612408576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612416828401846150f2565b67ffffffffffffffff81166000908152600360205260409020549091506001600160a01b0316612472576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff8116600090815260046020526040812080546bffffffffffffffffffffffff16918691906124a98385615533565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555084600560088282829054906101000a90046bffffffffffffffffffffffff166125009190615533565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508167ffffffffffffffff167fd39ec07f4e209f627a4c427971473820dc129761ba28de8906bd56f57101d4f882878461256791906154ef565b6040805192835260208301919091520161200f565b600b546000906601000000000000900460ff16156125c6576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005a905060008060006125da8787613700565b9250925092506000866060015163ffffffff1667ffffffffffffffff81111561260557612605615720565b60405190808252806020026020018201604052801561262e578160200160208202803683370190505b50905060005b876060015163ffffffff168110156126a25760408051602081018590529081018290526060016040516020818303038152906040528051906020012060001c828281518110612685576126856156f1565b60209081029190910101528061269a816155ef565b915050612634565b506000838152600960205260408082208290555181907f1fe543e300000000000000000000000000000000000000000000000000000000906126ea90879086906024016153f6565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252600b80547fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff166601000000000000179055908a015160808b015191925060009161279a9163ffffffff169084613a0e565b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff1690556020808c01805167ffffffffffffffff9081166000908152600490935260408084205492518216845290922080549394506c01000000000000000000000000918290048316936001939192600c9261281e928692900416615507565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060006128758a600b600001600b9054906101000a900463ffffffff1663ffffffff1661286f85612a46565b3a613a5c565b6020808e015167ffffffffffffffff166000908152600490915260409020549091506bffffffffffffffffffffffff808316911610156128e1576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808d015167ffffffffffffffff166000908152600490915260408120805483929061291d9084906bffffffffffffffffffffffff166155c2565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008b8152600660209081526040808320546001600160a01b03168352600890915281208054859450909261297991859116615533565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550877f7dffc5ae5ee4e2e4df1651cf6ad329a73cebdb728f37ea0187b9b17e036756e48883866040516129fc939291909283526bffffffffffffffffffffffff9190911660208301521515604082015260600190565b60405180910390a299505050505050505050505b92915050565b600081604051602001612a299190615243565b604051602081830303815290604052805190602001209050919050565b6040805161012081018252600c5463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c010000000000000000000000008104831660608301527001000000000000000000000000000000008104909216608082015262ffffff740100000000000000000000000000000000000000008304811660a08301819052770100000000000000000000000000000000000000000000008404821660c08401527a0100000000000000000000000000000000000000000000000000008404821660e08401527d0100000000000000000000000000000000000000000000000000000000009093041661010082015260009167ffffffffffffffff841611612b64575192915050565b8267ffffffffffffffff168160a0015162ffffff16108015612b9957508060c0015162ffffff168367ffffffffffffffff1611155b15612ba8576020015192915050565b8267ffffffffffffffff168160c0015162ffffff16108015612bdd57508060e0015162ffffff168367ffffffffffffffff1611155b15612bec576040015192915050565b8267ffffffffffffffff168160e0015162ffffff16108015612c22575080610100015162ffffff168367ffffffffffffffff1611155b15612c31576060015192915050565b6080015192915050565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680612c97576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614612ce4576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff1615612d2b576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d3484612fb2565b15612d6b576040517fb42f66e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109e58484613242565b612d7d6131e6565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612df857600080fd5b505afa158015612e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e309190614e5d565b6005549091506801000000000000000090046bffffffffffffffffffffffff1681811115612e94576040517fa99da30200000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016108dc565b81811015612fad576000612ea882846155ab565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152602482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb90604401602060405180830381600087803b158015612f3057600080fd5b505af1158015612f44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f689190614e3b565b50604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a1505b505050565b67ffffffffffffffff81166000908152600360209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561304757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613029575b505050505081525050905060005b8160400151518110156131cb5760005b6007548110156131b857600061318160078381548110613087576130876156f1565b9060005260206000200154856040015185815181106130a8576130a86156f1565b60200260200101518860026000896040015189815181106130cb576130cb6156f1565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812067ffffffffffffffff808f16835293522054166040805160208082018790526001600160a01b03959095168183015267ffffffffffffffff9384166060820152919092166080808301919091528251808303909101815260a08201835280519084012060c082019490945260e080820185905282518083039091018152610100909101909152805191012091565b50600081815260096020526040902054909150156131a55750600195945050505050565b50806131b0816155ef565b915050613065565b50806131c3816155ef565b915050613055565b5060009392505050565b6131dd6131e6565b61083481613b7c565b6000546001600160a01b031633146132405760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108dc565b565b600b546601000000000000900460ff1615613289576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff82166000908152600360209081526040808320815160608101835281546001600160a01b0390811682526001830154168185015260028201805484518187028101870186528181529295939486019383018282801561331a57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116132fc575b5050509190925250505067ffffffffffffffff80851660009081526004602090815260408083208151808301909252546bffffffffffffffffffffffff81168083526c01000000000000000000000000909104909416918101919091529293505b8360400151518110156134145760026000856040015183815181106133a2576133a26156f1565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812067ffffffffffffffff8a168252909252902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001690558061340c816155ef565b91505061337b565b5067ffffffffffffffff8516600090815260036020526040812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116825560018201805490911690559061346f6002830182614abc565b505067ffffffffffffffff8516600090815260046020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055600580548291906008906134df9084906801000000000000000090046bffffffffffffffffffffffff166155c2565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb85836bffffffffffffffffffffffff166040518363ffffffff1660e01b815260040161357d9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561359757600080fd5b505af11580156135ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135cf9190614e3b565b613605576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b03861681526bffffffffffffffffffffffff8316602082015267ffffffffffffffff8716917fe8ed5b475a5b5987aa9165e8731bb78043f39eee32ec5a1169a89e27fcd49815910160405180910390a25050505050565b60004661a4b181148061367c575062066eed81145b156136f95760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156136bb57600080fd5b505afa1580156136cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136f39190614e5d565b91505090565b4391505090565b60008060006137128560000151612a16565b6000818152600660205260409020549093506001600160a01b031680613767576040517f77f5b84c000000000000000000000000000000000000000000000000000000008152600481018590526024016108dc565b6080860151604051613786918691602001918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526009909352912054909350806137e5576040517f3688124a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85516020808801516040808a015160608b015160808c01519251613851968b96909594910195865267ffffffffffffffff948516602087015292909316604085015263ffffffff90811660608501529190911660808301526001600160a01b031660a082015260c00190565b60405160208183030381529060405280519060200120811461389f576040517fd529142c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006138ae8760000151613c3e565b9050806139ba5786516040517fe9413d3800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b15801561393a57600080fd5b505afa15801561394e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139729190614e5d565b9050806139ba5786516040517f175dadad00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108dc565b60008860800151826040516020016139dc929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c9050613a018982613d52565b9450505050509250925092565b60005a611388811015613a2057600080fd5b611388810390508460408204820311613a3857600080fd5b50823b613a4457600080fd5b60008083516020850160008789f190505b9392505050565b600080613a67613dbd565b905060008113613aa6576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018290526024016108dc565b6000613ab0613ec4565b9050600082825a613ac18b8b6154ef565b613acb91906155ab565b613ad5908861556e565b613adf91906154ef565b613af190670de0b6b3a764000061556e565b613afb919061555a565b90506000613b1463ffffffff881664e8d4a5100061556e565b9050613b2c816b033b2e3c9fd0803ce80000006155ab565b821115613b65576040517fe80fa38100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613b6f81836154ef565b9998505050505050505050565b6001600160a01b038116331415613bd55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108dc565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60004661a4b1811480613c53575062066eed81145b80613c60575062066eee81145b15613d42576101008367ffffffffffffffff16613c7b613667565b613c8591906155ab565b1180613ca25750613c94613667565b8367ffffffffffffffff1610155b15613cb05750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152606490632b407a829060240160206040518083038186803b158015613d0a57600080fd5b505afa158015613d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a559190614e5d565b505067ffffffffffffffff164090565b6000613d868360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151613f20565b60038360200151604051602001613d9e9291906153e2565b60408051601f1981840301815291905280516020909101209392505050565b600b54604080517ffeaf968c0000000000000000000000000000000000000000000000000000000081529051600092670100000000000000900463ffffffff169182151591849182917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b158015613e5657600080fd5b505afa158015613e6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e8e9190615137565b509450909250849150508015613eb25750613ea982426155ab565b8463ffffffff16105b15613ebc5750600a545b949350505050565b60004661a4b1811480613ed9575062066eed81145b15613f1857606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156136bb57600080fd5b600091505090565b613f298961415b565b613f755760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e20637572766500000000000060448201526064016108dc565b613f7e8861415b565b613fca5760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e206375727665000000000000000000000060448201526064016108dc565b613fd38361415b565b61401f5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e20637572766500000060448201526064016108dc565b6140288261415b565b6140745760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e2063757276650000000060448201526064016108dc565b614080878a8887614234565b6140cc5760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e6573730000000000000060448201526064016108dc565b60006140d88a87614385565b905060006140eb898b878b8689896143e9565b905060006140fc838d8d8a86614515565b9050808a1461414d5760405162461bcd60e51b815260206004820152600d60248201527f696e76616c69642070726f6f660000000000000000000000000000000000000060448201526064016108dc565b505050505050505050505050565b80516000906401000003d019116141b45760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e617465000000000000000000000000000060448201526064016108dc565b60208201516401000003d0191161420d5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e617465000000000000000000000000000060448201526064016108dc565b60208201516401000003d01990800961422d8360005b6020020151614555565b1492915050565b60006001600160a01b03821661428c5760405162461bcd60e51b815260206004820152600b60248201527f626164207769746e65737300000000000000000000000000000000000000000060448201526064016108dc565b6020840151600090600116156142a357601c6142a6565b601b5b905060007ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641418587600060200201510986517ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa15801561435d573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b61438d614ada565b6143ba600184846040516020016143a693929190615222565b604051602081830303815290604052614579565b90505b6143c68161415b565b612a105780516040805160208101929092526143e291016143a6565b90506143bd565b6143f1614ada565b825186516401000003d01990819006910614156144505760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e6374000060448201526064016108dc565b61445b8789886145c8565b6144a75760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c65640000000000000000000060448201526064016108dc565b6144b28486856145c8565b6144fe5760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c656400000000000000000060448201526064016108dc565b614509868484614710565b98975050505050505050565b600060028686868587604051602001614533969594939291906151b0565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614581614ada565b61458a826147d7565b815261459f61459a826000614223565b614812565b6020820181905260029006600114156145c3576020810180516401000003d0190390525b919050565b6000826146175760405162461bcd60e51b815260206004820152600b60248201527f7a65726f207363616c617200000000000000000000000000000000000000000060448201526064016108dc565b8351602085015160009061462d90600290615650565b1561463957601c61463c565b601b5b905060007ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641418387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa1580156146bc573d6000803e3d6000fd5b5050506020604051035190506000866040516020016146db919061519e565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614718614ada565b83516020808601518551918601516000938493849361473993909190614832565b919450925090506401000003d0198582096001146147995760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a0000000000000060448201526064016108dc565b60405180604001604052806401000003d019806147b8576147b8615693565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d01981106145c3576040805160208082019390935281518082038401815290820190915280519101206147df565b6000612a1082600261482b6401000003d01960016154ef565b901c614912565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614872838385856149d2565b909850905061488388828e886149f6565b909850905061489488828c876149f6565b909850905060006148a78d878b856149f6565b90985090506148b8888286866149d2565b90985090506148c988828e896149f6565b90985090508181146148fe576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614902565b8196505b5050505050509450945094915050565b60008061491d614af8565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a082015261494f614b16565b60208160c08460057ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa9250826149c85760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c75726521000000000000000000000000000060448201526064016108dc565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614aac579160200282015b82811115614aac57825182547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03909116178255602090920191600190910190614a5f565b50614ab8929150614b34565b5090565b50805460008255906000526020600020908101906108349190614b34565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614ab85760008155600101614b35565b80356001600160a01b03811681146145c357600080fd5b8060408101831015612a1057600080fd5b600082601f830112614b8257600080fd5b6040516040810181811067ffffffffffffffff82111715614ba557614ba5615720565b8060405250808385604086011115614bbc57600080fd5b60005b6002811015614bde578135835260209283019290910190600101614bbf565b509195945050505050565b600060a08284031215614bfb57600080fd5b60405160a0810181811067ffffffffffffffff82111715614c1e57614c1e615720565b604052905080614c2d83614cb3565b8152614c3b60208401614cb3565b6020820152614c4c60408401614c9f565b6040820152614c5d60608401614c9f565b6060820152614c6e60808401614b49565b60808201525092915050565b803561ffff811681146145c357600080fd5b803562ffffff811681146145c357600080fd5b803563ffffffff811681146145c357600080fd5b803567ffffffffffffffff811681146145c357600080fd5b805169ffffffffffffffffffff811681146145c357600080fd5b600060208284031215614cf757600080fd5b613a5582614b49565b60008060608385031215614d1357600080fd5b614d1c83614b49565b9150614d2b8460208501614b60565b90509250929050565b60008060008060608587031215614d4a57600080fd5b614d5385614b49565b935060208501359250604085013567ffffffffffffffff80821115614d7757600080fd5b818701915087601f830112614d8b57600080fd5b813581811115614d9a57600080fd5b886020828501011115614dac57600080fd5b95989497505060200194505050565b60008060408385031215614dce57600080fd5b614dd783614b49565b915060208301356bffffffffffffffffffffffff81168114614df857600080fd5b809150509250929050565b600060408284031215614e1557600080fd5b613a558383614b60565b600060408284031215614e3157600080fd5b613a558383614b71565b600060208284031215614e4d57600080fd5b81518015158114613a5557600080fd5b600060208284031215614e6f57600080fd5b5051919050565b600080600080600060a08688031215614e8e57600080fd5b85359450614e9e60208701614cb3565b9350614eac60408701614c7a565b9250614eba60608701614c9f565b9150614ec860808701614c9f565b90509295509295909350565b600080828403610240811215614ee957600080fd5b6101a080821215614ef957600080fd5b614f016154c5565b9150614f0d8686614b71565b8252614f1c8660408701614b71565b60208301526080850135604083015260a0850135606083015260c08501356080830152614f4b60e08601614b49565b60a0830152610100614f5f87828801614b71565b60c0840152614f72876101408801614b71565b60e08401526101808601358184015250819350614f9186828701614be9565b925050509250929050565b6000806000806000808688036101c0811215614fb757600080fd5b614fc088614c7a565b9650614fce60208901614c9f565b9550614fdc60408901614c9f565b9450614fea60608901614c9f565b935060808801359250610120807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608301121561502557600080fd5b61502d6154c5565b915061503b60a08a01614c9f565b825261504960c08a01614c9f565b602083015261505a60e08a01614c9f565b604083015261010061506d818b01614c9f565b606084015261507d828b01614c9f565b608084015261508f6101408b01614c8c565b60a08401526150a16101608b01614c8c565b60c08401526150b36101808b01614c8c565b60e08401526150c56101a08b01614c8c565b818401525050809150509295509295509295565b6000602082840312156150eb57600080fd5b5035919050565b60006020828403121561510457600080fd5b613a5582614cb3565b6000806040838503121561512057600080fd5b61512983614cb3565b9150614d2b60208401614b49565b600080600080600060a0868803121561514f57600080fd5b61515886614ccb565b9450602086015193506040860151925060608601519150614ec860808701614ccb565b8060005b60028110156109e557815184526020938401939091019060010161517f565b6151a8818361517b565b604001919050565b8681526151c0602082018761517b565b6151cd606082018661517b565b6151da60a082018561517b565b6151e760e082018461517b565b60609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166101208201526101340195945050505050565b838152615232602082018461517b565b606081019190915260800192915050565b60408101612a10828461517b565b600060208083528351808285015260005b8181101561527e57858101830151858201604001528201615262565b81811115615290576000604083870101525b50601f01601f1916929092016040019392505050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b818110156152f7578451835293830193918301916001016152db565b509098975050505050505050565b60006101c08201905061ffff8816825263ffffffff808816602084015280871660408401528086166060840152846080840152835481811660a085015261535960c08501838360201c1663ffffffff169052565b61537060e08501838360401c1663ffffffff169052565b6153886101008501838360601c1663ffffffff169052565b6153a06101208501838360801c1663ffffffff169052565b62ffffff60a082901c811661014086015260b882901c811661016086015260d082901c1661018085015260e81c6101a090930192909252979650505050505050565b82815260608101613a55602083018461517b565b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156154375784518352938301939183019160010161541b565b5090979650505050505050565b6000608082016bffffffffffffffffffffffff87168352602067ffffffffffffffff8716818501526001600160a01b0380871660408601526080606086015282865180855260a087019150838801945060005b818110156154b5578551841683529484019491840191600101615497565b50909a9950505050505050505050565b604051610120810167ffffffffffffffff811182821017156154e9576154e9615720565b60405290565b6000821982111561550257615502615664565b500190565b600067ffffffffffffffff80831681851680830382111561552a5761552a615664565b01949350505050565b60006bffffffffffffffffffffffff80831681851680830382111561552a5761552a615664565b60008261556957615569615693565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156155a6576155a6615664565b500290565b6000828210156155bd576155bd615664565b500390565b60006bffffffffffffffffffffffff838116908316818110156155e7576155e7615664565b039392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561562157615621615664565b5060010190565b600067ffffffffffffffff8083168181141561564657615646615664565b6001019392505050565b60008261565f5761565f615693565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x60e06040523480156200001157600080fd5b50604051620059bc380380620059bc8339810160408190526200003491620001b1565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e8565b5050506001600160601b0319606093841b811660805290831b811660a052911b1660c052620001fb565b6001600160a01b038116331415620001435760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001ac57600080fd5b919050565b600080600060608486031215620001c757600080fd5b620001d28462000194565b9250620001e26020850162000194565b9150620001f26040850162000194565b90509250925092565b60805160601c60a05160601c60c05160601c615757620002656000396000818161051901526138e70152600081816106030152613e0c01526000818161036d015281816114da0152818161237701528181612dae01528181612eea015261350f01526157576000f3fe608060405234801561001057600080fd5b506004361061025b5760003560e01c80636f64f03f11610145578063ad178361116100bd578063d2f9f9a71161008c578063e72f6e3011610071578063e72f6e30146106e0578063e82ad7d4146106f3578063f2fde38b1461071657600080fd5b8063d2f9f9a7146106ba578063d7ae1d30146106cd57600080fd5b8063ad178361146105fe578063af198b9714610625578063c3f909d414610655578063caf70c4a146106a757600080fd5b80638da5cb5b11610114578063a21a23e4116100f9578063a21a23e4146105c0578063a47c7696146105c8578063a4c0ed36146105eb57600080fd5b80638da5cb5b1461059c5780639f87fad7146105ad57600080fd5b80636f64f03f1461055b5780637341c10c1461056e57806379ba509714610581578063823597401461058957600080fd5b8063356dac71116101d85780635fbbc0d2116101a757806366316d8d1161018c57806366316d8d14610501578063689c45171461051457806369bcdb7d1461053b57600080fd5b80635fbbc0d2146103f357806364d51a2a146104f957600080fd5b8063356dac71146103a757806340d6bb82146103af5780634cb48a54146103cd5780635d3b1d30146103e057600080fd5b806308821d581161022f57806315c48b841161021457806315c48b841461030e578063181f5a77146103295780631b6b6d231461036857600080fd5b806308821d58146102cf57806312b58349146102e257600080fd5b80620122911461026057806302bcc5b61461028057806304c357cb1461029557806306bfa637146102a8575b600080fd5b610268610729565b604051610277939291906152a1565b60405180910390f35b61029361028e3660046150ed565b6107a5565b005b6102936102a3366004615108565b610837565b60055467ffffffffffffffff165b60405167ffffffffffffffff9091168152602001610277565b6102936102dd366004614dfe565b6109eb565b6005546801000000000000000090046bffffffffffffffffffffffff165b604051908152602001610277565b61031660c881565b60405161ffff9091168152602001610277565b604080518082018252601681527f565246436f6f7264696e61746f72563220312e302e300000000000000000000060208201529051610277919061524c565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610277565b600a54610300565b6103b86101f481565b60405163ffffffff9091168152602001610277565b6102936103db366004614f97565b610bb0565b6103006103ee366004614e71565b610fa7565b600c546040805163ffffffff80841682526401000000008404811660208301526801000000000000000084048116928201929092526c010000000000000000000000008304821660608201527001000000000000000000000000000000008304909116608082015262ffffff740100000000000000000000000000000000000000008304811660a0830152770100000000000000000000000000000000000000000000008304811660c08301527a0100000000000000000000000000000000000000000000000000008304811660e08301527d01000000000000000000000000000000000000000000000000000000000090920490911661010082015261012001610277565b610316606481565b61029361050f366004614db6565b611385565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b6103006105493660046150d4565b60009081526009602052604090205490565b610293610569366004614cfb565b6115d4565b61029361057c366004615108565b611704565b610293611951565b6102936105973660046150ed565b611a1a565b6000546001600160a01b031661038f565b6102936105bb366004615108565b611be0565b6102b661201f565b6105db6105d63660046150ed565b612202565b604051610277949392919061543f565b6102936105f9366004614d2f565b612325565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b610638610633366004614ecf565b61257c565b6040516bffffffffffffffffffffffff9091168152602001610277565b600b546040805161ffff8316815263ffffffff6201000084048116602083015267010000000000000084048116928201929092526b010000000000000000000000909204166060820152608001610277565b6103006106b5366004614e1a565b612a16565b6103b86106c83660046150ed565b612a46565b6102936106db366004615108565b612c3b565b6102936106ee366004614ce0565b612d75565b6107066107013660046150ed565b612fb2565b6040519015158152602001610277565b610293610724366004614ce0565b6131d5565b600b546007805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561079357602002820191906000526020600020905b81548152602001906001019080831161077f575b50505050509050925092509250909192565b6107ad6131e6565b67ffffffffffffffff81166000908152600360205260409020546001600160a01b0316610806576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020546108349082906001600160a01b0316613242565b50565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680610893576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038216146108e5576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024015b60405180910390fd5b600b546601000000000000900460ff161561092c576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff84166000908152600360205260409020600101546001600160a01b038481169116146109e55767ffffffffffffffff841660008181526003602090815260409182902060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091558251338152918201527f69436ea6df009049404f564eff6622cd00522b0bd6a89efd9e52a355c4a879be91015b60405180910390a25b50505050565b6109f36131e6565b604080518082018252600091610a22919084906002908390839080828437600092019190915250612a16915050565b6000818152600660205260409020549091506001600160a01b031680610a77576040517f77f5b84c000000000000000000000000000000000000000000000000000000008152600481018390526024016108dc565b600082815260066020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b600754811015610b67578260078281548110610aca57610aca6156ec565b90600052602060002001541415610b55576007805460009190610aef906001906155a6565b81548110610aff57610aff6156ec565b906000526020600020015490508060078381548110610b2057610b206156ec565b6000918252602090912001556007805480610b3d57610b3d6156bd565b60019003818190600052602060002001600090559055505b80610b5f816155ea565b915050610aac565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610ba391815260200190565b60405180910390a2505050565b610bb86131e6565b60c861ffff87161115610c0b576040517fa738697600000000000000000000000000000000000000000000000000000000815261ffff871660048201819052602482015260c860448201526064016108dc565b60008213610c48576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018390526024016108dc565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001690971762010000909502949094177fffffffffffffffffffffffffffffffffff000000000000000000ffffffffffff166701000000000000009092027fffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffff16919091176b010000000000000000000000909302929092179093558651600c80549489015189890151938a0151978a0151968a015160c08b015160e08c01516101008d01519588167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009099169890981764010000000093881693909302929092177fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff1668010000000000000000958716959095027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff16949094176c0100000000000000000000000098861698909802979097177fffffffffffffffffff00000000000000ffffffffffffffffffffffffffffffff1670010000000000000000000000000000000096909416959095027fffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffff16929092177401000000000000000000000000000000000000000062ffffff92831602177fffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffff1677010000000000000000000000000000000000000000000000958216959095027fffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffff16949094177a01000000000000000000000000000000000000000000000000000092851692909202919091177cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167d0100000000000000000000000000000000000000000000000000000000009390911692909202919091178155600a84905590517fc21e3bd2e0b339d2848f0dd956947a88966c242c0c0c582a33137a5c1ceb5cb291610f97918991899189918991899190615300565b60405180910390a1505050505050565b600b546000906601000000000000900460ff1615610ff1576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff85166000908152600360205260409020546001600160a01b031661104a576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260026020908152604080832067ffffffffffffffff808a16855292529091205416806110ba576040517ff0019fe600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff871660048201523360248201526044016108dc565b600b5461ffff90811690861610806110d6575060c861ffff8616115b1561112657600b546040517fa738697600000000000000000000000000000000000000000000000000000000815261ffff8088166004830152909116602482015260c860448201526064016108dc565b600b5463ffffffff620100009091048116908516111561118d57600b546040517ff5d7e01e00000000000000000000000000000000000000000000000000000000815263ffffffff80871660048301526201000090920490911660248201526044016108dc565b6101f463ffffffff841611156111df576040517f47386bec00000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526101f460248201526044016108dc565b60006111ec826001615502565b6040805160208082018c9052338284015267ffffffffffffffff808c16606084015284166080808401919091528351808403909101815260a08301845280519082012060c083018d905260e080840182905284518085039091018152610100909301909352815191012091925081611262613667565b60408051602081019390935282015267ffffffffffffffff8a16606082015263ffffffff8089166080830152871660a08201523360c082015260e00160408051808303601f19018152828252805160209182012060008681526009835283902055848352820183905261ffff8a169082015263ffffffff808916606083015287166080820152339067ffffffffffffffff8b16908c907f63373d1c4696214b898952999c9aaec57dac1ee2723cec59bea6888f489a97729060a00160405180910390a45033600090815260026020908152604080832067ffffffffffffffff808d16855292529091208054919093167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009091161790915591505095945050505050565b600b546601000000000000900460ff16156113cc576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600860205260409020546bffffffffffffffffffffffff80831691161015611426576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260086020526040812080548392906114539084906bffffffffffffffffffffffff166155bd565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555080600560088282829054906101000a90046bffffffffffffffffffffffff166114aa91906155bd565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb83836040518363ffffffff1660e01b81526004016115489291906001600160a01b039290921682526bffffffffffffffffffffffff16602082015260400190565b602060405180830381600087803b15801561156257600080fd5b505af1158015611576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a9190614e36565b6115d0576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6115dc6131e6565b60408051808201825260009161160b919084906002908390839080828437600092019190915250612a16915050565b6000818152600660205260409020549091506001600160a01b031615611660576040517f4a0b8fa7000000000000000000000000000000000000000000000000000000008152600481018290526024016108dc565b600081815260066020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091556007805460018101825594527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610ba3565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680611760576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038216146117ad576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff16156117f4576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff84166000908152600360205260409020600201546064141561184b576040517f05a48e0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260026020908152604080832067ffffffffffffffff80891685529252909120541615611885576109e5565b6001600160a01b038316600081815260026020818152604080842067ffffffffffffffff8a1680865290835281852080547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166001908117909155600384528286209094018054948501815585529382902090920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001685179055905192835290917f43dc749a04ac8fb825cbd514f7c0e13f13bc6f2ee66043b76629d51776cff8e091016109dc565b6001546001600160a01b031633146119ab5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108dc565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600b546601000000000000900460ff1615611a61576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020546001600160a01b0316611aba576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020600101546001600160a01b03163314611b425767ffffffffffffffff8116600090815260036020526040908190206001015490517fd084e9750000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016108dc565b67ffffffffffffffff81166000818152600360209081526040918290208054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001909301805490931690925583516001600160a01b03909116808252928101919091529092917f6f1dc65165ffffedfd8e507b4a0f1fcfdada045ed11f6c26ba27cedfe87802f0910160405180910390a25050565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680611c3c576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614611c89576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff1615611cd0576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611cd984612fb2565b15611d10576040517fb42f66e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260026020908152604080832067ffffffffffffffff808916855292529091205416611d91576040517ff0019fe600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff851660048201526001600160a01b03841660248201526044016108dc565b67ffffffffffffffff8416600090815260036020908152604080832060020180548251818502810185019093528083529192909190830182828015611dff57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611de1575b50505050509050600060018251611e1691906155a6565b905060005b8251811015611f8e57856001600160a01b0316838281518110611e4057611e406156ec565b60200260200101516001600160a01b03161415611f7c576000838381518110611e6b57611e6b6156ec565b6020026020010151905080600360008a67ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000206002018381548110611eb157611eb16156ec565b600091825260208083209190910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03949094169390931790925567ffffffffffffffff8a168152600390915260409020600201805480611f1e57611f1e6156bd565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905550611f8e565b80611f86816155ea565b915050611e1b565b506001600160a01b038516600081815260026020908152604080832067ffffffffffffffff8b168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001690555192835290917f182bff9831466789164ca77075fffd84916d35a8180ba73c27e45634549b445b91015b60405180910390a2505050505050565b600b546000906601000000000000900460ff1615612069576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805467ffffffffffffffff1690600061208383615623565b82546101009290920a67ffffffffffffffff8181021990931691831602179091556005541690506000806040519080825280602002602001820160405280156120d6578160200160208202803683370190505b506040805180820182526000808252602080830182815267ffffffffffffffff888116808552600484528685209551865493516bffffffffffffffffffffffff9091167fffffffffffffffffffffffff0000000000000000000000000000000000000000948516176c01000000000000000000000000919093160291909117909455845160608101865233815280830184815281870188815295855260038452959093208351815483166001600160a01b03918216178255955160018201805490931696169590951790559151805194955090936121ba9260028501920190614a3a565b505060405133815267ffffffffffffffff841691507f464722b4166576d3dcbba877b999bc35cf911f4eaf434b7eba68fa113951d0bf9060200160405180910390a250905090565b67ffffffffffffffff8116600090815260036020526040812054819081906060906001600160a01b0316612262576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff80861660009081526004602090815260408083205460038352928190208054600290910180548351818602810186019094528084526bffffffffffffffffffffffff8616966c01000000000000000000000000909604909516946001600160a01b0390921693909291839183018282801561230f57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116122f1575b5050505050905093509350935093509193509193565b600b546601000000000000900460ff161561236c576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146123ce576040517f44b0e3c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208114612408576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612416828401846150ed565b67ffffffffffffffff81166000908152600360205260409020549091506001600160a01b0316612472576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff8116600090815260046020526040812080546bffffffffffffffffffffffff16918691906124a9838561552e565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555084600560088282829054906101000a90046bffffffffffffffffffffffff16612500919061552e565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508167ffffffffffffffff167fd39ec07f4e209f627a4c427971473820dc129761ba28de8906bd56f57101d4f882878461256791906154ea565b6040805192835260208301919091520161200f565b600b546000906601000000000000900460ff16156125c6576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005a905060008060006125da87876136f7565b9250925092506000866060015163ffffffff1667ffffffffffffffff8111156126055761260561571b565b60405190808252806020026020018201604052801561262e578160200160208202803683370190505b50905060005b876060015163ffffffff168110156126a25760408051602081018590529081018290526060016040516020818303038152906040528051906020012060001c828281518110612685576126856156ec565b60209081029190910101528061269a816155ea565b915050612634565b506000838152600960205260408082208290555181907f1fe543e300000000000000000000000000000000000000000000000000000000906126ea90879086906024016153f1565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252600b80547fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff166601000000000000179055908a015160808b015191925060009161279a9163ffffffff169084613a05565b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff1690556020808c01805167ffffffffffffffff9081166000908152600490935260408084205492518216845290922080549394506c01000000000000000000000000918290048316936001939192600c9261281e928692900416615502565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060006128758a600b600001600b9054906101000a900463ffffffff1663ffffffff1661286f85612a46565b3a613a53565b6020808e015167ffffffffffffffff166000908152600490915260409020549091506bffffffffffffffffffffffff808316911610156128e1576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808d015167ffffffffffffffff166000908152600490915260408120805483929061291d9084906bffffffffffffffffffffffff166155bd565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008b8152600660209081526040808320546001600160a01b0316835260089091528120805485945090926129799185911661552e565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550877f7dffc5ae5ee4e2e4df1651cf6ad329a73cebdb728f37ea0187b9b17e036756e48883866040516129fc939291909283526bffffffffffffffffffffffff9190911660208301521515604082015260600190565b60405180910390a299505050505050505050505b92915050565b600081604051602001612a29919061523e565b604051602081830303815290604052805190602001209050919050565b6040805161012081018252600c5463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c010000000000000000000000008104831660608301527001000000000000000000000000000000008104909216608082015262ffffff740100000000000000000000000000000000000000008304811660a08301819052770100000000000000000000000000000000000000000000008404821660c08401527a0100000000000000000000000000000000000000000000000000008404821660e08401527d0100000000000000000000000000000000000000000000000000000000009093041661010082015260009167ffffffffffffffff841611612b64575192915050565b8267ffffffffffffffff168160a0015162ffffff16108015612b9957508060c0015162ffffff168367ffffffffffffffff1611155b15612ba8576020015192915050565b8267ffffffffffffffff168160c0015162ffffff16108015612bdd57508060e0015162ffffff168367ffffffffffffffff1611155b15612bec576040015192915050565b8267ffffffffffffffff168160e0015162ffffff16108015612c22575080610100015162ffffff168367ffffffffffffffff1611155b15612c31576060015192915050565b6080015192915050565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680612c97576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614612ce4576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff1615612d2b576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d3484612fb2565b15612d6b576040517fb42f66e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109e58484613242565b612d7d6131e6565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612df857600080fd5b505afa158015612e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e309190614e58565b6005549091506801000000000000000090046bffffffffffffffffffffffff1681811115612e94576040517fa99da30200000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016108dc565b81811015612fad576000612ea882846155a6565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152602482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb90604401602060405180830381600087803b158015612f3057600080fd5b505af1158015612f44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f689190614e36565b50604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a1505b505050565b67ffffffffffffffff81166000908152600360209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561304757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613029575b505050505081525050905060005b8160400151518110156131cb5760005b6007548110156131b857600061318160078381548110613087576130876156ec565b9060005260206000200154856040015185815181106130a8576130a86156ec565b60200260200101518860026000896040015189815181106130cb576130cb6156ec565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812067ffffffffffffffff808f16835293522054166040805160208082018790526001600160a01b03959095168183015267ffffffffffffffff9384166060820152919092166080808301919091528251808303909101815260a08201835280519084012060c082019490945260e080820185905282518083039091018152610100909101909152805191012091565b50600081815260096020526040902054909150156131a55750600195945050505050565b50806131b0816155ea565b915050613065565b50806131c3816155ea565b915050613055565b5060009392505050565b6131dd6131e6565b61083481613b73565b6000546001600160a01b031633146132405760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108dc565b565b600b546601000000000000900460ff1615613289576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff82166000908152600360209081526040808320815160608101835281546001600160a01b0390811682526001830154168185015260028201805484518187028101870186528181529295939486019383018282801561331a57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116132fc575b5050509190925250505067ffffffffffffffff80851660009081526004602090815260408083208151808301909252546bffffffffffffffffffffffff81168083526c01000000000000000000000000909104909416918101919091529293505b8360400151518110156134145760026000856040015183815181106133a2576133a26156ec565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812067ffffffffffffffff8a168252909252902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001690558061340c816155ea565b91505061337b565b5067ffffffffffffffff8516600090815260036020526040812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116825560018201805490911690559061346f6002830182614ab7565b505067ffffffffffffffff8516600090815260046020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055600580548291906008906134df9084906801000000000000000090046bffffffffffffffffffffffff166155bd565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb85836bffffffffffffffffffffffff166040518363ffffffff1660e01b815260040161357d9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561359757600080fd5b505af11580156135ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135cf9190614e36565b613605576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b03861681526bffffffffffffffffffffffff8316602082015267ffffffffffffffff8716917fe8ed5b475a5b5987aa9165e8731bb78043f39eee32ec5a1169a89e27fcd49815910160405180910390a25050505050565b60004661367381613c35565b156136f05760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156136b257600080fd5b505afa1580156136c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ea9190614e58565b91505090565b4391505090565b60008060006137098560000151612a16565b6000818152600660205260409020549093506001600160a01b03168061375e576040517f77f5b84c000000000000000000000000000000000000000000000000000000008152600481018590526024016108dc565b608086015160405161377d918691602001918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526009909352912054909350806137dc576040517f3688124a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85516020808801516040808a015160608b015160808c01519251613848968b96909594910195865267ffffffffffffffff948516602087015292909316604085015263ffffffff90811660608501529190911660808301526001600160a01b031660a082015260c00190565b604051602081830303815290604052805190602001208114613896576040517fd529142c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006138a58760000151613c58565b9050806139b15786516040517fe9413d3800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b15801561393157600080fd5b505afa158015613945573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139699190614e58565b9050806139b15786516040517f175dadad00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108dc565b60008860800151826040516020016139d3929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506139f88982613d56565b9450505050509250925092565b60005a611388811015613a1757600080fd5b611388810390508460408204820311613a2f57600080fd5b50823b613a3b57600080fd5b60008083516020850160008789f190505b9392505050565b600080613a5e613dc1565b905060008113613a9d576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018290526024016108dc565b6000613aa7613ec8565b9050600082825a613ab88b8b6154ea565b613ac291906155a6565b613acc9088615569565b613ad691906154ea565b613ae890670de0b6b3a7640000615569565b613af29190615555565b90506000613b0b63ffffffff881664e8d4a51000615569565b9050613b23816b033b2e3c9fd0803ce80000006155a6565b821115613b5c576040517fe80fa38100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613b6681836154ea565b9998505050505050505050565b6001600160a01b038116331415613bcc5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108dc565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061a4b1821480613c49575062066eed82145b80612a1057505062066eee1490565b600046613c6481613c35565b15613d46576101008367ffffffffffffffff16613c7f613667565b613c8991906155a6565b1180613ca65750613c98613667565b8367ffffffffffffffff1610155b15613cb45750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152606490632b407a829060240160206040518083038186803b158015613d0e57600080fd5b505afa158015613d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a4c9190614e58565b505067ffffffffffffffff164090565b6000613d8a8360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151613f1b565b60038360200151604051602001613da29291906153dd565b60408051601f1981840301815291905280516020909101209392505050565b600b54604080517ffeaf968c0000000000000000000000000000000000000000000000000000000081529051600092670100000000000000900463ffffffff169182151591849182917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b158015613e5a57600080fd5b505afa158015613e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e929190615132565b509450909250849150508015613eb65750613ead82426155a6565b8463ffffffff16105b15613ec05750600a545b949350505050565b600046613ed481613c35565b15613f1357606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156136b257600080fd5b600091505090565b613f2489614156565b613f705760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e20637572766500000000000060448201526064016108dc565b613f7988614156565b613fc55760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e206375727665000000000000000000000060448201526064016108dc565b613fce83614156565b61401a5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e20637572766500000060448201526064016108dc565b61402382614156565b61406f5760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e2063757276650000000060448201526064016108dc565b61407b878a888761422f565b6140c75760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e6573730000000000000060448201526064016108dc565b60006140d38a87614380565b905060006140e6898b878b8689896143e4565b905060006140f7838d8d8a86614510565b9050808a146141485760405162461bcd60e51b815260206004820152600d60248201527f696e76616c69642070726f6f660000000000000000000000000000000000000060448201526064016108dc565b505050505050505050505050565b80516000906401000003d019116141af5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e617465000000000000000000000000000060448201526064016108dc565b60208201516401000003d019116142085760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e617465000000000000000000000000000060448201526064016108dc565b60208201516401000003d0199080096142288360005b6020020151614550565b1492915050565b60006001600160a01b0382166142875760405162461bcd60e51b815260206004820152600b60248201527f626164207769746e65737300000000000000000000000000000000000000000060448201526064016108dc565b60208401516000906001161561429e57601c6142a1565b601b5b905060007ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641418587600060200201510986517ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614358573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614388614ad5565b6143b5600184846040516020016143a19392919061521d565b604051602081830303815290604052614574565b90505b6143c181614156565b612a105780516040805160208101929092526143dd91016143a1565b90506143b8565b6143ec614ad5565b825186516401000003d019908190069106141561444b5760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e6374000060448201526064016108dc565b6144568789886145c3565b6144a25760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c65640000000000000000000060448201526064016108dc565b6144ad8486856145c3565b6144f95760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c656400000000000000000060448201526064016108dc565b61450486848461470b565b98975050505050505050565b60006002868686858760405160200161452e969594939291906151ab565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b61457c614ad5565b614585826147d2565b815261459a61459582600061421e565b61480d565b6020820181905260029006600114156145be576020810180516401000003d0190390525b919050565b6000826146125760405162461bcd60e51b815260206004820152600b60248201527f7a65726f207363616c617200000000000000000000000000000000000000000060448201526064016108dc565b835160208501516000906146289060029061564b565b1561463457601c614637565b601b5b905060007ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641418387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa1580156146b7573d6000803e3d6000fd5b5050506020604051035190506000866040516020016146d69190615199565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614713614ad5565b8351602080860151855191860151600093849384936147349390919061482d565b919450925090506401000003d0198582096001146147945760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a0000000000000060448201526064016108dc565b60405180604001604052806401000003d019806147b3576147b361568e565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d01981106145be576040805160208082019390935281518082038401815290820190915280519101206147da565b6000612a108260026148266401000003d01960016154ea565b901c61490d565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a089050600061486d838385856149cd565b909850905061487e88828e886149f1565b909850905061488f88828c876149f1565b909850905060006148a28d878b856149f1565b90985090506148b3888286866149cd565b90985090506148c488828e896149f1565b90985090508181146148f9576401000003d019818a0998506401000003d01982890997506401000003d01981830996506148fd565b8196505b5050505050509450945094915050565b600080614918614af3565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a082015261494a614b11565b60208160c08460057ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa9250826149c35760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c75726521000000000000000000000000000060448201526064016108dc565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614aa7579160200282015b82811115614aa757825182547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03909116178255602090920191600190910190614a5a565b50614ab3929150614b2f565b5090565b50805460008255906000526020600020908101906108349190614b2f565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614ab35760008155600101614b30565b80356001600160a01b03811681146145be57600080fd5b8060408101831015612a1057600080fd5b600082601f830112614b7d57600080fd5b6040516040810181811067ffffffffffffffff82111715614ba057614ba061571b565b8060405250808385604086011115614bb757600080fd5b60005b6002811015614bd9578135835260209283019290910190600101614bba565b509195945050505050565b600060a08284031215614bf657600080fd5b60405160a0810181811067ffffffffffffffff82111715614c1957614c1961571b565b604052905080614c2883614cae565b8152614c3660208401614cae565b6020820152614c4760408401614c9a565b6040820152614c5860608401614c9a565b6060820152614c6960808401614b44565b60808201525092915050565b803561ffff811681146145be57600080fd5b803562ffffff811681146145be57600080fd5b803563ffffffff811681146145be57600080fd5b803567ffffffffffffffff811681146145be57600080fd5b805169ffffffffffffffffffff811681146145be57600080fd5b600060208284031215614cf257600080fd5b613a4c82614b44565b60008060608385031215614d0e57600080fd5b614d1783614b44565b9150614d268460208501614b5b565b90509250929050565b60008060008060608587031215614d4557600080fd5b614d4e85614b44565b935060208501359250604085013567ffffffffffffffff80821115614d7257600080fd5b818701915087601f830112614d8657600080fd5b813581811115614d9557600080fd5b886020828501011115614da757600080fd5b95989497505060200194505050565b60008060408385031215614dc957600080fd5b614dd283614b44565b915060208301356bffffffffffffffffffffffff81168114614df357600080fd5b809150509250929050565b600060408284031215614e1057600080fd5b613a4c8383614b5b565b600060408284031215614e2c57600080fd5b613a4c8383614b6c565b600060208284031215614e4857600080fd5b81518015158114613a4c57600080fd5b600060208284031215614e6a57600080fd5b5051919050565b600080600080600060a08688031215614e8957600080fd5b85359450614e9960208701614cae565b9350614ea760408701614c75565b9250614eb560608701614c9a565b9150614ec360808701614c9a565b90509295509295909350565b600080828403610240811215614ee457600080fd5b6101a080821215614ef457600080fd5b614efc6154c0565b9150614f088686614b6c565b8252614f178660408701614b6c565b60208301526080850135604083015260a0850135606083015260c08501356080830152614f4660e08601614b44565b60a0830152610100614f5a87828801614b6c565b60c0840152614f6d876101408801614b6c565b60e08401526101808601358184015250819350614f8c86828701614be4565b925050509250929050565b6000806000806000808688036101c0811215614fb257600080fd5b614fbb88614c75565b9650614fc960208901614c9a565b9550614fd760408901614c9a565b9450614fe560608901614c9a565b935060808801359250610120807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608301121561502057600080fd5b6150286154c0565b915061503660a08a01614c9a565b825261504460c08a01614c9a565b602083015261505560e08a01614c9a565b6040830152610100615068818b01614c9a565b6060840152615078828b01614c9a565b608084015261508a6101408b01614c87565b60a084015261509c6101608b01614c87565b60c08401526150ae6101808b01614c87565b60e08401526150c06101a08b01614c87565b818401525050809150509295509295509295565b6000602082840312156150e657600080fd5b5035919050565b6000602082840312156150ff57600080fd5b613a4c82614cae565b6000806040838503121561511b57600080fd5b61512483614cae565b9150614d2660208401614b44565b600080600080600060a0868803121561514a57600080fd5b61515386614cc6565b9450602086015193506040860151925060608601519150614ec360808701614cc6565b8060005b60028110156109e557815184526020938401939091019060010161517a565b6151a38183615176565b604001919050565b8681526151bb6020820187615176565b6151c86060820186615176565b6151d560a0820185615176565b6151e260e0820184615176565b60609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166101208201526101340195945050505050565b83815261522d6020820184615176565b606081019190915260800192915050565b60408101612a108284615176565b600060208083528351808285015260005b818110156152795785810183015185820160400152820161525d565b8181111561528b576000604083870101525b50601f01601f1916929092016040019392505050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b818110156152f2578451835293830193918301916001016152d6565b509098975050505050505050565b60006101c08201905061ffff8816825263ffffffff808816602084015280871660408401528086166060840152846080840152835481811660a085015261535460c08501838360201c1663ffffffff169052565b61536b60e08501838360401c1663ffffffff169052565b6153836101008501838360601c1663ffffffff169052565b61539b6101208501838360801c1663ffffffff169052565b62ffffff60a082901c811661014086015260b882901c811661016086015260d082901c1661018085015260e81c6101a090930192909252979650505050505050565b82815260608101613a4c6020830184615176565b6000604082018483526020604081850152818551808452606086019150828701935060005b8181101561543257845183529383019391830191600101615416565b5090979650505050505050565b6000608082016bffffffffffffffffffffffff87168352602067ffffffffffffffff8716818501526001600160a01b0380871660408601526080606086015282865180855260a087019150838801945060005b818110156154b0578551841683529484019491840191600101615492565b50909a9950505050505050505050565b604051610120810167ffffffffffffffff811182821017156154e4576154e461571b565b60405290565b600082198211156154fd576154fd61565f565b500190565b600067ffffffffffffffff8083168185168083038211156155255761552561565f565b01949350505050565b60006bffffffffffffffffffffffff8083168185168083038211156155255761552561565f565b6000826155645761556461568e565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156155a1576155a161565f565b500290565b6000828210156155b8576155b861565f565b500390565b60006bffffffffffffffffffffffff838116908316818110156155e2576155e261565f565b039392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561561c5761561c61565f565b5060010190565b600067ffffffffffffffff808316818114156156415761564161565f565b6001019392505050565b60008261565a5761565a61568e565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFCoordinatorV2ABI = VRFCoordinatorV2MetaData.ABI diff --git a/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go b/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go index d4da270386e..35de7b358a7 100644 --- a/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go +++ b/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go @@ -67,7 +67,7 @@ type VRFV2PlusClientRandomWordsRequest struct { var VRFCoordinatorV25MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2_5.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountNative\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldNativeBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNativeBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithNative\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"deregisterMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"deregisterProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2_5.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverNativeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2_5.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b506040516200615938038062006159833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615f7e620001db600039600081816106150152613a860152615f7e6000f3fe6080604052600436106102dc5760003560e01c806379ba50971161017f578063b08c8795116100e1578063da2f26101161008a578063e72f6e3011610064578063e72f6e3014610964578063ee9d2d3814610984578063f2fde38b146109b157600080fd5b8063da2f2610146108dd578063dac83d2914610913578063dc311dd31461093357600080fd5b8063caf70c4a116100bb578063caf70c4a1461087d578063cb6317971461089d578063d98e620e146108bd57600080fd5b8063b08c87951461081d578063b2a7cac51461083d578063bec4c08c1461085d57600080fd5b80639b1c385e11610143578063a4c0ed361161011d578063a4c0ed36146107b0578063aa433aff146107d0578063aefb212f146107f057600080fd5b80639b1c385e146107435780639d40a6fd14610763578063a21a23e41461079b57600080fd5b806379ba5097146106bd5780638402595e146106d257806386fe91c7146106f25780638da5cb5b1461071257806395b55cfc1461073057600080fd5b8063330987b31161024357806365982744116101ec5780636b6feccc116101c65780636b6feccc146106375780636f64f03f1461067d57806372e9d5651461069d57600080fd5b806365982744146105c357806366316d8d146105e3578063689c45171461060357600080fd5b806341af6c871161021d57806341af6c871461055e5780635d06b4ab1461058e57806364d51a2a146105ae57600080fd5b8063330987b3146104f3578063405b84fa1461051357806340d6bb821461053357600080fd5b80630ae09540116102a55780631b6b6d231161027f5780631b6b6d231461047f57806329492657146104b7578063294daa49146104d757600080fd5b80630ae09540146103f857806315c48b841461041857806318e3dd271461044057600080fd5b8062012291146102e157806304104edb1461030e578063043bd6ae14610330578063088070f51461035457806308821d58146103d8575b600080fd5b3480156102ed57600080fd5b506102f66109d1565b60405161030593929190615ae2565b60405180910390f35b34801561031a57600080fd5b5061032e61032936600461542f565b610a4d565b005b34801561033c57600080fd5b5061034660115481565b604051908152602001610305565b34801561036057600080fd5b50600d546103a09061ffff81169063ffffffff62010000820481169160ff600160301b820416916701000000000000008204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a001610305565b3480156103e457600080fd5b5061032e6103f336600461556f565b610c0f565b34801561040457600080fd5b5061032e610413366004615811565b610da3565b34801561042457600080fd5b5061042d60c881565b60405161ffff9091168152602001610305565b34801561044c57600080fd5b50600a5461046790600160601b90046001600160601b031681565b6040516001600160601b039091168152602001610305565b34801561048b57600080fd5b5060025461049f906001600160a01b031681565b6040516001600160a01b039091168152602001610305565b3480156104c357600080fd5b5061032e6104d236600461544c565b610e71565b3480156104e357600080fd5b5060405160018152602001610305565b3480156104ff57600080fd5b5061046761050e366004615641565b610fee565b34801561051f57600080fd5b5061032e61052e366004615811565b6114d8565b34801561053f57600080fd5b506105496101f481565b60405163ffffffff9091168152602001610305565b34801561056a57600080fd5b5061057e6105793660046155c4565b6118ff565b6040519015158152602001610305565b34801561059a57600080fd5b5061032e6105a936600461542f565b611b00565b3480156105ba57600080fd5b5061042d606481565b3480156105cf57600080fd5b5061032e6105de366004615481565b611bbe565b3480156105ef57600080fd5b5061032e6105fe36600461544c565b611c1e565b34801561060f57600080fd5b5061049f7f000000000000000000000000000000000000000000000000000000000000000081565b34801561064357600080fd5b506012546106609063ffffffff8082169164010000000090041682565b6040805163ffffffff938416815292909116602083015201610305565b34801561068957600080fd5b5061032e6106983660046154ba565b611de6565b3480156106a957600080fd5b5060035461049f906001600160a01b031681565b3480156106c957600080fd5b5061032e611ee5565b3480156106de57600080fd5b5061032e6106ed36600461542f565b611f96565b3480156106fe57600080fd5b50600a54610467906001600160601b031681565b34801561071e57600080fd5b506000546001600160a01b031661049f565b61032e61073e3660046155c4565b6120b1565b34801561074f57600080fd5b5061034661075e36600461571e565b6121f8565b34801561076f57600080fd5b50600754610783906001600160401b031681565b6040516001600160401b039091168152602001610305565b3480156107a757600080fd5b506103466125ed565b3480156107bc57600080fd5b5061032e6107cb3660046154e7565b61283d565b3480156107dc57600080fd5b5061032e6107eb3660046155c4565b6129dd565b3480156107fc57600080fd5b5061081061080b366004615836565b612a3d565b6040516103059190615a47565b34801561082957600080fd5b5061032e610838366004615773565b612b3e565b34801561084957600080fd5b5061032e6108583660046155c4565b612cd2565b34801561086957600080fd5b5061032e610878366004615811565b612e00565b34801561088957600080fd5b5061034661089836600461558b565b612f9c565b3480156108a957600080fd5b5061032e6108b8366004615811565b612fcc565b3480156108c957600080fd5b506103466108d83660046155c4565b6132cf565b3480156108e957600080fd5b5061049f6108f83660046155c4565b600e602052600090815260409020546001600160a01b031681565b34801561091f57600080fd5b5061032e61092e366004615811565b6132f0565b34801561093f57600080fd5b5061095361094e3660046155c4565b61340f565b604051610305959493929190615c4a565b34801561097057600080fd5b5061032e61097f36600461542f565b61350a565b34801561099057600080fd5b5061034661099f3660046155c4565b60106020526000908152604090205481565b3480156109bd57600080fd5b5061032e6109cc36600461542f565b6136f2565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff16939192839190830182828015610a3b57602002820191906000526020600020905b815481526020019060010190808311610a27575b50505050509050925092509250909192565b610a55613703565b60135460005b81811015610be257826001600160a01b031660138281548110610a8057610a80615f22565b6000918252602090912001546001600160a01b03161415610bd0576013610aa8600184615e1b565b81548110610ab857610ab8615f22565b600091825260209091200154601380546001600160a01b039092169183908110610ae457610ae4615f22565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055826013610b1b600185615e1b565b81548110610b2b57610b2b615f22565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506013805480610b6a57610b6a615f0c565b6000828152602090819020600019908301810180546001600160a01b03191690559091019091556040516001600160a01b03851681527ff80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af37910160405180910390a1505050565b80610bda81615e8a565b915050610a5b565b50604051635428d44960e01b81526001600160a01b03831660048201526024015b60405180910390fd5b50565b610c17613703565b604080518082018252600091610c46919084906002908390839080828437600092019190915250612f9c915050565b6000818152600e60205260409020549091506001600160a01b031680610c8257604051631dfd6e1360e21b815260048101839052602401610c03565b6000828152600e6020526040812080546001600160a01b03191690555b600f54811015610d5a5782600f8281548110610cbd57610cbd615f22565b90600052602060002001541415610d4857600f805460009190610ce290600190615e1b565b81548110610cf257610cf2615f22565b9060005260206000200154905080600f8381548110610d1357610d13615f22565b600091825260209091200155600f805480610d3057610d30615f0c565b60019003818190600052602060002001600090559055505b80610d5281615e8a565b915050610c9f565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610d9691815260200190565b60405180910390a2505050565b60008281526005602052604090205482906001600160a01b031680610ddb57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614610e0f57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615610e3a5760405163769dd35360e11b815260040160405180910390fd5b610e43846118ff565b15610e6157604051631685ecdd60e31b815260040160405180910390fd5b610e6b848461375f565b50505050565b600d54600160301b900460ff1615610e9c5760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610ed857604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610f009084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610f489190615e32565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610fc2576040519150601f19603f3d011682016040523d82523d6000602084013e610fc7565b606091505b5050905080610fe95760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff161561101c5760405163769dd35360e11b815260040160405180910390fd5b60005a9050600061102d858561391b565b90506000846060015163ffffffff166001600160401b0381111561105357611053615f38565b60405190808252806020026020018201604052801561107c578160200160208202803683370190505b50905060005b856060015163ffffffff168110156110fc578260400151816040516020016110b4929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c8282815181106110df576110df615f22565b6020908102919091010152806110f481615e8a565b915050611082565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b9161113491908690602401615b55565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805466ff0000000000001916600160301b17905590880151608089015191925060009161119c9163ffffffff169084613ba8565b600d805466ff00000000000019169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b03166111df816001615d9b565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a0151805161122c90600190615e1b565b8151811061123c5761123c615f22565b602091010151600d5460f89190911c600114915060009061126d908a90600160581b900463ffffffff163a85613bf6565b90508115611376576020808c01516000908152600690915260409020546001600160601b03808316600160601b9092041610156112bd57604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c906112f4908490600160601b90046001600160601b0316615e32565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c90915281208054859450909261134d91859116615dc6565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550611462565b6020808c01516000908152600690915260409020546001600160601b03808316911610156113b757604051631e9acf1760e31b815260040160405180910390fd5b6020808c0151600090815260069091526040812080548392906113e49084906001600160601b0316615e32565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b90915281208054859450909261143d91859116615dc6565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a6040015184886040516114bf939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff16156115035760405163769dd35360e11b815260040160405180910390fd5b61150c81613c46565b61153457604051635428d44960e01b81526001600160a01b0382166004820152602401610c03565b6000806000806115438661340f565b945094505093509350336001600160a01b0316826001600160a01b0316146115ad5760405162461bcd60e51b815260206004820152601660248201527f4e6f7420737562736372697074696f6e206f776e6572000000000000000000006044820152606401610c03565b6115b6866118ff565b156116035760405162461bcd60e51b815260206004820152601660248201527f50656e64696e67207265717565737420657869737473000000000000000000006044820152606401610c03565b60006040518060c00160405280611618600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b0316815250905060008160405160200161166c9190615a6d565b604051602081830303815290604052905061168688613cb0565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b038816906116bf908590600401615a5a565b6000604051808303818588803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611715905057506001600160601b03861615155b156117f45760025460405163a9059cbb60e01b81526001600160a01b0389811660048301526001600160601b03891660248301529091169063a9059cbb90604401602060405180830381600087803b15801561177057600080fd5b505af1158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a891906155a7565b6117f45760405162461bcd60e51b815260206004820152601260248201527f696e73756666696369656e742066756e647300000000000000000000000000006044820152606401610c03565b600d805466ff0000000000001916600160301b17905560005b83518110156118a25783818151811061182857611828615f22565b6020908102919091010151604051638ea9811760e01b81526001600160a01b038a8116600483015290911690638ea9811790602401600060405180830381600087803b15801561187757600080fd5b505af115801561188b573d6000803e3d6000fd5b50505050808061189a90615e8a565b91505061180d565b50600d805466ff00000000000019169055604080516001600160a01b0389168152602081018a90527fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187910160405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561198957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161196b575b505050505081525050905060005b816040015151811015611af65760005b600f54811015611ae3576000611aac600f83815481106119c9576119c9615f22565b9060005260206000200154856040015185815181106119ea576119ea615f22565b6020026020010151886004600089604001518981518110611a0d57611a0d615f22565b6020908102919091018101516001600160a01b03908116835282820193909352604091820160009081208e82528252829020548251808301889052959093168583015260608501939093526001600160401b039091166080808501919091528151808503909101815260a08401825280519083012060c084019490945260e0808401859052815180850390910181526101009093019052815191012091565b5060008181526010602052604090205490915015611ad05750600195945050505050565b5080611adb81615e8a565b9150506119a7565b5080611aee81615e8a565b915050611997565b5060009392505050565b611b08613703565b611b1181613c46565b15611b3a5760405163ac8a27ef60e01b81526001600160a01b0382166004820152602401610c03565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af016259060200160405180910390a150565b611bc6613703565b6002546001600160a01b031615611bf057604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff1615611c495760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b0316611c725760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b0380831691161015611cae57604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b602052604081208054839290611cd69084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b0316611d1e9190615e32565b82546101009290920a6001600160601b0381810219909316918316021790915560025460405163a9059cbb60e01b81526001600160a01b03868116600483015292851660248201529116915063a9059cbb90604401602060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc591906155a7565b611de257604051631e9acf1760e31b815260040160405180910390fd5b5050565b611dee613703565b604080518082018252600091611e1d919084906002908390839080828437600092019190915250612f9c915050565b6000818152600e60205260409020549091506001600160a01b031615611e5957604051634a0b8fa760e01b815260048101829052602401610c03565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610d96565b6001546001600160a01b03163314611f3f5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610c03565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611f9e613703565b600a544790600160601b90046001600160601b031681811115611fde576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015610fe9576000611ff28284615e1b565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114612041576040519150601f19603f3d011682016040523d82523d6000602084013e612046565b606091505b50509050806120685760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b0387168152602081018490527f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c910160405180910390a15050505050565b600d54600160301b900460ff16156120dc5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661211157604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c6121408385615dc6565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b03166121889190615dc6565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e9028234846121db9190615d83565b604080519283526020830191909152015b60405180910390a25050565b600d54600090600160301b900460ff16156122265760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b031661226157604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b0316806122b2576040516379bfd40160e01b815260208401356004820152336024820152604401610c03565b600d5461ffff166122c96060850160408601615758565b61ffff1610806122ec575060c86122e66060850160408601615758565b61ffff16115b15612332576123016060840160408501615758565b600d5460405163539c34bb60e11b815261ffff92831660048201529116602482015260c86044820152606401610c03565b600d5462010000900463ffffffff166123516080850160608601615858565b63ffffffff1611156123a15761236d6080840160608501615858565b600d54604051637aebf00f60e11b815263ffffffff9283166004820152620100009091049091166024820152604401610c03565b6101f46123b460a0850160808601615858565b63ffffffff1611156123fa576123d060a0840160808501615858565b6040516311ce1afb60e21b815263ffffffff90911660048201526101f46024820152604401610c03565b6000612407826001615d9b565b604080518635602080830182905233838501528089013560608401526001600160401b0385166080808501919091528451808503909101815260a0808501865281519183019190912060c085019390935260e0808501849052855180860390910181526101009094019094528251920191909120929350906000906124979061249290890189615c9f565b613eff565b905060006124a482613f7c565b9050836124af613fed565b60208a01356124c460808c0160608d01615858565b6124d460a08d0160808e01615858565b33866040516020016124ec9796959493929190615bad565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d60400160208101906125639190615758565b8e60600160208101906125769190615858565b8f60800160208101906125899190615858565b8960405161259c96959493929190615b6e565b60405180910390a450503360009081526004602090815260408083208983013584529091529020805467ffffffffffffffff19166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561261b5760405163769dd35360e11b815260040160405180910390fd5b600033612629600143615e1b565b600754604051606093841b6bffffffffffffffffffffffff199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006126a883615ea5565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b038111156126e7576126e7615f38565b604051908082528060200260200182016040528015612710578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b0392831617835592516001830180549094169116179091559251805194955090936127f19260028501920190615145565b5061280191506008905083614086565b5060405133815282907f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d9060200160405180910390a250905090565b600d54600160301b900460ff16156128685760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03163314612893576040516344b0e3c360e01b815260040160405180910390fd5b602081146128b457604051638129bbcd60e01b815260040160405180910390fd5b60006128c2828401846155c4565b6000818152600560205260409020549091506001600160a01b03166128fa57604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b0316918691906129218385615dc6565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166129699190615dc6565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846129bc9190615d83565b604080519283526020830191909152015b60405180910390a2505050505050565b6129e5613703565b6000818152600560205260409020546001600160a01b0316612a1a57604051630fb532db60e11b815260040160405180910390fd5b600081815260056020526040902054610c0c9082906001600160a01b031661375f565b60606000612a4b6008614092565b9050808410612a6d57604051631390f2a160e01b815260040160405180910390fd5b6000612a798486615d83565b905081811180612a87575083155b612a915780612a93565b815b90506000612aa18683615e1b565b6001600160401b03811115612ab857612ab8615f38565b604051908082528060200260200182016040528015612ae1578160200160208202803683370190505b50905060005b8151811015612b3457612b05612afd8883615d83565b60089061409c565b828281518110612b1757612b17615f22565b602090810291909101015280612b2c81615e8a565b915050612ae7565b5095945050505050565b612b46613703565b60c861ffff87161115612b805760405163539c34bb60e11b815261ffff871660048201819052602482015260c86044820152606401610c03565b60008213612ba4576040516321ea67b360e11b815260048101839052602401610c03565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff19168817620100008702176effffffffffffffffff000000000000191667010000000000000085026effffffff0000000000000000000000191617600160581b83021790558a51601280548d87015192891667ffffffffffffffff199091161764010000000092891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff1615612cfd5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316612d3257604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612d8b576000818152600560205260409081902060010154905163d084e97560e01b81526001600160a01b039091166004820152602401610c03565b6000818152600560209081526040918290208054336001600160a01b0319808316821784556001909301805490931690925583516001600160a01b0390911680825292810191909152909183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691016121ec565b60008281526005602052604090205482906001600160a01b031680612e3857604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612e6c57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615612e975760405163769dd35360e11b815260040160405180910390fd5b60008481526005602052604090206002015460641415612eca576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b031615612f0157610e6b565b6001600160a01b03831660008181526004602090815260408083208884528252808320805467ffffffffffffffff19166001908117909155600583528184206002018054918201815584529282902090920180546001600160a01b03191684179055905191825285917f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e191015b60405180910390a250505050565b600081604051602001612faf9190615a39565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b03168061300457604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461303857604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156130635760405163769dd35360e11b815260040160405180910390fd5b61306c846118ff565b1561308a57604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b03166130e6576040516379bfd40160e01b8152600481018590526001600160a01b0384166024820152604401610c03565b60008481526005602090815260408083206002018054825181850281018501909352808352919290919083018282801561314957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161312b575b505050505090506000600182516131609190615e1b565b905060005b825181101561326c57856001600160a01b031683828151811061318a5761318a615f22565b60200260200101516001600160a01b0316141561325a5760008383815181106131b5576131b5615f22565b6020026020010151905080600560008a815260200190815260200160002060020183815481106131e7576131e7615f22565b600091825260208083209190910180546001600160a01b0319166001600160a01b03949094169390931790925589815260059091526040902060020180548061323257613232615f0c565b600082815260209020810160001990810180546001600160a01b03191690550190555061326c565b8061326481615e8a565b915050613165565b506001600160a01b03851660008181526004602090815260408083208a8452825291829020805467ffffffffffffffff19169055905191825287917f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a791016129cd565b600f81815481106132df57600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061332857604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461335c57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156133875760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b03848116911614610e6b5760008481526005602090815260409182902060010180546001600160a01b0319166001600160a01b03871690811790915582513381529182015285917f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19101612f8e565b6000818152600560205260408120548190819081906060906001600160a01b031661344d57604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156134f057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116134d2575b505050505090509450945094509450945091939590929450565b613512613703565b6002546001600160a01b031661353b5760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561357f57600080fd5b505afa158015613593573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135b791906155dd565b600a549091506001600160601b0316818111156135f1576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015610fe95760006136058284615e1b565b60025460405163a9059cbb60e01b81526001600160a01b0387811660048301526024820184905292935091169063a9059cbb90604401602060405180830381600087803b15801561365557600080fd5b505af1158015613669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061368d91906155a7565b6136aa57604051631f01ff1360e21b815260040160405180910390fd5b604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a150505050565b6136fa613703565b610c0c816140a8565b6000546001600160a01b0316331461375d5760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c03565b565b60008061376b84613cb0565b60025491935091506001600160a01b03161580159061379257506001600160601b03821615155b156138425760025460405163a9059cbb60e01b81526001600160a01b0385811660048301526001600160601b03851660248301529091169063a9059cbb90604401602060405180830381600087803b1580156137ed57600080fd5b505af1158015613801573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382591906155a7565b61384257604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613898576040519150601f19603f3d011682016040523d82523d6000602084013e61389d565b606091505b50509050806138bf5760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006139478460000151612f9c565b6000818152600e60205260409020549091506001600160a01b03168061398357604051631dfd6e1360e21b815260048101839052602401610c03565b60008286608001516040516020016139a5929190918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526010909352912054909150806139eb57604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613a1a978a979096959101615bf7565b604051602081830303815290604052805190602001208114613a4f5760405163354a450b60e21b815260040160405180910390fd5b6000613a5e8760000151614152565b905080613b36578651604051631d2827a760e31b81526001600160401b0390911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b158015613ad057600080fd5b505afa158015613ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b0891906155dd565b905080613b3657865160405163175dadad60e01b81526001600160401b039091166004820152602401610c03565b6000886080015182604051602001613b58929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506000613b7f8a83614249565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a611388811015613bba57600080fd5b611388810390508460408204820311613bd257600080fd5b50823b613bde57600080fd5b60008083516020850160008789f190505b9392505050565b60008115613c2457601254613c1d9086908690640100000000900463ffffffff16866142b4565b9050613c3e565b601254613c3b908690869063ffffffff168661431e565b90505b949350505050565b6000805b601354811015613ca757826001600160a01b031660138281548110613c7157613c71615f22565b6000918252602090912001546001600160a01b03161415613c955750600192915050565b80613c9f81615e8a565b915050613c4a565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287968796949594860193919290830182828015613d3c57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613d1e575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613e19576004600084604001518381518110613dc857613dc8615f22565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208982529092529020805467ffffffffffffffff1916905580613e1181615e8a565b915050613da1565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613e5160028301826151aa565b5050600085815260066020526040812055613e6d60088661440c565b50600a8054859190600090613e8c9084906001600160601b0316615e32565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613ed49190615e32565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081019091526000815281613f2857506040805160208101909152600081526114d2565b63125fa26760e31b613f3a8385615e5a565b6001600160e01b03191614613f6257604051632923fee760e11b815260040160405180910390fd5b613f6f8260048186615d59565b810190613bef91906155f6565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613fb591511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b60004661a4b1811480614002575062066eed81145b1561407f5760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561404157600080fd5b505afa158015614055573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061407991906155dd565b91505090565b4391505090565b6000613bef8383614418565b60006114d2825490565b6000613bef8383614467565b6001600160a01b0381163314156141015760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c03565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60004661a4b1811480614167575062066eed81145b80614174575062066eee81145b1561423a57610100836001600160401b031661418e613fed565b6141989190615e1b565b11806141b457506141a7613fed565b836001600160401b031610155b156141c25750600092915050565b6040516315a03d4160e11b81526001600160401b0384166004820152606490632b407a829060240160206040518083038186803b15801561420257600080fd5b505afa158015614216573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bef91906155dd565b50506001600160401b03164090565b600061427d8360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151614491565b60038360200151604051602001614295929190615b41565b60408051601f1981840301815291905280516020909101209392505050565b6000806142bf6146bc565b905060005a6142ce8888615d83565b6142d89190615e1b565b6142e29085615dfc565b905060006142fb63ffffffff871664e8d4a51000615dfc565b9050826143088284615d83565b6143129190615d83565b98975050505050505050565b600080614329614718565b90506000811361434f576040516321ea67b360e11b815260048101829052602401610c03565b60006143596146bc565b9050600082825a61436a8b8b615d83565b6143749190615e1b565b61437e9088615dfc565b6143889190615d83565b61439a90670de0b6b3a7640000615dfc565b6143a49190615de8565b905060006143bd63ffffffff881664e8d4a51000615dfc565b90506143d5816b033b2e3c9fd0803ce8000000615e1b565b8211156143f55760405163e80fa38160e01b815260040160405180910390fd5b6143ff8183615d83565b9998505050505050505050565b6000613bef83836147e7565b600081815260018301602052604081205461445f575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556114d2565b5060006114d2565b600082600001828154811061447e5761447e615f22565b9060005260206000200154905092915050565b61449a896148da565b6144e65760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e2063757276650000000000006044820152606401610c03565b6144ef886148da565b61453b5760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e20637572766500000000000000000000006044820152606401610c03565b614544836148da565b6145905760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e2063757276650000006044820152606401610c03565b614599826148da565b6145e55760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e206375727665000000006044820152606401610c03565b6145f1878a88876149b3565b61463d5760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e657373000000000000006044820152606401610c03565b60006146498a87614ad6565b9050600061465c898b878b868989614b3a565b9050600061466d838d8d8a86614c5a565b9050808a146146ae5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610c03565b505050505050505050505050565b60004661a4b18114806146d1575062066eed81145b1561471057606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561404157600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093670100000000000000900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561477a57600080fd5b505afa15801561478e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b29190615873565b5094509092508491505080156147d657506147cd8242615e1b565b8463ffffffff16105b15613c3e5750601154949350505050565b600081815260018301602052604081205480156148d057600061480b600183615e1b565b855490915060009061481f90600190615e1b565b905081811461488457600086600001828154811061483f5761483f615f22565b906000526020600020015490508087600001848154811061486257614862615f22565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061489557614895615f0c565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506114d2565b60009150506114d2565b80516000906401000003d019116149335760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d0191161498c5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d0199080096149ac8360005b6020020151614c9a565b1492915050565b60006001600160a01b0382166149f95760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b6044820152606401610c03565b602084015160009060011615614a1057601c614a13565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614aae573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614ade6151c8565b614b0b60018484604051602001614af793929190615a18565b604051602081830303815290604052614cbe565b90505b614b17816148da565b6114d2578051604080516020810192909252614b339101614af7565b9050614b0e565b614b426151c8565b825186516401000003d0199081900691061415614ba15760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e637400006044820152606401610c03565b614bac878988614d0c565b614bf85760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c6564000000000000000000006044820152606401610c03565b614c03848685614d0c565b614c4f5760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c65640000000000000000006044820152606401610c03565b614312868484614e34565b600060028686868587604051602001614c78969594939291906159b9565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614cc66151c8565b614ccf82614efb565b8152614ce4614cdf8260006149a2565b614f36565b6020820181905260029006600114156125e8576020810180516401000003d019039052919050565b600082614d495760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b6044820152606401610c03565b83516020850151600090614d5f90600290615ecc565b15614d6b57601c614d6e565b601b5b9050600070014551231950b75fc4402da1732fc9bebe198387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa158015614de0573d6000803e3d6000fd5b505050602060405103519050600086604051602001614dff91906159a7565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614e3c6151c8565b835160208086015185519186015160009384938493614e5d93909190614f56565b919450925090506401000003d019858209600114614ebd5760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a000000000000006044820152606401610c03565b60405180604001604052806401000003d01980614edc57614edc615ef6565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d01981106125e857604080516020808201939093528151808203840181529082019091528051910120614f03565b60006114d2826002614f4f6401000003d0196001615d83565b901c615036565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614f96838385856150d8565b9098509050614fa788828e886150fc565b9098509050614fb888828c876150fc565b90985090506000614fcb8d878b856150fc565b9098509050614fdc888286866150d8565b9098509050614fed88828e896150fc565b9098509050818114615022576401000003d019818a0998506401000003d01982890997506401000003d0198183099650615026565b8196505b5050505050509450945094915050565b6000806150416151e6565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152615073615204565b60208160c0846005600019fa9250826150ce5760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c7572652100000000000000000000000000006044820152606401610c03565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b82805482825590600052602060002090810192821561519a579160200282015b8281111561519a57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615165565b506151a6929150615222565b5090565b5080546000825590600052602060002090810190610c0c9190615222565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b808211156151a65760008155600101615223565b80356125e881615f4e565b80604081018310156114d257600080fd5b600082601f83011261526457600080fd5b61526c615cec565b80838560408601111561527e57600080fd5b60005b60028110156152a0578135845260209384019390910190600101615281565b509095945050505050565b600082601f8301126152bc57600080fd5b81356001600160401b03808211156152d6576152d6615f38565b604051601f8301601f19908116603f011681019082821181831017156152fe576152fe615f38565b8160405283815286602085880101111561531757600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060c0828403121561534957600080fd5b615351615d14565b905081356001600160401b03808216821461536b57600080fd5b81835260208401356020840152615384604085016153ea565b6040840152615395606085016153ea565b60608401526153a660808501615237565b608084015260a08401359150808211156153bf57600080fd5b506153cc848285016152ab565b60a08301525092915050565b803561ffff811681146125e857600080fd5b803563ffffffff811681146125e857600080fd5b805169ffffffffffffffffffff811681146125e857600080fd5b80356001600160601b03811681146125e857600080fd5b60006020828403121561544157600080fd5b8135613bef81615f4e565b6000806040838503121561545f57600080fd5b823561546a81615f4e565b915061547860208401615418565b90509250929050565b6000806040838503121561549457600080fd5b823561549f81615f4e565b915060208301356154af81615f4e565b809150509250929050565b600080606083850312156154cd57600080fd5b82356154d881615f4e565b91506154788460208501615242565b600080600080606085870312156154fd57600080fd5b843561550881615f4e565b93506020850135925060408501356001600160401b038082111561552b57600080fd5b818701915087601f83011261553f57600080fd5b81358181111561554e57600080fd5b88602082850101111561556057600080fd5b95989497505060200194505050565b60006040828403121561558157600080fd5b613bef8383615242565b60006040828403121561559d57600080fd5b613bef8383615253565b6000602082840312156155b957600080fd5b8151613bef81615f63565b6000602082840312156155d657600080fd5b5035919050565b6000602082840312156155ef57600080fd5b5051919050565b60006020828403121561560857600080fd5b604051602081018181106001600160401b038211171561562a5761562a615f38565b604052823561563881615f63565b81529392505050565b6000808284036101c081121561565657600080fd5b6101a08082121561566657600080fd5b61566e615d36565b915061567a8686615253565b82526156898660408701615253565b60208301526080850135604083015260a0850135606083015260c085013560808301526156b860e08601615237565b60a08301526101006156cc87828801615253565b60c08401526156df876101408801615253565b60e0840152610180860135908301529092508301356001600160401b0381111561570857600080fd5b61571485828601615337565b9150509250929050565b60006020828403121561573057600080fd5b81356001600160401b0381111561574657600080fd5b820160c08185031215613bef57600080fd5b60006020828403121561576a57600080fd5b613bef826153d8565b60008060008060008086880360e081121561578d57600080fd5b615796886153d8565b96506157a4602089016153ea565b95506157b2604089016153ea565b94506157c0606089016153ea565b9350608088013592506040609f19820112156157db57600080fd5b506157e4615cec565b6157f060a089016153ea565b81526157fe60c089016153ea565b6020820152809150509295509295509295565b6000806040838503121561582457600080fd5b8235915060208301356154af81615f4e565b6000806040838503121561584957600080fd5b50508035926020909101359150565b60006020828403121561586a57600080fd5b613bef826153ea565b600080600080600060a0868803121561588b57600080fd5b615894866153fe565b94506020860151935060408601519250606086015191506158b7608087016153fe565b90509295509295909350565b600081518084526020808501945080840160005b838110156158fc5781516001600160a01b0316875295820195908201906001016158d7565b509495945050505050565b8060005b6002811015610e6b57815184526020938401939091019060010161590b565b600081518084526020808501945080840160005b838110156158fc5781518752958201959082019060010161593e565b6000815180845260005b8181101561598057602081850181015186830182015201615964565b81811115615992576000602083870101525b50601f01601f19169290920160200192915050565b6159b18183615907565b604001919050565b8681526159c96020820187615907565b6159d66060820186615907565b6159e360a0820185615907565b6159f060e0820184615907565b60609190911b6bffffffffffffffffffffffff19166101208201526101340195945050505050565b838152615a286020820184615907565b606081019190915260800192915050565b604081016114d28284615907565b602081526000613bef602083018461592a565b602081526000613bef602083018461595a565b6020815260ff8251166020820152602082015160408201526001600160a01b0360408301511660608201526000606083015160c06080840152615ab360e08401826158c3565b905060808401516001600160601b0380821660a08601528060a08701511660c086015250508091505092915050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615b3357845183529383019391830191600101615b17565b509098975050505050505050565b82815260608101613bef6020830184615907565b828152604060208201526000613c3e604083018461592a565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261431260c083018461595a565b878152866020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143ff60e083018461595a565b8781526001600160401b0387166020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143ff60e083018461595a565b60006001600160601b0380881683528087166020840152506001600160401b03851660408301526001600160a01b038416606083015260a06080830152615c9460a08301846158c3565b979650505050505050565b6000808335601e19843603018112615cb657600080fd5b8301803591506001600160401b03821115615cd057600080fd5b602001915036819003821315615ce557600080fd5b9250929050565b604080519081016001600160401b0381118282101715615d0e57615d0e615f38565b60405290565b60405160c081016001600160401b0381118282101715615d0e57615d0e615f38565b60405161012081016001600160401b0381118282101715615d0e57615d0e615f38565b60008085851115615d6957600080fd5b83861115615d7657600080fd5b5050820193919092039150565b60008219821115615d9657615d96615ee0565b500190565b60006001600160401b03808316818516808303821115615dbd57615dbd615ee0565b01949350505050565b60006001600160601b03808316818516808303821115615dbd57615dbd615ee0565b600082615df757615df7615ef6565b500490565b6000816000190483118215151615615e1657615e16615ee0565b500290565b600082821015615e2d57615e2d615ee0565b500390565b60006001600160601b0383811690831681811015615e5257615e52615ee0565b039392505050565b6001600160e01b03198135818116916004851015615e825780818660040360031b1b83161692505b505092915050565b6000600019821415615e9e57615e9e615ee0565b5060010190565b60006001600160401b0380831681811415615ec257615ec2615ee0565b6001019392505050565b600082615edb57615edb615ef6565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c0c57600080fd5b8015158114610c0c57600080fdfea164736f6c6343000806000a", + Bin: "0x60a06040523480156200001157600080fd5b506040516200615438038062006154833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615f79620001db600039600081816106150152613a860152615f796000f3fe6080604052600436106102dc5760003560e01c806379ba50971161017f578063b08c8795116100e1578063da2f26101161008a578063e72f6e3011610064578063e72f6e3014610964578063ee9d2d3814610984578063f2fde38b146109b157600080fd5b8063da2f2610146108dd578063dac83d2914610913578063dc311dd31461093357600080fd5b8063caf70c4a116100bb578063caf70c4a1461087d578063cb6317971461089d578063d98e620e146108bd57600080fd5b8063b08c87951461081d578063b2a7cac51461083d578063bec4c08c1461085d57600080fd5b80639b1c385e11610143578063a4c0ed361161011d578063a4c0ed36146107b0578063aa433aff146107d0578063aefb212f146107f057600080fd5b80639b1c385e146107435780639d40a6fd14610763578063a21a23e41461079b57600080fd5b806379ba5097146106bd5780638402595e146106d257806386fe91c7146106f25780638da5cb5b1461071257806395b55cfc1461073057600080fd5b8063330987b31161024357806365982744116101ec5780636b6feccc116101c65780636b6feccc146106375780636f64f03f1461067d57806372e9d5651461069d57600080fd5b806365982744146105c357806366316d8d146105e3578063689c45171461060357600080fd5b806341af6c871161021d57806341af6c871461055e5780635d06b4ab1461058e57806364d51a2a146105ae57600080fd5b8063330987b3146104f3578063405b84fa1461051357806340d6bb821461053357600080fd5b80630ae09540116102a55780631b6b6d231161027f5780631b6b6d231461047f57806329492657146104b7578063294daa49146104d757600080fd5b80630ae09540146103f857806315c48b841461041857806318e3dd271461044057600080fd5b8062012291146102e157806304104edb1461030e578063043bd6ae14610330578063088070f51461035457806308821d58146103d8575b600080fd5b3480156102ed57600080fd5b506102f66109d1565b60405161030593929190615add565b60405180910390f35b34801561031a57600080fd5b5061032e61032936600461542a565b610a4d565b005b34801561033c57600080fd5b5061034660115481565b604051908152602001610305565b34801561036057600080fd5b50600d546103a09061ffff81169063ffffffff62010000820481169160ff600160301b820416916701000000000000008204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a001610305565b3480156103e457600080fd5b5061032e6103f336600461556a565b610c0f565b34801561040457600080fd5b5061032e61041336600461580c565b610da3565b34801561042457600080fd5b5061042d60c881565b60405161ffff9091168152602001610305565b34801561044c57600080fd5b50600a5461046790600160601b90046001600160601b031681565b6040516001600160601b039091168152602001610305565b34801561048b57600080fd5b5060025461049f906001600160a01b031681565b6040516001600160a01b039091168152602001610305565b3480156104c357600080fd5b5061032e6104d2366004615447565b610e71565b3480156104e357600080fd5b5060405160018152602001610305565b3480156104ff57600080fd5b5061046761050e36600461563c565b610fee565b34801561051f57600080fd5b5061032e61052e36600461580c565b6114d8565b34801561053f57600080fd5b506105496101f481565b60405163ffffffff9091168152602001610305565b34801561056a57600080fd5b5061057e6105793660046155bf565b6118ff565b6040519015158152602001610305565b34801561059a57600080fd5b5061032e6105a936600461542a565b611b00565b3480156105ba57600080fd5b5061042d606481565b3480156105cf57600080fd5b5061032e6105de36600461547c565b611bbe565b3480156105ef57600080fd5b5061032e6105fe366004615447565b611c1e565b34801561060f57600080fd5b5061049f7f000000000000000000000000000000000000000000000000000000000000000081565b34801561064357600080fd5b506012546106609063ffffffff8082169164010000000090041682565b6040805163ffffffff938416815292909116602083015201610305565b34801561068957600080fd5b5061032e6106983660046154b5565b611de6565b3480156106a957600080fd5b5060035461049f906001600160a01b031681565b3480156106c957600080fd5b5061032e611ee5565b3480156106de57600080fd5b5061032e6106ed36600461542a565b611f96565b3480156106fe57600080fd5b50600a54610467906001600160601b031681565b34801561071e57600080fd5b506000546001600160a01b031661049f565b61032e61073e3660046155bf565b6120b1565b34801561074f57600080fd5b5061034661075e366004615719565b6121f8565b34801561076f57600080fd5b50600754610783906001600160401b031681565b6040516001600160401b039091168152602001610305565b3480156107a757600080fd5b506103466125ed565b3480156107bc57600080fd5b5061032e6107cb3660046154e2565b61283d565b3480156107dc57600080fd5b5061032e6107eb3660046155bf565b6129dd565b3480156107fc57600080fd5b5061081061080b366004615831565b612a3d565b6040516103059190615a42565b34801561082957600080fd5b5061032e61083836600461576e565b612b3e565b34801561084957600080fd5b5061032e6108583660046155bf565b612cd2565b34801561086957600080fd5b5061032e61087836600461580c565b612e00565b34801561088957600080fd5b50610346610898366004615586565b612f9c565b3480156108a957600080fd5b5061032e6108b836600461580c565b612fcc565b3480156108c957600080fd5b506103466108d83660046155bf565b6132cf565b3480156108e957600080fd5b5061049f6108f83660046155bf565b600e602052600090815260409020546001600160a01b031681565b34801561091f57600080fd5b5061032e61092e36600461580c565b6132f0565b34801561093f57600080fd5b5061095361094e3660046155bf565b61340f565b604051610305959493929190615c45565b34801561097057600080fd5b5061032e61097f36600461542a565b61350a565b34801561099057600080fd5b5061034661099f3660046155bf565b60106020526000908152604090205481565b3480156109bd57600080fd5b5061032e6109cc36600461542a565b6136f2565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff16939192839190830182828015610a3b57602002820191906000526020600020905b815481526020019060010190808311610a27575b50505050509050925092509250909192565b610a55613703565b60135460005b81811015610be257826001600160a01b031660138281548110610a8057610a80615f1d565b6000918252602090912001546001600160a01b03161415610bd0576013610aa8600184615e16565b81548110610ab857610ab8615f1d565b600091825260209091200154601380546001600160a01b039092169183908110610ae457610ae4615f1d565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055826013610b1b600185615e16565b81548110610b2b57610b2b615f1d565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506013805480610b6a57610b6a615f07565b6000828152602090819020600019908301810180546001600160a01b03191690559091019091556040516001600160a01b03851681527ff80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af37910160405180910390a1505050565b80610bda81615e85565b915050610a5b565b50604051635428d44960e01b81526001600160a01b03831660048201526024015b60405180910390fd5b50565b610c17613703565b604080518082018252600091610c46919084906002908390839080828437600092019190915250612f9c915050565b6000818152600e60205260409020549091506001600160a01b031680610c8257604051631dfd6e1360e21b815260048101839052602401610c03565b6000828152600e6020526040812080546001600160a01b03191690555b600f54811015610d5a5782600f8281548110610cbd57610cbd615f1d565b90600052602060002001541415610d4857600f805460009190610ce290600190615e16565b81548110610cf257610cf2615f1d565b9060005260206000200154905080600f8381548110610d1357610d13615f1d565b600091825260209091200155600f805480610d3057610d30615f07565b60019003818190600052602060002001600090559055505b80610d5281615e85565b915050610c9f565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610d9691815260200190565b60405180910390a2505050565b60008281526005602052604090205482906001600160a01b031680610ddb57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614610e0f57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615610e3a5760405163769dd35360e11b815260040160405180910390fd5b610e43846118ff565b15610e6157604051631685ecdd60e31b815260040160405180910390fd5b610e6b848461375f565b50505050565b600d54600160301b900460ff1615610e9c5760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610ed857604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610f009084906001600160601b0316615e2d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610f489190615e2d565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610fc2576040519150601f19603f3d011682016040523d82523d6000602084013e610fc7565b606091505b5050905080610fe95760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff161561101c5760405163769dd35360e11b815260040160405180910390fd5b60005a9050600061102d858561391b565b90506000846060015163ffffffff166001600160401b0381111561105357611053615f33565b60405190808252806020026020018201604052801561107c578160200160208202803683370190505b50905060005b856060015163ffffffff168110156110fc578260400151816040516020016110b4929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c8282815181106110df576110df615f1d565b6020908102919091010152806110f481615e85565b915050611082565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b9161113491908690602401615b50565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805466ff0000000000001916600160301b17905590880151608089015191925060009161119c9163ffffffff169084613ba8565b600d805466ff00000000000019169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b03166111df816001615d96565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a0151805161122c90600190615e16565b8151811061123c5761123c615f1d565b602091010151600d5460f89190911c600114915060009061126d908a90600160581b900463ffffffff163a85613bf6565b90508115611376576020808c01516000908152600690915260409020546001600160601b03808316600160601b9092041610156112bd57604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c906112f4908490600160601b90046001600160601b0316615e2d565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c90915281208054859450909261134d91859116615dc1565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550611462565b6020808c01516000908152600690915260409020546001600160601b03808316911610156113b757604051631e9acf1760e31b815260040160405180910390fd5b6020808c0151600090815260069091526040812080548392906113e49084906001600160601b0316615e2d565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b90915281208054859450909261143d91859116615dc1565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a6040015184886040516114bf939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff16156115035760405163769dd35360e11b815260040160405180910390fd5b61150c81613c46565b61153457604051635428d44960e01b81526001600160a01b0382166004820152602401610c03565b6000806000806115438661340f565b945094505093509350336001600160a01b0316826001600160a01b0316146115ad5760405162461bcd60e51b815260206004820152601660248201527f4e6f7420737562736372697074696f6e206f776e6572000000000000000000006044820152606401610c03565b6115b6866118ff565b156116035760405162461bcd60e51b815260206004820152601660248201527f50656e64696e67207265717565737420657869737473000000000000000000006044820152606401610c03565b60006040518060c00160405280611618600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b0316815250905060008160405160200161166c9190615a68565b604051602081830303815290604052905061168688613cb0565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b038816906116bf908590600401615a55565b6000604051808303818588803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611715905057506001600160601b03861615155b156117f45760025460405163a9059cbb60e01b81526001600160a01b0389811660048301526001600160601b03891660248301529091169063a9059cbb90604401602060405180830381600087803b15801561177057600080fd5b505af1158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a891906155a2565b6117f45760405162461bcd60e51b815260206004820152601260248201527f696e73756666696369656e742066756e647300000000000000000000000000006044820152606401610c03565b600d805466ff0000000000001916600160301b17905560005b83518110156118a25783818151811061182857611828615f1d565b6020908102919091010151604051638ea9811760e01b81526001600160a01b038a8116600483015290911690638ea9811790602401600060405180830381600087803b15801561187757600080fd5b505af115801561188b573d6000803e3d6000fd5b50505050808061189a90615e85565b91505061180d565b50600d805466ff00000000000019169055604080516001600160a01b0389168152602081018a90527fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187910160405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561198957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161196b575b505050505081525050905060005b816040015151811015611af65760005b600f54811015611ae3576000611aac600f83815481106119c9576119c9615f1d565b9060005260206000200154856040015185815181106119ea576119ea615f1d565b6020026020010151886004600089604001518981518110611a0d57611a0d615f1d565b6020908102919091018101516001600160a01b03908116835282820193909352604091820160009081208e82528252829020548251808301889052959093168583015260608501939093526001600160401b039091166080808501919091528151808503909101815260a08401825280519083012060c084019490945260e0808401859052815180850390910181526101009093019052815191012091565b5060008181526010602052604090205490915015611ad05750600195945050505050565b5080611adb81615e85565b9150506119a7565b5080611aee81615e85565b915050611997565b5060009392505050565b611b08613703565b611b1181613c46565b15611b3a5760405163ac8a27ef60e01b81526001600160a01b0382166004820152602401610c03565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af016259060200160405180910390a150565b611bc6613703565b6002546001600160a01b031615611bf057604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff1615611c495760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b0316611c725760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b0380831691161015611cae57604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b602052604081208054839290611cd69084906001600160601b0316615e2d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b0316611d1e9190615e2d565b82546101009290920a6001600160601b0381810219909316918316021790915560025460405163a9059cbb60e01b81526001600160a01b03868116600483015292851660248201529116915063a9059cbb90604401602060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc591906155a2565b611de257604051631e9acf1760e31b815260040160405180910390fd5b5050565b611dee613703565b604080518082018252600091611e1d919084906002908390839080828437600092019190915250612f9c915050565b6000818152600e60205260409020549091506001600160a01b031615611e5957604051634a0b8fa760e01b815260048101829052602401610c03565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610d96565b6001546001600160a01b03163314611f3f5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610c03565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611f9e613703565b600a544790600160601b90046001600160601b031681811115611fde576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015610fe9576000611ff28284615e16565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114612041576040519150601f19603f3d011682016040523d82523d6000602084013e612046565b606091505b50509050806120685760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b0387168152602081018490527f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c910160405180910390a15050505050565b600d54600160301b900460ff16156120dc5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661211157604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c6121408385615dc1565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b03166121889190615dc1565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e9028234846121db9190615d7e565b604080519283526020830191909152015b60405180910390a25050565b600d54600090600160301b900460ff16156122265760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b031661226157604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b0316806122b2576040516379bfd40160e01b815260208401356004820152336024820152604401610c03565b600d5461ffff166122c96060850160408601615753565b61ffff1610806122ec575060c86122e66060850160408601615753565b61ffff16115b15612332576123016060840160408501615753565b600d5460405163539c34bb60e11b815261ffff92831660048201529116602482015260c86044820152606401610c03565b600d5462010000900463ffffffff166123516080850160608601615853565b63ffffffff1611156123a15761236d6080840160608501615853565b600d54604051637aebf00f60e11b815263ffffffff9283166004820152620100009091049091166024820152604401610c03565b6101f46123b460a0850160808601615853565b63ffffffff1611156123fa576123d060a0840160808501615853565b6040516311ce1afb60e21b815263ffffffff90911660048201526101f46024820152604401610c03565b6000612407826001615d96565b604080518635602080830182905233838501528089013560608401526001600160401b0385166080808501919091528451808503909101815260a0808501865281519183019190912060c085019390935260e0808501849052855180860390910181526101009094019094528251920191909120929350906000906124979061249290890189615c9a565b613eff565b905060006124a482613f7c565b9050836124af613fed565b60208a01356124c460808c0160608d01615853565b6124d460a08d0160808e01615853565b33866040516020016124ec9796959493929190615ba8565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d60400160208101906125639190615753565b8e60600160208101906125769190615853565b8f60800160208101906125899190615853565b8960405161259c96959493929190615b69565b60405180910390a450503360009081526004602090815260408083208983013584529091529020805467ffffffffffffffff19166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561261b5760405163769dd35360e11b815260040160405180910390fd5b600033612629600143615e16565b600754604051606093841b6bffffffffffffffffffffffff199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006126a883615ea0565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b038111156126e7576126e7615f33565b604051908082528060200260200182016040528015612710578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b0392831617835592516001830180549094169116179091559251805194955090936127f19260028501920190615140565b506128019150600890508361407d565b5060405133815282907f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d9060200160405180910390a250905090565b600d54600160301b900460ff16156128685760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03163314612893576040516344b0e3c360e01b815260040160405180910390fd5b602081146128b457604051638129bbcd60e01b815260040160405180910390fd5b60006128c2828401846155bf565b6000818152600560205260409020549091506001600160a01b03166128fa57604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b0316918691906129218385615dc1565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166129699190615dc1565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846129bc9190615d7e565b604080519283526020830191909152015b60405180910390a2505050505050565b6129e5613703565b6000818152600560205260409020546001600160a01b0316612a1a57604051630fb532db60e11b815260040160405180910390fd5b600081815260056020526040902054610c0c9082906001600160a01b031661375f565b60606000612a4b6008614089565b9050808410612a6d57604051631390f2a160e01b815260040160405180910390fd5b6000612a798486615d7e565b905081811180612a87575083155b612a915780612a93565b815b90506000612aa18683615e16565b6001600160401b03811115612ab857612ab8615f33565b604051908082528060200260200182016040528015612ae1578160200160208202803683370190505b50905060005b8151811015612b3457612b05612afd8883615d7e565b600890614093565b828281518110612b1757612b17615f1d565b602090810291909101015280612b2c81615e85565b915050612ae7565b5095945050505050565b612b46613703565b60c861ffff87161115612b805760405163539c34bb60e11b815261ffff871660048201819052602482015260c86044820152606401610c03565b60008213612ba4576040516321ea67b360e11b815260048101839052602401610c03565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff19168817620100008702176effffffffffffffffff000000000000191667010000000000000085026effffffff0000000000000000000000191617600160581b83021790558a51601280548d87015192891667ffffffffffffffff199091161764010000000092891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff1615612cfd5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316612d3257604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612d8b576000818152600560205260409081902060010154905163d084e97560e01b81526001600160a01b039091166004820152602401610c03565b6000818152600560209081526040918290208054336001600160a01b0319808316821784556001909301805490931690925583516001600160a01b0390911680825292810191909152909183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691016121ec565b60008281526005602052604090205482906001600160a01b031680612e3857604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612e6c57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615612e975760405163769dd35360e11b815260040160405180910390fd5b60008481526005602052604090206002015460641415612eca576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b031615612f0157610e6b565b6001600160a01b03831660008181526004602090815260408083208884528252808320805467ffffffffffffffff19166001908117909155600583528184206002018054918201815584529282902090920180546001600160a01b03191684179055905191825285917f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e191015b60405180910390a250505050565b600081604051602001612faf9190615a34565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b03168061300457604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461303857604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156130635760405163769dd35360e11b815260040160405180910390fd5b61306c846118ff565b1561308a57604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b03166130e6576040516379bfd40160e01b8152600481018590526001600160a01b0384166024820152604401610c03565b60008481526005602090815260408083206002018054825181850281018501909352808352919290919083018282801561314957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161312b575b505050505090506000600182516131609190615e16565b905060005b825181101561326c57856001600160a01b031683828151811061318a5761318a615f1d565b60200260200101516001600160a01b0316141561325a5760008383815181106131b5576131b5615f1d565b6020026020010151905080600560008a815260200190815260200160002060020183815481106131e7576131e7615f1d565b600091825260208083209190910180546001600160a01b0319166001600160a01b03949094169390931790925589815260059091526040902060020180548061323257613232615f07565b600082815260209020810160001990810180546001600160a01b03191690550190555061326c565b8061326481615e85565b915050613165565b506001600160a01b03851660008181526004602090815260408083208a8452825291829020805467ffffffffffffffff19169055905191825287917f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a791016129cd565b600f81815481106132df57600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061332857604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461335c57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156133875760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b03848116911614610e6b5760008481526005602090815260409182902060010180546001600160a01b0319166001600160a01b03871690811790915582513381529182015285917f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19101612f8e565b6000818152600560205260408120548190819081906060906001600160a01b031661344d57604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156134f057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116134d2575b505050505090509450945094509450945091939590929450565b613512613703565b6002546001600160a01b031661353b5760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561357f57600080fd5b505afa158015613593573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135b791906155d8565b600a549091506001600160601b0316818111156135f1576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015610fe95760006136058284615e16565b60025460405163a9059cbb60e01b81526001600160a01b0387811660048301526024820184905292935091169063a9059cbb90604401602060405180830381600087803b15801561365557600080fd5b505af1158015613669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061368d91906155a2565b6136aa57604051631f01ff1360e21b815260040160405180910390fd5b604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a150505050565b6136fa613703565b610c0c8161409f565b6000546001600160a01b0316331461375d5760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c03565b565b60008061376b84613cb0565b60025491935091506001600160a01b03161580159061379257506001600160601b03821615155b156138425760025460405163a9059cbb60e01b81526001600160a01b0385811660048301526001600160601b03851660248301529091169063a9059cbb90604401602060405180830381600087803b1580156137ed57600080fd5b505af1158015613801573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382591906155a2565b61384257604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613898576040519150601f19603f3d011682016040523d82523d6000602084013e61389d565b606091505b50509050806138bf5760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006139478460000151612f9c565b6000818152600e60205260409020549091506001600160a01b03168061398357604051631dfd6e1360e21b815260048101839052602401610c03565b60008286608001516040516020016139a5929190918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526010909352912054909150806139eb57604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613a1a978a979096959101615bf2565b604051602081830303815290604052805190602001208114613a4f5760405163354a450b60e21b815260040160405180910390fd5b6000613a5e8760000151614149565b905080613b36578651604051631d2827a760e31b81526001600160401b0390911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b158015613ad057600080fd5b505afa158015613ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b0891906155d8565b905080613b3657865160405163175dadad60e01b81526001600160401b039091166004820152602401610c03565b6000886080015182604051602001613b58929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506000613b7f8a8361422a565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a611388811015613bba57600080fd5b611388810390508460408204820311613bd257600080fd5b50823b613bde57600080fd5b60008083516020850160008789f190505b9392505050565b60008115613c2457601254613c1d9086908690640100000000900463ffffffff1686614295565b9050613c3e565b601254613c3b908690869063ffffffff16866142ff565b90505b949350505050565b6000805b601354811015613ca757826001600160a01b031660138281548110613c7157613c71615f1d565b6000918252602090912001546001600160a01b03161415613c955750600192915050565b80613c9f81615e85565b915050613c4a565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287968796949594860193919290830182828015613d3c57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613d1e575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613e19576004600084604001518381518110613dc857613dc8615f1d565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208982529092529020805467ffffffffffffffff1916905580613e1181615e85565b915050613da1565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613e5160028301826151a5565b5050600085815260066020526040812055613e6d6008866143ed565b50600a8054859190600090613e8c9084906001600160601b0316615e2d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613ed49190615e2d565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081019091526000815281613f2857506040805160208101909152600081526114d2565b63125fa26760e31b613f3a8385615e55565b6001600160e01b03191614613f6257604051632923fee760e11b815260040160405180910390fd5b613f6f8260048186615d54565b810190613bef91906155f1565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613fb591511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b600046613ff9816143f9565b156140765760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561403857600080fd5b505afa15801561404c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061407091906155d8565b91505090565b4391505090565b6000613bef838361441c565b60006114d2825490565b6000613bef838361446b565b6001600160a01b0381163314156140f85760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c03565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600046614155816143f9565b1561421b57610100836001600160401b031661416f613fed565b6141799190615e16565b11806141955750614188613fed565b836001600160401b031610155b156141a35750600092915050565b6040516315a03d4160e11b81526001600160401b0384166004820152606490632b407a829060240160206040518083038186803b1580156141e357600080fd5b505afa1580156141f7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bef91906155d8565b50506001600160401b03164090565b600061425e8360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151614495565b60038360200151604051602001614276929190615b3c565b60408051601f1981840301815291905280516020909101209392505050565b6000806142a06146c0565b905060005a6142af8888615d7e565b6142b99190615e16565b6142c39085615df7565b905060006142dc63ffffffff871664e8d4a51000615df7565b9050826142e98284615d7e565b6142f39190615d7e565b98975050505050505050565b60008061430a614713565b905060008113614330576040516321ea67b360e11b815260048101829052602401610c03565b600061433a6146c0565b9050600082825a61434b8b8b615d7e565b6143559190615e16565b61435f9088615df7565b6143699190615d7e565b61437b90670de0b6b3a7640000615df7565b6143859190615de3565b9050600061439e63ffffffff881664e8d4a51000615df7565b90506143b6816b033b2e3c9fd0803ce8000000615e16565b8211156143d65760405163e80fa38160e01b815260040160405180910390fd5b6143e08183615d7e565b9998505050505050505050565b6000613bef83836147e2565b600061a4b182148061440d575062066eed82145b806114d257505062066eee1490565b6000818152600183016020526040812054614463575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556114d2565b5060006114d2565b600082600001828154811061448257614482615f1d565b9060005260206000200154905092915050565b61449e896148d5565b6144ea5760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e2063757276650000000000006044820152606401610c03565b6144f3886148d5565b61453f5760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e20637572766500000000000000000000006044820152606401610c03565b614548836148d5565b6145945760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e2063757276650000006044820152606401610c03565b61459d826148d5565b6145e95760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e206375727665000000006044820152606401610c03565b6145f5878a88876149ae565b6146415760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e657373000000000000006044820152606401610c03565b600061464d8a87614ad1565b90506000614660898b878b868989614b35565b90506000614671838d8d8a86614c55565b9050808a146146b25760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610c03565b505050505050505050505050565b6000466146cc816143f9565b1561470b57606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561403857600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093670100000000000000900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561477557600080fd5b505afa158015614789573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147ad919061586e565b5094509092508491505080156147d157506147c88242615e16565b8463ffffffff16105b15613c3e5750601154949350505050565b600081815260018301602052604081205480156148cb576000614806600183615e16565b855490915060009061481a90600190615e16565b905081811461487f57600086600001828154811061483a5761483a615f1d565b906000526020600020015490508087600001848154811061485d5761485d615f1d565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061489057614890615f07565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506114d2565b60009150506114d2565b80516000906401000003d0191161492e5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d019116149875760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d0199080096149a78360005b6020020151614c95565b1492915050565b60006001600160a01b0382166149f45760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b6044820152606401610c03565b602084015160009060011615614a0b57601c614a0e565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614aa9573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614ad96151c3565b614b0660018484604051602001614af293929190615a13565b604051602081830303815290604052614cb9565b90505b614b12816148d5565b6114d2578051604080516020810192909252614b2e9101614af2565b9050614b09565b614b3d6151c3565b825186516401000003d0199081900691061415614b9c5760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e637400006044820152606401610c03565b614ba7878988614d07565b614bf35760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c6564000000000000000000006044820152606401610c03565b614bfe848685614d07565b614c4a5760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c65640000000000000000006044820152606401610c03565b6142f3868484614e2f565b600060028686868587604051602001614c73969594939291906159b4565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614cc16151c3565b614cca82614ef6565b8152614cdf614cda82600061499d565b614f31565b6020820181905260029006600114156125e8576020810180516401000003d019039052919050565b600082614d445760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b6044820152606401610c03565b83516020850151600090614d5a90600290615ec7565b15614d6657601c614d69565b601b5b9050600070014551231950b75fc4402da1732fc9bebe198387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa158015614ddb573d6000803e3d6000fd5b505050602060405103519050600086604051602001614dfa91906159a2565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614e376151c3565b835160208086015185519186015160009384938493614e5893909190614f51565b919450925090506401000003d019858209600114614eb85760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a000000000000006044820152606401610c03565b60405180604001604052806401000003d01980614ed757614ed7615ef1565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d01981106125e857604080516020808201939093528151808203840181529082019091528051910120614efe565b60006114d2826002614f4a6401000003d0196001615d7e565b901c615031565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614f91838385856150d3565b9098509050614fa288828e886150f7565b9098509050614fb388828c876150f7565b90985090506000614fc68d878b856150f7565b9098509050614fd7888286866150d3565b9098509050614fe888828e896150f7565b909850905081811461501d576401000003d019818a0998506401000003d01982890997506401000003d0198183099650615021565b8196505b5050505050509450945094915050565b60008061503c6151e1565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a082015261506e6151ff565b60208160c0846005600019fa9250826150c95760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c7572652100000000000000000000000000006044820152606401610c03565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215615195579160200282015b8281111561519557825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615160565b506151a192915061521d565b5090565b5080546000825590600052602060002090810190610c0c919061521d565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b808211156151a1576000815560010161521e565b80356125e881615f49565b80604081018310156114d257600080fd5b600082601f83011261525f57600080fd5b615267615ce7565b80838560408601111561527957600080fd5b60005b600281101561529b57813584526020938401939091019060010161527c565b509095945050505050565b600082601f8301126152b757600080fd5b81356001600160401b03808211156152d1576152d1615f33565b604051601f8301601f19908116603f011681019082821181831017156152f9576152f9615f33565b8160405283815286602085880101111561531257600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060c0828403121561534457600080fd5b61534c615d0f565b905081356001600160401b03808216821461536657600080fd5b8183526020840135602084015261537f604085016153e5565b6040840152615390606085016153e5565b60608401526153a160808501615232565b608084015260a08401359150808211156153ba57600080fd5b506153c7848285016152a6565b60a08301525092915050565b803561ffff811681146125e857600080fd5b803563ffffffff811681146125e857600080fd5b805169ffffffffffffffffffff811681146125e857600080fd5b80356001600160601b03811681146125e857600080fd5b60006020828403121561543c57600080fd5b8135613bef81615f49565b6000806040838503121561545a57600080fd5b823561546581615f49565b915061547360208401615413565b90509250929050565b6000806040838503121561548f57600080fd5b823561549a81615f49565b915060208301356154aa81615f49565b809150509250929050565b600080606083850312156154c857600080fd5b82356154d381615f49565b9150615473846020850161523d565b600080600080606085870312156154f857600080fd5b843561550381615f49565b93506020850135925060408501356001600160401b038082111561552657600080fd5b818701915087601f83011261553a57600080fd5b81358181111561554957600080fd5b88602082850101111561555b57600080fd5b95989497505060200194505050565b60006040828403121561557c57600080fd5b613bef838361523d565b60006040828403121561559857600080fd5b613bef838361524e565b6000602082840312156155b457600080fd5b8151613bef81615f5e565b6000602082840312156155d157600080fd5b5035919050565b6000602082840312156155ea57600080fd5b5051919050565b60006020828403121561560357600080fd5b604051602081018181106001600160401b038211171561562557615625615f33565b604052823561563381615f5e565b81529392505050565b6000808284036101c081121561565157600080fd5b6101a08082121561566157600080fd5b615669615d31565b9150615675868661524e565b8252615684866040870161524e565b60208301526080850135604083015260a0850135606083015260c085013560808301526156b360e08601615232565b60a08301526101006156c78782880161524e565b60c08401526156da87610140880161524e565b60e0840152610180860135908301529092508301356001600160401b0381111561570357600080fd5b61570f85828601615332565b9150509250929050565b60006020828403121561572b57600080fd5b81356001600160401b0381111561574157600080fd5b820160c08185031215613bef57600080fd5b60006020828403121561576557600080fd5b613bef826153d3565b60008060008060008086880360e081121561578857600080fd5b615791886153d3565b965061579f602089016153e5565b95506157ad604089016153e5565b94506157bb606089016153e5565b9350608088013592506040609f19820112156157d657600080fd5b506157df615ce7565b6157eb60a089016153e5565b81526157f960c089016153e5565b6020820152809150509295509295509295565b6000806040838503121561581f57600080fd5b8235915060208301356154aa81615f49565b6000806040838503121561584457600080fd5b50508035926020909101359150565b60006020828403121561586557600080fd5b613bef826153e5565b600080600080600060a0868803121561588657600080fd5b61588f866153f9565b94506020860151935060408601519250606086015191506158b2608087016153f9565b90509295509295909350565b600081518084526020808501945080840160005b838110156158f75781516001600160a01b0316875295820195908201906001016158d2565b509495945050505050565b8060005b6002811015610e6b578151845260209384019390910190600101615906565b600081518084526020808501945080840160005b838110156158f757815187529582019590820190600101615939565b6000815180845260005b8181101561597b5760208185018101518683018201520161595f565b8181111561598d576000602083870101525b50601f01601f19169290920160200192915050565b6159ac8183615902565b604001919050565b8681526159c46020820187615902565b6159d16060820186615902565b6159de60a0820185615902565b6159eb60e0820184615902565b60609190911b6bffffffffffffffffffffffff19166101208201526101340195945050505050565b838152615a236020820184615902565b606081019190915260800192915050565b604081016114d28284615902565b602081526000613bef6020830184615925565b602081526000613bef6020830184615955565b6020815260ff8251166020820152602082015160408201526001600160a01b0360408301511660608201526000606083015160c06080840152615aae60e08401826158be565b905060808401516001600160601b0380821660a08601528060a08701511660c086015250508091505092915050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615b2e57845183529383019391830191600101615b12565b509098975050505050505050565b82815260608101613bef6020830184615902565b828152604060208201526000613c3e6040830184615925565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a08301526142f360c0830184615955565b878152866020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143e060e0830184615955565b8781526001600160401b0387166020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143e060e0830184615955565b60006001600160601b0380881683528087166020840152506001600160401b03851660408301526001600160a01b038416606083015260a06080830152615c8f60a08301846158be565b979650505050505050565b6000808335601e19843603018112615cb157600080fd5b8301803591506001600160401b03821115615ccb57600080fd5b602001915036819003821315615ce057600080fd5b9250929050565b604080519081016001600160401b0381118282101715615d0957615d09615f33565b60405290565b60405160c081016001600160401b0381118282101715615d0957615d09615f33565b60405161012081016001600160401b0381118282101715615d0957615d09615f33565b60008085851115615d6457600080fd5b83861115615d7157600080fd5b5050820193919092039150565b60008219821115615d9157615d91615edb565b500190565b60006001600160401b03808316818516808303821115615db857615db8615edb565b01949350505050565b60006001600160601b03808316818516808303821115615db857615db8615edb565b600082615df257615df2615ef1565b500490565b6000816000190483118215151615615e1157615e11615edb565b500290565b600082821015615e2857615e28615edb565b500390565b60006001600160601b0383811690831681811015615e4d57615e4d615edb565b039392505050565b6001600160e01b03198135818116916004851015615e7d5780818660040360031b1b83161692505b505092915050565b6000600019821415615e9957615e99615edb565b5060010190565b60006001600160401b0380831681811415615ebd57615ebd615edb565b6001019392505050565b600082615ed657615ed6615ef1565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c0c57600080fd5b8015158114610c0c57600080fdfea164736f6c6343000806000a", } var VRFCoordinatorV25ABI = VRFCoordinatorV25MetaData.ABI diff --git a/core/gethwrappers/generated/vrf_load_test_with_metrics/vrf_load_test_with_metrics.go b/core/gethwrappers/generated/vrf_load_test_with_metrics/vrf_load_test_with_metrics.go index eb11e58ceb2..93d50b72dd5 100644 --- a/core/gethwrappers/generated/vrf_load_test_with_metrics/vrf_load_test_with_metrics.go +++ b/core/gethwrappers/generated/vrf_load_test_with_metrics/vrf_load_test_with_metrics.go @@ -32,7 +32,7 @@ var ( var VRFV2LoadTestWithMetricsMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractVRFCoordinatorV2Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subId\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60c0604052600060045560006005556103e760065534801561002057600080fd5b506040516110f33803806110f383398101604081905261003f91610199565b6001600160601b0319606082901b1660805233806000816100a75760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100d7576100d7816100ef565b50505060601b6001600160601b03191660a0526101c9565b6001600160a01b0381163314156101485760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161009e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156101ab57600080fd5b81516001600160a01b03811681146101c257600080fd5b9392505050565b60805160601c60a05160601c610ef16102026000396000818161014301526103da0152600081816102b7015261031f0152610ef16000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806379ba509711610097578063d826f88f11610066578063d826f88f1461023f578063d8a4676f1461025e578063dc1670db14610283578063f2fde38b1461028c57600080fd5b806379ba5097146101a55780638da5cb5b146101ad578063a168fa89146101cb578063b1e217491461023657600080fd5b80633b2bcbf1116100d35780633b2bcbf11461013e578063557d2e921461018a578063737144bc1461019357806374dba1241461019c57600080fd5b80631757f11c146100fa5780631fe543e314610116578063271095ef1461012b575b600080fd5b61010360055481565b6040519081526020015b60405180910390f35b610129610124366004610bad565b61029f565b005b610129610139366004610c9c565b61035f565b6101657f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010d565b61010360035481565b61010360045481565b61010360065481565b610129610577565b60005473ffffffffffffffffffffffffffffffffffffffff16610165565b61020c6101d9366004610b7b565b6009602052600090815260409020805460028201546003830154600484015460059094015460ff90931693919290919085565b6040805195151586526020860194909452928401919091526060830152608082015260a00161010d565b61010360075481565b6101296000600481905560058190556103e76006556003819055600255565b61027161026c366004610b7b565b610674565b60405161010d96959493929190610d18565b61010360025481565b61012961029a366004610b3e565b610759565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610351576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b61035b828261076d565b5050565b610367610894565b60005b8161ffff168161ffff16101561056e576040517f5d3b1d300000000000000000000000000000000000000000000000000000000081526004810186905267ffffffffffffffff8816602482015261ffff8716604482015263ffffffff8086166064830152841660848201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690635d3b1d309060a401602060405180830381600087803b15801561043357600080fd5b505af1158015610447573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046b9190610b94565b60078190559050600061047c610917565b6040805160c08101825260008082528251818152602080820185528084019182524284860152606084018390526080840186905260a084018390528783526009815293909120825181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016901515178155905180519495509193909261050a926001850192910190610ab3565b506040820151600282015560608201516003808301919091556080830151600483015560a090920151600590910155805490600061054783610e4d565b9091555050600091825260086020526040909120558061056681610e2b565b91505061036a565b50505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610348565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000818152600960209081526040808320815160c081018352815460ff16151581526001820180548451818702810187019095528085526060958795869586958695869591949293858401939092908301828280156106f257602002820191906000526020600020905b8154815260200190600101908083116106de575b505050505081526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050806000015181602001518260400151836060015184608001518560a001519650965096509650965096505091939550919395565b610761610894565b61076a816109bd565b50565b6000610777610917565b600084815260086020526040812054919250906107949083610e14565b905060006107a582620f4240610dd7565b90506005548211156107b75760058290555b60065482106107c8576006546107ca565b815b6006556002546107da578061080d565b6002546107e8906001610d84565b816002546004546107f99190610dd7565b6108039190610d84565b61080d9190610d9c565b600455600085815260096020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081178255865161085f939290910191870190610ab3565b506000858152600960205260408120426003820155600501849055600280549161088883610e4d565b91905055505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610348565b565b60004661a4b181148061092c575062066eed81145b156109b657606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561097857600080fd5b505afa15801561098c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b09190610b94565b91505090565b4391505090565b73ffffffffffffffffffffffffffffffffffffffff8116331415610a3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610348565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610aee579160200282015b82811115610aee578251825591602001919060010190610ad3565b50610afa929150610afe565b5090565b5b80821115610afa5760008155600101610aff565b803561ffff81168114610b2557600080fd5b919050565b803563ffffffff81168114610b2557600080fd5b600060208284031215610b5057600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610b7457600080fd5b9392505050565b600060208284031215610b8d57600080fd5b5035919050565b600060208284031215610ba657600080fd5b5051919050565b60008060408385031215610bc057600080fd5b8235915060208084013567ffffffffffffffff80821115610be057600080fd5b818601915086601f830112610bf457600080fd5b813581811115610c0657610c06610eb5565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610c4957610c49610eb5565b604052828152858101935084860182860187018b1015610c6857600080fd5b600095505b83861015610c8b578035855260019590950194938601938601610c6d565b508096505050505050509250929050565b60008060008060008060c08789031215610cb557600080fd5b863567ffffffffffffffff81168114610ccd57600080fd5b9550610cdb60208801610b13565b945060408701359350610cf060608801610b2a565b9250610cfe60808801610b2a565b9150610d0c60a08801610b13565b90509295509295509295565b600060c082018815158352602060c08185015281895180845260e086019150828b01935060005b81811015610d5b57845183529383019391830191600101610d3f565b505060408501989098525050506060810193909352608083019190915260a09091015292915050565b60008219821115610d9757610d97610e86565b500190565b600082610dd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610e0f57610e0f610e86565b500290565b600082821015610e2657610e26610e86565b500390565b600061ffff80831681811415610e4357610e43610e86565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610e7f57610e7f610e86565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x60c0604052600060045560006005556103e760065534801561002057600080fd5b5060405161111138038061111183398101604081905261003f91610199565b6001600160601b0319606082901b1660805233806000816100a75760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100d7576100d7816100ef565b50505060601b6001600160601b03191660a0526101c9565b6001600160a01b0381163314156101485760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161009e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156101ab57600080fd5b81516001600160a01b03811681146101c257600080fd5b9392505050565b60805160601c60a05160601c610f0f6102026000396000818161014301526103da0152600081816102b7015261031f0152610f0f6000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806379ba509711610097578063d826f88f11610066578063d826f88f1461023f578063d8a4676f1461025e578063dc1670db14610283578063f2fde38b1461028c57600080fd5b806379ba5097146101a55780638da5cb5b146101ad578063a168fa89146101cb578063b1e217491461023657600080fd5b80633b2bcbf1116100d35780633b2bcbf11461013e578063557d2e921461018a578063737144bc1461019357806374dba1241461019c57600080fd5b80631757f11c146100fa5780631fe543e314610116578063271095ef1461012b575b600080fd5b61010360055481565b6040519081526020015b60405180910390f35b610129610124366004610bcb565b61029f565b005b610129610139366004610cba565b61035f565b6101657f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010d565b61010360035481565b61010360045481565b61010360065481565b610129610577565b60005473ffffffffffffffffffffffffffffffffffffffff16610165565b61020c6101d9366004610b99565b6009602052600090815260409020805460028201546003830154600484015460059094015460ff90931693919290919085565b6040805195151586526020860194909452928401919091526060830152608082015260a00161010d565b61010360075481565b6101296000600481905560058190556103e76006556003819055600255565b61027161026c366004610b99565b610674565b60405161010d96959493929190610d36565b61010360025481565b61012961029a366004610b5c565b610759565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610351576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b61035b828261076d565b5050565b610367610894565b60005b8161ffff168161ffff16101561056e576040517f5d3b1d300000000000000000000000000000000000000000000000000000000081526004810186905267ffffffffffffffff8816602482015261ffff8716604482015263ffffffff8086166064830152841660848201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690635d3b1d309060a401602060405180830381600087803b15801561043357600080fd5b505af1158015610447573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046b9190610bb2565b60078190559050600061047c610917565b6040805160c08101825260008082528251818152602080820185528084019182524284860152606084018390526080840186905260a084018390528783526009815293909120825181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016901515178155905180519495509193909261050a926001850192910190610ad1565b506040820151600282015560608201516003808301919091556080830151600483015560a090920151600590910155805490600061054783610e6b565b9091555050600091825260086020526040909120558061056681610e49565b91505061036a565b50505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610348565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000818152600960209081526040808320815160c081018352815460ff16151581526001820180548451818702810187019095528085526060958795869586958695869591949293858401939092908301828280156106f257602002820191906000526020600020905b8154815260200190600101908083116106de575b505050505081526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050806000015181602001518260400151836060015184608001518560a001519650965096509650965096505091939550919395565b610761610894565b61076a816109b4565b50565b6000610777610917565b600084815260086020526040812054919250906107949083610e32565b905060006107a582620f4240610df5565b90506005548211156107b75760058290555b60065482106107c8576006546107ca565b815b6006556002546107da578061080d565b6002546107e8906001610da2565b816002546004546107f99190610df5565b6108039190610da2565b61080d9190610dba565b600455600085815260096020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081178255865161085f939290910191870190610ad1565b506000858152600960205260408120426003820155600501849055600280549161088883610e6b565b91905055505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610348565b565b60004661092381610aaa565b156109ad57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561096f57600080fd5b505afa158015610983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a79190610bb2565b91505090565b4391505090565b73ffffffffffffffffffffffffffffffffffffffff8116331415610a34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610348565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061a4b1821480610abe575062066eed82145b80610acb575062066eee82145b92915050565b828054828255906000526020600020908101928215610b0c579160200282015b82811115610b0c578251825591602001919060010190610af1565b50610b18929150610b1c565b5090565b5b80821115610b185760008155600101610b1d565b803561ffff81168114610b4357600080fd5b919050565b803563ffffffff81168114610b4357600080fd5b600060208284031215610b6e57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610b9257600080fd5b9392505050565b600060208284031215610bab57600080fd5b5035919050565b600060208284031215610bc457600080fd5b5051919050565b60008060408385031215610bde57600080fd5b8235915060208084013567ffffffffffffffff80821115610bfe57600080fd5b818601915086601f830112610c1257600080fd5b813581811115610c2457610c24610ed3565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610c6757610c67610ed3565b604052828152858101935084860182860187018b1015610c8657600080fd5b600095505b83861015610ca9578035855260019590950194938601938601610c8b565b508096505050505050509250929050565b60008060008060008060c08789031215610cd357600080fd5b863567ffffffffffffffff81168114610ceb57600080fd5b9550610cf960208801610b31565b945060408701359350610d0e60608801610b48565b9250610d1c60808801610b48565b9150610d2a60a08801610b31565b90509295509295509295565b600060c082018815158352602060c08185015281895180845260e086019150828b01935060005b81811015610d7957845183529383019391830191600101610d5d565b505060408501989098525050506060810193909352608083019190915260a09091015292915050565b60008219821115610db557610db5610ea4565b500190565b600082610df0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610e2d57610e2d610ea4565b500290565b600082821015610e4457610e44610ea4565b500390565b600061ffff80831681811415610e6157610e61610ea4565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610e9d57610e9d610ea4565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFV2LoadTestWithMetricsABI = VRFV2LoadTestWithMetricsMetaData.ABI diff --git a/core/gethwrappers/generated/vrf_owner_test_consumer/vrf_owner_test_consumer.go b/core/gethwrappers/generated/vrf_owner_test_consumer/vrf_owner_test_consumer.go index e815f5491d9..ce42ddb7d6c 100644 --- a/core/gethwrappers/generated/vrf_owner_test_consumer/vrf_owner_test_consumer.go +++ b/core/gethwrappers/generated/vrf_owner_test_consumer/vrf_owner_test_consumer.go @@ -32,7 +32,7 @@ var ( var VRFV2OwnerTestConsumerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractVRFCoordinatorV2Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a0604052600060055560006006556103e76007553480156200002157600080fd5b50604051620013ae380380620013ae8339810160408190526200004491620002bf565b6001600160601b0319606082901b166080523380600081620000ad5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000e057620000e08162000213565b5050600280546001600160a01b0319166001600160a01b0384169081179091556040805163288688f960e21b8152905191925063a21a23e49160048083019260209291908290030181600087803b1580156200013b57600080fd5b505af115801562000150573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001769190620002f1565b600280546001600160401b03928316600160a01b908102600160a01b600160e01b03198316811793849055604051631cd0704360e21b81529190930490931660048401523060248401526001600160a01b0391821691161790637341c10c90604401600060405180830381600087803b158015620001f357600080fd5b505af115801562000208573d6000803e3d6000fd5b50505050506200031c565b6001600160a01b0381163314156200026e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000a4565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620002d257600080fd5b81516001600160a01b0381168114620002ea57600080fd5b9392505050565b6000602082840312156200030457600080fd5b81516001600160401b0381168114620002ea57600080fd5b60805160601c61106c62000342600039600081816103000152610368015261106c6000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063a168fa8911610097578063d8a4676f11610066578063d8a4676f14610262578063dc1670db14610287578063eb1d28bb14610290578063f2fde38b146102d557600080fd5b8063a168fa89146101bc578063ad603ea214610227578063b1e217491461023a578063d826f88f1461024357600080fd5b8063737144bc116100d3578063737144bc1461018457806374dba1241461018d57806379ba5097146101965780638da5cb5b1461019e57600080fd5b80631757f11c146101055780631fe543e3146101215780633b2bcbf114610136578063557d2e921461017b575b600080fd5b61010e60065481565b6040519081526020015b60405180910390f35b61013461012f366004610da4565b6102e8565b005b6002546101569073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b61010e60045481565b61010e60055481565b61010e60075481565b6101346103a8565b60005473ffffffffffffffffffffffffffffffffffffffff16610156565b6101fd6101ca366004610d72565b600a602052600090815260409020805460028201546003830154600484015460059094015460ff90931693919290919085565b6040805195151586526020860194909452928401919091526060830152608082015260a001610118565b610134610235366004610d14565b6104a5565b61010e60085481565b6101346000600581905560068190556103e76007556004819055600355565b610275610270366004610d72565b610809565b60405161011896959493929190610e93565b61010e60035481565b6002546102bc9074010000000000000000000000000000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610118565b6101346102e3366004610cd7565b6108ee565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461039a576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6103a48282610902565b5050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610429576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610391565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6104ad610a2d565b60005b8161ffff168161ffff1610156106ad576002546040517f5d3b1d300000000000000000000000000000000000000000000000000000000081526004810187905274010000000000000000000000000000000000000000820467ffffffffffffffff16602482015261ffff8816604482015263ffffffff80871660648301528516608482015260009173ffffffffffffffffffffffffffffffffffffffff1690635d3b1d309060a401602060405180830381600087803b15801561057257600080fd5b505af1158015610586573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105aa9190610d8b565b6008819055905060006105bb610ab0565b6040805160c08101825260008082528251818152602080820185528084019182524284860152606084018390526080840186905260a08401839052878352600a815293909120825181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169015151781559051805194955091939092610649926001850192910190610c4c565b506040820151600282015560608201516003820155608082015160048083019190915560a090920151600590910155805490600061068683610fc8565b909155505060009182526009602052604090912055806106a581610fa6565b9150506104b0565b506002546040517f9f87fad700000000000000000000000000000000000000000000000000000000815274010000000000000000000000000000000000000000820467ffffffffffffffff16600482015230602482015273ffffffffffffffffffffffffffffffffffffffff90911690639f87fad790604401600060405180830381600087803b15801561074057600080fd5b505af1158015610754573d6000803e3d6000fd5b50506002546040517fd7ae1d3000000000000000000000000000000000000000000000000000000000815274010000000000000000000000000000000000000000820467ffffffffffffffff16600482015233602482015273ffffffffffffffffffffffffffffffffffffffff909116925063d7ae1d309150604401600060405180830381600087803b1580156107ea57600080fd5b505af11580156107fe573d6000803e3d6000fd5b505050505050505050565b6000818152600a60209081526040808320815160c081018352815460ff161515815260018201805484518187028101870190955280855260609587958695869586958695919492938584019390929083018282801561088757602002820191906000526020600020905b815481526020019060010190808311610873575b505050505081526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050806000015181602001518260400151836060015184608001518560a001519650965096509650965096505091939550919395565b6108f6610a2d565b6108ff81610b56565b50565b600061090c610ab0565b600084815260096020526040812054919250906109299083610f8f565b9050600061093a82620f4240610f52565b905060065482111561094c5760068290555b600754821061095d5760075461095f565b815b60075560035461096f57806109a2565b60035461097d906001610eff565b8160035460055461098e9190610f52565b6109989190610eff565b6109a29190610f17565b6005556000858152600a6020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117825586516109f4939290910191870190610c4c565b506000858152600a60205260408120426003808301919091556005909101859055805491610a2183610fc8565b91905055505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610aae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610391565b565b60004661a4b1811480610ac5575062066eed81145b15610b4f57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1157600080fd5b505afa158015610b25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b499190610d8b565b91505090565b4391505090565b73ffffffffffffffffffffffffffffffffffffffff8116331415610bd6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610391565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610c87579160200282015b82811115610c87578251825591602001919060010190610c6c565b50610c93929150610c97565b5090565b5b80821115610c935760008155600101610c98565b803561ffff81168114610cbe57600080fd5b919050565b803563ffffffff81168114610cbe57600080fd5b600060208284031215610ce957600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610d0d57600080fd5b9392505050565b600080600080600060a08688031215610d2c57600080fd5b610d3586610cac565b945060208601359350610d4a60408701610cc3565b9250610d5860608701610cc3565b9150610d6660808701610cac565b90509295509295909350565b600060208284031215610d8457600080fd5b5035919050565b600060208284031215610d9d57600080fd5b5051919050565b60008060408385031215610db757600080fd5b8235915060208084013567ffffffffffffffff80821115610dd757600080fd5b818601915086601f830112610deb57600080fd5b813581811115610dfd57610dfd611030565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610e4057610e40611030565b604052828152858101935084860182860187018b1015610e5f57600080fd5b600095505b83861015610e82578035855260019590950194938601938601610e64565b508096505050505050509250929050565b600060c082018815158352602060c08185015281895180845260e086019150828b01935060005b81811015610ed657845183529383019391830191600101610eba565b505060408501989098525050506060810193909352608083019190915260a09091015292915050565b60008219821115610f1257610f12611001565b500190565b600082610f4d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610f8a57610f8a611001565b500290565b600082821015610fa157610fa1611001565b500390565b600061ffff80831681811415610fbe57610fbe611001565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610ffa57610ffa611001565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x60a0604052600060055560006006556103e76007553480156200002157600080fd5b50604051620013cc380380620013cc8339810160408190526200004491620002bf565b6001600160601b0319606082901b166080523380600081620000ad5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000e057620000e08162000213565b5050600280546001600160a01b0319166001600160a01b0384169081179091556040805163288688f960e21b8152905191925063a21a23e49160048083019260209291908290030181600087803b1580156200013b57600080fd5b505af115801562000150573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001769190620002f1565b600280546001600160401b03928316600160a01b908102600160a01b600160e01b03198316811793849055604051631cd0704360e21b81529190930490931660048401523060248401526001600160a01b0391821691161790637341c10c90604401600060405180830381600087803b158015620001f357600080fd5b505af115801562000208573d6000803e3d6000fd5b50505050506200031c565b6001600160a01b0381163314156200026e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000a4565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620002d257600080fd5b81516001600160a01b0381168114620002ea57600080fd5b9392505050565b6000602082840312156200030457600080fd5b81516001600160401b0381168114620002ea57600080fd5b60805160601c61108a62000342600039600081816103000152610368015261108a6000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063a168fa8911610097578063d8a4676f11610066578063d8a4676f14610262578063dc1670db14610287578063eb1d28bb14610290578063f2fde38b146102d557600080fd5b8063a168fa89146101bc578063ad603ea214610227578063b1e217491461023a578063d826f88f1461024357600080fd5b8063737144bc116100d3578063737144bc1461018457806374dba1241461018d57806379ba5097146101965780638da5cb5b1461019e57600080fd5b80631757f11c146101055780631fe543e3146101215780633b2bcbf114610136578063557d2e921461017b575b600080fd5b61010e60065481565b6040519081526020015b60405180910390f35b61013461012f366004610dc2565b6102e8565b005b6002546101569073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b61010e60045481565b61010e60055481565b61010e60075481565b6101346103a8565b60005473ffffffffffffffffffffffffffffffffffffffff16610156565b6101fd6101ca366004610d90565b600a602052600090815260409020805460028201546003830154600484015460059094015460ff90931693919290919085565b6040805195151586526020860194909452928401919091526060830152608082015260a001610118565b610134610235366004610d32565b6104a5565b61010e60085481565b6101346000600581905560068190556103e76007556004819055600355565b610275610270366004610d90565b610809565b60405161011896959493929190610eb1565b61010e60035481565b6002546102bc9074010000000000000000000000000000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610118565b6101346102e3366004610cf5565b6108ee565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461039a576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6103a48282610902565b5050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610429576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610391565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6104ad610a2d565b60005b8161ffff168161ffff1610156106ad576002546040517f5d3b1d300000000000000000000000000000000000000000000000000000000081526004810187905274010000000000000000000000000000000000000000820467ffffffffffffffff16602482015261ffff8816604482015263ffffffff80871660648301528516608482015260009173ffffffffffffffffffffffffffffffffffffffff1690635d3b1d309060a401602060405180830381600087803b15801561057257600080fd5b505af1158015610586573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105aa9190610da9565b6008819055905060006105bb610ab0565b6040805160c08101825260008082528251818152602080820185528084019182524284860152606084018390526080840186905260a08401839052878352600a815293909120825181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169015151781559051805194955091939092610649926001850192910190610c6a565b506040820151600282015560608201516003820155608082015160048083019190915560a090920151600590910155805490600061068683610fe6565b909155505060009182526009602052604090912055806106a581610fc4565b9150506104b0565b506002546040517f9f87fad700000000000000000000000000000000000000000000000000000000815274010000000000000000000000000000000000000000820467ffffffffffffffff16600482015230602482015273ffffffffffffffffffffffffffffffffffffffff90911690639f87fad790604401600060405180830381600087803b15801561074057600080fd5b505af1158015610754573d6000803e3d6000fd5b50506002546040517fd7ae1d3000000000000000000000000000000000000000000000000000000000815274010000000000000000000000000000000000000000820467ffffffffffffffff16600482015233602482015273ffffffffffffffffffffffffffffffffffffffff909116925063d7ae1d309150604401600060405180830381600087803b1580156107ea57600080fd5b505af11580156107fe573d6000803e3d6000fd5b505050505050505050565b6000818152600a60209081526040808320815160c081018352815460ff161515815260018201805484518187028101870190955280855260609587958695869586958695919492938584019390929083018282801561088757602002820191906000526020600020905b815481526020019060010190808311610873575b505050505081526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050806000015181602001518260400151836060015184608001518560a001519650965096509650965096505091939550919395565b6108f6610a2d565b6108ff81610b4d565b50565b600061090c610ab0565b600084815260096020526040812054919250906109299083610fad565b9050600061093a82620f4240610f70565b905060065482111561094c5760068290555b600754821061095d5760075461095f565b815b60075560035461096f57806109a2565b60035461097d906001610f1d565b8160035460055461098e9190610f70565b6109989190610f1d565b6109a29190610f35565b6005556000858152600a6020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117825586516109f4939290910191870190610c6a565b506000858152600a60205260408120426003808301919091556005909101859055805491610a2183610fe6565b91905055505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610aae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610391565b565b600046610abc81610c43565b15610b4657606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0857600080fd5b505afa158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b409190610da9565b91505090565b4391505090565b73ffffffffffffffffffffffffffffffffffffffff8116331415610bcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610391565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061a4b1821480610c57575062066eed82145b80610c64575062066eee82145b92915050565b828054828255906000526020600020908101928215610ca5579160200282015b82811115610ca5578251825591602001919060010190610c8a565b50610cb1929150610cb5565b5090565b5b80821115610cb15760008155600101610cb6565b803561ffff81168114610cdc57600080fd5b919050565b803563ffffffff81168114610cdc57600080fd5b600060208284031215610d0757600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610d2b57600080fd5b9392505050565b600080600080600060a08688031215610d4a57600080fd5b610d5386610cca565b945060208601359350610d6860408701610ce1565b9250610d7660608701610ce1565b9150610d8460808701610cca565b90509295509295909350565b600060208284031215610da257600080fd5b5035919050565b600060208284031215610dbb57600080fd5b5051919050565b60008060408385031215610dd557600080fd5b8235915060208084013567ffffffffffffffff80821115610df557600080fd5b818601915086601f830112610e0957600080fd5b813581811115610e1b57610e1b61104e565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610e5e57610e5e61104e565b604052828152858101935084860182860187018b1015610e7d57600080fd5b600095505b83861015610ea0578035855260019590950194938601938601610e82565b508096505050505050509250929050565b600060c082018815158352602060c08185015281895180845260e086019150828b01935060005b81811015610ef457845183529383019391830191600101610ed8565b505060408501989098525050506060810193909352608083019190915260a09091015292915050565b60008219821115610f3057610f3061101f565b500190565b600082610f6b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610fa857610fa861101f565b500290565b600082821015610fbf57610fbf61101f565b500390565b600061ffff80831681811415610fdc57610fdc61101f565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156110185761101861101f565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFV2OwnerTestConsumerABI = VRFV2OwnerTestConsumerMetaData.ABI diff --git a/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics/vrf_v2plus_load_test_with_metrics.go b/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics/vrf_v2plus_load_test_with_metrics.go index 9bb00660e12..c8971595c53 100644 --- a/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics/vrf_v2plus_load_test_with_metrics.go +++ b/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics/vrf_v2plus_load_test_with_metrics.go @@ -32,7 +32,7 @@ var ( var VRFV2PlusLoadTestWithMetricsMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"_nativePayment\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"requestRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6080604052600060055560006006556103e760075534801561002057600080fd5b5060405161134738038061134783398101604081905261003f9161019b565b8033806000816100965760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100c6576100c6816100f1565b5050600280546001600160a01b0319166001600160a01b039390931692909217909155506101cb9050565b6001600160a01b03811633141561014a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161008d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156101ad57600080fd5b81516001600160a01b03811681146101c457600080fd5b9392505050565b61116d806101da6000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80638ea9811711610097578063d826f88f11610066578063d826f88f14610252578063d8a4676f14610271578063dc1670db14610296578063f2fde38b1461029f57600080fd5b80638ea98117146101ab5780639eccacf6146101be578063a168fa89146101de578063b1e217491461024957600080fd5b8063737144bc116100d3578063737144bc1461015257806374dba1241461015b57806379ba5097146101645780638da5cb5b1461016c57600080fd5b80631757f11c146101055780631fe543e314610121578063557d2e92146101365780636846de201461013f575b600080fd5b61010e60065481565b6040519081526020015b60405180910390f35b61013461012f366004610d66565b6102b2565b005b61010e60045481565b61013461014d366004610e55565b610338565b61010e60055481565b61010e60075481565b610134610565565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b6101346101b9366004610cf7565b610662565b6002546101869073ffffffffffffffffffffffffffffffffffffffff1681565b61021f6101ec366004610d34565b600a602052600090815260409020805460028201546003830154600484015460059094015460ff90931693919290919085565b6040805195151586526020860194909452928401919091526060830152608082015260a001610118565b61010e60085481565b6101346000600581905560068190556103e76007556004819055600355565b61028461027f366004610d34565b61076d565b60405161011896959493929190610ed4565b61010e60035481565b6101346102ad366004610cf7565b610852565b60025473ffffffffffffffffffffffffffffffffffffffff16331461032a576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b6103348282610866565b5050565b610340610991565b60005b8161ffff168161ffff16101561055b5760006040518060c001604052808881526020018a81526020018961ffff1681526020018763ffffffff1681526020018563ffffffff1681526020016103a76040518060200160405280891515815250610a14565b90526002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e90610405908590600401610f40565b602060405180830381600087803b15801561041f57600080fd5b505af1158015610433573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104579190610d4d565b600881905590506000610468610ad0565b6040805160c08101825260008082528251818152602080820185528084019182524284860152606084018390526080840186905260a08401839052878352600a815293909120825181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690151517815590518051949550919390926104f6926001850192910190610c6c565b506040820151600282015560608201516003820155608082015160048083019190915560a0909201516005909101558054906000610533836110c9565b9091555050600091825260096020526040909120555080610553816110a7565b915050610343565b5050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610321565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906106a2575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561072657336106c760005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610321565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000818152600a60209081526040808320815160c081018352815460ff16151581526001820180548451818702810187019095528085526060958795869586958695869591949293858401939092908301828280156107eb57602002820191906000526020600020905b8154815260200190600101908083116107d7575b505050505081526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050806000015181602001518260400151836060015184608001518560a001519650965096509650965096505091939550919395565b61085a610991565b61086381610b76565b50565b6000610870610ad0565b6000848152600960205260408120549192509061088d9083611090565b9050600061089e82620f4240611053565b90506006548211156108b05760068290555b60075482106108c1576007546108c3565b815b6007556003546108d35780610906565b6003546108e1906001611000565b816003546005546108f29190611053565b6108fc9190611000565b6109069190611018565b6005556000858152600a6020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811782558651610958939290910191870190610c6c565b506000858152600a60205260408120426003808301919091556005909101859055805491610985836110c9565b91905055505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610321565b565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401610a4d91511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b60004661a4b1811480610ae5575062066eed81145b15610b6f57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b3157600080fd5b505afa158015610b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b699190610d4d565b91505090565b4391505090565b73ffffffffffffffffffffffffffffffffffffffff8116331415610bf6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610321565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610ca7579160200282015b82811115610ca7578251825591602001919060010190610c8c565b50610cb3929150610cb7565b5090565b5b80821115610cb35760008155600101610cb8565b803561ffff81168114610cde57600080fd5b919050565b803563ffffffff81168114610cde57600080fd5b600060208284031215610d0957600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610d2d57600080fd5b9392505050565b600060208284031215610d4657600080fd5b5035919050565b600060208284031215610d5f57600080fd5b5051919050565b60008060408385031215610d7957600080fd5b8235915060208084013567ffffffffffffffff80821115610d9957600080fd5b818601915086601f830112610dad57600080fd5b813581811115610dbf57610dbf611131565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610e0257610e02611131565b604052828152858101935084860182860187018b1015610e2157600080fd5b600095505b83861015610e44578035855260019590950194938601938601610e26565b508096505050505050509250929050565b600080600080600080600060e0888a031215610e7057600080fd5b87359650610e8060208901610ccc565b955060408801359450610e9560608901610ce3565b935060808801358015158114610eaa57600080fd5b9250610eb860a08901610ce3565b9150610ec660c08901610ccc565b905092959891949750929550565b600060c082018815158352602060c08185015281895180845260e086019150828b01935060005b81811015610f1757845183529383019391830191600101610efb565b505060408501989098525050506060810193909352608083019190915260a09091015292915050565b6000602080835283518184015280840151604084015261ffff6040850151166060840152606084015163ffffffff80821660808601528060808701511660a0860152505060a084015160c08085015280518060e086015260005b81811015610fb75782810184015186820161010001528301610f9a565b81811115610fca57600061010083880101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169390930161010001949350505050565b6000821982111561101357611013611102565b500190565b60008261104e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561108b5761108b611102565b500290565b6000828210156110a2576110a2611102565b500390565b600061ffff808316818114156110bf576110bf611102565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156110fb576110fb611102565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x6080604052600060055560006006556103e760075534801561002057600080fd5b5060405161136538038061136583398101604081905261003f9161019b565b8033806000816100965760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100c6576100c6816100f1565b5050600280546001600160a01b0319166001600160a01b039390931692909217909155506101cb9050565b6001600160a01b03811633141561014a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161008d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156101ad57600080fd5b81516001600160a01b03811681146101c457600080fd5b9392505050565b61118b806101da6000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80638ea9811711610097578063d826f88f11610066578063d826f88f14610252578063d8a4676f14610271578063dc1670db14610296578063f2fde38b1461029f57600080fd5b80638ea98117146101ab5780639eccacf6146101be578063a168fa89146101de578063b1e217491461024957600080fd5b8063737144bc116100d3578063737144bc1461015257806374dba1241461015b57806379ba5097146101645780638da5cb5b1461016c57600080fd5b80631757f11c146101055780631fe543e314610121578063557d2e92146101365780636846de201461013f575b600080fd5b61010e60065481565b6040519081526020015b60405180910390f35b61013461012f366004610d84565b6102b2565b005b61010e60045481565b61013461014d366004610e73565b610338565b61010e60055481565b61010e60075481565b610134610565565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b6101346101b9366004610d15565b610662565b6002546101869073ffffffffffffffffffffffffffffffffffffffff1681565b61021f6101ec366004610d52565b600a602052600090815260409020805460028201546003830154600484015460059094015460ff90931693919290919085565b6040805195151586526020860194909452928401919091526060830152608082015260a001610118565b61010e60085481565b6101346000600581905560068190556103e76007556004819055600355565b61028461027f366004610d52565b61076d565b60405161011896959493929190610ef2565b61010e60035481565b6101346102ad366004610d15565b610852565b60025473ffffffffffffffffffffffffffffffffffffffff16331461032a576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b6103348282610866565b5050565b610340610991565b60005b8161ffff168161ffff16101561055b5760006040518060c001604052808881526020018a81526020018961ffff1681526020018763ffffffff1681526020018563ffffffff1681526020016103a76040518060200160405280891515815250610a14565b90526002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e90610405908590600401610f5e565b602060405180830381600087803b15801561041f57600080fd5b505af1158015610433573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104579190610d6b565b600881905590506000610468610ad0565b6040805160c08101825260008082528251818152602080820185528084019182524284860152606084018390526080840186905260a08401839052878352600a815293909120825181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690151517815590518051949550919390926104f6926001850192910190610c8a565b506040820151600282015560608201516003820155608082015160048083019190915560a0909201516005909101558054906000610533836110e7565b9091555050600091825260096020526040909120555080610553816110c5565b915050610343565b5050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610321565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906106a2575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561072657336106c760005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610321565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000818152600a60209081526040808320815160c081018352815460ff16151581526001820180548451818702810187019095528085526060958795869586958695869591949293858401939092908301828280156107eb57602002820191906000526020600020905b8154815260200190600101908083116107d7575b505050505081526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050806000015181602001518260400151836060015184608001518560a001519650965096509650965096505091939550919395565b61085a610991565b61086381610b6d565b50565b6000610870610ad0565b6000848152600960205260408120549192509061088d90836110ae565b9050600061089e82620f4240611071565b90506006548211156108b05760068290555b60075482106108c1576007546108c3565b815b6007556003546108d35780610906565b6003546108e190600161101e565b816003546005546108f29190611071565b6108fc919061101e565b6109069190611036565b6005556000858152600a6020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811782558651610958939290910191870190610c8a565b506000858152600a60205260408120426003808301919091556005909101859055805491610985836110e7565b91905055505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610321565b565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401610a4d91511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b600046610adc81610c63565b15610b6657606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b2857600080fd5b505afa158015610b3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b609190610d6b565b91505090565b4391505090565b73ffffffffffffffffffffffffffffffffffffffff8116331415610bed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610321565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061a4b1821480610c77575062066eed82145b80610c84575062066eee82145b92915050565b828054828255906000526020600020908101928215610cc5579160200282015b82811115610cc5578251825591602001919060010190610caa565b50610cd1929150610cd5565b5090565b5b80821115610cd15760008155600101610cd6565b803561ffff81168114610cfc57600080fd5b919050565b803563ffffffff81168114610cfc57600080fd5b600060208284031215610d2757600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610d4b57600080fd5b9392505050565b600060208284031215610d6457600080fd5b5035919050565b600060208284031215610d7d57600080fd5b5051919050565b60008060408385031215610d9757600080fd5b8235915060208084013567ffffffffffffffff80821115610db757600080fd5b818601915086601f830112610dcb57600080fd5b813581811115610ddd57610ddd61114f565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610e2057610e2061114f565b604052828152858101935084860182860187018b1015610e3f57600080fd5b600095505b83861015610e62578035855260019590950194938601938601610e44565b508096505050505050509250929050565b600080600080600080600060e0888a031215610e8e57600080fd5b87359650610e9e60208901610cea565b955060408801359450610eb360608901610d01565b935060808801358015158114610ec857600080fd5b9250610ed660a08901610d01565b9150610ee460c08901610cea565b905092959891949750929550565b600060c082018815158352602060c08185015281895180845260e086019150828b01935060005b81811015610f3557845183529383019391830191600101610f19565b505060408501989098525050506060810193909352608083019190915260a09091015292915050565b6000602080835283518184015280840151604084015261ffff6040850151166060840152606084015163ffffffff80821660808601528060808701511660a0860152505060a084015160c08085015280518060e086015260005b81811015610fd55782810184015186820161010001528301610fb8565b81811115610fe857600061010083880101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169390930161010001949350505050565b6000821982111561103157611031611120565b500190565b60008261106c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156110a9576110a9611120565b500290565b6000828210156110c0576110c0611120565b500390565b600061ffff808316818114156110dd576110dd611120565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561111957611119611120565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFV2PlusLoadTestWithMetricsABI = VRFV2PlusLoadTestWithMetricsMetaData.ABI diff --git a/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go b/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go index 8d96b864642..b42d110b85a 100644 --- a/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go +++ b/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go @@ -67,7 +67,7 @@ type VRFV2PlusClientRandomWordsRequest struct { var VRFCoordinatorV2PlusUpgradedVersionMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transferredValue\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"expectedValue\",\"type\":\"uint96\"}],\"name\":\"InvalidNativeBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"requestVersion\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"expectedVersion\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubscriptionIDCollisionFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountNative\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldNativeBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNativeBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithNative\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedData\",\"type\":\"bytes\"}],\"name\":\"onMigration\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverNativeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b50604051620060b9380380620060b9833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615ede620001db600039600081816104eb01526136f60152615ede6000f3fe6080604052600436106102015760003560e01c806201229114610206578063043bd6ae14610233578063088070f5146102575780630ae09540146102d757806315c48b84146102f957806318e3dd27146103215780631b6b6d2314610360578063294926571461038d578063294daa49146103ad578063330987b3146103c9578063405b84fa146103e957806340d6bb821461040957806341af6c87146104345780635d06b4ab1461046457806364d51a2a14610484578063659827441461049957806366316d8d146104b9578063689c4517146104d95780636b6feccc1461050d5780636f64f03f1461054357806372e9d5651461056357806379ba5097146105835780638402595e1461059857806386fe91c7146105b85780638da5cb5b146105d857806395b55cfc146105f65780639b1c385e146106095780639d40a6fd14610629578063a21a23e414610656578063a4c0ed361461066b578063aa433aff1461068b578063aefb212f146106ab578063b08c8795146106d8578063b2a7cac5146106f8578063bec4c08c14610718578063caf70c4a14610738578063cb63179714610758578063ce3f471914610778578063d98e620e1461078b578063da2f2610146107ab578063dac83d29146107e1578063dc311dd314610801578063e72f6e3014610832578063ee9d2d3814610852578063f2fde38b1461087f575b600080fd5b34801561021257600080fd5b5061021b61089f565b60405161022a939291906159d4565b60405180910390f35b34801561023f57600080fd5b5061024960115481565b60405190815260200161022a565b34801561026357600080fd5b50600d5461029f9061ffff81169063ffffffff62010000820481169160ff600160301b82041691600160381b8204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a00161022a565b3480156102e357600080fd5b506102f76102f2366004615655565b61091b565b005b34801561030557600080fd5b5061030e60c881565b60405161ffff909116815260200161022a565b34801561032d57600080fd5b50600a5461034890600160601b90046001600160601b031681565b6040516001600160601b03909116815260200161022a565b34801561036c57600080fd5b50600254610380906001600160a01b031681565b60405161022a9190615878565b34801561039957600080fd5b506102f76103a83660046151c7565b6109e9565b3480156103b957600080fd5b506040516001815260200161022a565b3480156103d557600080fd5b506103486103e43660046153c3565b610b66565b3480156103f557600080fd5b506102f7610404366004615655565b611041565b34801561041557600080fd5b5061041f6101f481565b60405163ffffffff909116815260200161022a565b34801561044057600080fd5b5061045461044f366004615305565b61142c565b604051901515815260200161022a565b34801561047057600080fd5b506102f761047f3660046151aa565b6115cd565b34801561049057600080fd5b5061030e606481565b3480156104a557600080fd5b506102f76104b43660046151fc565b611684565b3480156104c557600080fd5b506102f76104d43660046151c7565b6116e4565b3480156104e557600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b34801561051957600080fd5b506012546105359063ffffffff80821691600160201b90041682565b60405161022a929190615b56565b34801561054f57600080fd5b506102f761055e366004615235565b6118ac565b34801561056f57600080fd5b50600354610380906001600160a01b031681565b34801561058f57600080fd5b506102f76119b3565b3480156105a457600080fd5b506102f76105b33660046151aa565b611a5d565b3480156105c457600080fd5b50600a54610348906001600160601b031681565b3480156105e457600080fd5b506000546001600160a01b0316610380565b6102f7610604366004615305565b611b69565b34801561061557600080fd5b506102496106243660046154a0565b611cad565b34801561063557600080fd5b50600754610649906001600160401b031681565b60405161022a9190615b6d565b34801561066257600080fd5b5061024961201d565b34801561067757600080fd5b506102f7610686366004615271565b61226b565b34801561069757600080fd5b506102f76106a6366004615305565b612408565b3480156106b757600080fd5b506106cb6106c636600461567a565b61246b565b60405161022a91906158ef565b3480156106e457600080fd5b506102f76106f33660046155b7565b61256c565b34801561070457600080fd5b506102f7610713366004615305565b6126e0565b34801561072457600080fd5b506102f7610733366004615655565b612804565b34801561074457600080fd5b506102496107533660046152cc565b61299b565b34801561076457600080fd5b506102f7610773366004615655565b6129cb565b6102f7610786366004615337565b612cb8565b34801561079757600080fd5b506102496107a6366004615305565b612fc9565b3480156107b757600080fd5b506103806107c6366004615305565b600e602052600090815260409020546001600160a01b031681565b3480156107ed57600080fd5b506102f76107fc366004615655565b612fea565b34801561080d57600080fd5b5061082161081c366004615305565b6130fa565b60405161022a959493929190615b81565b34801561083e57600080fd5b506102f761084d3660046151aa565b6131f5565b34801561085e57600080fd5b5061024961086d366004615305565b60106020526000908152604090205481565b34801561088b57600080fd5b506102f761089a3660046151aa565b6133d0565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561090957602002820191906000526020600020905b8154815260200190600101908083116108f5575b50505050509050925092509250909192565b60008281526005602052604090205482906001600160a01b03168061095357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146109875780604051636c51fda960e11b815260040161097e9190615878565b60405180910390fd5b600d54600160301b900460ff16156109b25760405163769dd35360e11b815260040160405180910390fd5b6109bb8461142c565b156109d957604051631685ecdd60e31b815260040160405180910390fd5b6109e384846133e1565b50505050565b600d54600160301b900460ff1615610a145760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610a5057604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610a789084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610ac09190615d92565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b5050905080610b615760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff1615610b945760405163769dd35360e11b815260040160405180910390fd5b60005a90506000610ba5858561359c565b90506000846060015163ffffffff166001600160401b03811115610bcb57610bcb615e98565b604051908082528060200260200182016040528015610bf4578160200160208202803683370190505b50905060005b856060015163ffffffff16811015610c6b57826040015181604051602001610c23929190615902565b6040516020818303038152906040528051906020012060001c828281518110610c4e57610c4e615e82565b602090810291909101015280610c6381615dea565b915050610bfa565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b91610ca391908690602401615a5e565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805460ff60301b1916600160301b179055908801516080890151919250600091610d089163ffffffff16908461380f565b600d805460ff60301b19169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b0316610d48816001615cfb565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a01518051610d9590600190615d7b565b81518110610da557610da5615e82565b602091010151600d5460f89190911c6001149150600090610dd6908a90600160581b900463ffffffff163a8561385d565b90508115610edf576020808c01516000908152600690915260409020546001600160601b03808316600160601b909204161015610e2657604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c90610e5d908490600160601b90046001600160601b0316615d92565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c909152812080548594509092610eb691859116615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550610fcb565b6020808c01516000908152600690915260409020546001600160601b0380831691161015610f2057604051631e9acf1760e31b815260040160405180910390fd5b6020808c015160009081526006909152604081208054839290610f4d9084906001600160601b0316615d92565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b909152812080548594509092610fa691859116615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a604001518488604051611028939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff161561106c5760405163769dd35360e11b815260040160405180910390fd5b611075816138ac565b6110945780604051635428d44960e01b815260040161097e9190615878565b6000806000806110a3866130fa565b945094505093509350336001600160a01b0316826001600160a01b0316146111065760405162461bcd60e51b81526020600482015260166024820152752737ba1039bab139b1b934b83a34b7b71037bbb732b960511b604482015260640161097e565b61110f8661142c565b156111555760405162461bcd60e51b815260206004820152601660248201527550656e64696e6720726571756573742065786973747360501b604482015260640161097e565b60006040518060c0016040528061116a600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b031681525090506000816040516020016111be9190615941565b60405160208183030381529060405290506111d888613916565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b0388169061121190859060040161592e565b6000604051808303818588803b15801561122a57600080fd5b505af115801561123e573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611267905057506001600160601b03861615155b156113315760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061129e908a908a906004016158bf565b602060405180830381600087803b1580156112b857600080fd5b505af11580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f091906152e8565b6113315760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015260640161097e565b600d805460ff60301b1916600160301b17905560005b83518110156113da5783818151811061136257611362615e82565b60200260200101516001600160a01b0316638ea98117896040518263ffffffff1660e01b81526004016113959190615878565b600060405180830381600087803b1580156113af57600080fd5b505af11580156113c3573d6000803e3d6000fd5b5050505080806113d290615dea565b915050611347565b50600d805460ff60301b191690556040517fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be41879061141a9089908b9061588c565b60405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287969395860193909291908301828280156114b657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611498575b505050505081525050905060005b8160400151518110156115c35760005b600f548110156115b0576000611579600f83815481106114f6576114f6615e82565b90600052602060002001548560400151858151811061151757611517615e82565b602002602001015188600460008960400151898151811061153a5761153a615e82565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208d82529092529020546001600160401b0316613b64565b506000818152601060205260409020549091501561159d5750600195945050505050565b50806115a881615dea565b9150506114d4565b50806115bb81615dea565b9150506114c4565b5060009392505050565b6115d5613bed565b6115de816138ac565b156115fe578060405163ac8a27ef60e01b815260040161097e9190615878565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383161790556040517fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af0162590611679908390615878565b60405180910390a150565b61168c613bed565b6002546001600160a01b0316156116b657604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff161561170f5760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03166117385760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b038083169116101561177457604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b60205260408120805483929061179c9084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b03166117e49190615d92565b82546001600160601b039182166101009390930a92830291909202199091161790555060025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061183990859085906004016158bf565b602060405180830381600087803b15801561185357600080fd5b505af1158015611867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188b91906152e8565b6118a857604051631e9acf1760e31b815260040160405180910390fd5b5050565b6118b4613bed565b6040805180820182526000916118e391908490600290839083908082843760009201919091525061299b915050565b6000818152600e60205260409020549091506001600160a01b03161561191f57604051634a0b8fa760e01b81526004810182905260240161097e565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b8910160405180910390a2505050565b6001546001600160a01b03163314611a065760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015260640161097e565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611a65613bed565b600a544790600160601b90046001600160601b031681811115611a9f5780826040516354ced18160e11b815260040161097e929190615902565b81811015610b61576000611ab38284615d7b565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114611b02576040519150601f19603f3d011682016040523d82523d6000602084013e611b07565b606091505b5050905080611b295760405163950b247960e01b815260040160405180910390fd5b7f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c8583604051611b5a92919061588c565b60405180910390a15050505050565b600d54600160301b900460ff1615611b945760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316611bc957604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c611bf88385615d26565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b0316611c409190615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902823484611c939190615ce3565b604051611ca1929190615902565b60405180910390a25050565b600d54600090600160301b900460ff1615611cdb5760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b0316611d1657604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b031680611d63578260200135336040516379bfd40160e01b815260040161097e929190615a33565b600d5461ffff16611d7a606085016040860161559c565b61ffff161080611d9d575060c8611d97606085016040860161559c565b61ffff16115b15611dd757611db2606084016040850161559c565b600d5460405163539c34bb60e11b815261097e929161ffff169060c8906004016159b6565b600d5462010000900463ffffffff16611df6608085016060860161569c565b63ffffffff161115611e3c57611e12608084016060850161569c565b600d54604051637aebf00f60e11b815261097e929162010000900463ffffffff1690600401615b56565b6101f4611e4f60a085016080860161569c565b63ffffffff161115611e8957611e6b60a084016080850161569c565b6101f46040516311ce1afb60e21b815260040161097e929190615b56565b6000611e96826001615cfb565b9050600080611eac863533602089013586613b64565b90925090506000611ec8611ec360a0890189615bd6565b613c42565b90506000611ed582613cbf565b905083611ee0613d30565b60208a0135611ef560808c0160608d0161569c565b611f0560a08d0160808e0161569c565b3386604051602001611f1d9796959493929190615ab6565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d6040016020810190611f94919061559c565b8e6060016020810190611fa7919061569c565b8f6080016020810190611fba919061569c565b89604051611fcd96959493929190615a77565b60405180910390a45050336000908152600460209081526040808320898301358452909152902080546001600160401b0319166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561204b5760405163769dd35360e11b815260040160405180910390fd5b600033612059600143615d7b565b600754604051606093841b6001600160601b03199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006120d383615e05565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b0381111561211257612112615e98565b60405190808252806020026020018201604052801561213b578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b03928316178355925160018301805490941691161790915592518051949550909361221c9260028501920190614e1b565b5061222c91506008905083613dc9565b50817f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d3360405161225d9190615878565b60405180910390a250905090565b600d54600160301b900460ff16156122965760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b031633146122c1576040516344b0e3c360e01b815260040160405180910390fd5b602081146122e257604051638129bbcd60e01b815260040160405180910390fd5b60006122f082840184615305565b6000818152600560205260409020549091506001600160a01b031661232857604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b03169186919061234f8385615d26565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166123979190615d26565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846123ea9190615ce3565b6040516123f8929190615902565b60405180910390a2505050505050565b612410613bed565b6000818152600560205260409020546001600160a01b031661244557604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020546124689082906001600160a01b03166133e1565b50565b606060006124796008613dd5565b905080841061249b57604051631390f2a160e01b815260040160405180910390fd5b60006124a78486615ce3565b9050818111806124b5575083155b6124bf57806124c1565b815b905060006124cf8683615d7b565b6001600160401b038111156124e6576124e6615e98565b60405190808252806020026020018201604052801561250f578160200160208202803683370190505b50905060005b81518110156125625761253361252b8883615ce3565b600890613ddf565b82828151811061254557612545615e82565b60209081029190910101528061255a81615dea565b915050612515565b5095945050505050565b612574613bed565b60c861ffff871611156125a157858660c860405163539c34bb60e11b815260040161097e939291906159b6565b600082136125c5576040516321ea67b360e11b81526004810183905260240161097e565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff1916881762010000870217600160301b600160781b031916600160381b850263ffffffff60581b191617600160581b83021790558a51601280548d8701519289166001600160401b031990911617600160201b92891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff161561270b5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661274057604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612797576000818152600560205260409081902060010154905163d084e97560e01b815261097e916001600160a01b031690600401615878565b6000818152600560205260409081902080546001600160a01b031980821633908117845560019093018054909116905591516001600160a01b039092169183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691611ca19185916158a5565b60008281526005602052604090205482906001600160a01b03168061283c57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146128675780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff16156128925760405163769dd35360e11b815260040160405180910390fd5b600084815260056020526040902060020154606414156128c5576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316156128fc576109e3565b6001600160a01b0383166000818152600460209081526040808320888452825280832080546001600160401b031916600190811790915560058352818420600201805491820181558452919092200180546001600160a01b0319169092179091555184907f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e19061298d908690615878565b60405180910390a250505050565b6000816040516020016129ae91906158e1565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b031680612a0357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612a2e5780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff1615612a595760405163769dd35360e11b815260040160405180910390fd5b612a628461142c565b15612a8057604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316612ace5783836040516379bfd40160e01b815260040161097e929190615a33565b600084815260056020908152604080832060020180548251818502810185019093528083529192909190830182828015612b3157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612b13575b50505050509050600060018251612b489190615d7b565b905060005b8251811015612c5457856001600160a01b0316838281518110612b7257612b72615e82565b60200260200101516001600160a01b03161415612c42576000838381518110612b9d57612b9d615e82565b6020026020010151905080600560008a81526020019081526020016000206002018381548110612bcf57612bcf615e82565b600091825260208083209190910180546001600160a01b0319166001600160a01b039490941693909317909255898152600590915260409020600201805480612c1a57612c1a615e6c565b600082815260209020810160001990810180546001600160a01b031916905501905550612c54565b80612c4c81615dea565b915050612b4d565b506001600160a01b03851660009081526004602090815260408083208984529091529081902080546001600160401b03191690555186907f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7906123f8908890615878565b6000612cc6828401846154da565b9050806000015160ff16600114612cff57805160405163237d181f60e21b815260ff90911660048201526001602482015260440161097e565b8060a001516001600160601b03163414612d435760a08101516040516306acf13560e41b81523460048201526001600160601b03909116602482015260440161097e565b6020808201516000908152600590915260409020546001600160a01b031615612d7f576040516326afa43560e11b815260040160405180910390fd5b60005b816060015151811015612e1f5760016004600084606001518481518110612dab57612dab615e82565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008460200151815260200190815260200160002060006101000a8154816001600160401b0302191690836001600160401b031602179055508080612e1790615dea565b915050612d82565b50604080516060808201835260808401516001600160601b03908116835260a0850151811660208085019182526000858701818152828901805183526006845288832097518854955192516001600160401b0316600160c01b026001600160c01b03938816600160601b026001600160c01b0319909716919097161794909417169390931790945584518084018652868601516001600160a01b03908116825281860184815294880151828801908152925184526005865295909220825181549087166001600160a01b0319918216178255935160018201805491909716941693909317909455925180519192612f1e92600285019290910190614e1b565b5050506080810151600a8054600090612f419084906001600160601b0316615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055508060a00151600a600c8282829054906101000a90046001600160601b0316612f8d9190615d26565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506109e381602001516008613dc990919063ffffffff16565b600f8181548110612fd957600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061302257604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461304d5780604051636c51fda960e11b815260040161097e9190615878565b600d54600160301b900460ff16156130785760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b038481169116146109e3576000848152600560205260409081902060010180546001600160a01b0319166001600160a01b0386161790555184907f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19061298d90339087906158a5565b6000818152600560205260408120548190819081906060906001600160a01b031661313857604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156131db57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116131bd575b505050505090509450945094509450945091939590929450565b6131fd613bed565b6002546001600160a01b03166132265760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190613257903090600401615878565b60206040518083038186803b15801561326f57600080fd5b505afa158015613283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132a7919061531e565b600a549091506001600160601b0316818111156132db5780826040516354ced18160e11b815260040161097e929190615902565b81811015610b615760006132ef8284615d7b565b60025460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb90613322908790859060040161588c565b602060405180830381600087803b15801561333c57600080fd5b505af1158015613350573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061337491906152e8565b61339157604051631f01ff1360e21b815260040160405180910390fd5b7f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b43660084826040516133c292919061588c565b60405180910390a150505050565b6133d8613bed565b61246881613deb565b6000806133ed84613916565b60025491935091506001600160a01b03161580159061341457506001600160601b03821615155b156134c35760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906134549086906001600160601b0387169060040161588c565b602060405180830381600087803b15801561346e57600080fd5b505af1158015613482573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134a691906152e8565b6134c357604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613519576040519150601f19603f3d011682016040523d82523d6000602084013e61351e565b606091505b50509050806135405760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006135c8846000015161299b565b6000818152600e60205260409020549091506001600160a01b03168061360457604051631dfd6e1360e21b81526004810183905260240161097e565b600082866080015160405160200161361d929190615902565b60408051601f198184030181529181528151602092830120600081815260109093529120549091508061366357604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613692978a979096959101615b02565b6040516020818303038152906040528051906020012081146136c75760405163354a450b60e21b815260040160405180910390fd5b60006136d68760000151613e8f565b90508061379d578651604051631d2827a760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163e9413d389161372a9190600401615b6d565b60206040518083038186803b15801561374257600080fd5b505afa158015613756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061377a919061531e565b90508061379d57865160405163175dadad60e01b815261097e9190600401615b6d565b60008860800151826040516020016137bf929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905060006137e68a83613f82565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a61138881101561382157600080fd5b61138881039050846040820482031161383957600080fd5b50823b61384557600080fd5b60008083516020850160008789f190505b9392505050565b6000811561388a576012546138839086908690600160201b900463ffffffff1686613fed565b90506138a4565b6012546138a1908690869063ffffffff1686614057565b90505b949350505050565b6000805b60135481101561390d57826001600160a01b0316601382815481106138d7576138d7615e82565b6000918252602090912001546001600160a01b031614156138fb5750600192915050565b8061390581615dea565b9150506138b0565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879687969495948601939192908301828280156139a257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613984575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613a7e576004600084604001518381518110613a2e57613a2e615e82565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902080546001600160401b031916905580613a7681615dea565b915050613a07565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613ab66002830182614e80565b5050600085815260066020526040812055613ad2600886614144565b50600a8054859190600090613af19084906001600160601b0316615d92565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613b399190615d92565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081018690526001600160a01b03851691810191909152606081018390526001600160401b03821660808201526000908190819060a00160408051601f198184030181529082905280516020918201209250613bc9918991849101615902565b60408051808303601f19018152919052805160209091012097909650945050505050565b6000546001600160a01b03163314613c405760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b604482015260640161097e565b565b60408051602081019091526000815281613c6b575060408051602081019091526000815261103b565b63125fa26760e31b613c7d8385615dba565b6001600160e01b03191614613ca557604051632923fee760e11b815260040160405180910390fd5b613cb28260048186615cb9565b8101906138569190615378565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613cf891511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b60004661a4b1811480613d45575062066eed81145b15613dc25760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d8457600080fd5b505afa158015613d98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dbc919061531e565b91505090565b4391505090565b60006138568383614150565b600061103b825490565b6000613856838361419f565b6001600160a01b038116331415613e3e5760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b604482015260640161097e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60004661a4b1811480613ea4575062066eed81145b80613eb1575062066eee81145b15613f7357610100836001600160401b0316613ecb613d30565b613ed59190615d7b565b1180613ef15750613ee4613d30565b836001600160401b031610155b15613eff5750600092915050565b6040516315a03d4160e11b8152606490632b407a8290613f23908690600401615b6d565b60206040518083038186803b158015613f3b57600080fd5b505afa158015613f4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613856919061531e565b50506001600160401b03164090565b6000613fb68360000151846020015185604001518660600151868860a001518960c001518a60e001518b61010001516141c9565b60038360200151604051602001613fce929190615a4a565b60408051601f1981840301815291905280516020909101209392505050565b600080613ff86143e4565b905060005a6140078888615ce3565b6140119190615d7b565b61401b9085615d5c565b9050600061403463ffffffff871664e8d4a51000615d5c565b9050826140418284615ce3565b61404b9190615ce3565b98975050505050505050565b600080614062614440565b905060008113614088576040516321ea67b360e11b81526004810182905260240161097e565b60006140926143e4565b9050600082825a6140a38b8b615ce3565b6140ad9190615d7b565b6140b79088615d5c565b6140c19190615ce3565b6140d390670de0b6b3a7640000615d5c565b6140dd9190615d48565b905060006140f663ffffffff881664e8d4a51000615d5c565b905061410d81676765c793fa10079d601b1b615d7b565b82111561412d5760405163e80fa38160e01b815260040160405180910390fd5b6141378183615ce3565b9998505050505050505050565b6000613856838361450b565b60008181526001830160205260408120546141975750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561103b565b50600061103b565b60008260000182815481106141b6576141b6615e82565b9060005260206000200154905092915050565b6141d2896145fe565b61421b5760405162461bcd60e51b815260206004820152601a6024820152797075626c6963206b6579206973206e6f74206f6e20637572766560301b604482015260640161097e565b614224886145fe565b6142685760405162461bcd60e51b815260206004820152601560248201527467616d6d61206973206e6f74206f6e20637572766560581b604482015260640161097e565b614271836145fe565b6142bd5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e206375727665000000604482015260640161097e565b6142c6826145fe565b6143115760405162461bcd60e51b815260206004820152601c60248201527b73486173685769746e657373206973206e6f74206f6e20637572766560201b604482015260640161097e565b61431d878a88876146c1565b6143655760405162461bcd60e51b81526020600482015260196024820152786164647228632a706b2b732a6729213d5f755769746e65737360381b604482015260640161097e565b60006143718a876147d5565b90506000614384898b878b868989614839565b90506000614395838d8d8a8661494c565b9050808a146143d65760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b604482015260640161097e565b505050505050505050505050565b60004661a4b18114806143f9575062066eed81145b1561443857606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d8457600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093600160381b900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561449e57600080fd5b505afa1580156144b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144d691906156b7565b5094509092508491505080156144fa57506144f18242615d7b565b8463ffffffff16105b156138a45750601154949350505050565b600081815260018301602052604081205480156145f457600061452f600183615d7b565b855490915060009061454390600190615d7b565b90508181146145a857600086600001828154811061456357614563615e82565b906000526020600020015490508087600001848154811061458657614586615e82565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145b9576145b9615e6c565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061103b565b600091505061103b565b80516000906401000003d0191161464c5760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420782d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d0191161469a5760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420792d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d0199080096146ba8360005b602002015161498c565b1492915050565b60006001600160a01b0382166147075760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b604482015260640161097e565b60208401516000906001161561471e57601c614721565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe199182039250600091908909875160408051600080825260209091019182905292935060019161478b91869188918790615910565b6020604051602081039080840390855afa1580156147ad573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b6147dd614e9e565b61480a600184846040516020016147f693929190615857565b6040516020818303038152906040526149b0565b90505b614816816145fe565b61103b57805160408051602081019290925261483291016147f6565b905061480d565b614841614e9e565b825186516401000003d01990819006910614156148a05760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e63740000604482015260640161097e565b6148ab8789886149fe565b6148f05760405162461bcd60e51b8152602060048201526016602482015275119a5c9cdd081b5d5b0818da1958dac819985a5b195960521b604482015260640161097e565b6148fb8486856149fe565b6149415760405162461bcd60e51b815260206004820152601760248201527614d958dbdb99081b5d5b0818da1958dac819985a5b1959604a1b604482015260640161097e565b61404b868484614b19565b60006002868686858760405160200161496a969594939291906157fd565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b6149b8614e9e565b6149c182614bdc565b81526149d66149d18260006146b0565b614c17565b602082018190526002900660011415612018576020810180516401000003d019039052919050565b600082614a3b5760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b604482015260640161097e565b83516020850151600090614a5190600290615e2c565b15614a5d57601c614a60565b601b5b9050600070014551231950b75fc4402da1732fc9bebe19838709604080516000808252602090910191829052919250600190614aa3908390869088908790615910565b6020604051602081039080840390855afa158015614ac5573d6000803e3d6000fd5b505050602060405103519050600086604051602001614ae491906157eb565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614b21614e9e565b835160208086015185519186015160009384938493614b4293909190614c37565b919450925090506401000003d019858209600114614b9e5760405162461bcd60e51b815260206004820152601960248201527834b73b2d1036bab9ba1031329034b73b32b939b29037b3103d60391b604482015260640161097e565b60405180604001604052806401000003d01980614bbd57614bbd615e56565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d019811061201857604080516020808201939093528151808203840181529082019091528051910120614be4565b600061103b826002614c306401000003d0196001615ce3565b901c614d17565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614c7783838585614dae565b9098509050614c8888828e88614dd2565b9098509050614c9988828c87614dd2565b90985090506000614cac8d878b85614dd2565b9098509050614cbd88828686614dae565b9098509050614cce88828e89614dd2565b9098509050818114614d03576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614d07565b8196505b5050505050509450945094915050565b600080614d22614ebc565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614d54614eda565b60208160c0846005600019fa925082614da45760405162461bcd60e51b81526020600482015260126024820152716269674d6f64457870206661696c7572652160701b604482015260640161097e565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614e70579160200282015b82811115614e7057825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614e3b565b50614e7c929150614ef8565b5090565b50805460008255906000526020600020908101906124689190614ef8565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614e7c5760008155600101614ef9565b803561201881615eae565b600082601f830112614f2957600080fd5b813560206001600160401b03821115614f4457614f44615e98565b8160051b614f53828201615c89565b838152828101908684018388018501891015614f6e57600080fd5b600093505b85841015614f9a578035614f8681615eae565b835260019390930192918401918401614f73565b50979650505050505050565b600082601f830112614fb757600080fd5b614fbf615c1c565b808385604086011115614fd157600080fd5b60005b6002811015614ff3578135845260209384019390910190600101614fd4565b509095945050505050565b60008083601f84011261501057600080fd5b5081356001600160401b0381111561502757600080fd5b60208301915083602082850101111561503f57600080fd5b9250929050565b600082601f83011261505757600080fd5b81356001600160401b0381111561507057615070615e98565b615083601f8201601f1916602001615c89565b81815284602083860101111561509857600080fd5b816020850160208301376000918101602001919091529392505050565b600060c082840312156150c757600080fd5b6150cf615c44565b905081356001600160401b0380821682146150e957600080fd5b8183526020840135602084015261510260408501615168565b604084015261511360608501615168565b606084015261512460808501614f0d565b608084015260a084013591508082111561513d57600080fd5b5061514a84828501615046565b60a08301525092915050565b803561ffff8116811461201857600080fd5b803563ffffffff8116811461201857600080fd5b80516001600160501b038116811461201857600080fd5b80356001600160601b038116811461201857600080fd5b6000602082840312156151bc57600080fd5b813561385681615eae565b600080604083850312156151da57600080fd5b82356151e581615eae565b91506151f360208401615193565b90509250929050565b6000806040838503121561520f57600080fd5b823561521a81615eae565b9150602083013561522a81615eae565b809150509250929050565b6000806060838503121561524857600080fd5b823561525381615eae565b91506060830184101561526557600080fd5b50926020919091019150565b6000806000806060858703121561528757600080fd5b843561529281615eae565b93506020850135925060408501356001600160401b038111156152b457600080fd5b6152c087828801614ffe565b95989497509550505050565b6000604082840312156152de57600080fd5b6138568383614fa6565b6000602082840312156152fa57600080fd5b815161385681615ec3565b60006020828403121561531757600080fd5b5035919050565b60006020828403121561533057600080fd5b5051919050565b6000806020838503121561534a57600080fd5b82356001600160401b0381111561536057600080fd5b61536c85828601614ffe565b90969095509350505050565b60006020828403121561538a57600080fd5b604051602081016001600160401b03811182821017156153ac576153ac615e98565b60405282356153ba81615ec3565b81529392505050565b6000808284036101c08112156153d857600080fd5b6101a0808212156153e857600080fd5b6153f0615c66565b91506153fc8686614fa6565b825261540b8660408701614fa6565b60208301526080850135604083015260a0850135606083015260c0850135608083015261543a60e08601614f0d565b60a083015261010061544e87828801614fa6565b60c0840152615461876101408801614fa6565b60e0840152610180860135908301529092508301356001600160401b0381111561548a57600080fd5b615496858286016150b5565b9150509250929050565b6000602082840312156154b257600080fd5b81356001600160401b038111156154c857600080fd5b820160c0818503121561385657600080fd5b6000602082840312156154ec57600080fd5b81356001600160401b038082111561550357600080fd5b9083019060c0828603121561551757600080fd5b61551f615c44565b823560ff8116811461553057600080fd5b81526020838101359082015261554860408401614f0d565b604082015260608301358281111561555f57600080fd5b61556b87828601614f18565b60608301525061557d60808401615193565b608082015261558e60a08401615193565b60a082015295945050505050565b6000602082840312156155ae57600080fd5b61385682615156565b60008060008060008086880360e08112156155d157600080fd5b6155da88615156565b96506155e860208901615168565b95506155f660408901615168565b945061560460608901615168565b9350608088013592506040609f198201121561561f57600080fd5b50615628615c1c565b61563460a08901615168565b815261564260c08901615168565b6020820152809150509295509295509295565b6000806040838503121561566857600080fd5b82359150602083013561522a81615eae565b6000806040838503121561568d57600080fd5b50508035926020909101359150565b6000602082840312156156ae57600080fd5b61385682615168565b600080600080600060a086880312156156cf57600080fd5b6156d88661517c565b94506020860151935060408601519250606086015191506156fb6080870161517c565b90509295509295909350565b600081518084526020808501945080840160005b838110156157405781516001600160a01b03168752958201959082019060010161571b565b509495945050505050565b8060005b60028110156109e357815184526020938401939091019060010161574f565b600081518084526020808501945080840160005b8381101561574057815187529582019590820190600101615782565b6000815180845260005b818110156157c4576020818501810151868301820152016157a8565b818111156157d6576000602083870101525b50601f01601f19169290920160200192915050565b6157f5818361574b565b604001919050565b86815261580d602082018761574b565b61581a606082018661574b565b61582760a082018561574b565b61583460e082018461574b565b60609190911b6001600160601b0319166101208201526101340195945050505050565b838152615867602082018461574b565b606081019190915260800192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039290921682526001600160601b0316602082015260400190565b6040810161103b828461574b565b602081526000613856602083018461576e565b918252602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b602081526000613856602083018461579e565b6020815260ff82511660208201526020820151604082015260018060a01b0360408301511660608201526000606083015160c0608084015261598660e0840182615707565b60808501516001600160601b0390811660a0868101919091529095015190941660c0909301929092525090919050565b61ffff93841681529183166020830152909116604082015260600190565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615a2557845183529383019391830191600101615a09565b509098975050505050505050565b9182526001600160a01b0316602082015260400190565b82815260608101613856602083018461574b565b8281526040602082015260006138a4604083018461576e565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261404b60c083018461579e565b878152602081018790526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c082018190526000906141379083018461579e565b8781526001600160401b03871660208201526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c082018190526000906141379083018461579e565b63ffffffff92831681529116602082015260400190565b6001600160401b0391909116815260200190565b6001600160601b038681168252851660208201526001600160401b03841660408201526001600160a01b038316606082015260a060808201819052600090615bcb90830184615707565b979650505050505050565b6000808335601e19843603018112615bed57600080fd5b8301803591506001600160401b03821115615c0757600080fd5b60200191503681900382131561503f57600080fd5b604080519081016001600160401b0381118282101715615c3e57615c3e615e98565b60405290565b60405160c081016001600160401b0381118282101715615c3e57615c3e615e98565b60405161012081016001600160401b0381118282101715615c3e57615c3e615e98565b604051601f8201601f191681016001600160401b0381118282101715615cb157615cb1615e98565b604052919050565b60008085851115615cc957600080fd5b83861115615cd657600080fd5b5050820193919092039150565b60008219821115615cf657615cf6615e40565b500190565b60006001600160401b03828116848216808303821115615d1d57615d1d615e40565b01949350505050565b60006001600160601b03828116848216808303821115615d1d57615d1d615e40565b600082615d5757615d57615e56565b500490565b6000816000190483118215151615615d7657615d76615e40565b500290565b600082821015615d8d57615d8d615e40565b500390565b60006001600160601b0383811690831681811015615db257615db2615e40565b039392505050565b6001600160e01b03198135818116916004851015615de25780818660040360031b1b83161692505b505092915050565b6000600019821415615dfe57615dfe615e40565b5060010190565b60006001600160401b0382811680821415615e2257615e22615e40565b6001019392505050565b600082615e3b57615e3b615e56565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461246857600080fd5b801515811461246857600080fdfea164736f6c6343000806000a", + Bin: "0x60a06040523480156200001157600080fd5b50604051620060b4380380620060b4833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615ed9620001db600039600081816104eb01526136f60152615ed96000f3fe6080604052600436106102015760003560e01c806201229114610206578063043bd6ae14610233578063088070f5146102575780630ae09540146102d757806315c48b84146102f957806318e3dd27146103215780631b6b6d2314610360578063294926571461038d578063294daa49146103ad578063330987b3146103c9578063405b84fa146103e957806340d6bb821461040957806341af6c87146104345780635d06b4ab1461046457806364d51a2a14610484578063659827441461049957806366316d8d146104b9578063689c4517146104d95780636b6feccc1461050d5780636f64f03f1461054357806372e9d5651461056357806379ba5097146105835780638402595e1461059857806386fe91c7146105b85780638da5cb5b146105d857806395b55cfc146105f65780639b1c385e146106095780639d40a6fd14610629578063a21a23e414610656578063a4c0ed361461066b578063aa433aff1461068b578063aefb212f146106ab578063b08c8795146106d8578063b2a7cac5146106f8578063bec4c08c14610718578063caf70c4a14610738578063cb63179714610758578063ce3f471914610778578063d98e620e1461078b578063da2f2610146107ab578063dac83d29146107e1578063dc311dd314610801578063e72f6e3014610832578063ee9d2d3814610852578063f2fde38b1461087f575b600080fd5b34801561021257600080fd5b5061021b61089f565b60405161022a939291906159cf565b60405180910390f35b34801561023f57600080fd5b5061024960115481565b60405190815260200161022a565b34801561026357600080fd5b50600d5461029f9061ffff81169063ffffffff62010000820481169160ff600160301b82041691600160381b8204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a00161022a565b3480156102e357600080fd5b506102f76102f2366004615650565b61091b565b005b34801561030557600080fd5b5061030e60c881565b60405161ffff909116815260200161022a565b34801561032d57600080fd5b50600a5461034890600160601b90046001600160601b031681565b6040516001600160601b03909116815260200161022a565b34801561036c57600080fd5b50600254610380906001600160a01b031681565b60405161022a9190615873565b34801561039957600080fd5b506102f76103a83660046151c2565b6109e9565b3480156103b957600080fd5b506040516001815260200161022a565b3480156103d557600080fd5b506103486103e43660046153be565b610b66565b3480156103f557600080fd5b506102f7610404366004615650565b611041565b34801561041557600080fd5b5061041f6101f481565b60405163ffffffff909116815260200161022a565b34801561044057600080fd5b5061045461044f366004615300565b61142c565b604051901515815260200161022a565b34801561047057600080fd5b506102f761047f3660046151a5565b6115cd565b34801561049057600080fd5b5061030e606481565b3480156104a557600080fd5b506102f76104b43660046151f7565b611684565b3480156104c557600080fd5b506102f76104d43660046151c2565b6116e4565b3480156104e557600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b34801561051957600080fd5b506012546105359063ffffffff80821691600160201b90041682565b60405161022a929190615b51565b34801561054f57600080fd5b506102f761055e366004615230565b6118ac565b34801561056f57600080fd5b50600354610380906001600160a01b031681565b34801561058f57600080fd5b506102f76119b3565b3480156105a457600080fd5b506102f76105b33660046151a5565b611a5d565b3480156105c457600080fd5b50600a54610348906001600160601b031681565b3480156105e457600080fd5b506000546001600160a01b0316610380565b6102f7610604366004615300565b611b69565b34801561061557600080fd5b5061024961062436600461549b565b611cad565b34801561063557600080fd5b50600754610649906001600160401b031681565b60405161022a9190615b68565b34801561066257600080fd5b5061024961201d565b34801561067757600080fd5b506102f761068636600461526c565b61226b565b34801561069757600080fd5b506102f76106a6366004615300565b612408565b3480156106b757600080fd5b506106cb6106c6366004615675565b61246b565b60405161022a91906158ea565b3480156106e457600080fd5b506102f76106f33660046155b2565b61256c565b34801561070457600080fd5b506102f7610713366004615300565b6126e0565b34801561072457600080fd5b506102f7610733366004615650565b612804565b34801561074457600080fd5b506102496107533660046152c7565b61299b565b34801561076457600080fd5b506102f7610773366004615650565b6129cb565b6102f7610786366004615332565b612cb8565b34801561079757600080fd5b506102496107a6366004615300565b612fc9565b3480156107b757600080fd5b506103806107c6366004615300565b600e602052600090815260409020546001600160a01b031681565b3480156107ed57600080fd5b506102f76107fc366004615650565b612fea565b34801561080d57600080fd5b5061082161081c366004615300565b6130fa565b60405161022a959493929190615b7c565b34801561083e57600080fd5b506102f761084d3660046151a5565b6131f5565b34801561085e57600080fd5b5061024961086d366004615300565b60106020526000908152604090205481565b34801561088b57600080fd5b506102f761089a3660046151a5565b6133d0565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561090957602002820191906000526020600020905b8154815260200190600101908083116108f5575b50505050509050925092509250909192565b60008281526005602052604090205482906001600160a01b03168061095357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146109875780604051636c51fda960e11b815260040161097e9190615873565b60405180910390fd5b600d54600160301b900460ff16156109b25760405163769dd35360e11b815260040160405180910390fd5b6109bb8461142c565b156109d957604051631685ecdd60e31b815260040160405180910390fd5b6109e384846133e1565b50505050565b600d54600160301b900460ff1615610a145760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610a5057604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610a789084906001600160601b0316615d8d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610ac09190615d8d565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b5050905080610b615760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff1615610b945760405163769dd35360e11b815260040160405180910390fd5b60005a90506000610ba5858561359c565b90506000846060015163ffffffff166001600160401b03811115610bcb57610bcb615e93565b604051908082528060200260200182016040528015610bf4578160200160208202803683370190505b50905060005b856060015163ffffffff16811015610c6b57826040015181604051602001610c239291906158fd565b6040516020818303038152906040528051906020012060001c828281518110610c4e57610c4e615e7d565b602090810291909101015280610c6381615de5565b915050610bfa565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b91610ca391908690602401615a59565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805460ff60301b1916600160301b179055908801516080890151919250600091610d089163ffffffff16908461380f565b600d805460ff60301b19169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b0316610d48816001615cf6565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a01518051610d9590600190615d76565b81518110610da557610da5615e7d565b602091010151600d5460f89190911c6001149150600090610dd6908a90600160581b900463ffffffff163a8561385d565b90508115610edf576020808c01516000908152600690915260409020546001600160601b03808316600160601b909204161015610e2657604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c90610e5d908490600160601b90046001600160601b0316615d8d565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c909152812080548594509092610eb691859116615d21565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550610fcb565b6020808c01516000908152600690915260409020546001600160601b0380831691161015610f2057604051631e9acf1760e31b815260040160405180910390fd5b6020808c015160009081526006909152604081208054839290610f4d9084906001600160601b0316615d8d565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b909152812080548594509092610fa691859116615d21565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a604001518488604051611028939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff161561106c5760405163769dd35360e11b815260040160405180910390fd5b611075816138ac565b6110945780604051635428d44960e01b815260040161097e9190615873565b6000806000806110a3866130fa565b945094505093509350336001600160a01b0316826001600160a01b0316146111065760405162461bcd60e51b81526020600482015260166024820152752737ba1039bab139b1b934b83a34b7b71037bbb732b960511b604482015260640161097e565b61110f8661142c565b156111555760405162461bcd60e51b815260206004820152601660248201527550656e64696e6720726571756573742065786973747360501b604482015260640161097e565b60006040518060c0016040528061116a600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b031681525090506000816040516020016111be919061593c565b60405160208183030381529060405290506111d888613916565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b03881690611211908590600401615929565b6000604051808303818588803b15801561122a57600080fd5b505af115801561123e573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611267905057506001600160601b03861615155b156113315760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061129e908a908a906004016158ba565b602060405180830381600087803b1580156112b857600080fd5b505af11580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f091906152e3565b6113315760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015260640161097e565b600d805460ff60301b1916600160301b17905560005b83518110156113da5783818151811061136257611362615e7d565b60200260200101516001600160a01b0316638ea98117896040518263ffffffff1660e01b81526004016113959190615873565b600060405180830381600087803b1580156113af57600080fd5b505af11580156113c3573d6000803e3d6000fd5b5050505080806113d290615de5565b915050611347565b50600d805460ff60301b191690556040517fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be41879061141a9089908b90615887565b60405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287969395860193909291908301828280156114b657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611498575b505050505081525050905060005b8160400151518110156115c35760005b600f548110156115b0576000611579600f83815481106114f6576114f6615e7d565b90600052602060002001548560400151858151811061151757611517615e7d565b602002602001015188600460008960400151898151811061153a5761153a615e7d565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208d82529092529020546001600160401b0316613b64565b506000818152601060205260409020549091501561159d5750600195945050505050565b50806115a881615de5565b9150506114d4565b50806115bb81615de5565b9150506114c4565b5060009392505050565b6115d5613bed565b6115de816138ac565b156115fe578060405163ac8a27ef60e01b815260040161097e9190615873565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383161790556040517fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af0162590611679908390615873565b60405180910390a150565b61168c613bed565b6002546001600160a01b0316156116b657604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff161561170f5760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03166117385760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b038083169116101561177457604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b60205260408120805483929061179c9084906001600160601b0316615d8d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b03166117e49190615d8d565b82546001600160601b039182166101009390930a92830291909202199091161790555060025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061183990859085906004016158ba565b602060405180830381600087803b15801561185357600080fd5b505af1158015611867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188b91906152e3565b6118a857604051631e9acf1760e31b815260040160405180910390fd5b5050565b6118b4613bed565b6040805180820182526000916118e391908490600290839083908082843760009201919091525061299b915050565b6000818152600e60205260409020549091506001600160a01b03161561191f57604051634a0b8fa760e01b81526004810182905260240161097e565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b8910160405180910390a2505050565b6001546001600160a01b03163314611a065760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015260640161097e565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611a65613bed565b600a544790600160601b90046001600160601b031681811115611a9f5780826040516354ced18160e11b815260040161097e9291906158fd565b81811015610b61576000611ab38284615d76565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114611b02576040519150601f19603f3d011682016040523d82523d6000602084013e611b07565b606091505b5050905080611b295760405163950b247960e01b815260040160405180910390fd5b7f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c8583604051611b5a929190615887565b60405180910390a15050505050565b600d54600160301b900460ff1615611b945760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316611bc957604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c611bf88385615d21565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b0316611c409190615d21565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902823484611c939190615cde565b604051611ca19291906158fd565b60405180910390a25050565b600d54600090600160301b900460ff1615611cdb5760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b0316611d1657604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b031680611d63578260200135336040516379bfd40160e01b815260040161097e929190615a2e565b600d5461ffff16611d7a6060850160408601615597565b61ffff161080611d9d575060c8611d976060850160408601615597565b61ffff16115b15611dd757611db26060840160408501615597565b600d5460405163539c34bb60e11b815261097e929161ffff169060c8906004016159b1565b600d5462010000900463ffffffff16611df66080850160608601615697565b63ffffffff161115611e3c57611e126080840160608501615697565b600d54604051637aebf00f60e11b815261097e929162010000900463ffffffff1690600401615b51565b6101f4611e4f60a0850160808601615697565b63ffffffff161115611e8957611e6b60a0840160808501615697565b6101f46040516311ce1afb60e21b815260040161097e929190615b51565b6000611e96826001615cf6565b9050600080611eac863533602089013586613b64565b90925090506000611ec8611ec360a0890189615bd1565b613c42565b90506000611ed582613cbf565b905083611ee0613d30565b60208a0135611ef560808c0160608d01615697565b611f0560a08d0160808e01615697565b3386604051602001611f1d9796959493929190615ab1565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d6040016020810190611f949190615597565b8e6060016020810190611fa79190615697565b8f6080016020810190611fba9190615697565b89604051611fcd96959493929190615a72565b60405180910390a45050336000908152600460209081526040808320898301358452909152902080546001600160401b0319166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561204b5760405163769dd35360e11b815260040160405180910390fd5b600033612059600143615d76565b600754604051606093841b6001600160601b03199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006120d383615e00565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b0381111561211257612112615e93565b60405190808252806020026020018201604052801561213b578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b03928316178355925160018301805490941691161790915592518051949550909361221c9260028501920190614e16565b5061222c91506008905083613dc0565b50817f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d3360405161225d9190615873565b60405180910390a250905090565b600d54600160301b900460ff16156122965760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b031633146122c1576040516344b0e3c360e01b815260040160405180910390fd5b602081146122e257604051638129bbcd60e01b815260040160405180910390fd5b60006122f082840184615300565b6000818152600560205260409020549091506001600160a01b031661232857604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b03169186919061234f8385615d21565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166123979190615d21565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846123ea9190615cde565b6040516123f89291906158fd565b60405180910390a2505050505050565b612410613bed565b6000818152600560205260409020546001600160a01b031661244557604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020546124689082906001600160a01b03166133e1565b50565b606060006124796008613dcc565b905080841061249b57604051631390f2a160e01b815260040160405180910390fd5b60006124a78486615cde565b9050818111806124b5575083155b6124bf57806124c1565b815b905060006124cf8683615d76565b6001600160401b038111156124e6576124e6615e93565b60405190808252806020026020018201604052801561250f578160200160208202803683370190505b50905060005b81518110156125625761253361252b8883615cde565b600890613dd6565b82828151811061254557612545615e7d565b60209081029190910101528061255a81615de5565b915050612515565b5095945050505050565b612574613bed565b60c861ffff871611156125a157858660c860405163539c34bb60e11b815260040161097e939291906159b1565b600082136125c5576040516321ea67b360e11b81526004810183905260240161097e565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff1916881762010000870217600160301b600160781b031916600160381b850263ffffffff60581b191617600160581b83021790558a51601280548d8701519289166001600160401b031990911617600160201b92891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff161561270b5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661274057604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612797576000818152600560205260409081902060010154905163d084e97560e01b815261097e916001600160a01b031690600401615873565b6000818152600560205260409081902080546001600160a01b031980821633908117845560019093018054909116905591516001600160a01b039092169183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691611ca19185916158a0565b60008281526005602052604090205482906001600160a01b03168061283c57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146128675780604051636c51fda960e11b815260040161097e9190615873565b600d54600160301b900460ff16156128925760405163769dd35360e11b815260040160405180910390fd5b600084815260056020526040902060020154606414156128c5576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316156128fc576109e3565b6001600160a01b0383166000818152600460209081526040808320888452825280832080546001600160401b031916600190811790915560058352818420600201805491820181558452919092200180546001600160a01b0319169092179091555184907f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e19061298d908690615873565b60405180910390a250505050565b6000816040516020016129ae91906158dc565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b031680612a0357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612a2e5780604051636c51fda960e11b815260040161097e9190615873565b600d54600160301b900460ff1615612a595760405163769dd35360e11b815260040160405180910390fd5b612a628461142c565b15612a8057604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316612ace5783836040516379bfd40160e01b815260040161097e929190615a2e565b600084815260056020908152604080832060020180548251818502810185019093528083529192909190830182828015612b3157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612b13575b50505050509050600060018251612b489190615d76565b905060005b8251811015612c5457856001600160a01b0316838281518110612b7257612b72615e7d565b60200260200101516001600160a01b03161415612c42576000838381518110612b9d57612b9d615e7d565b6020026020010151905080600560008a81526020019081526020016000206002018381548110612bcf57612bcf615e7d565b600091825260208083209190910180546001600160a01b0319166001600160a01b039490941693909317909255898152600590915260409020600201805480612c1a57612c1a615e67565b600082815260209020810160001990810180546001600160a01b031916905501905550612c54565b80612c4c81615de5565b915050612b4d565b506001600160a01b03851660009081526004602090815260408083208984529091529081902080546001600160401b03191690555186907f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7906123f8908890615873565b6000612cc6828401846154d5565b9050806000015160ff16600114612cff57805160405163237d181f60e21b815260ff90911660048201526001602482015260440161097e565b8060a001516001600160601b03163414612d435760a08101516040516306acf13560e41b81523460048201526001600160601b03909116602482015260440161097e565b6020808201516000908152600590915260409020546001600160a01b031615612d7f576040516326afa43560e11b815260040160405180910390fd5b60005b816060015151811015612e1f5760016004600084606001518481518110612dab57612dab615e7d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008460200151815260200190815260200160002060006101000a8154816001600160401b0302191690836001600160401b031602179055508080612e1790615de5565b915050612d82565b50604080516060808201835260808401516001600160601b03908116835260a0850151811660208085019182526000858701818152828901805183526006845288832097518854955192516001600160401b0316600160c01b026001600160c01b03938816600160601b026001600160c01b0319909716919097161794909417169390931790945584518084018652868601516001600160a01b03908116825281860184815294880151828801908152925184526005865295909220825181549087166001600160a01b0319918216178255935160018201805491909716941693909317909455925180519192612f1e92600285019290910190614e16565b5050506080810151600a8054600090612f419084906001600160601b0316615d21565b92506101000a8154816001600160601b0302191690836001600160601b031602179055508060a00151600a600c8282829054906101000a90046001600160601b0316612f8d9190615d21565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506109e381602001516008613dc090919063ffffffff16565b600f8181548110612fd957600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061302257604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461304d5780604051636c51fda960e11b815260040161097e9190615873565b600d54600160301b900460ff16156130785760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b038481169116146109e3576000848152600560205260409081902060010180546001600160a01b0319166001600160a01b0386161790555184907f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19061298d90339087906158a0565b6000818152600560205260408120548190819081906060906001600160a01b031661313857604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156131db57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116131bd575b505050505090509450945094509450945091939590929450565b6131fd613bed565b6002546001600160a01b03166132265760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190613257903090600401615873565b60206040518083038186803b15801561326f57600080fd5b505afa158015613283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132a79190615319565b600a549091506001600160601b0316818111156132db5780826040516354ced18160e11b815260040161097e9291906158fd565b81811015610b615760006132ef8284615d76565b60025460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906133229087908590600401615887565b602060405180830381600087803b15801561333c57600080fd5b505af1158015613350573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061337491906152e3565b61339157604051631f01ff1360e21b815260040160405180910390fd5b7f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b43660084826040516133c2929190615887565b60405180910390a150505050565b6133d8613bed565b61246881613de2565b6000806133ed84613916565b60025491935091506001600160a01b03161580159061341457506001600160601b03821615155b156134c35760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906134549086906001600160601b03871690600401615887565b602060405180830381600087803b15801561346e57600080fd5b505af1158015613482573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134a691906152e3565b6134c357604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613519576040519150601f19603f3d011682016040523d82523d6000602084013e61351e565b606091505b50509050806135405760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006135c8846000015161299b565b6000818152600e60205260409020549091506001600160a01b03168061360457604051631dfd6e1360e21b81526004810183905260240161097e565b600082866080015160405160200161361d9291906158fd565b60408051601f198184030181529181528151602092830120600081815260109093529120549091508061366357604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613692978a979096959101615afd565b6040516020818303038152906040528051906020012081146136c75760405163354a450b60e21b815260040160405180910390fd5b60006136d68760000151613e86565b90508061379d578651604051631d2827a760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163e9413d389161372a9190600401615b68565b60206040518083038186803b15801561374257600080fd5b505afa158015613756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061377a9190615319565b90508061379d57865160405163175dadad60e01b815261097e9190600401615b68565b60008860800151826040516020016137bf929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905060006137e68a83613f63565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a61138881101561382157600080fd5b61138881039050846040820482031161383957600080fd5b50823b61384557600080fd5b60008083516020850160008789f190505b9392505050565b6000811561388a576012546138839086908690600160201b900463ffffffff1686613fce565b90506138a4565b6012546138a1908690869063ffffffff1686614038565b90505b949350505050565b6000805b60135481101561390d57826001600160a01b0316601382815481106138d7576138d7615e7d565b6000918252602090912001546001600160a01b031614156138fb5750600192915050565b8061390581615de5565b9150506138b0565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879687969495948601939192908301828280156139a257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613984575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613a7e576004600084604001518381518110613a2e57613a2e615e7d565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902080546001600160401b031916905580613a7681615de5565b915050613a07565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613ab66002830182614e7b565b5050600085815260066020526040812055613ad2600886614125565b50600a8054859190600090613af19084906001600160601b0316615d8d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613b399190615d8d565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081018690526001600160a01b03851691810191909152606081018390526001600160401b03821660808201526000908190819060a00160408051601f198184030181529082905280516020918201209250613bc99189918491016158fd565b60408051808303601f19018152919052805160209091012097909650945050505050565b6000546001600160a01b03163314613c405760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b604482015260640161097e565b565b60408051602081019091526000815281613c6b575060408051602081019091526000815261103b565b63125fa26760e31b613c7d8385615db5565b6001600160e01b03191614613ca557604051632923fee760e11b815260040160405180910390fd5b613cb28260048186615cb4565b8101906138569190615373565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613cf891511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b600046613d3c81614131565b15613db95760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d7b57600080fd5b505afa158015613d8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613db39190615319565b91505090565b4391505090565b60006138568383614154565b600061103b825490565b600061385683836141a3565b6001600160a01b038116331415613e355760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b604482015260640161097e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600046613e9281614131565b15613f5457610100836001600160401b0316613eac613d30565b613eb69190615d76565b1180613ed25750613ec5613d30565b836001600160401b031610155b15613ee05750600092915050565b6040516315a03d4160e11b8152606490632b407a8290613f04908690600401615b68565b60206040518083038186803b158015613f1c57600080fd5b505afa158015613f30573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138569190615319565b50506001600160401b03164090565b6000613f978360000151846020015185604001518660600151868860a001518960c001518a60e001518b61010001516141cd565b60038360200151604051602001613faf929190615a45565b60408051601f1981840301815291905280516020909101209392505050565b600080613fd96143e8565b905060005a613fe88888615cde565b613ff29190615d76565b613ffc9085615d57565b9050600061401563ffffffff871664e8d4a51000615d57565b9050826140228284615cde565b61402c9190615cde565b98975050505050505050565b60008061404361443b565b905060008113614069576040516321ea67b360e11b81526004810182905260240161097e565b60006140736143e8565b9050600082825a6140848b8b615cde565b61408e9190615d76565b6140989088615d57565b6140a29190615cde565b6140b490670de0b6b3a7640000615d57565b6140be9190615d43565b905060006140d763ffffffff881664e8d4a51000615d57565b90506140ee81676765c793fa10079d601b1b615d76565b82111561410e5760405163e80fa38160e01b815260040160405180910390fd5b6141188183615cde565b9998505050505050505050565b60006138568383614506565b600061a4b1821480614145575062066eed82145b8061103b57505062066eee1490565b600081815260018301602052604081205461419b5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561103b565b50600061103b565b60008260000182815481106141ba576141ba615e7d565b9060005260206000200154905092915050565b6141d6896145f9565b61421f5760405162461bcd60e51b815260206004820152601a6024820152797075626c6963206b6579206973206e6f74206f6e20637572766560301b604482015260640161097e565b614228886145f9565b61426c5760405162461bcd60e51b815260206004820152601560248201527467616d6d61206973206e6f74206f6e20637572766560581b604482015260640161097e565b614275836145f9565b6142c15760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e206375727665000000604482015260640161097e565b6142ca826145f9565b6143155760405162461bcd60e51b815260206004820152601c60248201527b73486173685769746e657373206973206e6f74206f6e20637572766560201b604482015260640161097e565b614321878a88876146bc565b6143695760405162461bcd60e51b81526020600482015260196024820152786164647228632a706b2b732a6729213d5f755769746e65737360381b604482015260640161097e565b60006143758a876147d0565b90506000614388898b878b868989614834565b90506000614399838d8d8a86614947565b9050808a146143da5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b604482015260640161097e565b505050505050505050505050565b6000466143f481614131565b1561443357606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d7b57600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093600160381b900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561449957600080fd5b505afa1580156144ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144d191906156b2565b5094509092508491505080156144f557506144ec8242615d76565b8463ffffffff16105b156138a45750601154949350505050565b600081815260018301602052604081205480156145ef57600061452a600183615d76565b855490915060009061453e90600190615d76565b90508181146145a357600086600001828154811061455e5761455e615e7d565b906000526020600020015490508087600001848154811061458157614581615e7d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145b4576145b4615e67565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061103b565b600091505061103b565b80516000906401000003d019116146475760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420782d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d019116146955760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420792d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d0199080096146b58360005b6020020151614987565b1492915050565b60006001600160a01b0382166147025760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b604482015260640161097e565b60208401516000906001161561471957601c61471c565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020909101918290529293506001916147869186918891879061590b565b6020604051602081039080840390855afa1580156147a8573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b6147d8614e99565b614805600184846040516020016147f193929190615852565b6040516020818303038152906040526149ab565b90505b614811816145f9565b61103b57805160408051602081019290925261482d91016147f1565b9050614808565b61483c614e99565b825186516401000003d019908190069106141561489b5760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e63740000604482015260640161097e565b6148a68789886149f9565b6148eb5760405162461bcd60e51b8152602060048201526016602482015275119a5c9cdd081b5d5b0818da1958dac819985a5b195960521b604482015260640161097e565b6148f68486856149f9565b61493c5760405162461bcd60e51b815260206004820152601760248201527614d958dbdb99081b5d5b0818da1958dac819985a5b1959604a1b604482015260640161097e565b61402c868484614b14565b600060028686868587604051602001614965969594939291906157f8565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b6149b3614e99565b6149bc82614bd7565b81526149d16149cc8260006146ab565b614c12565b602082018190526002900660011415612018576020810180516401000003d019039052919050565b600082614a365760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b604482015260640161097e565b83516020850151600090614a4c90600290615e27565b15614a5857601c614a5b565b601b5b9050600070014551231950b75fc4402da1732fc9bebe19838709604080516000808252602090910191829052919250600190614a9e90839086908890879061590b565b6020604051602081039080840390855afa158015614ac0573d6000803e3d6000fd5b505050602060405103519050600086604051602001614adf91906157e6565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614b1c614e99565b835160208086015185519186015160009384938493614b3d93909190614c32565b919450925090506401000003d019858209600114614b995760405162461bcd60e51b815260206004820152601960248201527834b73b2d1036bab9ba1031329034b73b32b939b29037b3103d60391b604482015260640161097e565b60405180604001604052806401000003d01980614bb857614bb8615e51565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d019811061201857604080516020808201939093528151808203840181529082019091528051910120614bdf565b600061103b826002614c2b6401000003d0196001615cde565b901c614d12565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614c7283838585614da9565b9098509050614c8388828e88614dcd565b9098509050614c9488828c87614dcd565b90985090506000614ca78d878b85614dcd565b9098509050614cb888828686614da9565b9098509050614cc988828e89614dcd565b9098509050818114614cfe576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614d02565b8196505b5050505050509450945094915050565b600080614d1d614eb7565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614d4f614ed5565b60208160c0846005600019fa925082614d9f5760405162461bcd60e51b81526020600482015260126024820152716269674d6f64457870206661696c7572652160701b604482015260640161097e565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614e6b579160200282015b82811115614e6b57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614e36565b50614e77929150614ef3565b5090565b50805460008255906000526020600020908101906124689190614ef3565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614e775760008155600101614ef4565b803561201881615ea9565b600082601f830112614f2457600080fd5b813560206001600160401b03821115614f3f57614f3f615e93565b8160051b614f4e828201615c84565b838152828101908684018388018501891015614f6957600080fd5b600093505b85841015614f95578035614f8181615ea9565b835260019390930192918401918401614f6e565b50979650505050505050565b600082601f830112614fb257600080fd5b614fba615c17565b808385604086011115614fcc57600080fd5b60005b6002811015614fee578135845260209384019390910190600101614fcf565b509095945050505050565b60008083601f84011261500b57600080fd5b5081356001600160401b0381111561502257600080fd5b60208301915083602082850101111561503a57600080fd5b9250929050565b600082601f83011261505257600080fd5b81356001600160401b0381111561506b5761506b615e93565b61507e601f8201601f1916602001615c84565b81815284602083860101111561509357600080fd5b816020850160208301376000918101602001919091529392505050565b600060c082840312156150c257600080fd5b6150ca615c3f565b905081356001600160401b0380821682146150e457600080fd5b818352602084013560208401526150fd60408501615163565b604084015261510e60608501615163565b606084015261511f60808501614f08565b608084015260a084013591508082111561513857600080fd5b5061514584828501615041565b60a08301525092915050565b803561ffff8116811461201857600080fd5b803563ffffffff8116811461201857600080fd5b80516001600160501b038116811461201857600080fd5b80356001600160601b038116811461201857600080fd5b6000602082840312156151b757600080fd5b813561385681615ea9565b600080604083850312156151d557600080fd5b82356151e081615ea9565b91506151ee6020840161518e565b90509250929050565b6000806040838503121561520a57600080fd5b823561521581615ea9565b9150602083013561522581615ea9565b809150509250929050565b6000806060838503121561524357600080fd5b823561524e81615ea9565b91506060830184101561526057600080fd5b50926020919091019150565b6000806000806060858703121561528257600080fd5b843561528d81615ea9565b93506020850135925060408501356001600160401b038111156152af57600080fd5b6152bb87828801614ff9565b95989497509550505050565b6000604082840312156152d957600080fd5b6138568383614fa1565b6000602082840312156152f557600080fd5b815161385681615ebe565b60006020828403121561531257600080fd5b5035919050565b60006020828403121561532b57600080fd5b5051919050565b6000806020838503121561534557600080fd5b82356001600160401b0381111561535b57600080fd5b61536785828601614ff9565b90969095509350505050565b60006020828403121561538557600080fd5b604051602081016001600160401b03811182821017156153a7576153a7615e93565b60405282356153b581615ebe565b81529392505050565b6000808284036101c08112156153d357600080fd5b6101a0808212156153e357600080fd5b6153eb615c61565b91506153f78686614fa1565b82526154068660408701614fa1565b60208301526080850135604083015260a0850135606083015260c0850135608083015261543560e08601614f08565b60a083015261010061544987828801614fa1565b60c084015261545c876101408801614fa1565b60e0840152610180860135908301529092508301356001600160401b0381111561548557600080fd5b615491858286016150b0565b9150509250929050565b6000602082840312156154ad57600080fd5b81356001600160401b038111156154c357600080fd5b820160c0818503121561385657600080fd5b6000602082840312156154e757600080fd5b81356001600160401b03808211156154fe57600080fd5b9083019060c0828603121561551257600080fd5b61551a615c3f565b823560ff8116811461552b57600080fd5b81526020838101359082015261554360408401614f08565b604082015260608301358281111561555a57600080fd5b61556687828601614f13565b6060830152506155786080840161518e565b608082015261558960a0840161518e565b60a082015295945050505050565b6000602082840312156155a957600080fd5b61385682615151565b60008060008060008086880360e08112156155cc57600080fd5b6155d588615151565b96506155e360208901615163565b95506155f160408901615163565b94506155ff60608901615163565b9350608088013592506040609f198201121561561a57600080fd5b50615623615c17565b61562f60a08901615163565b815261563d60c08901615163565b6020820152809150509295509295509295565b6000806040838503121561566357600080fd5b82359150602083013561522581615ea9565b6000806040838503121561568857600080fd5b50508035926020909101359150565b6000602082840312156156a957600080fd5b61385682615163565b600080600080600060a086880312156156ca57600080fd5b6156d386615177565b94506020860151935060408601519250606086015191506156f660808701615177565b90509295509295909350565b600081518084526020808501945080840160005b8381101561573b5781516001600160a01b031687529582019590820190600101615716565b509495945050505050565b8060005b60028110156109e357815184526020938401939091019060010161574a565b600081518084526020808501945080840160005b8381101561573b5781518752958201959082019060010161577d565b6000815180845260005b818110156157bf576020818501810151868301820152016157a3565b818111156157d1576000602083870101525b50601f01601f19169290920160200192915050565b6157f08183615746565b604001919050565b8681526158086020820187615746565b6158156060820186615746565b61582260a0820185615746565b61582f60e0820184615746565b60609190911b6001600160601b0319166101208201526101340195945050505050565b8381526158626020820184615746565b606081019190915260800192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039290921682526001600160601b0316602082015260400190565b6040810161103b8284615746565b6020815260006138566020830184615769565b918252602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b6020815260006138566020830184615799565b6020815260ff82511660208201526020820151604082015260018060a01b0360408301511660608201526000606083015160c0608084015261598160e0840182615702565b60808501516001600160601b0390811660a0868101919091529095015190941660c0909301929092525090919050565b61ffff93841681529183166020830152909116604082015260600190565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615a2057845183529383019391830191600101615a04565b509098975050505050505050565b9182526001600160a01b0316602082015260400190565b828152606081016138566020830184615746565b8281526040602082015260006138a46040830184615769565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261402c60c0830184615799565b878152602081018790526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c0820181905260009061411890830184615799565b8781526001600160401b03871660208201526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c0820181905260009061411890830184615799565b63ffffffff92831681529116602082015260400190565b6001600160401b0391909116815260200190565b6001600160601b038681168252851660208201526001600160401b03841660408201526001600160a01b038316606082015260a060808201819052600090615bc690830184615702565b979650505050505050565b6000808335601e19843603018112615be857600080fd5b8301803591506001600160401b03821115615c0257600080fd5b60200191503681900382131561503a57600080fd5b604080519081016001600160401b0381118282101715615c3957615c39615e93565b60405290565b60405160c081016001600160401b0381118282101715615c3957615c39615e93565b60405161012081016001600160401b0381118282101715615c3957615c39615e93565b604051601f8201601f191681016001600160401b0381118282101715615cac57615cac615e93565b604052919050565b60008085851115615cc457600080fd5b83861115615cd157600080fd5b5050820193919092039150565b60008219821115615cf157615cf1615e3b565b500190565b60006001600160401b03828116848216808303821115615d1857615d18615e3b565b01949350505050565b60006001600160601b03828116848216808303821115615d1857615d18615e3b565b600082615d5257615d52615e51565b500490565b6000816000190483118215151615615d7157615d71615e3b565b500290565b600082821015615d8857615d88615e3b565b500390565b60006001600160601b0383811690831681811015615dad57615dad615e3b565b039392505050565b6001600160e01b03198135818116916004851015615ddd5780818660040360031b1b83161692505b505092915050565b6000600019821415615df957615df9615e3b565b5060010190565b60006001600160401b0382811680821415615e1d57615e1d615e3b565b6001019392505050565b600082615e3657615e36615e51565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461246857600080fd5b801515811461246857600080fdfea164736f6c6343000806000a", } var VRFCoordinatorV2PlusUpgradedVersionABI = VRFCoordinatorV2PlusUpgradedVersionMetaData.ABI diff --git a/core/gethwrappers/generated/vrfv2_wrapper/vrfv2_wrapper.go b/core/gethwrappers/generated/vrfv2_wrapper/vrfv2_wrapper.go index e50c335e03b..9ce091f8a50 100644 --- a/core/gethwrappers/generated/vrfv2_wrapper/vrfv2_wrapper.go +++ b/core/gethwrappers/generated/vrfv2_wrapper/vrfv2_wrapper.go @@ -32,7 +32,7 @@ var ( var VRFV2WrapperMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkEthFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractExtendedVRFCoordinatorV2Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_ETH_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"requestGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"int256\",\"name\":\"requestWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"juelsPaid\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101206040526001805463ffffffff60a01b1916609160a21b1790553480156200002857600080fd5b50604051620025d0380380620025d08339810160408190526200004b91620002d8565b803380600081620000a35760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d657620000d6816200020f565b5050506001600160601b0319606091821b811660805284821b811660a05283821b811660c0529082901b1660e0526040805163288688f960e21b815290516000916001600160a01b0384169163a21a23e49160048082019260209290919082900301818787803b1580156200014a57600080fd5b505af11580156200015f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000185919062000322565b60c081901b6001600160c01b03191661010052604051631cd0704360e21b81526001600160401b03821660048201523060248201529091506001600160a01b03831690637341c10c90604401600060405180830381600087803b158015620001ec57600080fd5b505af115801562000201573d6000803e3d6000fd5b505050505050505062000354565b6001600160a01b0381163314156200026a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620002d357600080fd5b919050565b600080600060608486031215620002ee57600080fd5b620002f984620002bb565b92506200030960208501620002bb565b91506200031960408501620002bb565b90509250925092565b6000602082840312156200033557600080fd5b81516001600160401b03811681146200034d57600080fd5b9392505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160c01c6121e9620003e7600039600081816101970152610c5501526000818161028401528181610c1601528181610fec015281816110cd01526111680152600081816103fd015261161c01526000818161021b01528181610a6801526112ba01526000818161055801526105c001526121e96000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c80638da5cb5b116100e3578063c15ce4d71161008c578063f2fde38b11610066578063f2fde38b14610511578063f3fef3a314610524578063fc2a88c31461053757600080fd5b8063c15ce4d714610432578063c3f909d414610445578063cdd8d885146104d457600080fd5b8063a608a1e1116100bd578063a608a1e1146103e6578063ad178361146103f8578063bf17e5591461041f57600080fd5b80638da5cb5b146103ad578063a3907d71146103cb578063a4c0ed36146103d357600080fd5b80633b2bcbf11161014557806357a8070a1161011f57806357a8070a1461037557806379ba5097146103925780637fb5d19d1461039a57600080fd5b80633b2bcbf11461027f5780634306d354146102a657806348baa1c5146102c757600080fd5b80631b6b6d23116101765780631b6b6d23146102165780631fe543e3146102625780632f2770db1461027757600080fd5b8063030932bb14610192578063181f5a77146101d7575b600080fd5b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b604080518082018252601281527f56524656325772617070657220312e302e300000000000000000000000000000602082015290516101ce9190611f7c565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ce565b610275610270366004611c61565b610540565b005b610275610600565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b6102b96102b4366004611d9a565b610636565b6040519081526020016101ce565b6103316102d5366004611c48565b600860205260009081526040902080546001820154600283015460039093015473ffffffffffffffffffffffffffffffffffffffff8316937401000000000000000000000000000000000000000090930463ffffffff16929085565b6040805173ffffffffffffffffffffffffffffffffffffffff909616865263ffffffff9094166020860152928401919091526060830152608082015260a0016101ce565b6003546103829060ff1681565b60405190151581526020016101ce565b61027561073d565b6102b96103a8366004611e02565b61083a565b60005473ffffffffffffffffffffffffffffffffffffffff1661023d565b610275610940565b6102756103e1366004611b27565b610972565b60035461038290610100900460ff1681565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b61027561042d366004611d9a565b610e50565b610275610440366004611ed6565b610ea7565b6004546005546006546007546040805194855263ffffffff80851660208701526401000000008504811691860191909152680100000000000000008404811660608601526c01000000000000000000000000840416608085015260ff700100000000000000000000000000000000909304831660a085015260c08401919091521660e0820152610100016101ce565b6001546104fc9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016101ce565b61027561051f366004611ae2565b611252565b610275610532366004611afd565b611266565b6102b960025481565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105f2576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6105fc828261133b565b5050565b610608611546565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60035460009060ff166106a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff1615610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b60006107216115c9565b90506107348363ffffffff163a8361173d565b9150505b919050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146107be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016105e9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60035460009060ff166108a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff161561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b60006109256115c9565b90506109388463ffffffff16848361173d565b949350505050565b610948611546565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60035460ff166109de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff1615610a50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610aef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b00000000000000000060448201526064016105e9565b60008080610aff84860186611db7565b9250925092506000610b108461185e565b90506000610b1c6115c9565b90506000610b318663ffffffff163a8461173d565b905080891015610b9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f7700000000000000000000000000000000000000000060448201526064016105e9565b60075460ff1663ffffffff85161115610c12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f206869676800000000000000000000000000000060448201526064016105e9565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635d3b1d306006547f000000000000000000000000000000000000000000000000000000000000000089600560089054906101000a900463ffffffff16898d610c949190612055565b610c9e9190612055565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b168152600481019490945267ffffffffffffffff909216602484015261ffff16604483015263ffffffff90811660648301528816608482015260a401602060405180830381600087803b158015610d1d57600080fd5b505af1158015610d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d559190611bd0565b90506040518060a001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018863ffffffff1681526020013a81526020018481526020018b8152506008600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff160217905550604082015181600101556060820151816002015560808201518160030155905050806002819055505050505050505050505050565b610e58611546565b6001805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b610eaf611546565b6005805460ff808616700100000000000000000000000000000000027fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff63ffffffff8981166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff918c166801000000000000000002919091167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff909516949094179390931792909216919091179091556006839055600780549183167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00928316179055600380549091166001179055604080517fc3f909d4000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163c3f909d4916004828101926080929190829003018186803b15801561103257600080fd5b505afa158015611046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106a9190611be9565b50600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f356dac7100000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163356dac71916004808301926020929190829003018186803b15801561112857600080fd5b505afa15801561113c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111609190611bd0565b6004819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635fbbc0d26040518163ffffffff1660e01b81526004016101206040518083038186803b1580156111cd57600080fd5b505afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112059190611e20565b50506005805463ffffffff909816640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909816979097179096555050505050505050505050565b61125a611546565b6112638161187c565b50565b61126e611546565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b1580156112fe57600080fd5b505af1158015611312573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113369190611bae565b505050565b6000828152600860208181526040808420815160a081018352815473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008304168387015260018401805495840195909552600284018054606085015260038501805460808601528b8a52979096527fffffffffffffffff000000000000000000000000000000000000000000000000909116909255918590559184905592909155815116611458576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016105e9565b600080631fe543e360e01b8585604051602401611476929190611fef565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060006114f0846020015163ffffffff16856000015184611972565b90508061153e57835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146115c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016105e9565b565b600554604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009263ffffffff161515918391829173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163feaf968c9160048082019260a092909190829003018186803b15801561166357600080fd5b505afa158015611677573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169b9190611f38565b5094509092508491505080156116c157506116b68242612116565b60055463ffffffff16105b156116cb57506004545b6000811215611736576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b207765692070726963650000000000000000000060448201526064016105e9565b9392505050565b600154600090819061176c9074010000000000000000000000000000000000000000900463ffffffff166119be565b60055463ffffffff6c01000000000000000000000000820481169161179f9168010000000000000000909104168861203d565b6117a9919061203d565b6117b390866120d9565b6117bd919061203d565b90506000836117d483670de0b6b3a76400006120d9565b6117de91906120a2565b60055490915060009060649061180b90700100000000000000000000000000000000900460ff168261207d565b6118189060ff16846120d9565b61182291906120a2565b60055490915060009061184890640100000000900463ffffffff1664e8d4a510006120d9565b611852908361203d565b98975050505050505050565b600061186b603f836120b6565b611876906001612055565b92915050565b73ffffffffffffffffffffffffffffffffffffffff81163314156118fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016105e9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561198457600080fd5b61138881039050846040820482031161199c57600080fd5b50823b6119a857600080fd5b60008083516020850160008789f1949350505050565b60004661a4b18114806119d3575062066eed81145b15611a77576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b158015611a2157600080fd5b505afa158015611a35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a599190611d50565b5050505091505083608c611a6d919061203d565b61093890826120d9565b50600092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461073857600080fd5b805162ffffff8116811461073857600080fd5b803560ff8116811461073857600080fd5b805169ffffffffffffffffffff8116811461073857600080fd5b600060208284031215611af457600080fd5b61173682611a80565b60008060408385031215611b1057600080fd5b611b1983611a80565b946020939093013593505050565b60008060008060608587031215611b3d57600080fd5b611b4685611a80565b935060208501359250604085013567ffffffffffffffff80821115611b6a57600080fd5b818701915087601f830112611b7e57600080fd5b813581811115611b8d57600080fd5b886020828501011115611b9f57600080fd5b95989497505060200194505050565b600060208284031215611bc057600080fd5b8151801515811461173657600080fd5b600060208284031215611be257600080fd5b5051919050565b60008060008060808587031215611bff57600080fd5b8451611c0a816121ba565b6020860151909450611c1b816121ca565b6040860151909350611c2c816121ca565b6060860151909250611c3d816121ca565b939692955090935050565b600060208284031215611c5a57600080fd5b5035919050565b60008060408385031215611c7457600080fd5b8235915060208084013567ffffffffffffffff80821115611c9457600080fd5b818601915086601f830112611ca857600080fd5b813581811115611cba57611cba61218b565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611cfd57611cfd61218b565b604052828152858101935084860182860187018b1015611d1c57600080fd5b600095505b83861015611d3f578035855260019590950194938601938601611d21565b508096505050505050509250929050565b60008060008060008060c08789031215611d6957600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b600060208284031215611dac57600080fd5b8135611736816121ca565b600080600060608486031215611dcc57600080fd5b8335611dd7816121ca565b92506020840135611de7816121ba565b91506040840135611df7816121ca565b809150509250925092565b60008060408385031215611e1557600080fd5b8235611b19816121ca565b60008060008060008060008060006101208a8c031215611e3f57600080fd5b8951611e4a816121ca565b60208b0151909950611e5b816121ca565b60408b0151909850611e6c816121ca565b60608b0151909750611e7d816121ca565b60808b0151909650611e8e816121ca565b9450611e9c60a08b01611aa4565b9350611eaa60c08b01611aa4565b9250611eb860e08b01611aa4565b9150611ec76101008b01611aa4565b90509295985092959850929598565b600080600080600060a08688031215611eee57600080fd5b8535611ef9816121ca565b94506020860135611f09816121ca565b9350611f1760408701611ab7565b925060608601359150611f2c60808701611ab7565b90509295509295909350565b600080600080600060a08688031215611f5057600080fd5b611f5986611ac8565b9450602086015193506040860151925060608601519150611f2c60808701611ac8565b600060208083528351808285015260005b81811015611fa957858101830151858201604001528201611f8d565b81811115611fbb576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b8181101561203057845183529383019391830191600101612014565b5090979650505050505050565b600082198211156120505761205061212d565b500190565b600063ffffffff8083168185168083038211156120745761207461212d565b01949350505050565b600060ff821660ff84168060ff0382111561209a5761209a61212d565b019392505050565b6000826120b1576120b161215c565b500490565b600063ffffffff808416806120cd576120cd61215c565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156121115761211161212d565b500290565b6000828210156121285761212861212d565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff8116811461126357600080fd5b63ffffffff8116811461126357600080fdfea164736f6c6343000806000a", + Bin: "0x6101206040526001805463ffffffff60a01b1916609160a21b1790553480156200002857600080fd5b50604051620025ea380380620025ea8339810160408190526200004b91620002d8565b803380600081620000a35760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d657620000d6816200020f565b5050506001600160601b0319606091821b811660805284821b811660a05283821b811660c0529082901b1660e0526040805163288688f960e21b815290516000916001600160a01b0384169163a21a23e49160048082019260209290919082900301818787803b1580156200014a57600080fd5b505af11580156200015f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000185919062000322565b60c081901b6001600160c01b03191661010052604051631cd0704360e21b81526001600160401b03821660048201523060248201529091506001600160a01b03831690637341c10c90604401600060405180830381600087803b158015620001ec57600080fd5b505af115801562000201573d6000803e3d6000fd5b505050505050505062000354565b6001600160a01b0381163314156200026a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620002d357600080fd5b919050565b600080600060608486031215620002ee57600080fd5b620002f984620002bb565b92506200030960208501620002bb565b91506200031960408501620002bb565b90509250925092565b6000602082840312156200033557600080fd5b81516001600160401b03811681146200034d57600080fd5b9392505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160c01c612203620003e7600039600081816101970152610c5501526000818161028401528181610c1601528181610fec015281816110cd01526111680152600081816103fd015261161c01526000818161021b01528181610a6801526112ba01526000818161055801526105c001526122036000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c80638da5cb5b116100e3578063c15ce4d71161008c578063f2fde38b11610066578063f2fde38b14610511578063f3fef3a314610524578063fc2a88c31461053757600080fd5b8063c15ce4d714610432578063c3f909d414610445578063cdd8d885146104d457600080fd5b8063a608a1e1116100bd578063a608a1e1146103e6578063ad178361146103f8578063bf17e5591461041f57600080fd5b80638da5cb5b146103ad578063a3907d71146103cb578063a4c0ed36146103d357600080fd5b80633b2bcbf11161014557806357a8070a1161011f57806357a8070a1461037557806379ba5097146103925780637fb5d19d1461039a57600080fd5b80633b2bcbf11461027f5780634306d354146102a657806348baa1c5146102c757600080fd5b80631b6b6d23116101765780631b6b6d23146102165780631fe543e3146102625780632f2770db1461027757600080fd5b8063030932bb14610192578063181f5a77146101d7575b600080fd5b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b604080518082018252601281527f56524656325772617070657220312e302e300000000000000000000000000000602082015290516101ce9190611f96565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ce565b610275610270366004611c7b565b610540565b005b610275610600565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b6102b96102b4366004611db4565b610636565b6040519081526020016101ce565b6103316102d5366004611c62565b600860205260009081526040902080546001820154600283015460039093015473ffffffffffffffffffffffffffffffffffffffff8316937401000000000000000000000000000000000000000090930463ffffffff16929085565b6040805173ffffffffffffffffffffffffffffffffffffffff909616865263ffffffff9094166020860152928401919091526060830152608082015260a0016101ce565b6003546103829060ff1681565b60405190151581526020016101ce565b61027561073d565b6102b96103a8366004611e1c565b61083a565b60005473ffffffffffffffffffffffffffffffffffffffff1661023d565b610275610940565b6102756103e1366004611b41565b610972565b60035461038290610100900460ff1681565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b61027561042d366004611db4565b610e50565b610275610440366004611ef0565b610ea7565b6004546005546006546007546040805194855263ffffffff80851660208701526401000000008504811691860191909152680100000000000000008404811660608601526c01000000000000000000000000840416608085015260ff700100000000000000000000000000000000909304831660a085015260c08401919091521660e0820152610100016101ce565b6001546104fc9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016101ce565b61027561051f366004611afc565b611252565b610275610532366004611b17565b611266565b6102b960025481565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105f2576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6105fc828261133b565b5050565b610608611546565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60035460009060ff166106a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff1615610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b60006107216115c9565b90506107348363ffffffff163a8361173d565b9150505b919050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146107be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016105e9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60035460009060ff166108a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff161561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b60006109256115c9565b90506109388463ffffffff16848361173d565b949350505050565b610948611546565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60035460ff166109de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff1615610a50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610aef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b00000000000000000060448201526064016105e9565b60008080610aff84860186611dd1565b9250925092506000610b108461185e565b90506000610b1c6115c9565b90506000610b318663ffffffff163a8461173d565b905080891015610b9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f7700000000000000000000000000000000000000000060448201526064016105e9565b60075460ff1663ffffffff85161115610c12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f206869676800000000000000000000000000000060448201526064016105e9565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635d3b1d306006547f000000000000000000000000000000000000000000000000000000000000000089600560089054906101000a900463ffffffff16898d610c94919061206f565b610c9e919061206f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b168152600481019490945267ffffffffffffffff909216602484015261ffff16604483015263ffffffff90811660648301528816608482015260a401602060405180830381600087803b158015610d1d57600080fd5b505af1158015610d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d559190611bea565b90506040518060a001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018863ffffffff1681526020013a81526020018481526020018b8152506008600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff160217905550604082015181600101556060820151816002015560808201518160030155905050806002819055505050505050505050505050565b610e58611546565b6001805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b610eaf611546565b6005805460ff808616700100000000000000000000000000000000027fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff63ffffffff8981166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff918c166801000000000000000002919091167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff909516949094179390931792909216919091179091556006839055600780549183167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00928316179055600380549091166001179055604080517fc3f909d4000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163c3f909d4916004828101926080929190829003018186803b15801561103257600080fd5b505afa158015611046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106a9190611c03565b50600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f356dac7100000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163356dac71916004808301926020929190829003018186803b15801561112857600080fd5b505afa15801561113c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111609190611bea565b6004819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635fbbc0d26040518163ffffffff1660e01b81526004016101206040518083038186803b1580156111cd57600080fd5b505afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112059190611e3a565b50506005805463ffffffff909816640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909816979097179096555050505050505050505050565b61125a611546565b6112638161187c565b50565b61126e611546565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b1580156112fe57600080fd5b505af1158015611312573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113369190611bc8565b505050565b6000828152600860208181526040808420815160a081018352815473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008304168387015260018401805495840195909552600284018054606085015260038501805460808601528b8a52979096527fffffffffffffffff000000000000000000000000000000000000000000000000909116909255918590559184905592909155815116611458576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016105e9565b600080631fe543e360e01b8585604051602401611476929190612009565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060006114f0846020015163ffffffff16856000015184611972565b90508061153e57835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146115c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016105e9565b565b600554604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009263ffffffff161515918391829173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163feaf968c9160048082019260a092909190829003018186803b15801561166357600080fd5b505afa158015611677573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169b9190611f52565b5094509092508491505080156116c157506116b68242612130565b60055463ffffffff16105b156116cb57506004545b6000811215611736576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b207765692070726963650000000000000000000060448201526064016105e9565b9392505050565b600154600090819061176c9074010000000000000000000000000000000000000000900463ffffffff166119be565b60055463ffffffff6c01000000000000000000000000820481169161179f91680100000000000000009091041688612057565b6117a99190612057565b6117b390866120f3565b6117bd9190612057565b90506000836117d483670de0b6b3a76400006120f3565b6117de91906120bc565b60055490915060009060649061180b90700100000000000000000000000000000000900460ff1682612097565b6118189060ff16846120f3565b61182291906120bc565b60055490915060009061184890640100000000900463ffffffff1664e8d4a510006120f3565b6118529083612057565b98975050505050505050565b600061186b603f836120d0565b61187690600161206f565b92915050565b73ffffffffffffffffffffffffffffffffffffffff81163314156118fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016105e9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561198457600080fd5b61138881039050846040820482031161199c57600080fd5b50823b6119a857600080fd5b60008083516020850160008789f1949350505050565b6000466119ca81611a77565b15611a6e576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b158015611a1857600080fd5b505afa158015611a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a509190611d6a565b5050505091505083608c611a649190612057565b61093890826120f3565b50600092915050565b600061a4b1821480611a8b575062066eed82145b8061187657505062066eee1490565b803573ffffffffffffffffffffffffffffffffffffffff8116811461073857600080fd5b805162ffffff8116811461073857600080fd5b803560ff8116811461073857600080fd5b805169ffffffffffffffffffff8116811461073857600080fd5b600060208284031215611b0e57600080fd5b61173682611a9a565b60008060408385031215611b2a57600080fd5b611b3383611a9a565b946020939093013593505050565b60008060008060608587031215611b5757600080fd5b611b6085611a9a565b935060208501359250604085013567ffffffffffffffff80821115611b8457600080fd5b818701915087601f830112611b9857600080fd5b813581811115611ba757600080fd5b886020828501011115611bb957600080fd5b95989497505060200194505050565b600060208284031215611bda57600080fd5b8151801515811461173657600080fd5b600060208284031215611bfc57600080fd5b5051919050565b60008060008060808587031215611c1957600080fd5b8451611c24816121d4565b6020860151909450611c35816121e4565b6040860151909350611c46816121e4565b6060860151909250611c57816121e4565b939692955090935050565b600060208284031215611c7457600080fd5b5035919050565b60008060408385031215611c8e57600080fd5b8235915060208084013567ffffffffffffffff80821115611cae57600080fd5b818601915086601f830112611cc257600080fd5b813581811115611cd457611cd46121a5565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611d1757611d176121a5565b604052828152858101935084860182860187018b1015611d3657600080fd5b600095505b83861015611d59578035855260019590950194938601938601611d3b565b508096505050505050509250929050565b60008060008060008060c08789031215611d8357600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b600060208284031215611dc657600080fd5b8135611736816121e4565b600080600060608486031215611de657600080fd5b8335611df1816121e4565b92506020840135611e01816121d4565b91506040840135611e11816121e4565b809150509250925092565b60008060408385031215611e2f57600080fd5b8235611b33816121e4565b60008060008060008060008060006101208a8c031215611e5957600080fd5b8951611e64816121e4565b60208b0151909950611e75816121e4565b60408b0151909850611e86816121e4565b60608b0151909750611e97816121e4565b60808b0151909650611ea8816121e4565b9450611eb660a08b01611abe565b9350611ec460c08b01611abe565b9250611ed260e08b01611abe565b9150611ee16101008b01611abe565b90509295985092959850929598565b600080600080600060a08688031215611f0857600080fd5b8535611f13816121e4565b94506020860135611f23816121e4565b9350611f3160408701611ad1565b925060608601359150611f4660808701611ad1565b90509295509295909350565b600080600080600060a08688031215611f6a57600080fd5b611f7386611ae2565b9450602086015193506040860151925060608601519150611f4660808701611ae2565b600060208083528351808285015260005b81811015611fc357858101830151858201604001528201611fa7565b81811115611fd5576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b8181101561204a5784518352938301939183019160010161202e565b5090979650505050505050565b6000821982111561206a5761206a612147565b500190565b600063ffffffff80831681851680830382111561208e5761208e612147565b01949350505050565b600060ff821660ff84168060ff038211156120b4576120b4612147565b019392505050565b6000826120cb576120cb612176565b500490565b600063ffffffff808416806120e7576120e7612176565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561212b5761212b612147565b500290565b60008282101561214257612142612147565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff8116811461126357600080fd5b63ffffffff8116811461126357600080fdfea164736f6c6343000806000a", } var VRFV2WrapperABI = VRFV2WrapperMetaData.ABI diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go index cee53ca92ff..5974a2cc19c 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go @@ -32,7 +32,7 @@ var ( var VRFV2PlusWrapperMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractExtendedVRFCoordinatorV2PlusInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60c06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b5060405162003134380380620031348339810160408190526200004c9162000335565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200026c565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b806001600160a01b031660a0816001600160a01b031660601b815250506000816001600160a01b031663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620001bd57600080fd5b505af1158015620001d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f891906200037f565b6080819052604051632fb1302360e21b8152600481018290523060248201529091506001600160a01b0383169063bec4c08c90604401600060405180830381600087803b1580156200024957600080fd5b505af11580156200025e573d6000803e3d6000fd5b505050505050505062000399565b6001600160a01b038116331415620002c75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200033057600080fd5b919050565b6000806000606084860312156200034b57600080fd5b620003568462000318565b9250620003666020850162000318565b9150620003766040850162000318565b90509250925092565b6000602082840312156200039257600080fd5b5051919050565b60805160a05160601c612d41620003f3600039600081816102f901528181610e08015281816116e1015281816119fa01528181611adb0152611b760152600081816101ef01528181610d3f015261165b0152612d416000f3fe6080604052600436106101d85760003560e01c80638da5cb5b11610102578063c15ce4d711610095578063f254bdc711610064578063f254bdc71461070a578063f2fde38b14610747578063f3fef3a314610767578063fc2a88c31461078757600080fd5b8063c15ce4d7146105e9578063c3f909d414610609578063cdd8d88514610693578063da4f5e6d146106cd57600080fd5b8063a3907d71116100d1578063a3907d7114610575578063a4c0ed361461058a578063a608a1e1146105aa578063bf17e559146105c957600080fd5b80638da5cb5b146104dd5780638ea98117146105085780639eccacf614610528578063a02e06161461055557600080fd5b80634306d3541161017a57806362a504fc1161014957806362a504fc14610475578063650596541461048857806379ba5097146104a85780637fb5d19d146104bd57600080fd5b80634306d3541461034057806348baa1c5146103605780634b1609351461042b57806357a8070a1461044b57600080fd5b80631fe543e3116101b65780631fe543e3146102925780632f2770db146102b25780633255c456146102c75780633b2bcbf1146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f366004612669565b61079d565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612ad7565b34801561029e57600080fd5b506102446102ad3660046127cd565b610879565b3480156102be57600080fd5b506102446108fa565b3480156102d357600080fd5b506102116102e236600461296e565b610930565b3480156102f357600080fd5b5061031b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b34801561034c57600080fd5b5061021161035b366004612906565b610a28565b34801561036c57600080fd5b506103ea61037b3660046127b4565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161021b565b34801561043757600080fd5b50610211610446366004612906565b610b2f565b34801561045757600080fd5b506008546104659060ff1681565b604051901515815260200161021b565b610211610483366004612923565b610c26565b34801561049457600080fd5b506102446104a336600461264e565b610f7b565b3480156104b457600080fd5b50610244610fc6565b3480156104c957600080fd5b506102116104d836600461296e565b6110c3565b3480156104e957600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661031b565b34801561051457600080fd5b5061024461052336600461264e565b6111c9565b34801561053457600080fd5b5060025461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561056157600080fd5b5061024461057036600461264e565b6112d4565b34801561058157600080fd5b5061024461137f565b34801561059657600080fd5b506102446105a5366004612693565b6113b1565b3480156105b657600080fd5b5060085461046590610100900460ff1681565b3480156105d557600080fd5b506102446105e4366004612906565b611895565b3480156105f557600080fd5b506102446106043660046129c6565b6118dc565b34801561061557600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e08201526101000161021b565b34801561069f57600080fd5b506007546106b890640100000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106d957600080fd5b5060065461031b906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561071657600080fd5b5060075461031b906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561075357600080fd5b5061024461076236600461264e565b611c85565b34801561077357600080fd5b50610244610782366004612669565b611c99565b34801561079357600080fd5b5061021160045481565b6107a5611d94565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107ff576040519150601f19603f3d011682016040523d82523d6000602084013e610804565b606091505b5050905080610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108ec576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440161086b565b6108f68282611e17565b5050565b610902611d94565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff1661099f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610a11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b610a218363ffffffff1683611fff565b9392505050565b60085460009060ff16610a97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610b09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b6000610b136120d5565b9050610b268363ffffffff163a83612235565b9150505b919050565b60085460009060ff16610b9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610c10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b610c208263ffffffff163a611fff565b92915050565b600080610c3285612327565b90506000610c468663ffffffff163a611fff565b905080341015610cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161086b565b6008546301000000900460ff1663ffffffff85161115610d2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161086b565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff16610d8b868b612bad565b610d959190612bad565b63ffffffff1681526020018663ffffffff168152602001610dc660405180602001604052806001151581525061233f565b90526040517f9b1c385e00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b1c385e90610e3d908490600401612aea565b602060405180830381600087803b158015610e5757600080fd5b505af1158015610e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8f919061273c565b6040805160608101825233815263ffffffff808b16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9190911617179290921691909117905593505050509392505050565b610f83611d94565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314611047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161086b565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16611132576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff16156111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b60006111ae6120d5565b90506111c18463ffffffff168483612235565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590611209575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561128d573361122e60005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015291909116604482015260640161086b565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6112dc611d94565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff161561133c576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611387611d94565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff1661141d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff161561148f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff163314611520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b000000000000000000604482015260640161086b565b6000808061153084860186612923565b925092509250600061154184612327565b9050600061154d6120d5565b905060006115628663ffffffff163a84612235565b9050808910156115ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161086b565b6008546301000000900460ff1663ffffffff8516111561164a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161086b565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff166116a7878b612bad565b6116b19190612bad565b63ffffffff1681526020018663ffffffff16815260200160405180602001604052806000815250815250905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016117389190612aea565b602060405180830381600087803b15801561175257600080fd5b505af1158015611766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178a919061273c565b905060405180606001604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018963ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555090505080600481905550505050505050505050505050565b61189d611d94565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b6118e4611d94565b6007805463ffffffff86811668010000000000000000027fffffffffffffffffffffffffffffffffffffffff00000000ffffffff00000000909216908816171790556008805460038490557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0060ff8481166301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff9188166201000002919091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9093169290921791909117166001179055604080517f088070f5000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163088070f5916004828101926080929190829003018186803b158015611a4057600080fd5b505afa158015611a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a789190612755565b50600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f043bd6ae00000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163043bd6ae916004808301926020929190829003018186803b158015611b3657600080fd5b505afa158015611b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6e919061273c565b6005819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636b6feccc6040518163ffffffff1660e01b8152600401604080518083038186803b158015611bd957600080fd5b505afa158015611bed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c11919061298c565b600680547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff166801000000000000000063ffffffff938416027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff161764010000000093909216929092021790555050505050565b611c8d611d94565b611c96816123fb565b50565b611ca1611d94565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611d2657600080fd5b505af1158015611d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5e919061271a565b6108f6576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161086b565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611f11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e64000000000000000000000000000000604482015260640161086b565b600080631fe543e360e01b8585604051602401611f2f929190612b47565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611fa9846020015163ffffffff168560000151846124f1565b905080611ff757835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b600754600090819061201e90640100000000900463ffffffff1661253d565b60075463ffffffff680100000000000000008204811691612040911687612b95565b61204a9190612b95565b6120549085612c31565b61205e9190612b95565b600854909150819060009060649061207f9062010000900460ff1682612bd5565b61208c9060ff1684612c31565b6120969190612bfa565b6006549091506000906120c09068010000000000000000900463ffffffff1664e8d4a51000612c31565b6120ca9083612b95565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b15801561216257600080fd5b505afa158015612176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219a9190612a28565b5094509092508491505080156121c057506121b58242612c6e565b60065463ffffffff16105b156121ca57506005545b6000811215610a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b2077656920707269636500000000000000000000604482015260640161086b565b600754600090819061225490640100000000900463ffffffff1661253d565b60075463ffffffff680100000000000000008204811691612276911688612b95565b6122809190612b95565b61228a9086612c31565b6122949190612b95565b90506000836122ab83670de0b6b3a7640000612c31565b6122b59190612bfa565b6008549091506000906064906122d49062010000900460ff1682612bd5565b6122e19060ff1684612c31565b6122eb9190612bfa565b60065490915060009061231190640100000000900463ffffffff1664e8d4a51000612c31565b61231b9083612b95565b98975050505050505050565b6000612334603f83612c0e565b610c20906001612bad565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161237891511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff811633141561247b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161086b565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561250357600080fd5b61138881039050846040820482031161251b57600080fd5b50823b61252757600080fd5b60008083516020850160008789f1949350505050565b60004661a4b1811480612552575062066eed81145b156125f6576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b1580156125a057600080fd5b505afa1580156125b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125d891906128bc565b5050505091505083608c6125ec9190612b95565b6111c19082612c31565b50600092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b2a57600080fd5b803560ff81168114610b2a57600080fd5b805169ffffffffffffffffffff81168114610b2a57600080fd5b60006020828403121561266057600080fd5b610a21826125ff565b6000806040838503121561267c57600080fd5b612685836125ff565b946020939093013593505050565b600080600080606085870312156126a957600080fd5b6126b2856125ff565b935060208501359250604085013567ffffffffffffffff808211156126d657600080fd5b818701915087601f8301126126ea57600080fd5b8135818111156126f957600080fd5b88602082850101111561270b57600080fd5b95989497505060200194505050565b60006020828403121561272c57600080fd5b81518015158114610a2157600080fd5b60006020828403121561274e57600080fd5b5051919050565b6000806000806080858703121561276b57600080fd5b845161277681612d12565b602086015190945061278781612d22565b604086015190935061279881612d22565b60608601519092506127a981612d22565b939692955090935050565b6000602082840312156127c657600080fd5b5035919050565b600080604083850312156127e057600080fd5b8235915060208084013567ffffffffffffffff8082111561280057600080fd5b818601915086601f83011261281457600080fd5b81358181111561282657612826612ce3565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561286957612869612ce3565b604052828152858101935084860182860187018b101561288857600080fd5b600095505b838610156128ab57803585526001959095019493860193860161288d565b508096505050505050509250929050565b60008060008060008060c087890312156128d557600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561291857600080fd5b8135610a2181612d22565b60008060006060848603121561293857600080fd5b833561294381612d22565b9250602084013561295381612d12565b9150604084013561296381612d22565b809150509250925092565b6000806040838503121561298157600080fd5b823561268581612d22565b6000806040838503121561299f57600080fd5b82516129aa81612d22565b60208401519092506129bb81612d22565b809150509250929050565b600080600080600060a086880312156129de57600080fd5b85356129e981612d22565b945060208601356129f981612d22565b9350612a0760408701612623565b925060608601359150612a1c60808701612623565b90509295509295909350565b600080600080600060a08688031215612a4057600080fd5b612a4986612634565b9450602086015193506040860151925060608601519150612a1c60808701612634565b6000815180845260005b81811015612a9257602081850181015186830182015201612a76565b81811115612aa4576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a216020830184612a6c565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c0808401526111c160e0840182612a6c565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612b8857845183529383019391830191600101612b6c565b5090979650505050505050565b60008219821115612ba857612ba8612c85565b500190565b600063ffffffff808316818516808303821115612bcc57612bcc612c85565b01949350505050565b600060ff821660ff84168060ff03821115612bf257612bf2612c85565b019392505050565b600082612c0957612c09612cb4565b500490565b600063ffffffff80841680612c2557612c25612cb4565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c6957612c69612c85565b500290565b600082821015612c8057612c80612c85565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff81168114611c9657600080fd5b63ffffffff81168114611c9657600080fdfea164736f6c6343000806000a", + Bin: "0x60c06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b506040516200314e3803806200314e8339810160408190526200004c9162000335565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200026c565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b806001600160a01b031660a0816001600160a01b031660601b815250506000816001600160a01b031663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620001bd57600080fd5b505af1158015620001d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f891906200037f565b6080819052604051632fb1302360e21b8152600481018290523060248201529091506001600160a01b0383169063bec4c08c90604401600060405180830381600087803b1580156200024957600080fd5b505af11580156200025e573d6000803e3d6000fd5b505050505050505062000399565b6001600160a01b038116331415620002c75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200033057600080fd5b919050565b6000806000606084860312156200034b57600080fd5b620003568462000318565b9250620003666020850162000318565b9150620003766040850162000318565b90509250925092565b6000602082840312156200039257600080fd5b5051919050565b60805160a05160601c612d5b620003f3600039600081816102f901528181610e08015281816116e1015281816119fa01528181611adb0152611b760152600081816101ef01528181610d3f015261165b0152612d5b6000f3fe6080604052600436106101d85760003560e01c80638da5cb5b11610102578063c15ce4d711610095578063f254bdc711610064578063f254bdc71461070a578063f2fde38b14610747578063f3fef3a314610767578063fc2a88c31461078757600080fd5b8063c15ce4d7146105e9578063c3f909d414610609578063cdd8d88514610693578063da4f5e6d146106cd57600080fd5b8063a3907d71116100d1578063a3907d7114610575578063a4c0ed361461058a578063a608a1e1146105aa578063bf17e559146105c957600080fd5b80638da5cb5b146104dd5780638ea98117146105085780639eccacf614610528578063a02e06161461055557600080fd5b80634306d3541161017a57806362a504fc1161014957806362a504fc14610475578063650596541461048857806379ba5097146104a85780637fb5d19d146104bd57600080fd5b80634306d3541461034057806348baa1c5146103605780634b1609351461042b57806357a8070a1461044b57600080fd5b80631fe543e3116101b65780631fe543e3146102925780632f2770db146102b25780633255c456146102c75780633b2bcbf1146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f366004612683565b61079d565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612af1565b34801561029e57600080fd5b506102446102ad3660046127e7565b610879565b3480156102be57600080fd5b506102446108fa565b3480156102d357600080fd5b506102116102e2366004612988565b610930565b3480156102f357600080fd5b5061031b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b34801561034c57600080fd5b5061021161035b366004612920565b610a28565b34801561036c57600080fd5b506103ea61037b3660046127ce565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161021b565b34801561043757600080fd5b50610211610446366004612920565b610b2f565b34801561045757600080fd5b506008546104659060ff1681565b604051901515815260200161021b565b61021161048336600461293d565b610c26565b34801561049457600080fd5b506102446104a3366004612668565b610f7b565b3480156104b457600080fd5b50610244610fc6565b3480156104c957600080fd5b506102116104d8366004612988565b6110c3565b3480156104e957600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661031b565b34801561051457600080fd5b50610244610523366004612668565b6111c9565b34801561053457600080fd5b5060025461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561056157600080fd5b50610244610570366004612668565b6112d4565b34801561058157600080fd5b5061024461137f565b34801561059657600080fd5b506102446105a53660046126ad565b6113b1565b3480156105b657600080fd5b5060085461046590610100900460ff1681565b3480156105d557600080fd5b506102446105e4366004612920565b611895565b3480156105f557600080fd5b506102446106043660046129e0565b6118dc565b34801561061557600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e08201526101000161021b565b34801561069f57600080fd5b506007546106b890640100000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106d957600080fd5b5060065461031b906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561071657600080fd5b5060075461031b906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561075357600080fd5b50610244610762366004612668565b611c85565b34801561077357600080fd5b50610244610782366004612683565b611c99565b34801561079357600080fd5b5061021160045481565b6107a5611d94565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107ff576040519150601f19603f3d011682016040523d82523d6000602084013e610804565b606091505b5050905080610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108ec576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440161086b565b6108f68282611e17565b5050565b610902611d94565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff1661099f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610a11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b610a218363ffffffff1683611fff565b9392505050565b60085460009060ff16610a97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610b09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b6000610b136120d5565b9050610b268363ffffffff163a83612235565b9150505b919050565b60085460009060ff16610b9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610c10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b610c208263ffffffff163a611fff565b92915050565b600080610c3285612327565b90506000610c468663ffffffff163a611fff565b905080341015610cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161086b565b6008546301000000900460ff1663ffffffff85161115610d2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161086b565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff16610d8b868b612bc7565b610d959190612bc7565b63ffffffff1681526020018663ffffffff168152602001610dc660405180602001604052806001151581525061233f565b90526040517f9b1c385e00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b1c385e90610e3d908490600401612b04565b602060405180830381600087803b158015610e5757600080fd5b505af1158015610e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8f9190612756565b6040805160608101825233815263ffffffff808b16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9190911617179290921691909117905593505050509392505050565b610f83611d94565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314611047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161086b565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16611132576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff16156111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b60006111ae6120d5565b90506111c18463ffffffff168483612235565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590611209575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561128d573361122e60005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015291909116604482015260640161086b565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6112dc611d94565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff161561133c576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611387611d94565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff1661141d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff161561148f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff163314611520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b000000000000000000604482015260640161086b565b600080806115308486018661293d565b925092509250600061154184612327565b9050600061154d6120d5565b905060006115628663ffffffff163a84612235565b9050808910156115ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161086b565b6008546301000000900460ff1663ffffffff8516111561164a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161086b565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff166116a7878b612bc7565b6116b19190612bc7565b63ffffffff1681526020018663ffffffff16815260200160405180602001604052806000815250815250905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016117389190612b04565b602060405180830381600087803b15801561175257600080fd5b505af1158015611766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178a9190612756565b905060405180606001604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018963ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555090505080600481905550505050505050505050505050565b61189d611d94565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b6118e4611d94565b6007805463ffffffff86811668010000000000000000027fffffffffffffffffffffffffffffffffffffffff00000000ffffffff00000000909216908816171790556008805460038490557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0060ff8481166301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff9188166201000002919091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9093169290921791909117166001179055604080517f088070f5000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163088070f5916004828101926080929190829003018186803b158015611a4057600080fd5b505afa158015611a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a78919061276f565b50600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f043bd6ae00000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163043bd6ae916004808301926020929190829003018186803b158015611b3657600080fd5b505afa158015611b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6e9190612756565b6005819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636b6feccc6040518163ffffffff1660e01b8152600401604080518083038186803b158015611bd957600080fd5b505afa158015611bed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1191906129a6565b600680547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff166801000000000000000063ffffffff938416027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff161764010000000093909216929092021790555050505050565b611c8d611d94565b611c96816123fb565b50565b611ca1611d94565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611d2657600080fd5b505af1158015611d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5e9190612734565b6108f6576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161086b565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611f11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e64000000000000000000000000000000604482015260640161086b565b600080631fe543e360e01b8585604051602401611f2f929190612b61565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611fa9846020015163ffffffff168560000151846124f1565b905080611ff757835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b600754600090819061201e90640100000000900463ffffffff1661253d565b60075463ffffffff680100000000000000008204811691612040911687612baf565b61204a9190612baf565b6120549085612c4b565b61205e9190612baf565b600854909150819060009060649061207f9062010000900460ff1682612bef565b61208c9060ff1684612c4b565b6120969190612c14565b6006549091506000906120c09068010000000000000000900463ffffffff1664e8d4a51000612c4b565b6120ca9083612baf565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b15801561216257600080fd5b505afa158015612176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219a9190612a42565b5094509092508491505080156121c057506121b58242612c88565b60065463ffffffff16105b156121ca57506005545b6000811215610a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b2077656920707269636500000000000000000000604482015260640161086b565b600754600090819061225490640100000000900463ffffffff1661253d565b60075463ffffffff680100000000000000008204811691612276911688612baf565b6122809190612baf565b61228a9086612c4b565b6122949190612baf565b90506000836122ab83670de0b6b3a7640000612c4b565b6122b59190612c14565b6008549091506000906064906122d49062010000900460ff1682612bef565b6122e19060ff1684612c4b565b6122eb9190612c14565b60065490915060009061231190640100000000900463ffffffff1664e8d4a51000612c4b565b61231b9083612baf565b98975050505050505050565b6000612334603f83612c28565b610c20906001612bc7565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161237891511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff811633141561247b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161086b565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561250357600080fd5b61138881039050846040820482031161251b57600080fd5b50823b61252757600080fd5b60008083516020850160008789f1949350505050565b600046612549816125f6565b156125ed576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561259757600080fd5b505afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf91906128d6565b5050505091505083608c6125e39190612baf565b6111c19082612c4b565b50600092915050565b600061a4b182148061260a575062066eed82145b80610c2057505062066eee1490565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b2a57600080fd5b803560ff81168114610b2a57600080fd5b805169ffffffffffffffffffff81168114610b2a57600080fd5b60006020828403121561267a57600080fd5b610a2182612619565b6000806040838503121561269657600080fd5b61269f83612619565b946020939093013593505050565b600080600080606085870312156126c357600080fd5b6126cc85612619565b935060208501359250604085013567ffffffffffffffff808211156126f057600080fd5b818701915087601f83011261270457600080fd5b81358181111561271357600080fd5b88602082850101111561272557600080fd5b95989497505060200194505050565b60006020828403121561274657600080fd5b81518015158114610a2157600080fd5b60006020828403121561276857600080fd5b5051919050565b6000806000806080858703121561278557600080fd5b845161279081612d2c565b60208601519094506127a181612d3c565b60408601519093506127b281612d3c565b60608601519092506127c381612d3c565b939692955090935050565b6000602082840312156127e057600080fd5b5035919050565b600080604083850312156127fa57600080fd5b8235915060208084013567ffffffffffffffff8082111561281a57600080fd5b818601915086601f83011261282e57600080fd5b81358181111561284057612840612cfd565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561288357612883612cfd565b604052828152858101935084860182860187018b10156128a257600080fd5b600095505b838610156128c55780358552600195909501949386019386016128a7565b508096505050505050509250929050565b60008060008060008060c087890312156128ef57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561293257600080fd5b8135610a2181612d3c565b60008060006060848603121561295257600080fd5b833561295d81612d3c565b9250602084013561296d81612d2c565b9150604084013561297d81612d3c565b809150509250925092565b6000806040838503121561299b57600080fd5b823561269f81612d3c565b600080604083850312156129b957600080fd5b82516129c481612d3c565b60208401519092506129d581612d3c565b809150509250929050565b600080600080600060a086880312156129f857600080fd5b8535612a0381612d3c565b94506020860135612a1381612d3c565b9350612a216040870161263d565b925060608601359150612a366080870161263d565b90509295509295909350565b600080600080600060a08688031215612a5a57600080fd5b612a638661264e565b9450602086015193506040860151925060608601519150612a366080870161264e565b6000815180845260005b81811015612aac57602081850181015186830182015201612a90565b81811115612abe576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a216020830184612a86565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c0808401526111c160e0840182612a86565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612ba257845183529383019391830191600101612b86565b5090979650505050505050565b60008219821115612bc257612bc2612c9f565b500190565b600063ffffffff808316818516808303821115612be657612be6612c9f565b01949350505050565b600060ff821660ff84168060ff03821115612c0c57612c0c612c9f565b019392505050565b600082612c2357612c23612cce565b500490565b600063ffffffff80841680612c3f57612c3f612cce565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c8357612c83612c9f565b500290565b600082821015612c9a57612c9a612c9f565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff81168114611c9657600080fd5b63ffffffff81168114611c9657600080fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperABI = VRFV2PlusWrapperMetaData.ABI diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go b/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go index d8c85370649..4318b4bdeaf 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go @@ -32,7 +32,7 @@ var ( var VRFV2PlusWrapperLoadTestConsumerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vrfV2PlusWrapper\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"LINKAlreadySet\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"WrappedRequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"}],\"name\":\"WrapperRequestMade\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWrapper\",\"outputs\":[{\"internalType\":\"contractVRFV2PlusWrapperInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"makeRequests\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"makeRequestsNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"}],\"name\":\"setLinkToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLink\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x6080604052600060065560006007556103e76008553480156200002157600080fd5b5060405162001dd138038062001dd18339810160408190526200004491620001f2565b3380600084846001600160a01b038216156200007657600080546001600160a01b0319166001600160a01b0384161790555b600180546001600160a01b0319166001600160a01b03928316179055831615159050620000ea5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b03848116919091179091558116156200011d576200011d8162000128565b50505050506200022a565b6001600160a01b038116331415620001835760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000e1565b600380546001600160a01b0319166001600160a01b03838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b80516001600160a01b0381168114620001ed57600080fd5b919050565b600080604083850312156200020657600080fd5b6200021183620001d5565b91506200022160208401620001d5565b90509250929050565b611b97806200023a6000396000f3fe6080604052600436106101635760003560e01c80638f6b7070116100c0578063d826f88f11610074578063dc1670db11610059578063dc1670db14610421578063f176596214610437578063f2fde38b1461045757600080fd5b8063d826f88f146103c2578063d8a4676f146103ee57600080fd5b8063a168fa89116100a5578063a168fa89146102f7578063afacbf9c1461038c578063b1e21749146103ac57600080fd5b80638f6b7070146102ac5780639c24ea40146102d757600080fd5b806374dba124116101175780637a8042bd116100fc5780637a8042bd1461022057806384276d81146102405780638da5cb5b1461026057600080fd5b806374dba124146101f557806379ba50971461020b57600080fd5b80631fe543e3116101485780631fe543e3146101a7578063557d2e92146101c9578063737144bc146101df57600080fd5b806312065fe01461016f5780631757f11c1461019157600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b50475b6040519081526020015b60405180910390f35b34801561019d57600080fd5b5061017e60075481565b3480156101b357600080fd5b506101c76101c23660046117a4565b610477565b005b3480156101d557600080fd5b5061017e60055481565b3480156101eb57600080fd5b5061017e60065481565b34801561020157600080fd5b5061017e60085481565b34801561021757600080fd5b506101c7610530565b34801561022c57600080fd5b506101c761023b366004611772565b610631565b34801561024c57600080fd5b506101c761025b366004611772565b61071b565b34801561026c57600080fd5b5060025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610188565b3480156102b857600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff16610287565b3480156102e357600080fd5b506101c76102f2366004611713565b61080b565b34801561030357600080fd5b50610355610312366004611772565b600b602052600090815260409020805460018201546003830154600484015460058501546006860154600790960154949560ff9485169593949293919290911687565b604080519788529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e001610188565b34801561039857600080fd5b506101c76103a7366004611893565b6108a2565b3480156103b857600080fd5b5061017e60095481565b3480156103ce57600080fd5b506101c76000600681905560078190556103e76008556005819055600455565b3480156103fa57600080fd5b5061040e610409366004611772565b610b12565b60405161018897969594939291906119e3565b34801561042d57600080fd5b5061017e60045481565b34801561044357600080fd5b506101c7610452366004611893565b610c95565b34801561046357600080fd5b506101c7610472366004611713565b610efd565b60015473ffffffffffffffffffffffffffffffffffffffff163314610522576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f6e6c792056524620563220506c757320777261707065722063616e2066756c60448201527f66696c6c0000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61052c8282610f11565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146105b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610519565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560038054909116905560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b6106396110f0565b60005473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61067660025473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401602060405180830381600087803b1580156106e357600080fd5b505af11580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052c9190611750565b6107236110f0565b600061074460025473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461079b576040519150601f19603f3d011682016040523d82523d6000602084013e6107a0565b606091505b505090508061052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f77697468647261774e6174697665206661696c656400000000000000000000006044820152606401610519565b60005473ffffffffffffffffffffffffffffffffffffffff161561085b576040517f64f778ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6108aa6110f0565b60005b8161ffff168161ffff161015610b0b5760006108ca868686611173565b6009819055905060006108db611378565b6001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8a16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634306d3549060240160206040518083038186803b15801561095057600080fd5b505afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610988919061178b565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c0850184905260e08501849052898452600b8352949092208351815591516001830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790559251805194955091939092610a30926002850192910190611688565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610aa383611af3565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610aed9084815260200190565b60405180910390a25050508080610b0390611ad1565b9150506108ad565b5050505050565b6000818152600b602052604081205481906060908290819081908190610b94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000888152600b6020908152604080832081516101008101835281548152600182015460ff16151581850152600282018054845181870281018701865281815292959394860193830182828015610c0a57602002820191906000526020600020905b815481526020019060010190808311610bf6575b50505050508152602001600382015481526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff1615151515815250509050806000015181602001518260400151836060015184608001518560a001518660c00151975097509750975097509750975050919395979092949650565b610c9d6110f0565b60005b8161ffff168161ffff161015610b0b576000610cbd86868661141e565b600981905590506000610cce611378565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff8a16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b158015610d4357600080fd5b505afa158015610d57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7b919061178b565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c08501849052600160e086018190528a8552600b84529590932084518155905194810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001695151595909517909455905180519495509193610e229260028501920190611688565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610e9583611af3565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610edf9084815260200190565b60405180910390a25050508080610ef590611ad1565b915050610ca0565b610f056110f0565b610f0e81611591565b50565b6000828152600b6020526040902054610f86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000610f90611378565b6000848152600a602052604081205491925090610fad9083611aba565b90506000610fbe82620f4240611a7d565b9050600754821115610fd05760078290555b6008548210610fe157600854610fe3565b815b600855600454610ff35780611026565b600454611001906001611a2a565b816004546006546110129190611a7d565b61101c9190611a2a565b6110269190611a42565b6006556004805490600061103983611af3565b90915550506000858152600b60209081526040909120600181810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055855161109192600290920191870190611688565b506000858152600b602052604090819020426004820155600681018590555490517f6c84e12b4c188e61f1b4727024a5cf05c025fa58467e5eedf763c0744c89da7b916110e191889188916119ba565b60405180910390a15050505050565b60025473ffffffffffffffffffffffffffffffffffffffff163314611171576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610519565b565b600080546001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8716600482015273ffffffffffffffffffffffffffffffffffffffff92831692634000aea09216908190634306d3549060240160206040518083038186803b1580156111f057600080fd5b505afa158015611204573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611228919061178b565b6040805163ffffffff808b16602083015261ffff8a169282019290925290871660608201526080016040516020818303038152906040526040518463ffffffff1660e01b815260040161127d93929190611922565b602060405180830381600087803b15801561129757600080fd5b505af11580156112ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112cf9190611750565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b815260040160206040518083038186803b15801561133857600080fd5b505afa15801561134c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611370919061178b565b949350505050565b60004661a4b181148061138d575062066eed81145b1561141757606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113d957600080fd5b505afa1580156113ed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611411919061178b565b91505090565b4391505090565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff85166004820152600091829173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b15801561149257600080fd5b505afa1580156114a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ca919061178b565b6001546040517f62a504fc00000000000000000000000000000000000000000000000000000000815263ffffffff808916600483015261ffff881660248301528616604482015291925073ffffffffffffffffffffffffffffffffffffffff16906362a504fc9083906064016020604051808303818588803b15801561154f57600080fd5b505af1158015611563573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611588919061178b565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8116331415611611576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610519565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b8280548282559060005260206000209081019282156116c3579160200282015b828111156116c35782518255916020019190600101906116a8565b506116cf9291506116d3565b5090565b5b808211156116cf57600081556001016116d4565b803561ffff811681146116fa57600080fd5b919050565b803563ffffffff811681146116fa57600080fd5b60006020828403121561172557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461174957600080fd5b9392505050565b60006020828403121561176257600080fd5b8151801515811461174957600080fd5b60006020828403121561178457600080fd5b5035919050565b60006020828403121561179d57600080fd5b5051919050565b600080604083850312156117b757600080fd5b8235915060208084013567ffffffffffffffff808211156117d757600080fd5b818601915086601f8301126117eb57600080fd5b8135818111156117fd576117fd611b5b565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561184057611840611b5b565b604052828152858101935084860182860187018b101561185f57600080fd5b600095505b83861015611882578035855260019590950194938601938601611864565b508096505050505050509250929050565b600080600080608085870312156118a957600080fd5b6118b2856116ff565b93506118c0602086016116e8565b92506118ce604086016116ff565b91506118dc606086016116e8565b905092959194509250565b600081518084526020808501945080840160005b83811015611917578151875295820195908201906001016118fb565b509495945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815260006020848184015260606040840152835180606085015260005b8181101561197257858101830151858201608001528201611956565b81811115611984576000608083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160800195945050505050565b8381526060602082015260006119d360608301856118e7565b9050826040830152949350505050565b878152861515602082015260e060408201526000611a0460e08301886118e7565b90508560608301528460808301528360a08301528260c083015298975050505050505050565b60008219821115611a3d57611a3d611b2c565b500190565b600082611a78577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611ab557611ab5611b2c565b500290565b600082821015611acc57611acc611b2c565b500390565b600061ffff80831681811415611ae957611ae9611b2c565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611b2557611b25611b2c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x6080604052600060065560006007556103e76008553480156200002157600080fd5b5060405162001def38038062001def8339810160408190526200004491620001f2565b3380600084846001600160a01b038216156200007657600080546001600160a01b0319166001600160a01b0384161790555b600180546001600160a01b0319166001600160a01b03928316179055831615159050620000ea5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b03848116919091179091558116156200011d576200011d8162000128565b50505050506200022a565b6001600160a01b038116331415620001835760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000e1565b600380546001600160a01b0319166001600160a01b03838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b80516001600160a01b0381168114620001ed57600080fd5b919050565b600080604083850312156200020657600080fd5b6200021183620001d5565b91506200022160208401620001d5565b90509250929050565b611bb5806200023a6000396000f3fe6080604052600436106101635760003560e01c80638f6b7070116100c0578063d826f88f11610074578063dc1670db11610059578063dc1670db14610421578063f176596214610437578063f2fde38b1461045757600080fd5b8063d826f88f146103c2578063d8a4676f146103ee57600080fd5b8063a168fa89116100a5578063a168fa89146102f7578063afacbf9c1461038c578063b1e21749146103ac57600080fd5b80638f6b7070146102ac5780639c24ea40146102d757600080fd5b806374dba124116101175780637a8042bd116100fc5780637a8042bd1461022057806384276d81146102405780638da5cb5b1461026057600080fd5b806374dba124146101f557806379ba50971461020b57600080fd5b80631fe543e3116101485780631fe543e3146101a7578063557d2e92146101c9578063737144bc146101df57600080fd5b806312065fe01461016f5780631757f11c1461019157600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b50475b6040519081526020015b60405180910390f35b34801561019d57600080fd5b5061017e60075481565b3480156101b357600080fd5b506101c76101c23660046117c2565b610477565b005b3480156101d557600080fd5b5061017e60055481565b3480156101eb57600080fd5b5061017e60065481565b34801561020157600080fd5b5061017e60085481565b34801561021757600080fd5b506101c7610530565b34801561022c57600080fd5b506101c761023b366004611790565b610631565b34801561024c57600080fd5b506101c761025b366004611790565b61071b565b34801561026c57600080fd5b5060025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610188565b3480156102b857600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff16610287565b3480156102e357600080fd5b506101c76102f2366004611731565b61080b565b34801561030357600080fd5b50610355610312366004611790565b600b602052600090815260409020805460018201546003830154600484015460058501546006860154600790960154949560ff9485169593949293919290911687565b604080519788529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e001610188565b34801561039857600080fd5b506101c76103a73660046118b1565b6108a2565b3480156103b857600080fd5b5061017e60095481565b3480156103ce57600080fd5b506101c76000600681905560078190556103e76008556005819055600455565b3480156103fa57600080fd5b5061040e610409366004611790565b610b12565b6040516101889796959493929190611a01565b34801561042d57600080fd5b5061017e60045481565b34801561044357600080fd5b506101c76104523660046118b1565b610c95565b34801561046357600080fd5b506101c7610472366004611731565b610efd565b60015473ffffffffffffffffffffffffffffffffffffffff163314610522576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f6e6c792056524620563220506c757320777261707065722063616e2066756c60448201527f66696c6c0000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61052c8282610f11565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146105b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610519565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560038054909116905560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b6106396110f0565b60005473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61067660025473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401602060405180830381600087803b1580156106e357600080fd5b505af11580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052c919061176e565b6107236110f0565b600061074460025473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461079b576040519150601f19603f3d011682016040523d82523d6000602084013e6107a0565b606091505b505090508061052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f77697468647261774e6174697665206661696c656400000000000000000000006044820152606401610519565b60005473ffffffffffffffffffffffffffffffffffffffff161561085b576040517f64f778ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6108aa6110f0565b60005b8161ffff168161ffff161015610b0b5760006108ca868686611173565b6009819055905060006108db611378565b6001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8a16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634306d3549060240160206040518083038186803b15801561095057600080fd5b505afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098891906117a9565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c0850184905260e08501849052898452600b8352949092208351815591516001830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790559251805194955091939092610a309260028501929101906116a6565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610aa383611b11565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610aed9084815260200190565b60405180910390a25050508080610b0390611aef565b9150506108ad565b5050505050565b6000818152600b602052604081205481906060908290819081908190610b94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000888152600b6020908152604080832081516101008101835281548152600182015460ff16151581850152600282018054845181870281018701865281815292959394860193830182828015610c0a57602002820191906000526020600020905b815481526020019060010190808311610bf6575b50505050508152602001600382015481526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff1615151515815250509050806000015181602001518260400151836060015184608001518560a001518660c00151975097509750975097509750975050919395979092949650565b610c9d6110f0565b60005b8161ffff168161ffff161015610b0b576000610cbd868686611415565b600981905590506000610cce611378565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff8a16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b158015610d4357600080fd5b505afa158015610d57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7b91906117a9565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c08501849052600160e086018190528a8552600b84529590932084518155905194810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001695151595909517909455905180519495509193610e2292600285019201906116a6565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610e9583611b11565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610edf9084815260200190565b60405180910390a25050508080610ef590611aef565b915050610ca0565b610f056110f0565b610f0e81611588565b50565b6000828152600b6020526040902054610f86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000610f90611378565b6000848152600a602052604081205491925090610fad9083611ad8565b90506000610fbe82620f4240611a9b565b9050600754821115610fd05760078290555b6008548210610fe157600854610fe3565b815b600855600454610ff35780611026565b600454611001906001611a48565b816004546006546110129190611a9b565b61101c9190611a48565b6110269190611a60565b6006556004805490600061103983611b11565b90915550506000858152600b60209081526040909120600181810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790558551611091926002909201918701906116a6565b506000858152600b602052604090819020426004820155600681018590555490517f6c84e12b4c188e61f1b4727024a5cf05c025fa58467e5eedf763c0744c89da7b916110e191889188916119d8565b60405180910390a15050505050565b60025473ffffffffffffffffffffffffffffffffffffffff163314611171576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610519565b565b600080546001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8716600482015273ffffffffffffffffffffffffffffffffffffffff92831692634000aea09216908190634306d3549060240160206040518083038186803b1580156111f057600080fd5b505afa158015611204573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122891906117a9565b6040805163ffffffff808b16602083015261ffff8a169282019290925290871660608201526080016040516020818303038152906040526040518463ffffffff1660e01b815260040161127d93929190611940565b602060405180830381600087803b15801561129757600080fd5b505af11580156112ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112cf919061176e565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b815260040160206040518083038186803b15801561133857600080fd5b505afa15801561134c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137091906117a9565b949350505050565b6000466113848161167f565b1561140e57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113d057600080fd5b505afa1580156113e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140891906117a9565b91505090565b4391505090565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff85166004820152600091829173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c191906117a9565b6001546040517f62a504fc00000000000000000000000000000000000000000000000000000000815263ffffffff808916600483015261ffff881660248301528616604482015291925073ffffffffffffffffffffffffffffffffffffffff16906362a504fc9083906064016020604051808303818588803b15801561154657600080fd5b505af115801561155a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061157f91906117a9565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8116331415611608576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610519565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b600061a4b1821480611693575062066eed82145b806116a0575062066eee82145b92915050565b8280548282559060005260206000209081019282156116e1579160200282015b828111156116e15782518255916020019190600101906116c6565b506116ed9291506116f1565b5090565b5b808211156116ed57600081556001016116f2565b803561ffff8116811461171857600080fd5b919050565b803563ffffffff8116811461171857600080fd5b60006020828403121561174357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461176757600080fd5b9392505050565b60006020828403121561178057600080fd5b8151801515811461176757600080fd5b6000602082840312156117a257600080fd5b5035919050565b6000602082840312156117bb57600080fd5b5051919050565b600080604083850312156117d557600080fd5b8235915060208084013567ffffffffffffffff808211156117f557600080fd5b818601915086601f83011261180957600080fd5b81358181111561181b5761181b611b79565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561185e5761185e611b79565b604052828152858101935084860182860187018b101561187d57600080fd5b600095505b838610156118a0578035855260019590950194938601938601611882565b508096505050505050509250929050565b600080600080608085870312156118c757600080fd5b6118d08561171d565b93506118de60208601611706565b92506118ec6040860161171d565b91506118fa60608601611706565b905092959194509250565b600081518084526020808501945080840160005b8381101561193557815187529582019590820190600101611919565b509495945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815260006020848184015260606040840152835180606085015260005b8181101561199057858101830151858201608001528201611974565b818111156119a2576000608083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160800195945050505050565b8381526060602082015260006119f16060830185611905565b9050826040830152949350505050565b878152861515602082015260e060408201526000611a2260e0830188611905565b90508560608301528460808301528360a08301528260c083015298975050505050505050565b60008219821115611a5b57611a5b611b4a565b500190565b600082611a96577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611ad357611ad3611b4a565b500290565b600082821015611aea57611aea611b4a565b500390565b600061ffff80831681811415611b0757611b07611b4a565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611b4357611b43611b4a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperLoadTestConsumerABI = VRFV2PlusWrapperLoadTestConsumerMetaData.ABI diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 24715dbe527..7e45ec4774d 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -7,7 +7,7 @@ automation_consumer_benchmark: ../../contracts/solc/v0.8.16/AutomationConsumerBe automation_forwarder_logic: ../../contracts/solc/v0.8.16/AutomationForwarderLogic.abi ../../contracts/solc/v0.8.16/AutomationForwarderLogic.bin 15ae0c367297955fdab4b552dbb10e1f2be80a8fde0efec4a4d398693e9d72b5 automation_registrar_wrapper2_1: ../../contracts/solc/v0.8.16/AutomationRegistrar2_1.abi ../../contracts/solc/v0.8.16/AutomationRegistrar2_1.bin eb06d853aab39d3196c593b03e555851cbe8386e0fe54a74c2479f62d14b3c42 automation_utils_2_1: ../../contracts/solc/v0.8.16/AutomationUtils2_1.abi ../../contracts/solc/v0.8.16/AutomationUtils2_1.bin 331bfa79685aee6ddf63b64c0747abee556c454cae3fb8175edff425b615d8aa -batch_blockhash_store: ../../contracts/solc/v0.8.6/BatchBlockhashStore.abi ../../contracts/solc/v0.8.6/BatchBlockhashStore.bin c5ab26709a01050402615659403f32d5cd1b85f3ad6bb6bfe021692f4233cf19 +batch_blockhash_store: ../../contracts/solc/v0.8.6/BatchBlockhashStore.abi ../../contracts/solc/v0.8.6/BatchBlockhashStore.bin 14356c48ef70f66ef74f22f644450dbf3b2a147c1b68deaa7e7d1eb8ffab15db batch_vrf_coordinator_v2: ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2.bin d0a54963260d8c1f1bbd984b758285e6027cfb5a7e42701bcb562ab123219332 batch_vrf_coordinator_v2plus: ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2Plus.abi ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2Plus.bin 7bb76ae241cf1b37b41920830b836cb99f1ad33efd7435ca2398ff6cd2fe5d48 blockhash_store: ../../contracts/solc/v0.6/BlockhashStore.abi ../../contracts/solc/v0.6/BlockhashStore.bin a0dc60bcc4bf071033d23fddf7ae936c6a4d1dd81488434b7e24b7aa1fabc37c @@ -60,7 +60,7 @@ solidity_vrf_wrapper: ../../contracts/solc/v0.6/VRF.abi ../../contracts/solc/v0. streams_lookup_compatible_interface: ../../contracts/solc/v0.8.16/StreamsLookupCompatibleInterface.abi ../../contracts/solc/v0.8.16/StreamsLookupCompatibleInterface.bin feb92cc666df21ea04ab9d7a588a513847b01b2f66fc167d06ab28ef2b17e015 streams_lookup_upkeep_wrapper: ../../contracts/solc/v0.8.16/StreamsLookupUpkeep.abi ../../contracts/solc/v0.8.16/StreamsLookupUpkeep.bin b1a598963cacac51ed4706538d0f142bdc0d94b9a4b13e2d402131cdf05c9bcf test_api_consumer_wrapper: ../../contracts/solc/v0.6/TestAPIConsumer.abi ../../contracts/solc/v0.6/TestAPIConsumer.bin ed10893cb18894c18e275302329c955f14ea2de37ee044f84aa1e067ac5ea71e -trusted_blockhash_store: ../../contracts/solc/v0.8.6/TrustedBlockhashStore.abi ../../contracts/solc/v0.8.6/TrustedBlockhashStore.bin 34e71c5dc94f50e21f2bef76b0daa5821634655ca3722ce1204ce43cca1b2e19 +trusted_blockhash_store: ../../contracts/solc/v0.8.6/TrustedBlockhashStore.abi ../../contracts/solc/v0.8.6/TrustedBlockhashStore.bin 98cb0dc06c15af5dcd3b53bdfc98e7ed2489edc96a42203294ac2fc0efdda02b type_and_version_interface_wrapper: ../../contracts/solc/v0.8.6/TypeAndVersionInterface.abi ../../contracts/solc/v0.8.6/TypeAndVersionInterface.bin bc9c3a6e73e3ebd5b58754df0deeb3b33f4bb404d5709bb904aed51d32f4b45e upkeep_counter_wrapper: ../../contracts/solc/v0.7/UpkeepCounter.abi ../../contracts/solc/v0.7/UpkeepCounter.bin 901961ebf18906febc1c350f02da85c7ea1c2a68da70cfd94efa27c837a48663 upkeep_perform_counter_restrictive_wrapper: ../../contracts/solc/v0.7/UpkeepPerformCounterRestrictive.abi ../../contracts/solc/v0.7/UpkeepPerformCounterRestrictive.bin 8975a058fba528e16d8414dc6f13946d17a145fcbc66cf25a32449b6fe1ce878 @@ -72,35 +72,35 @@ vrf_consumer_v2: ../../contracts/solc/v0.8.6/VRFConsumerV2.abi ../../contracts/s vrf_consumer_v2_plus_upgradeable_example: ../../contracts/solc/v0.8.6/VRFConsumerV2PlusUpgradeableExample.abi ../../contracts/solc/v0.8.6/VRFConsumerV2PlusUpgradeableExample.bin 3155c611e4d6882e9324b6e975033b31356776ea8b031ca63d63da37589d583b vrf_consumer_v2_upgradeable_example: ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample.abi ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample.bin f1790a9a2f2a04c730593e483459709cb89e897f8a19d7a3ac0cfe6a97265e6e vrf_coordinator_mock: ../../contracts/solc/v0.8.6/VRFCoordinatorMock.abi ../../contracts/solc/v0.8.6/VRFCoordinatorMock.bin 5c495cf8df1f46d8736b9150cdf174cce358cb8352f60f0d5bb9581e23920501 -vrf_coordinator_v2: ../../contracts/solc/v0.8.6/VRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2.bin 906e8155db28513c64c6f828d5b8eaf586b873de4369c77c0a19b6c5adf623c1 -vrf_coordinator_v2_5: ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.bin b3b2ed681837264ec3f180d180ef6fb4d6f4f89136673268b57d540b0d682618 +vrf_coordinator_v2: ../../contracts/solc/v0.8.6/VRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2.bin 6ab95dcdf48951b07698abfc53be56c1b571110fcb2b8f72df1256db091a5f0a +vrf_coordinator_v2_5: ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.bin 37ad0cc55dcc417c62de7b798defc17910dd1eda6738f755572189b8134a8b74 vrf_coordinator_v2_plus_v2_example: ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus_V2Example.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus_V2Example.bin 4a5b86701983b1b65f0a8dfa116b3f6d75f8f706fa274004b57bdf5992e4cec3 vrf_coordinator_v2plus: ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus.bin e4409bbe361258273458a5c99408b3d7f0cc57a2560dee91c0596cc6d6f738be vrf_coordinator_v2plus_interface: ../../contracts/solc/v0.8.6/IVRFCoordinatorV2PlusInternal.abi ../../contracts/solc/v0.8.6/IVRFCoordinatorV2PlusInternal.bin 834a2ce0e83276372a0e1446593fd89798f4cf6dc95d4be0113e99fadf61558b vrf_external_sub_owner_example: ../../contracts/solc/v0.8.6/VRFExternalSubOwnerExample.abi ../../contracts/solc/v0.8.6/VRFExternalSubOwnerExample.bin 14f888eb313930b50233a6f01ea31eba0206b7f41a41f6311670da8bb8a26963 vrf_load_test_external_sub_owner: ../../contracts/solc/v0.8.6/VRFLoadTestExternalSubOwner.abi ../../contracts/solc/v0.8.6/VRFLoadTestExternalSubOwner.bin 2097faa70265e420036cc8a3efb1f1e0836ad2d7323b295b9a26a125dbbe6c7d vrf_load_test_ownerless_consumer: ../../contracts/solc/v0.8.6/VRFLoadTestOwnerlessConsumer.abi ../../contracts/solc/v0.8.6/VRFLoadTestOwnerlessConsumer.bin 74f914843cbc70b9c3079c3e1c709382ce415225e8bb40113e7ac018bfcb0f5c -vrf_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2LoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2LoadTestWithMetrics.bin 6c8f08fe8ae9254ae0607dffa5faf2d554488850aa788795b0445938488ad9ce +vrf_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2LoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2LoadTestWithMetrics.bin 8ab9de5816fbdf93a2865e2711b85a39a6fc9c413a4b336578c485be1158d430 vrf_malicious_consumer_v2: ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2.abi ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2.bin 9755fa8ffc7f5f0b337d5d413d77b0c9f6cd6f68c31727d49acdf9d4a51bc522 vrf_malicious_consumer_v2_plus: ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2Plus.abi ../../contracts/solc/v0.8.6/VRFMaliciousConsumerV2Plus.bin f8d8cd2a9287f7f98541027cfdddeea209c5a17184ee37204181c97897a52c41 vrf_owner: ../../contracts/solc/v0.8.6/VRFOwner.abi ../../contracts/solc/v0.8.6/VRFOwner.bin eccfae5ee295b5850e22f61240c469f79752b8d9a3bac5d64aec7ac8def2f6cb -vrf_owner_test_consumer: ../../contracts/solc/v0.8.6/VRFV2OwnerTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2OwnerTestConsumer.bin 9a53f1f6d23f6f9bd9781284d8406e4b0741d59d13da2bdf4a9e0a8754c88101 +vrf_owner_test_consumer: ../../contracts/solc/v0.8.6/VRFV2OwnerTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2OwnerTestConsumer.bin 0537bbe96c5a8bbd44d0a65fbb7e51f6a9f9e75f4673225845ac1ba33f4e7974 vrf_ownerless_consumer_example: ../../contracts/solc/v0.8.6/VRFOwnerlessConsumerExample.abi ../../contracts/solc/v0.8.6/VRFOwnerlessConsumerExample.bin 9893b3805863273917fb282eed32274e32aa3d5c2a67a911510133e1218132be vrf_single_consumer_example: ../../contracts/solc/v0.8.6/VRFSingleConsumerExample.abi ../../contracts/solc/v0.8.6/VRFSingleConsumerExample.bin 892a5ed35da2e933f7fd7835cd6f7f70ef3aa63a9c03a22c5b1fd026711b0ece -vrf_v2plus_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.bin 41a6c14753817ef6143716082754a30653a36b1902b596f695afc1b56940c0ae +vrf_v2plus_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.bin 0a89cb7ed9dfb42f91e559b03dc351ccdbe14d281a7ab71c63bd3f47eeed7711 vrf_v2plus_single_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusSingleConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusSingleConsumerExample.bin e2aa4cfef91b1d1869ec1f517b4d41049884e0e25345384c2fccbe08cda3e603 vrf_v2plus_sub_owner: ../../contracts/solc/v0.8.6/VRFV2PlusExternalSubOwnerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusExternalSubOwnerExample.bin 8bc4a8b74d302b9a7a37556d3746105f487c4d3555643721748533d01b1ae5a4 -vrf_v2plus_upgraded_version: ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.bin 24850318f2af4ad0fab64bc42f0d815bc41388902eba190720e33e4c11f2f0b9 +vrf_v2plus_upgraded_version: ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.bin cb37587e0979a9a668eed8b388dc1d835c9763f699f6b97a77d1c3d35d4f04b6 vrfv2_proxy_admin: ../../contracts/solc/v0.8.6/VRFV2ProxyAdmin.abi ../../contracts/solc/v0.8.6/VRFV2ProxyAdmin.bin 30b6d1af9c4ae05daddda2afdab1877d857ab5321afe3540a01e94d5ded9bcef vrfv2_reverting_example: ../../contracts/solc/v0.8.6/VRFV2RevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2RevertingExample.bin 1ae46f80351d428bd85ba58b9041b2a608a1845300d79a8fed83edf96606de87 vrfv2_transparent_upgradeable_proxy: ../../contracts/solc/v0.8.6/VRFV2TransparentUpgradeableProxy.abi ../../contracts/solc/v0.8.6/VRFV2TransparentUpgradeableProxy.bin 84be44ffac513ef5b009d53846b76d3247ceb9fa0545dec2a0dd11606a915850 -vrfv2_wrapper: ../../contracts/solc/v0.8.6/VRFV2Wrapper.abi ../../contracts/solc/v0.8.6/VRFV2Wrapper.bin ccbacaaf7fa058ced4998a3811ad6af15f1be07db20548b945f7569b99d85cbc +vrfv2_wrapper: ../../contracts/solc/v0.8.6/VRFV2Wrapper.abi ../../contracts/solc/v0.8.6/VRFV2Wrapper.bin 7682891b23b7cae7f79803b662556637c52d295c415fbb0708dbec1e5303c01a vrfv2_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample.bin 3c5c9f1c501e697a7e77e959b48767e2a0bb1372393fd7686f7aaef3eb794231 vrfv2_wrapper_interface: ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.abi ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.bin ff8560169de171a68b360b7438d13863682d07040d984fd0fb096b2379421003 vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contracts/solc/v0.8.6/VRFV2PlusClient.bin bec10896851c433bb5997c96d96d9871b335924a59a8ab07d7062fcbc3992c6e vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 2c480a6d7955d33a00690fdd943486d95802e48a03f3cc243df314448e4ddb2c vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin e5ae923d5fdfa916303cd7150b8474ccd912e14bafe950c6431f6ec94821f642 vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 -vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 32664596d07d6c1563187496f54ca5e24dc028a0358f9f4dd6cb12a51595c823 +vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 47d42936e0e6a073ffcb2d5b766c5882cdfbb81462f58edb0bbdacfb3dd6ed32 vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin d4ddf86da21b87c013f551b2563ab68712ea9d4724894664d5778f6b124f4e78 -vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 8212afe0f981cd0820f46f1e2e98219ce5d1b1eeae502730dbb52b8638f9ad44 +vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 4e8dcc8f60568aa09cc1adc800a56161f46642edc77768c3efab222a30a0e5ae From 57fec368609328df00b746adcfb17630251cba40 Mon Sep 17 00:00:00 2001 From: Cedric Date: Wed, 27 Sep 2023 15:42:58 +0100 Subject: [PATCH 21/84] [fix] Refactor some flakey tests (#10777) * [fix] Fix flakey test by avoiding full table lock * [fix] Refactor some flakey tests - Stop using Eventually() in SessionReaper tests, and use a channel to signal when the reaper has run instead. - Start using random users where we previously used APIEmailAdmin. - Remove a full table lock and replace it with a selective delete which should reduce some lock contention * Clean up user/session methods --- core/cmd/shell_remote_test.go | 24 ++++++++++------ core/cmd/shell_test.go | 13 ++++++--- core/internal/cltest/mocks.go | 38 +++++++----------------- core/sessions/orm_test.go | 41 ++++++++++++++------------ core/sessions/reaper.go | 20 +++++++++++-- core/sessions/reaper_helper_test.go | 5 ++++ core/sessions/reaper_test.go | 43 +++++++++++++--------------- core/web/sessions_controller_test.go | 25 +++++++++++++--- 8 files changed, 122 insertions(+), 87 deletions(-) create mode 100644 core/sessions/reaper_helper_test.go diff --git a/core/cmd/shell_remote_test.go b/core/cmd/shell_remote_test.go index 83686443faa..8fb1a9fb646 100644 --- a/core/cmd/shell_remote_test.go +++ b/core/cmd/shell_remote_test.go @@ -257,17 +257,20 @@ func TestShell_DestroyExternalInitiator_NotFound(t *testing.T) { func TestShell_RemoteLogin(t *testing.T) { app := startNewApplicationV2(t, nil) + orm := app.SessionORM() + + u := cltest.NewUserWithSession(t, orm) tests := []struct { name, file string email, pwd string wantError bool }{ - {"success prompt", "", cltest.APIEmailAdmin, cltest.Password, false}, + {"success prompt", "", u.Email, cltest.Password, false}, {"success file", "../internal/fixtures/apicredentials", "", "", false}, {"failure prompt", "", "wrong@email.com", "wrongpwd", true}, {"failure file", "/tmp/doesntexist", "", "", true}, - {"failure file w correct prompt", "/tmp/doesntexist", cltest.APIEmailAdmin, cltest.Password, true}, + {"failure file w correct prompt", "/tmp/doesntexist", u.Email, cltest.Password, true}, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { @@ -297,7 +300,8 @@ func TestShell_RemoteBuildCompatibility(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) - enteredStrings := []string{cltest.APIEmailAdmin, cltest.Password} + u := cltest.NewUserWithSession(t, app.SessionORM()) + enteredStrings := []string{u.Email, cltest.Password} prompter := &cltest.MockCountingPrompter{T: t, EnteredStrings: append(enteredStrings, enteredStrings...)} client := app.NewAuthenticatingShell(prompter) @@ -335,6 +339,7 @@ func TestShell_CheckRemoteBuildCompatibility(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) + u := cltest.NewUserWithSession(t, app.SessionORM()) tests := []struct { name string remoteVersion, remoteSha string @@ -349,7 +354,7 @@ func TestShell_CheckRemoteBuildCompatibility(t *testing.T) { } for _, test := range tests { t.Run(test.name, func(t *testing.T) { - enteredStrings := []string{cltest.APIEmailAdmin, cltest.Password} + enteredStrings := []string{u.Email, cltest.Password} prompter := &cltest.MockCountingPrompter{T: t, EnteredStrings: enteredStrings} client := app.NewAuthenticatingShell(prompter) @@ -410,8 +415,9 @@ func TestShell_ChangePassword(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) + u := cltest.NewUserWithSession(t, app.SessionORM()) - enteredStrings := []string{cltest.APIEmailAdmin, cltest.Password} + enteredStrings := []string{u.Email, cltest.Password} prompter := &cltest.MockCountingPrompter{T: t, EnteredStrings: enteredStrings} client := app.NewAuthenticatingShell(prompter) @@ -459,7 +465,8 @@ func TestShell_Profile_InvalidSecondsParam(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) - enteredStrings := []string{cltest.APIEmailAdmin, cltest.Password} + u := cltest.NewUserWithSession(t, app.SessionORM()) + enteredStrings := []string{u.Email, cltest.Password} prompter := &cltest.MockCountingPrompter{T: t, EnteredStrings: enteredStrings} client := app.NewAuthenticatingShell(prompter) @@ -489,7 +496,8 @@ func TestShell_Profile(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) - enteredStrings := []string{cltest.APIEmailAdmin, cltest.Password} + u := cltest.NewUserWithSession(t, app.SessionORM()) + enteredStrings := []string{u.Email, cltest.Password} prompter := &cltest.MockCountingPrompter{T: t, EnteredStrings: enteredStrings} client := app.NewAuthenticatingShell(prompter) @@ -656,7 +664,7 @@ func TestShell_AutoLogin(t *testing.T) { require.NoError(t, err) // Expire the session and then try again - pgtest.MustExec(t, app.GetSqlxDB(), "TRUNCATE sessions") + pgtest.MustExec(t, app.GetSqlxDB(), "delete from sessions where email = $1", user.Email) err = client.ListJobs(cli.NewContext(nil, fs, nil)) require.NoError(t, err) } diff --git a/core/cmd/shell_test.go b/core/cmd/shell_test.go index c74a0067a68..a8190a05951 100644 --- a/core/cmd/shell_test.go +++ b/core/cmd/shell_test.go @@ -33,13 +33,16 @@ import ( func TestTerminalCookieAuthenticator_AuthenticateWithoutSession(t *testing.T) { t.Parallel() + app := cltest.NewApplicationEVMDisabled(t) + u := cltest.NewUserWithSession(t, app.SessionORM()) + tests := []struct { name, email, pwd string }{ {"bad email", "notreal", cltest.Password}, - {"bad pwd", cltest.APIEmailAdmin, "mostcommonwrongpwdever"}, + {"bad pwd", u.Email, "mostcommonwrongpwdever"}, {"bad both", "notreal", "mostcommonwrongpwdever"}, - {"correct", cltest.APIEmailAdmin, cltest.Password}, + {"correct", u.Email, cltest.Password}, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { @@ -63,14 +66,16 @@ func TestTerminalCookieAuthenticator_AuthenticateWithSession(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) + u := cltest.NewUserWithSession(t, app.SessionORM()) + tests := []struct { name, email, pwd string wantError bool }{ {"bad email", "notreal", cltest.Password, true}, - {"bad pwd", cltest.APIEmailAdmin, "mostcommonwrongpwdever", true}, + {"bad pwd", u.Email, "mostcommonwrongpwdever", true}, {"bad both", "notreal", "mostcommonwrongpwdever", true}, - {"success", cltest.APIEmailAdmin, cltest.Password, false}, + {"success", u.Email, cltest.Password, false}, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { diff --git a/core/internal/cltest/mocks.go b/core/internal/cltest/mocks.go index 439ca2b721d..9fdbcbb373d 100644 --- a/core/internal/cltest/mocks.go +++ b/core/internal/cltest/mocks.go @@ -27,6 +27,7 @@ import ( gethTypes "github.com/ethereum/go-ethereum/core/types" "github.com/robfig/cron/v3" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) // MockSubscription a mock subscription @@ -308,35 +309,16 @@ func MustRandomUser(t testing.TB) sessions.User { return r } -// CreateUserWithRole inserts a new user with specified role and associated test DB email into the test DB -func CreateUserWithRole(t testing.TB, role sessions.UserRole) sessions.User { - email := "" - switch role { - case sessions.UserRoleAdmin: - email = APIEmailAdmin - case sessions.UserRoleEdit: - email = APIEmailEdit - case sessions.UserRoleRun: - email = APIEmailRun - case sessions.UserRoleView: - email = APIEmailViewOnly - default: - t.Fatal("Unexpected role for CreateUserWithRole") - } - - r, err := sessions.NewUser(email, Password, role) - if err != nil { - logger.TestLogger(t).Panic(err) - } - return r -} +func NewUserWithSession(t testing.TB, orm sessions.ORM) sessions.User { + u := MustRandomUser(t) + require.NoError(t, orm.CreateUser(&u)) -func MustNewUser(t *testing.T, email, password string) sessions.User { - r, err := sessions.NewUser(email, password, sessions.UserRoleAdmin) - if err != nil { - t.Fatal(err) - } - return r + _, err := orm.CreateSession(sessions.SessionRequest{ + Email: u.Email, + Password: Password, + }) + require.NoError(t, err) + return u } type MockAPIInitializer struct { diff --git a/core/sessions/orm_test.go b/core/sessions/orm_test.go index 804ea2dbb87..5decb823086 100644 --- a/core/sessions/orm_test.go +++ b/core/sessions/orm_test.go @@ -34,8 +34,8 @@ func TestORM_FindUser(t *testing.T) { t.Parallel() db, orm := setupORM(t) - user1 := cltest.MustNewUser(t, "test1@email1.net", cltest.Password) - user2 := cltest.MustNewUser(t, "test2@email2.net", cltest.Password) + user1 := cltest.MustRandomUser(t) + user2 := cltest.MustRandomUser(t) require.NoError(t, orm.CreateUser(&user1)) require.NoError(t, orm.CreateUser(&user2)) @@ -56,12 +56,11 @@ func TestORM_AuthorizedUserWithSession(t *testing.T) { sessionID string sessionDuration time.Duration wantError string - wantEmail string }{ - {"authorized", "correctID", cltest.MustParseDuration(t, "3m"), "", "have@email"}, - {"expired", "correctID", cltest.MustParseDuration(t, "0m"), sessions.ErrUserSessionExpired.Error(), ""}, - {"incorrect", "wrong", cltest.MustParseDuration(t, "3m"), sessions.ErrUserSessionExpired.Error(), ""}, - {"empty", "", cltest.MustParseDuration(t, "3m"), sessions.ErrEmptySessionID.Error(), ""}, + {"authorized", "correctID", cltest.MustParseDuration(t, "3m"), ""}, + {"expired", "correctID", cltest.MustParseDuration(t, "0m"), sessions.ErrUserSessionExpired.Error()}, + {"incorrect", "wrong", cltest.MustParseDuration(t, "3m"), sessions.ErrUserSessionExpired.Error()}, + {"empty", "", cltest.MustParseDuration(t, "3m"), sessions.ErrEmptySessionID.Error()}, } for _, test := range tests { @@ -69,7 +68,7 @@ func TestORM_AuthorizedUserWithSession(t *testing.T) { db := pgtest.NewSqlxDB(t) orm := sessions.NewORM(db, test.sessionDuration, logger.TestLogger(t), pgtest.NewQConfig(true), &audit.AuditLoggerService{}) - user := cltest.MustNewUser(t, "have@email", cltest.Password) + user := cltest.MustRandomUser(t) require.NoError(t, orm.CreateUser(&user)) prevSession := cltest.NewSession("correctID") @@ -83,7 +82,7 @@ func TestORM_AuthorizedUserWithSession(t *testing.T) { require.EqualError(t, err, test.wantError) } else { require.NoError(t, err) - assert.Equal(t, test.wantEmail, actual.Email) + assert.Equal(t, user.Email, actual.Email) var bumpedSession sessions.Session err = db.Get(&bumpedSession, "SELECT * FROM sessions WHERE ID = $1", prevSession.ID) require.NoError(t, err) @@ -97,13 +96,13 @@ func TestORM_DeleteUser(t *testing.T) { t.Parallel() _, orm := setupORM(t) - _, err := orm.FindUser(cltest.APIEmailAdmin) - require.NoError(t, err) + u := cltest.MustRandomUser(t) + require.NoError(t, orm.CreateUser(&u)) - err = orm.DeleteUser(cltest.APIEmailAdmin) + err := orm.DeleteUser(u.Email) require.NoError(t, err) - _, err = orm.FindUser(cltest.APIEmailAdmin) + _, err = orm.FindUser(u.Email) require.Error(t, err) } @@ -112,14 +111,17 @@ func TestORM_DeleteUserSession(t *testing.T) { db, orm := setupORM(t) + u := cltest.MustRandomUser(t) + require.NoError(t, orm.CreateUser(&u)) + session := sessions.NewSession() - _, err := db.Exec("INSERT INTO sessions (id, email, last_used, created_at) VALUES ($1, $2, now(), now())", session.ID, cltest.APIEmailAdmin) + _, err := db.Exec("INSERT INTO sessions (id, email, last_used, created_at) VALUES ($1, $2, now(), now())", session.ID, u.Email) require.NoError(t, err) err = orm.DeleteUserSession(session.ID) require.NoError(t, err) - _, err = orm.FindUser(cltest.APIEmailAdmin) + _, err = orm.FindUser(u.Email) require.NoError(t, err) sessions, err := orm.Sessions(0, 10) @@ -130,14 +132,17 @@ func TestORM_DeleteUserSession(t *testing.T) { func TestORM_DeleteUserCascade(t *testing.T) { db, orm := setupORM(t) + u := cltest.MustRandomUser(t) + require.NoError(t, orm.CreateUser(&u)) + session := sessions.NewSession() - _, err := db.Exec("INSERT INTO sessions (id, email, last_used, created_at) VALUES ($1, $2, now(), now())", session.ID, cltest.APIEmailAdmin) + _, err := db.Exec("INSERT INTO sessions (id, email, last_used, created_at) VALUES ($1, $2, now(), now())", session.ID, u.Email) require.NoError(t, err) - err = orm.DeleteUser(cltest.APIEmailAdmin) + err = orm.DeleteUser(u.Email) require.NoError(t, err) - _, err = orm.FindUser(cltest.APIEmailAdmin) + _, err = orm.FindUser(u.Email) require.Error(t, err) sessions, err := orm.Sessions(0, 10) diff --git a/core/sessions/reaper.go b/core/sessions/reaper.go index c4f0ed6796c..a80f0124bb6 100644 --- a/core/sessions/reaper.go +++ b/core/sessions/reaper.go @@ -13,6 +13,10 @@ type sessionReaper struct { db *sql.DB config SessionReaperConfig lggr logger.Logger + + // Receive from this for testing via sr.RunSignal() + // to be notified after each reaper run. + runSignal chan struct{} } type SessionReaperConfig interface { @@ -22,11 +26,18 @@ type SessionReaperConfig interface { // NewSessionReaper creates a reaper that cleans stale sessions from the store. func NewSessionReaper(db *sql.DB, config SessionReaperConfig, lggr logger.Logger) utils.SleeperTask { - return utils.NewSleeperTask(&sessionReaper{ + return utils.NewSleeperTask(NewSessionReaperWorker(db, config, lggr)) +} + +func NewSessionReaperWorker(db *sql.DB, config SessionReaperConfig, lggr logger.Logger) *sessionReaper { + return &sessionReaper{ db, config, lggr.Named("SessionReaper"), - }) + + // For testing only. + make(chan struct{}, 10), + } } func (sr *sessionReaper) Name() string { @@ -40,6 +51,11 @@ func (sr *sessionReaper) Work() { if err != nil { sr.lggr.Error("unable to reap stale sessions: ", err) } + + select { + case sr.runSignal <- struct{}{}: + default: + } } // DeleteStaleSessions deletes all sessions before the passed time. diff --git a/core/sessions/reaper_helper_test.go b/core/sessions/reaper_helper_test.go new file mode 100644 index 00000000000..cec9b72d7ee --- /dev/null +++ b/core/sessions/reaper_helper_test.go @@ -0,0 +1,5 @@ +package sessions + +func (sr *sessionReaper) RunSignal() <-chan struct{} { + return sr.runSignal +} diff --git a/core/sessions/reaper_test.go b/core/sessions/reaper_test.go index d095a23edd5..1e325ea5063 100644 --- a/core/sessions/reaper_test.go +++ b/core/sessions/reaper_test.go @@ -1,7 +1,6 @@ package sessions_test import ( - "database/sql" "testing" "time" @@ -11,8 +10,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/sessions" "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/core/utils" - "github.com/onsi/gomega" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -35,7 +34,9 @@ func TestSessionReaper_ReapSessions(t *testing.T) { lggr := logger.TestLogger(t) orm := sessions.NewORM(db, config.SessionTimeout().Duration(), lggr, pgtest.NewQConfig(true), audit.NoopLogger) - r := sessions.NewSessionReaper(db.DB, config, lggr) + rw := sessions.NewSessionReaperWorker(db.DB, config, lggr) + r := utils.NewSleeperTask(rw) + t.Cleanup(func() { assert.NoError(t, r.Stop()) }) @@ -54,34 +55,30 @@ func TestSessionReaper_ReapSessions(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - t.Cleanup(func() { - clearSessions(t, db.DB) - }) + user := cltest.MustRandomUser(t) + require.NoError(t, orm.CreateUser(&user)) - _, err := db.Exec("INSERT INTO sessions (last_used, email, id, created_at) VALUES ($1, $2, $3, now())", test.lastUsed, cltest.APIEmailAdmin, test.name) + session := sessions.NewSession() + session.Email = user.Email + + _, err := db.Exec("INSERT INTO sessions (last_used, email, id, created_at) VALUES ($1, $2, $3, now())", test.lastUsed, user.Email, test.name) require.NoError(t, err) + t.Cleanup(func() { + _, err2 := db.Exec("DELETE FROM sessions where email = $1", user.Email) + require.NoError(t, err2) + }) + r.WakeUp() + <-rw.RunSignal() + sessions, err := orm.Sessions(0, 10) + assert.NoError(t, err) if test.wantReap { - gomega.NewWithT(t).Eventually(func() []sessions.Session { - sessions, err := orm.Sessions(0, 10) - assert.NoError(t, err) - return sessions - }).Should(gomega.HaveLen(0)) + assert.Len(t, sessions, 0) } else { - gomega.NewWithT(t).Consistently(func() []sessions.Session { - sessions, err := orm.Sessions(0, 10) - assert.NoError(t, err) - return sessions - }).Should(gomega.HaveLen(1)) + assert.Len(t, sessions, 1) } }) } } - -// clearSessions removes all sessions. -func clearSessions(t *testing.T, db *sql.DB) { - _, err := db.Exec("DELETE FROM sessions") - require.NoError(t, err) -} diff --git a/core/web/sessions_controller_test.go b/core/web/sessions_controller_test.go index 41865868b80..7184e3f95b4 100644 --- a/core/web/sessions_controller_test.go +++ b/core/web/sessions_controller_test.go @@ -26,6 +26,9 @@ func TestSessionsController_Create(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) + user := cltest.MustRandomUser(t) + require.NoError(t, app.SessionORM().CreateUser(&user)) + client := clhttptest.NewTestLocalOnlyHTTPClient() tests := []struct { name string @@ -33,9 +36,9 @@ func TestSessionsController_Create(t *testing.T) { password string wantSession bool }{ - {"incorrect pwd", cltest.APIEmailAdmin, "incorrect", false}, + {"incorrect pwd", user.Email, "incorrect", false}, {"incorrect email", "incorrect@test.net", cltest.Password, false}, - {"correct", cltest.APIEmailAdmin, cltest.Password, true}, + {"correct", user.Email, cltest.Password, true}, } for _, test := range tests { @@ -76,7 +79,7 @@ func TestSessionsController_Create(t *testing.T) { func mustInsertSession(t *testing.T, q pg.Q, session *sessions.Session) { sql := "INSERT INTO sessions (id, email, last_used, created_at) VALUES ($1, $2, $3, $4) RETURNING *" - _, err := q.Exec(sql, session.ID, cltest.APIEmailAdmin, session.LastUsed, session.CreatedAt) + _, err := q.Exec(sql, session.ID, session.Email, session.LastUsed, session.CreatedAt) require.NoError(t, err) } @@ -86,12 +89,16 @@ func TestSessionsController_Create_ReapSessions(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) + user := cltest.MustRandomUser(t) + require.NoError(t, app.SessionORM().CreateUser(&user)) + staleSession := cltest.NewSession() staleSession.LastUsed = time.Now().Add(-cltest.MustParseDuration(t, "241h")) + staleSession.Email = user.Email q := pg.NewQ(app.GetSqlxDB(), app.GetLogger(), app.GetConfig().Database()) mustInsertSession(t, q, &staleSession) - body := fmt.Sprintf(`{"email":"%s","password":"%s"}`, cltest.APIEmailAdmin, cltest.Password) + body := fmt.Sprintf(`{"email":"%s","password":"%s"}`, user.Email, cltest.Password) resp, err := http.Post(app.Server.URL+"/sessions", "application/json", bytes.NewBufferString(body)) assert.NoError(t, err) defer func() { assert.NoError(t, resp.Body.Close()) }() @@ -116,7 +123,11 @@ func TestSessionsController_Destroy(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) + user := cltest.MustRandomUser(t) + require.NoError(t, app.SessionORM().CreateUser(&user)) + correctSession := sessions.NewSession() + correctSession.Email = user.Email q := pg.NewQ(app.GetSqlxDB(), app.GetLogger(), app.GetConfig().Database()) mustInsertSession(t, q, &correctSession) @@ -158,11 +169,17 @@ func TestSessionsController_Destroy_ReapSessions(t *testing.T) { q := pg.NewQ(app.GetSqlxDB(), app.GetLogger(), app.GetConfig().Database()) require.NoError(t, app.Start(testutils.Context(t))) + user := cltest.MustRandomUser(t) + require.NoError(t, app.SessionORM().CreateUser(&user)) + correctSession := sessions.NewSession() + correctSession.Email = user.Email + mustInsertSession(t, q, &correctSession) cookie := cltest.MustGenerateSessionCookie(t, correctSession.ID) staleSession := cltest.NewSession() + staleSession.Email = user.Email staleSession.LastUsed = time.Now().Add(-cltest.MustParseDuration(t, "241h")) mustInsertSession(t, q, &staleSession) From 7b1ae85dff9ad78142ae29dc8ea67da38c95b371 Mon Sep 17 00:00:00 2001 From: Makram Date: Wed, 27 Sep 2023 18:27:12 +0300 Subject: [PATCH 22/84] feature: cmd for closest bhs block (#10799) * feature: cmd for closest bhs block * use closest block in batch backwards mode if start block is not provided * chore: additional logging --------- Co-authored-by: jinhoonbang --- core/scripts/vrfv2/testnet/main.go | 28 +++++++++++---- core/scripts/vrfv2/testnet/scripts/util.go | 41 +++++++++++++++++++++- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/core/scripts/vrfv2/testnet/main.go b/core/scripts/vrfv2/testnet/main.go index d30c0e7fca3..d418eb6d153 100644 --- a/core/scripts/vrfv2/testnet/main.go +++ b/core/scripts/vrfv2/testnet/main.go @@ -418,12 +418,19 @@ func main() { } if *startBlock == -1 { - tx, err2 := bhs.StoreEarliest(e.Owner) - helpers.PanicErr(err2) - receipt := helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID, "Store Earliest") - // storeEarliest will store receipt block number minus 256 which is the earliest block - // the blockhash() instruction will work on. - *startBlock = receipt.BlockNumber.Int64() - 256 + closestBlock, err2 := scripts.ClosestBlock(e, common.HexToAddress(*batchAddr), uint64(*endBlock), uint64(*batchSize)) + // found a block with blockhash stored that's more recent that end block + if err2 == nil { + *startBlock = int64(closestBlock) + } else { + fmt.Println("encountered error while looking for closest block:", err2) + tx, err2 := bhs.StoreEarliest(e.Owner) + helpers.PanicErr(err2) + receipt := helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID, "Store Earliest") + // storeEarliest will store receipt block number minus 256 which is the earliest block + // the blockhash() instruction will work on. + *startBlock = receipt.BlockNumber.Int64() - 256 + } } // Check if the provided start block is in the BHS. If it's not, print out an appropriate @@ -476,6 +483,7 @@ func main() { helpers.PanicErr(err) fmt.Println("received receipt, continuing") + fmt.Println("there are", len(blockRange)-j, "blocks left to store") } fmt.Println("done") case "latest-head": @@ -1330,6 +1338,14 @@ func main() { blockNumber := cmd.Int("block-number", -1, "block number") helpers.ParseArgs(cmd, os.Args[2:]) _ = helpers.CalculateLatestBlockHeader(e, *blockNumber) + case "closest-block": + cmd := flag.NewFlagSet("closest-block", flag.ExitOnError) + blockNumber := cmd.Uint64("block-number", 0, "block number") + batchBHSAddress := cmd.String("batch-bhs-address", "", "address of the batch blockhash store") + batchSize := cmd.Uint64("batch-size", 100, "batch size") + helpers.ParseArgs(cmd, os.Args[2:], "block-number", "batch-bhs-address") + _, err := scripts.ClosestBlock(e, common.HexToAddress(*batchBHSAddress), *blockNumber, *batchSize) + helpers.PanicErr(err) case "wrapper-universe-deploy": scripts.DeployWrapperUniverse(e) default: diff --git a/core/scripts/vrfv2/testnet/scripts/util.go b/core/scripts/vrfv2/testnet/scripts/util.go index 3b429837c93..a55a78adb58 100644 --- a/core/scripts/vrfv2/testnet/scripts/util.go +++ b/core/scripts/vrfv2/testnet/scripts/util.go @@ -3,11 +3,14 @@ package scripts import ( "context" "encoding/hex" + "errors" "fmt" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_load_test_with_metrics" "math/big" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_load_test_with_metrics" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" @@ -212,3 +215,39 @@ func EoaLoadTestConsumerWithMetricsDeploy(e helpers.Environment, consumerCoordin helpers.PanicErr(err) return helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) } + +func ClosestBlock(e helpers.Environment, batchBHSAddress common.Address, blockMissingBlockhash uint64, batchSize uint64) (uint64, error) { + batchBHS, err := batch_blockhash_store.NewBatchBlockhashStore(batchBHSAddress, e.Ec) + if err != nil { + return 0, err + } + startBlock := blockMissingBlockhash + 1 + endBlock := startBlock + batchSize + for { + latestBlock, err := e.Ec.HeaderByNumber(context.Background(), nil) + if err != nil { + return 0, err + } + if latestBlock.Number.Uint64() < endBlock { + return 0, errors.New("closest block with blockhash not found") + } + var blockRange []*big.Int + for i := startBlock; i <= endBlock; i++ { + blockRange = append(blockRange, big.NewInt(int64(i))) + } + fmt.Println("Searching range", startBlock, "-", endBlock, "inclusive") + hashes, err := batchBHS.GetBlockhashes(nil, blockRange) + if err != nil { + return 0, err + } + for i, hash := range hashes { + if hash != (common.Hash{}) { + fmt.Println("found closest block:", startBlock+uint64(i), "hash:", hexutil.Encode(hash[:])) + fmt.Println("distance from missing block:", startBlock+uint64(i)-blockMissingBlockhash) + return startBlock + uint64(i), nil + } + } + startBlock = endBlock + 1 + endBlock = startBlock + batchSize + } +} From 0d475b6da1a28237e2acdc8ce94ff20df85f438f Mon Sep 17 00:00:00 2001 From: Sri Kidambi <1702865+kidambisrinivas@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:27:44 +0100 Subject: [PATCH 23/84] Redesign VRFV2PlusWrapper to be migratable to new VRFCoordinators (#10809) * Removing dependency on ExtendedVRFCoordinatorV2Plus interface to make VRFV2PlusWrapper migratable to new VRFCoordinators * Provide additional config params to VRFV2PlusWrapper from integration tests --------- Co-authored-by: Sri Kidambi --- .../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol | 61 ++++++++++--------- .../test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol | 6 +- .../vrfv2plus_wrapper/vrfv2plus_wrapper.go | 42 +++---------- ...rapper-dependency-versions-do-not-edit.txt | 2 +- .../actions/vrfv2plus/vrfv2plus_steps.go | 5 ++ .../contracts/contract_vrf_models.go | 2 +- .../contracts/ethereum_vrfv2plus_contracts.go | 15 ++++- 7 files changed, 67 insertions(+), 66 deletions(-) diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol index f339cce6b4d..cd453c2639a 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol @@ -21,24 +21,35 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume error LinkAlreadySet(); error FailedToTransferLink(); + /* Storage Slot 1: BEGIN */ // s_keyHash is the key hash to use when requesting randomness. Fees are paid based on current gas // fees, so this should be set to the highest gas lane on the network. bytes32 s_keyHash; + /* Storage Slot 1: END */ + /* Storage Slot 2: BEGIN */ uint256 public immutable SUBSCRIPTION_ID; + /* Storage Slot 2: END */ + /* Storage Slot 3: BEGIN */ // 5k is plenty for an EXTCODESIZE call (2600) + warm CALL (100) // and some arithmetic operations. uint256 private constant GAS_FOR_CALL_EXACT_CHECK = 5_000; + /* Storage Slot 3: END */ + /* Storage Slot 4: BEGIN */ // lastRequestId is the request ID of the most recent VRF V2 request made by this wrapper. This // should only be relied on within the same transaction the request was made. uint256 public override lastRequestId; + /* Storage Slot 4: END */ + /* Storage Slot 5: BEGIN */ // s_fallbackWeiPerUnitLink is the backup LINK exchange rate used when the LINK/NATIVE feed is // stale. int256 private s_fallbackWeiPerUnitLink; + /* Storage Slot 5: END */ + /* Storage Slot 6: BEGIN */ // s_stalenessSeconds is the number of seconds before we consider the feed price to be stale and // fallback to fallbackWeiPerUnitLink. uint32 private s_stalenessSeconds; @@ -52,9 +63,9 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume uint32 private s_fulfillmentFlatFeeNativePPM; LinkTokenInterface public s_link; + /* Storage Slot 6: END */ - // Other configuration - + /* Storage Slot 7: BEGIN */ // s_wrapperGasOverhead reflects the gas overhead of the wrapper's fulfillRandomWords // function. The cost for this gas is passed to the user. uint32 private s_wrapperGasOverhead; @@ -76,7 +87,9 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume uint32 private s_coordinatorGasOverhead; AggregatorV3Interface public s_linkNativeFeed; + /* Storage Slot 7: END */ + /* Storage Slot 8: BEGIN */ // s_configured tracks whether this contract has been configured. If not configured, randomness // requests cannot be made. bool public s_configured; @@ -91,8 +104,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume // s_maxNumWords is the max number of words that can be requested in a single wrapped VRF request. uint8 s_maxNumWords; - - ExtendedVRFCoordinatorV2PlusInterface public immutable COORDINATOR; + /* Storage Slot 8: END */ struct Callback { address callbackAddress; @@ -103,8 +115,11 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume // GasPrice is unlikely to be more than 14 ETH on most chains uint64 requestGasPrice; } + /* Storage Slot 9: BEGIN */ mapping(uint256 => Callback) /* requestID */ /* callback */ public s_callbacks; + /* Storage Slot 9: END */ + constructor(address _link, address _linkNativeFeed, address _coordinator) VRFConsumerBaseV2Plus(_coordinator) { if (_link != address(0)) { s_link = LinkTokenInterface(_link); @@ -112,12 +127,11 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume if (_linkNativeFeed != address(0)) { s_linkNativeFeed = AggregatorV3Interface(_linkNativeFeed); } - COORDINATOR = ExtendedVRFCoordinatorV2PlusInterface(_coordinator); // Create this wrapper's subscription and add itself as a consumer. - uint256 subId = ExtendedVRFCoordinatorV2PlusInterface(_coordinator).createSubscription(); + uint256 subId = s_vrfCoordinator.createSubscription(); SUBSCRIPTION_ID = subId; - ExtendedVRFCoordinatorV2PlusInterface(_coordinator).addConsumer(subId, address(this)); + s_vrfCoordinator.addConsumer(subId, address(this)); } /** @@ -169,7 +183,11 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume uint32 _coordinatorGasOverhead, uint8 _wrapperPremiumPercentage, bytes32 _keyHash, - uint8 _maxNumWords + uint8 _maxNumWords, + uint32 stalenessSeconds, + int256 fallbackWeiPerUnitLink, + uint32 fulfillmentFlatFeeLinkPPM, + uint32 fulfillmentFlatFeeNativePPM ) external onlyOwner { s_wrapperGasOverhead = _wrapperGasOverhead; s_coordinatorGasOverhead = _coordinatorGasOverhead; @@ -179,9 +197,10 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume s_configured = true; // Get other configuration from coordinator - (, , s_stalenessSeconds, ) = COORDINATOR.s_config(); - s_fallbackWeiPerUnitLink = COORDINATOR.s_fallbackWeiPerUnitLink(); - (s_fulfillmentFlatFeeLinkPPM, s_fulfillmentFlatFeeNativePPM) = COORDINATOR.s_feeConfig(); + s_stalenessSeconds = stalenessSeconds; + s_fallbackWeiPerUnitLink = fallbackWeiPerUnitLink; + s_fulfillmentFlatFeeLinkPPM = fulfillmentFlatFeeLinkPPM; + s_fulfillmentFlatFeeNativePPM = fulfillmentFlatFeeNativePPM; } /** @@ -356,7 +375,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume numWords: numWords, extraArgs: "" // empty extraArgs defaults to link payment }); - uint256 requestId = COORDINATOR.requestRandomWords(req); + uint256 requestId = s_vrfCoordinator.requestRandomWords(req); s_callbacks[requestId] = Callback({ callbackAddress: _sender, callbackGasLimit: callbackGasLimit, @@ -382,7 +401,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume numWords: _numWords, extraArgs: VRFV2PlusClient._argsToBytes(VRFV2PlusClient.ExtraArgsV1({nativePayment: true})) }); - requestId = COORDINATOR.requestRandomWords(req); + requestId = s_vrfCoordinator.requestRandomWords(req); s_callbacks[requestId] = Callback({ callbackAddress: msg.sender, callbackGasLimit: _callbackGasLimit, @@ -510,19 +529,3 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume _; } } - -interface ExtendedVRFCoordinatorV2PlusInterface is IVRFCoordinatorV2Plus { - function s_config() - external - view - returns ( - uint16 minimumRequestConfirmations, - uint32 maxGasLimit, - uint32 stalenessSeconds, - uint32 gasAfterPaymentCalculation - ); - - function s_fallbackWeiPerUnitLink() external view returns (int256); - - function s_feeConfig() external view returns (uint32 fulfillmentFlatFeeLinkPPM, uint32 fulfillmentFlatFeeNativePPM); -} diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol index 8ed39093821..4cb02991da1 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol @@ -69,7 +69,11 @@ contract VRFV2PlusWrapperTest is BaseTest { coordinatorGasOverhead, // coordinator gas overhead 0, // premium percentage vrfKeyHash, // keyHash - 10 // max number of words + 10, // max number of words, + 1, // stalenessSeconds + 50000000000000000, // fallbackWeiPerUnitLink + 0, // fulfillmentFlatFeeLinkPPM + 0 // fulfillmentFlatFeeNativePPM ); ( , diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go index 5974a2cc19c..2dcb2439466 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go @@ -31,8 +31,8 @@ var ( ) var VRFV2PlusWrapperMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractExtendedVRFCoordinatorV2PlusInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60c06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b506040516200314e3803806200314e8339810160408190526200004c9162000335565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200026c565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b806001600160a01b031660a0816001600160a01b031660601b815250506000816001600160a01b031663a21a23e46040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620001bd57600080fd5b505af1158015620001d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f891906200037f565b6080819052604051632fb1302360e21b8152600481018290523060248201529091506001600160a01b0383169063bec4c08c90604401600060405180830381600087803b1580156200024957600080fd5b505af11580156200025e573d6000803e3d6000fd5b505050505050505062000399565b6001600160a01b038116331415620002c75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200033057600080fd5b919050565b6000806000606084860312156200034b57600080fd5b620003568462000318565b9250620003666020850162000318565b9150620003766040850162000318565b90509250925092565b6000602082840312156200039257600080fd5b5051919050565b60805160a05160601c612d5b620003f3600039600081816102f901528181610e08015281816116e1015281816119fa01528181611adb0152611b760152600081816101ef01528181610d3f015261165b0152612d5b6000f3fe6080604052600436106101d85760003560e01c80638da5cb5b11610102578063c15ce4d711610095578063f254bdc711610064578063f254bdc71461070a578063f2fde38b14610747578063f3fef3a314610767578063fc2a88c31461078757600080fd5b8063c15ce4d7146105e9578063c3f909d414610609578063cdd8d88514610693578063da4f5e6d146106cd57600080fd5b8063a3907d71116100d1578063a3907d7114610575578063a4c0ed361461058a578063a608a1e1146105aa578063bf17e559146105c957600080fd5b80638da5cb5b146104dd5780638ea98117146105085780639eccacf614610528578063a02e06161461055557600080fd5b80634306d3541161017a57806362a504fc1161014957806362a504fc14610475578063650596541461048857806379ba5097146104a85780637fb5d19d146104bd57600080fd5b80634306d3541461034057806348baa1c5146103605780634b1609351461042b57806357a8070a1461044b57600080fd5b80631fe543e3116101b65780631fe543e3146102925780632f2770db146102b25780633255c456146102c75780633b2bcbf1146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f366004612683565b61079d565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612af1565b34801561029e57600080fd5b506102446102ad3660046127e7565b610879565b3480156102be57600080fd5b506102446108fa565b3480156102d357600080fd5b506102116102e2366004612988565b610930565b3480156102f357600080fd5b5061031b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b34801561034c57600080fd5b5061021161035b366004612920565b610a28565b34801561036c57600080fd5b506103ea61037b3660046127ce565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161021b565b34801561043757600080fd5b50610211610446366004612920565b610b2f565b34801561045757600080fd5b506008546104659060ff1681565b604051901515815260200161021b565b61021161048336600461293d565b610c26565b34801561049457600080fd5b506102446104a3366004612668565b610f7b565b3480156104b457600080fd5b50610244610fc6565b3480156104c957600080fd5b506102116104d8366004612988565b6110c3565b3480156104e957600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661031b565b34801561051457600080fd5b50610244610523366004612668565b6111c9565b34801561053457600080fd5b5060025461031b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561056157600080fd5b50610244610570366004612668565b6112d4565b34801561058157600080fd5b5061024461137f565b34801561059657600080fd5b506102446105a53660046126ad565b6113b1565b3480156105b657600080fd5b5060085461046590610100900460ff1681565b3480156105d557600080fd5b506102446105e4366004612920565b611895565b3480156105f557600080fd5b506102446106043660046129e0565b6118dc565b34801561061557600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e08201526101000161021b565b34801561069f57600080fd5b506007546106b890640100000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106d957600080fd5b5060065461031b906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561071657600080fd5b5060075461031b906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561075357600080fd5b50610244610762366004612668565b611c85565b34801561077357600080fd5b50610244610782366004612683565b611c99565b34801561079357600080fd5b5061021160045481565b6107a5611d94565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107ff576040519150601f19603f3d011682016040523d82523d6000602084013e610804565b606091505b5050905080610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108ec576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440161086b565b6108f68282611e17565b5050565b610902611d94565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff1661099f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610a11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b610a218363ffffffff1683611fff565b9392505050565b60085460009060ff16610a97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610b09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b6000610b136120d5565b9050610b268363ffffffff163a83612235565b9150505b919050565b60085460009060ff16610b9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff1615610c10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b610c208263ffffffff163a611fff565b92915050565b600080610c3285612327565b90506000610c468663ffffffff163a611fff565b905080341015610cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161086b565b6008546301000000900460ff1663ffffffff85161115610d2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161086b565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff16610d8b868b612bc7565b610d959190612bc7565b63ffffffff1681526020018663ffffffff168152602001610dc660405180602001604052806001151581525061233f565b90526040517f9b1c385e00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b1c385e90610e3d908490600401612b04565b602060405180830381600087803b158015610e5757600080fd5b505af1158015610e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8f9190612756565b6040805160608101825233815263ffffffff808b16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9190911617179290921691909117905593505050509392505050565b610f83611d94565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314611047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161086b565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16611132576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff16156111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b60006111ae6120d5565b90506111c18463ffffffff168483612235565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590611209575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561128d573361122e60005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015291909116604482015260640161086b565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6112dc611d94565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff161561133c576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611387611d94565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff1661141d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161086b565b600854610100900460ff161561148f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161086b565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff163314611520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b000000000000000000604482015260640161086b565b600080806115308486018661293d565b925092509250600061154184612327565b9050600061154d6120d5565b905060006115628663ffffffff163a84612235565b9050808910156115ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161086b565b6008546301000000900460ff1663ffffffff8516111561164a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161086b565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff166116a7878b612bc7565b6116b19190612bc7565b63ffffffff1681526020018663ffffffff16815260200160405180602001604052806000815250815250905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016117389190612b04565b602060405180830381600087803b15801561175257600080fd5b505af1158015611766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178a9190612756565b905060405180606001604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018963ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555090505080600481905550505050505050505050505050565b61189d611d94565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b6118e4611d94565b6007805463ffffffff86811668010000000000000000027fffffffffffffffffffffffffffffffffffffffff00000000ffffffff00000000909216908816171790556008805460038490557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0060ff8481166301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff9188166201000002919091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9093169290921791909117166001179055604080517f088070f5000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163088070f5916004828101926080929190829003018186803b158015611a4057600080fd5b505afa158015611a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a78919061276f565b50600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f043bd6ae00000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163043bd6ae916004808301926020929190829003018186803b158015611b3657600080fd5b505afa158015611b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6e9190612756565b6005819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636b6feccc6040518163ffffffff1660e01b8152600401604080518083038186803b158015611bd957600080fd5b505afa158015611bed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1191906129a6565b600680547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff166801000000000000000063ffffffff938416027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff161764010000000093909216929092021790555050505050565b611c8d611d94565b611c96816123fb565b50565b611ca1611d94565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611d2657600080fd5b505af1158015611d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5e9190612734565b6108f6576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161086b565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611f11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e64000000000000000000000000000000604482015260640161086b565b600080631fe543e360e01b8585604051602401611f2f929190612b61565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611fa9846020015163ffffffff168560000151846124f1565b905080611ff757835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b600754600090819061201e90640100000000900463ffffffff1661253d565b60075463ffffffff680100000000000000008204811691612040911687612baf565b61204a9190612baf565b6120549085612c4b565b61205e9190612baf565b600854909150819060009060649061207f9062010000900460ff1682612bef565b61208c9060ff1684612c4b565b6120969190612c14565b6006549091506000906120c09068010000000000000000900463ffffffff1664e8d4a51000612c4b565b6120ca9083612baf565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b15801561216257600080fd5b505afa158015612176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219a9190612a42565b5094509092508491505080156121c057506121b58242612c88565b60065463ffffffff16105b156121ca57506005545b6000811215610a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b2077656920707269636500000000000000000000604482015260640161086b565b600754600090819061225490640100000000900463ffffffff1661253d565b60075463ffffffff680100000000000000008204811691612276911688612baf565b6122809190612baf565b61228a9086612c4b565b6122949190612baf565b90506000836122ab83670de0b6b3a7640000612c4b565b6122b59190612c14565b6008549091506000906064906122d49062010000900460ff1682612bef565b6122e19060ff1684612c4b565b6122eb9190612c14565b60065490915060009061231190640100000000900463ffffffff1664e8d4a51000612c4b565b61231b9083612baf565b98975050505050505050565b6000612334603f83612c28565b610c20906001612bc7565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161237891511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff811633141561247b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161086b565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561250357600080fd5b61138881039050846040820482031161251b57600080fd5b50823b61252757600080fd5b60008083516020850160008789f1949350505050565b600046612549816125f6565b156125ed576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561259757600080fd5b505afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf91906128d6565b5050505091505083608c6125e39190612baf565b6111c19082612c4b565b50600092915050565b600061a4b182148061260a575062066eed82145b80610c2057505062066eee1490565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b2a57600080fd5b803560ff81168114610b2a57600080fd5b805169ffffffffffffffffffff81168114610b2a57600080fd5b60006020828403121561267a57600080fd5b610a2182612619565b6000806040838503121561269657600080fd5b61269f83612619565b946020939093013593505050565b600080600080606085870312156126c357600080fd5b6126cc85612619565b935060208501359250604085013567ffffffffffffffff808211156126f057600080fd5b818701915087601f83011261270457600080fd5b81358181111561271357600080fd5b88602082850101111561272557600080fd5b95989497505060200194505050565b60006020828403121561274657600080fd5b81518015158114610a2157600080fd5b60006020828403121561276857600080fd5b5051919050565b6000806000806080858703121561278557600080fd5b845161279081612d2c565b60208601519094506127a181612d3c565b60408601519093506127b281612d3c565b60608601519092506127c381612d3c565b939692955090935050565b6000602082840312156127e057600080fd5b5035919050565b600080604083850312156127fa57600080fd5b8235915060208084013567ffffffffffffffff8082111561281a57600080fd5b818601915086601f83011261282e57600080fd5b81358181111561284057612840612cfd565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561288357612883612cfd565b604052828152858101935084860182860187018b10156128a257600080fd5b600095505b838610156128c55780358552600195909501949386019386016128a7565b508096505050505050509250929050565b60008060008060008060c087890312156128ef57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561293257600080fd5b8135610a2181612d3c565b60008060006060848603121561295257600080fd5b833561295d81612d3c565b9250602084013561296d81612d2c565b9150604084013561297d81612d3c565b809150509250925092565b6000806040838503121561299b57600080fd5b823561269f81612d3c565b600080604083850312156129b957600080fd5b82516129c481612d3c565b60208401519092506129d581612d3c565b809150509250929050565b600080600080600060a086880312156129f857600080fd5b8535612a0381612d3c565b94506020860135612a1381612d3c565b9350612a216040870161263d565b925060608601359150612a366080870161263d565b90509295509295909350565b600080600080600060a08688031215612a5a57600080fd5b612a638661264e565b9450602086015193506040860151925060608601519150612a366080870161264e565b6000815180845260005b81811015612aac57602081850181015186830182015201612a90565b81811115612abe576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a216020830184612a86565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c0808401526111c160e0840182612a86565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612ba257845183529383019391830191600101612b86565b5090979650505050505050565b60008219821115612bc257612bc2612c9f565b500190565b600063ffffffff808316818516808303821115612be657612be6612c9f565b01949350505050565b600060ff821660ff84168060ff03821115612c0c57612c0c612c9f565b019392505050565b600082612c2357612c23612cce565b500490565b600063ffffffff80841680612c3f57612c3f612cce565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c8357612c83612c9f565b500290565b600082821015612c9a57612c9a612c9f565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff81168114611c9657600080fd5b63ffffffff81168114611c9657600080fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b5060405162002df438038062002df48339810160408190526200004c9162000323565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200025a565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b6002546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e491600480830192602092919082900301818787803b158015620001a957600080fd5b505af1158015620001be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e491906200036d565b6080819052600254604051632fb1302360e21b8152600481018390523060248201529192506001600160a01b03169063bec4c08c90604401600060405180830381600087803b1580156200023757600080fd5b505af11580156200024c573d6000803e3d6000fd5b505050505050505062000387565b6001600160a01b038116331415620002b55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031e57600080fd5b919050565b6000806000606084860312156200033957600080fd5b620003448462000306565b9250620003546020850162000306565b9150620003646040850162000306565b90509250925092565b6000602082840312156200038057600080fd5b5051919050565b608051612a43620003b1600039600081816101e401528181610cfc01526115fa0152612a436000f3fe6080604052600436106101cd5760003560e01c80638ea98117116100f7578063bf17e55911610095578063f254bdc711610064578063f254bdc7146106c7578063f2fde38b14610704578063f3fef3a314610724578063fc2a88c31461074457600080fd5b8063bf17e559146105a6578063c3f909d4146105c6578063cdd8d88514610650578063da4f5e6d1461068a57600080fd5b8063a3907d71116100d1578063a3907d7114610532578063a4c0ed3614610547578063a608a1e114610567578063bed41a931461058657600080fd5b80638ea98117146104c55780639eccacf6146104e5578063a02e06161461051257600080fd5b806348baa1c51161016f578063650596541161013e578063650596541461042457806379ba5097146104445780637fb5d19d146104595780638da5cb5b1461047957600080fd5b806348baa1c5146102fc5780634b160935146103c757806357a8070a146103e757806362a504fc1461041157600080fd5b80631fe543e3116101ab5780631fe543e3146102875780632f2770db146102a75780633255c456146102bc5780634306d354146102dc57600080fd5b8063030932bb146101d257806307b18bde14610219578063181f5a771461023b575b600080fd5b3480156101de57600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561022557600080fd5b506102396102343660046123e5565b61075a565b005b34801561024757600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021091906127fb565b34801561029357600080fd5b506102396102a23660046124ea565b610836565b3480156102b357600080fd5b506102396108b7565b3480156102c857600080fd5b506102066102d736600461268a565b6108ed565b3480156102e857600080fd5b506102066102f7366004612623565b6109e5565b34801561030857600080fd5b506103866103173660046124b8565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff1690820152606001610210565b3480156103d357600080fd5b506102066103e2366004612623565b610aec565b3480156103f357600080fd5b506008546104019060ff1681565b6040519015158152602001610210565b61020661041f36600461263e565b610be3565b34801561043057600080fd5b5061023961043f3660046123ca565b610f1a565b34801561045057600080fd5b50610239610f65565b34801561046557600080fd5b5061020661047436600461268a565b611062565b34801561048557600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610210565b3480156104d157600080fd5b506102396104e03660046123ca565b611168565b3480156104f157600080fd5b506002546104a09073ffffffffffffffffffffffffffffffffffffffff1681565b34801561051e57600080fd5b5061023961052d3660046123ca565b611273565b34801561053e57600080fd5b5061023961131e565b34801561055357600080fd5b5061023961056236600461240f565b611350565b34801561057357600080fd5b5060085461040190610100900460ff1681565b34801561059257600080fd5b506102396105a13660046126a6565b611836565b3480156105b257600080fd5b506102396105c1366004612623565b61198c565b3480156105d257600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e082015261010001610210565b34801561065c57600080fd5b5060075461067590640100000000900463ffffffff1681565b60405163ffffffff9091168152602001610210565b34801561069657600080fd5b506006546104a0906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106d357600080fd5b506007546104a0906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561071057600080fd5b5061023961071f3660046123ca565b6119d3565b34801561073057600080fd5b5061023961073f3660046123e5565b6119e7565b34801561075057600080fd5b5061020660045481565b610762611ae2565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107bc576040519150601f19603f3d011682016040523d82523d6000602084013e6107c1565b606091505b5050905080610831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108a9576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610828565b6108b38282611b65565b5050565b6108bf611ae2565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff1661095c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff16156109ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b6109de8363ffffffff1683611d4d565b9392505050565b60085460009060ff16610a54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff1615610ac6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b6000610ad0611e23565b9050610ae38363ffffffff163a83611f83565b9150505b919050565b60085460009060ff16610b5b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff1615610bcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b610bdd8263ffffffff163a611d4d565b92915050565b600080610bef85612075565b90506000610c038663ffffffff163a611d4d565b905080341015610c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610828565b6008546301000000900460ff1663ffffffff85161115610ceb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610828565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff16610d48868b6128d1565b610d5291906128d1565b63ffffffff1681526020018663ffffffff168152602001610d8360405180602001604052806001151581525061208d565b90526002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e90610ddc90849060040161280e565b602060405180830381600087803b158015610df657600080fd5b505af1158015610e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2e91906124d1565b6040805160608101825233815263ffffffff808b16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9190911617179290921691909117905593505050509392505050565b610f22611ae2565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610fe6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610828565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff166110d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff1615611143576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b600061114d611e23565b90506111608463ffffffff168483611f83565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906111a8575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561122c57336111cd60005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610828565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61127b611ae2565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16156112db576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611326611ae2565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff166113bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff161561142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146114bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610828565b600080806114cf8486018661263e565b92509250925060006114e084612075565b905060006114ec611e23565b905060006115018663ffffffff163a84611f83565b90508089101561156d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610828565b6008546301000000900460ff1663ffffffff851611156115e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610828565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff16611646878b6128d1565b61165091906128d1565b63ffffffff1681526020018663ffffffff1681526020016040518060200160405280600081525081525090506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016116d9919061280e565b602060405180830381600087803b1580156116f357600080fd5b505af1158015611707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172b91906124d1565b905060405180606001604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018963ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555090505080600481905550505050505050505050505050565b61183e611ae2565b6007805463ffffffff9a8b167fffffffffffffffffffffffffffffffffffffffff00000000ffffffff000000009091161768010000000000000000998b168a02179055600880546003979097557fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9096166201000060ff988916027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009590971694909402959095177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117909355600680546005949094557fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff9187167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009094169390931764010000000094871694909402939093179290921691909316909102179055565b611994611ae2565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b6119db611ae2565b6119e481612149565b50565b6119ef611ae2565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611a7457600080fd5b505af1158015611a88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aac9190612496565b6108b3576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611b63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610828565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611c5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610828565b600080631fe543e360e01b8585604051602401611c7d92919061286b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611cf7846020015163ffffffff1685600001518461223f565b905080611d4557835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6007546000908190611d6c90640100000000900463ffffffff1661228b565b60075463ffffffff680100000000000000008204811691611d8e9116876128b9565b611d9891906128b9565b611da29085612955565b611dac91906128b9565b6008549091508190600090606490611dcd9062010000900460ff16826128f9565b611dda9060ff1684612955565b611de4919061291e565b600654909150600090611e0e9068010000000000000000900463ffffffff1664e8d4a51000612955565b611e1890836128b9565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b158015611eb057600080fd5b505afa158015611ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee89190612740565b509450909250849150508015611f0e5750611f038242612992565b60065463ffffffff16105b15611f1857506005545b60008112156109de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610828565b6007546000908190611fa290640100000000900463ffffffff1661228b565b60075463ffffffff680100000000000000008204811691611fc49116886128b9565b611fce91906128b9565b611fd89086612955565b611fe291906128b9565b9050600083611ff983670de0b6b3a7640000612955565b612003919061291e565b6008549091506000906064906120229062010000900460ff16826128f9565b61202f9060ff1684612955565b612039919061291e565b60065490915060009061205f90640100000000900463ffffffff1664e8d4a51000612955565b61206990836128b9565b98975050505050505050565b6000612082603f83612932565b610bdd9060016128d1565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa826040516024016120c691511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff81163314156121c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610828565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561225157600080fd5b61138881039050846040820482031161226957600080fd5b50823b61227557600080fd5b60008083516020850160008789f1949350505050565b60004661229781612344565b1561233b576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b1580156122e557600080fd5b505afa1580156122f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061231d91906125d9565b5050505091505083608c61233191906128b9565b6111609082612955565b50600092915050565b600061a4b1821480612358575062066eed82145b80610bdd57505062066eee1490565b803573ffffffffffffffffffffffffffffffffffffffff81168114610ae757600080fd5b803563ffffffff81168114610ae757600080fd5b803560ff81168114610ae757600080fd5b805169ffffffffffffffffffff81168114610ae757600080fd5b6000602082840312156123dc57600080fd5b6109de82612367565b600080604083850312156123f857600080fd5b61240183612367565b946020939093013593505050565b6000806000806060858703121561242557600080fd5b61242e85612367565b935060208501359250604085013567ffffffffffffffff8082111561245257600080fd5b818701915087601f83011261246657600080fd5b81358181111561247557600080fd5b88602082850101111561248757600080fd5b95989497505060200194505050565b6000602082840312156124a857600080fd5b815180151581146109de57600080fd5b6000602082840312156124ca57600080fd5b5035919050565b6000602082840312156124e357600080fd5b5051919050565b600080604083850312156124fd57600080fd5b8235915060208084013567ffffffffffffffff8082111561251d57600080fd5b818601915086601f83011261253157600080fd5b81358181111561254357612543612a07565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561258657612586612a07565b604052828152858101935084860182860187018b10156125a557600080fd5b600095505b838610156125c85780358552600195909501949386019386016125aa565b508096505050505050509250929050565b60008060008060008060c087890312156125f257600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561263557600080fd5b6109de8261238b565b60008060006060848603121561265357600080fd5b61265c8461238b565b9250602084013561ffff8116811461267357600080fd5b91506126816040850161238b565b90509250925092565b6000806040838503121561269d57600080fd5b6124018361238b565b60008060008060008060008060006101208a8c0312156126c557600080fd5b6126ce8a61238b565b98506126dc60208b0161238b565b97506126ea60408b0161239f565b965060608a013595506126ff60808b0161239f565b945061270d60a08b0161238b565b935060c08a0135925061272260e08b0161238b565b91506127316101008b0161238b565b90509295985092959850929598565b600080600080600060a0868803121561275857600080fd5b612761866123b0565b9450602086015193506040860151925060608601519150612784608087016123b0565b90509295509295909350565b6000815180845260005b818110156127b65760208185018101518683018201520161279a565b818111156127c8576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006109de6020830184612790565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c08084015261116060e0840182612790565b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156128ac57845183529383019391830191600101612890565b5090979650505050505050565b600082198211156128cc576128cc6129a9565b500190565b600063ffffffff8083168185168083038211156128f0576128f06129a9565b01949350505050565b600060ff821660ff84168060ff03821115612916576129166129a9565b019392505050565b60008261292d5761292d6129d8565b500490565b600063ffffffff80841680612949576129496129d8565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561298d5761298d6129a9565b500290565b6000828210156129a4576129a46129a9565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperABI = VRFV2PlusWrapperMetaData.ABI @@ -171,28 +171,6 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorRaw) Transact(opts *bind.Tran return _VRFV2PlusWrapper.Contract.contract.Transact(opts, method, params...) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) COORDINATOR(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _VRFV2PlusWrapper.contract.Call(opts, &out, "COORDINATOR") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) COORDINATOR() (common.Address, error) { - return _VRFV2PlusWrapper.Contract.COORDINATOR(&_VRFV2PlusWrapper.CallOpts) -} - -func (_VRFV2PlusWrapper *VRFV2PlusWrapperCallerSession) COORDINATOR() (common.Address, error) { - return _VRFV2PlusWrapper.Contract.COORDINATOR(&_VRFV2PlusWrapper.CallOpts) -} - func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) SUBSCRIPTIONID(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} err := _VRFV2PlusWrapper.contract.Call(opts, &out, "SUBSCRIPTION_ID") @@ -640,16 +618,16 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) RequestRandomWordsIn return _VRFV2PlusWrapper.Contract.RequestRandomWordsInNative(&_VRFV2PlusWrapper.TransactOpts, _callbackGasLimit, _requestConfirmations, _numWords) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) SetConfig(opts *bind.TransactOpts, _wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8) (*types.Transaction, error) { - return _VRFV2PlusWrapper.contract.Transact(opts, "setConfig", _wrapperGasOverhead, _coordinatorGasOverhead, _wrapperPremiumPercentage, _keyHash, _maxNumWords) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) SetConfig(opts *bind.TransactOpts, _wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeLinkPPM uint32, fulfillmentFlatFeeNativePPM uint32) (*types.Transaction, error) { + return _VRFV2PlusWrapper.contract.Transact(opts, "setConfig", _wrapperGasOverhead, _coordinatorGasOverhead, _wrapperPremiumPercentage, _keyHash, _maxNumWords, stalenessSeconds, fallbackWeiPerUnitLink, fulfillmentFlatFeeLinkPPM, fulfillmentFlatFeeNativePPM) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) SetConfig(_wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8) (*types.Transaction, error) { - return _VRFV2PlusWrapper.Contract.SetConfig(&_VRFV2PlusWrapper.TransactOpts, _wrapperGasOverhead, _coordinatorGasOverhead, _wrapperPremiumPercentage, _keyHash, _maxNumWords) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) SetConfig(_wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeLinkPPM uint32, fulfillmentFlatFeeNativePPM uint32) (*types.Transaction, error) { + return _VRFV2PlusWrapper.Contract.SetConfig(&_VRFV2PlusWrapper.TransactOpts, _wrapperGasOverhead, _coordinatorGasOverhead, _wrapperPremiumPercentage, _keyHash, _maxNumWords, stalenessSeconds, fallbackWeiPerUnitLink, fulfillmentFlatFeeLinkPPM, fulfillmentFlatFeeNativePPM) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) SetConfig(_wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8) (*types.Transaction, error) { - return _VRFV2PlusWrapper.Contract.SetConfig(&_VRFV2PlusWrapper.TransactOpts, _wrapperGasOverhead, _coordinatorGasOverhead, _wrapperPremiumPercentage, _keyHash, _maxNumWords) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) SetConfig(_wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeLinkPPM uint32, fulfillmentFlatFeeNativePPM uint32) (*types.Transaction, error) { + return _VRFV2PlusWrapper.Contract.SetConfig(&_VRFV2PlusWrapper.TransactOpts, _wrapperGasOverhead, _coordinatorGasOverhead, _wrapperPremiumPercentage, _keyHash, _maxNumWords, stalenessSeconds, fallbackWeiPerUnitLink, fulfillmentFlatFeeLinkPPM, fulfillmentFlatFeeNativePPM) } func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) SetCoordinator(opts *bind.TransactOpts, _vrfCoordinator common.Address) (*types.Transaction, error) { @@ -1191,8 +1169,6 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapper) Address() common.Address { } type VRFV2PlusWrapperInterface interface { - COORDINATOR(opts *bind.CallOpts) (common.Address, error) - SUBSCRIPTIONID(opts *bind.CallOpts) (*big.Int, error) CalculateRequestPrice(opts *bind.CallOpts, _callbackGasLimit uint32) (*big.Int, error) @@ -1241,7 +1217,7 @@ type VRFV2PlusWrapperInterface interface { RequestRandomWordsInNative(opts *bind.TransactOpts, _callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32) (*types.Transaction, error) - SetConfig(opts *bind.TransactOpts, _wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8) (*types.Transaction, error) + SetConfig(opts *bind.TransactOpts, _wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeLinkPPM uint32, fulfillmentFlatFeeNativePPM uint32) (*types.Transaction, error) SetCoordinator(opts *bind.TransactOpts, _vrfCoordinator common.Address) (*types.Transaction, error) diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 7e45ec4774d..c9e6ed06309 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -101,6 +101,6 @@ vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contract vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 2c480a6d7955d33a00690fdd943486d95802e48a03f3cc243df314448e4ddb2c vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin e5ae923d5fdfa916303cd7150b8474ccd912e14bafe950c6431f6ec94821f642 vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 -vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 47d42936e0e6a073ffcb2d5b766c5882cdfbb81462f58edb0bbdacfb3dd6ed32 +vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin af73d5757129d4de1d287716ecdc560427904bc2a68b7dace4e6b5ac02539a31 vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin d4ddf86da21b87c013f551b2563ab68712ea9d4724894664d5778f6b124f4e78 vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 4e8dcc8f60568aa09cc1adc800a56161f46642edc77768c3efab222a30a0e5ae diff --git a/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go b/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go index 8c3c2a733ac..aa6dba8e1b4 100644 --- a/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go +++ b/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go @@ -17,6 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" + "github.com/smartcontractkit/chainlink/v2/core/assets" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" chainlinkutils "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -379,6 +380,10 @@ func SetupVRFV2PlusWrapperEnvironment( vrfv2plus_constants.WrapperPremiumPercentage, keyHash, vrfv2plus_constants.WrapperMaxNumberOfWords, + vrfv2plus_constants.StalenessSeconds, + assets.GWei(50_000_000).ToInt(), + vrfv2plus_constants.VRFCoordinatorV2_5FeeConfig.FulfillmentFlatFeeLinkPPM, + vrfv2plus_constants.VRFCoordinatorV2_5FeeConfig.FulfillmentFlatFeeNativePPM, ) if err != nil { return nil, nil, err diff --git a/integration-tests/contracts/contract_vrf_models.go b/integration-tests/contracts/contract_vrf_models.go index 0d302215bea..2b623469aa4 100644 --- a/integration-tests/contracts/contract_vrf_models.go +++ b/integration-tests/contracts/contract_vrf_models.go @@ -126,7 +126,7 @@ type VRFCoordinatorV2PlusUpgradedVersion interface { type VRFV2PlusWrapper interface { Address() string - SetConfig(wrapperGasOverhead uint32, coordinatorGasOverhead uint32, wrapperPremiumPercentage uint8, keyHash [32]byte, maxNumWords uint8) error + SetConfig(wrapperGasOverhead uint32, coordinatorGasOverhead uint32, wrapperPremiumPercentage uint8, keyHash [32]byte, maxNumWords uint8, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeLinkPPM uint32, fulfillmentFlatFeeNativePPM uint32) error GetSubID(ctx context.Context) (*big.Int, error) } diff --git a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go index d07492d0df1..4ca5c0fec45 100644 --- a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go @@ -745,7 +745,16 @@ func (v *EthereumVRFV2PlusWrapperLoadTestConsumer) Address() string { return v.address.Hex() } -func (v *EthereumVRFV2PlusWrapper) SetConfig(wrapperGasOverhead uint32, coordinatorGasOverhead uint32, wrapperPremiumPercentage uint8, keyHash [32]byte, maxNumWords uint8) error { +func (v *EthereumVRFV2PlusWrapper) SetConfig(wrapperGasOverhead uint32, + coordinatorGasOverhead uint32, + wrapperPremiumPercentage uint8, + keyHash [32]byte, + maxNumWords uint8, + stalenessSeconds uint32, + fallbackWeiPerUnitLink *big.Int, + fulfillmentFlatFeeLinkPPM uint32, + fulfillmentFlatFeeNativePPM uint32, +) error { opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) if err != nil { return err @@ -757,6 +766,10 @@ func (v *EthereumVRFV2PlusWrapper) SetConfig(wrapperGasOverhead uint32, coordina wrapperPremiumPercentage, keyHash, maxNumWords, + stalenessSeconds, + fallbackWeiPerUnitLink, + fulfillmentFlatFeeLinkPPM, + fulfillmentFlatFeeNativePPM, ) if err != nil { return err From 49837dad8428fb94d28bf2890885d55b81ef69dd Mon Sep 17 00:00:00 2001 From: Lei Date: Wed, 27 Sep 2023 08:28:57 -0700 Subject: [PATCH 24/84] Support dynamic secrets (#10797) * support dynamic secrets config for cl node * wrap as func opt and fix tests * remove legacy field * add back the legacyURL for automation only --------- Co-authored-by: skudasov --- integration-tests/docker/test_env/cl_node.go | 25 +++++++++++++------ integration-tests/docker/test_env/test_env.go | 4 ++- .../docker/test_env/test_env_builder.go | 10 ++++++-- integration-tests/smoke/automation_test.go | 11 +++++++- integration-tests/utils/templates/secrets.go | 14 +++++++---- 5 files changed, 47 insertions(+), 17 deletions(-) diff --git a/integration-tests/docker/test_env/cl_node.go b/integration-tests/docker/test_env/cl_node.go index e4182ca4c36..d6ebaa69d81 100644 --- a/integration-tests/docker/test_env/cl_node.go +++ b/integration-tests/docker/test_env/cl_node.go @@ -58,6 +58,12 @@ type ClNode struct { type ClNodeOption = func(c *ClNode) +func WithSecrets(secretsTOML string) ClNodeOption { + return func(c *ClNode) { + c.NodeSecretsConfigTOML = secretsTOML + } +} + // Sets custom node container name if name is not empty func WithNodeContainerName(name string) ClNodeOption { return func(c *ClNode) { @@ -237,17 +243,20 @@ func (n *ClNode) StartContainer() error { if err != nil { return err } + + // If the node secrets TOML is not set, generate it with the default template nodeSecretsToml, err := templates.NodeSecretsTemplate{ - PgDbName: n.PostgresDb.DbName, - PgHost: n.PostgresDb.ContainerName, - PgPort: n.PostgresDb.Port, - PgPassword: n.PostgresDb.Password, + PgDbName: n.PostgresDb.DbName, + PgHost: n.PostgresDb.ContainerName, + PgPort: n.PostgresDb.Port, + PgPassword: n.PostgresDb.Password, + CustomSecrets: n.NodeSecretsConfigTOML, }.String() if err != nil { return err } - n.NodeSecretsConfigTOML = nodeSecretsToml - cReq, err := n.getContainerRequest() + + cReq, err := n.getContainerRequest(nodeSecretsToml) if err != nil { return err } @@ -302,7 +311,7 @@ func (n *ClNode) StartContainer() error { return nil } -func (n *ClNode) getContainerRequest() ( +func (n *ClNode) getContainerRequest(secrets string) ( *tc.ContainerRequest, error) { configFile, err := os.CreateTemp("", "node_config") if err != nil { @@ -320,7 +329,7 @@ func (n *ClNode) getContainerRequest() ( if err != nil { return nil, err } - _, err = secretsFile.WriteString(n.NodeSecretsConfigTOML) + _, err = secretsFile.WriteString(secrets) if err != nil { return nil, err } diff --git a/integration-tests/docker/test_env/test_env.go b/integration-tests/docker/test_env/test_env.go index 8c4faadbd2b..e3a9037da2c 100644 --- a/integration-tests/docker/test_env/test_env.go +++ b/integration-tests/docker/test_env/test_env.go @@ -24,6 +24,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/logwatch" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -154,7 +155,7 @@ func (te *CLClusterTestEnv) GetAPIs() []*client.ChainlinkClient { } // StartClNodes start one bootstrap node and {count} OCR nodes -func (te *CLClusterTestEnv) StartClNodes(nodeConfig *chainlink.Config, count int) error { +func (te *CLClusterTestEnv) StartClNodes(nodeConfig *chainlink.Config, count int, secretsConfig string) error { eg := &errgroup.Group{} nodes := make(chan *ClNode, count) @@ -168,6 +169,7 @@ func (te *CLClusterTestEnv) StartClNodes(nodeConfig *chainlink.Config, count int dbContainerName = te.Cfg.Nodes[nodeIndex].DbContainerName } n := NewClNode([]string{te.Network.Name}, nodeConfig, + WithSecrets(secretsConfig), WithNodeContainerName(nodeContainerName), WithDbContainerName(dbContainerName), ) diff --git a/integration-tests/docker/test_env/test_env_builder.go b/integration-tests/docker/test_env/test_env_builder.go index f3944b0ba96..19fd49fe11a 100644 --- a/integration-tests/docker/test_env/test_env_builder.go +++ b/integration-tests/docker/test_env/test_env_builder.go @@ -27,6 +27,7 @@ type CLTestEnvBuilder struct { hasMockServer bool hasForwarders bool clNodeConfig *chainlink.Config + secretsConfig string nonDevGethNetworks []blockchain.EVMNetwork clNodesCount int externalAdapterCount int @@ -87,6 +88,11 @@ func (b *CLTestEnvBuilder) WithCLNodeConfig(cfg *chainlink.Config) *CLTestEnvBui return b } +func (b *CLTestEnvBuilder) WithSecretsConfig(secrets string) *CLTestEnvBuilder { + b.secretsConfig = secrets + return b +} + func (b *CLTestEnvBuilder) WithMockServer(externalAdapterCount int) *CLTestEnvBuilder { b.hasMockServer = true b.externalAdapterCount = externalAdapterCount @@ -171,7 +177,7 @@ func (b *CLTestEnvBuilder) buildNewEnv(cfg *TestEnvConfig) (*CLClusterTestEnv, e return nil, errors.New("cannot create nodes with custom config without nonDevNetworks") } - err = te.StartClNodes(b.clNodeConfig, b.clNodesCount) + err = te.StartClNodes(b.clNodeConfig, b.clNodesCount, b.secretsConfig) if err != nil { return nil, err } @@ -233,7 +239,7 @@ func (b *CLTestEnvBuilder) buildNewEnv(cfg *TestEnvConfig) (*CLClusterTestEnv, e node.SetChainConfig(cfg, wsUrls, httpUrls, networkConfig, b.hasForwarders) - err := te.StartClNodes(cfg, b.clNodesCount) + err := te.StartClNodes(cfg, b.clNodesCount, b.secretsConfig) if err != nil { return nil, err } diff --git a/integration-tests/smoke/automation_test.go b/integration-tests/smoke/automation_test.go index 76ee75b21ba..0eabac7844b 100644 --- a/integration-tests/smoke/automation_test.go +++ b/integration-tests/smoke/automation_test.go @@ -1005,13 +1005,22 @@ func setupAutomationTestDocker( clNodeConfig.P2P.V2.AnnounceAddresses = &[]string{"0.0.0.0:6690"} clNodeConfig.P2P.V2.ListenAddresses = &[]string{"0.0.0.0:6690"} - // launch the environment + secretsConfig := ` + [Mercury.Credentials.cred1] + LegacyURL = 'http://localhost:53299' + URL = 'http://localhost:53299' + Username = 'node' + Password = 'nodepass' + ` + + //launch the environment env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). WithMockServer(1). WithCLNodes(5). WithCLNodeConfig(clNodeConfig). + WithSecretsConfig(secretsConfig). WithFunding(big.NewFloat(.5)). Build() require.NoError(t, err, "Error deploying test environment") diff --git a/integration-tests/utils/templates/secrets.go b/integration-tests/utils/templates/secrets.go index 3d3f9e44a90..f81287e871f 100644 --- a/integration-tests/utils/templates/secrets.go +++ b/integration-tests/utils/templates/secrets.go @@ -8,10 +8,11 @@ import ( // NodeSecretsTemplate are used as text templates because of secret redacted fields of chainlink.Secrets // secret fields can't be marshalled as a plain text type NodeSecretsTemplate struct { - PgDbName string - PgHost string - PgPort string - PgPassword string + PgDbName string + PgHost string + PgPort string + PgPassword string + CustomSecrets string } func (c NodeSecretsTemplate) String() (string, error) { @@ -22,11 +23,14 @@ URL = 'postgresql://postgres:{{ .PgPassword }}@{{ .PgHost }}:{{ .PgPort }}/{{ .P [Password] Keystore = '................' # Required +{{ if .CustomSecrets }} + {{ .CustomSecrets }} +{{ else }} [Mercury.Credentials.cred1] -# URL = 'http://host.docker.internal:3000/reports' URL = 'localhost:1338' Username = 'node' Password = 'nodepass' +{{ end }} ` return templates.MarshalTemplate(c, uuid.NewString(), tpl) } From f7d0b38b6379d5cf3399b9d84064752a9ad4cdee Mon Sep 17 00:00:00 2001 From: Akshay Aggarwal Date: Wed, 27 Sep 2023 16:49:05 +0100 Subject: [PATCH 25/84] Fix automation - mercury v0.3 response decoding (#10812) * Fix automation - mercury v0.3 response decoding * update --- .../ocr2keeper/evm21/streams_lookup.go | 15 ++++- .../ocr2keeper/evm21/streams_lookup_test.go | 60 ++++++++++++++----- 2 files changed, 57 insertions(+), 18 deletions(-) diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go index 2155b383002..6c1789de9c4 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go @@ -66,10 +66,10 @@ type MercuryV03Response struct { } type MercuryV03Report struct { - FeedID []byte `json:"feedID"` // feed id in hex + FeedID string `json:"feedID"` // feed id in hex encoded ValidFromTimestamp uint32 `json:"validFromTimestamp"` ObservationsTimestamp uint32 `json:"observationsTimestamp"` - FullReport []byte `json:"fullReport"` // the actual mercury report of this feed, can be sent to verifier + FullReport string `json:"fullReport"` // the actual hex encoded mercury report of this feed, can be sent to verifier } type MercuryData struct { @@ -528,6 +528,7 @@ func (r *EvmRegistry) multiFeedsRequest(ctx context.Context, ch chan<- MercuryDa } else if resp.StatusCode == 420 { // in 0.3, this will happen when missing/malformed query args, missing or bad required headers, non-existent feeds, or no permissions for feeds retryable = false + state = encoding.InvalidMercuryRequest return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by missing/malformed query args, missing or bad required headers, non-existent feeds, or no permissions for feeds", sl.time.String(), sl.upkeepId.String(), resp.StatusCode) } else if resp.StatusCode != http.StatusOK { retryable = false @@ -549,13 +550,21 @@ func (r *EvmRegistry) multiFeedsRequest(ctx context.Context, ch chan<- MercuryDa // hence, retry in this case. retry will help when we send a very new timestamp and reports are not yet generated if len(response.Reports) != len(sl.feeds) { // TODO: AUTO-5044: calculate what reports are missing and log a warning + lggr.Warnf("at timestamp %s upkeep %s mercury v0.3 server retruned 200 status with %d reports while we requested %d feeds, treating as 404 (not found) and retrying", sl.time.String(), sl.upkeepId.String(), len(response.Reports), len(sl.feeds)) retryable = true state = encoding.MercuryFlakyFailure return fmt.Errorf("%d", http.StatusNotFound) } var reportBytes [][]byte for _, rsp := range response.Reports { - reportBytes = append(reportBytes, rsp.FullReport) + b, err := hexutil.Decode(rsp.FullReport) + if err != nil { + lggr.Warnf("at timestamp %s upkeep %s failed to decode reportBlob %s: %v", sl.time.String(), sl.upkeepId.String(), rsp.FullReport, err) + retryable = false + state = encoding.InvalidMercuryResponse + return err + } + reportBytes = append(reportBytes, b) } ch <- MercuryData{ Index: 0, diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup_test.go b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup_test.go index 42aeecb64f6..f59cec18c1e 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup_test.go @@ -731,16 +731,16 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { response: &MercuryV03Response{ Reports: []MercuryV03Report{ { - FeedID: hexutil.MustDecode("0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"), + FeedID: "0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", ValidFromTimestamp: 123456, ObservationsTimestamp: 123456, - FullReport: hexutil.MustDecode("0xab2123dc00000012"), + FullReport: "0xab2123dc00000012", }, { - FeedID: hexutil.MustDecode("0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"), + FeedID: "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000", ValidFromTimestamp: 123458, ObservationsTimestamp: 123458, - FullReport: hexutil.MustDecode("0xab2123dc00000016"), + FullReport: "0xab2123dc00000016", }, }, }, @@ -761,20 +761,49 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { response: &MercuryV03Response{ Reports: []MercuryV03Report{ { - FeedID: hexutil.MustDecode("0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"), + FeedID: "0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", ValidFromTimestamp: 123456, ObservationsTimestamp: 123456, - FullReport: hexutil.MustDecode("0xab2123dc00000012"), + FullReport: "0xab2123dc00000012", }, { - FeedID: hexutil.MustDecode("0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"), + FeedID: "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000", ValidFromTimestamp: 123458, ObservationsTimestamp: 123458, - FullReport: hexutil.MustDecode("0xab2123dc00000019"), + FullReport: "0xab2123dc00000019", }, }, }, }, + { + name: "failure - fail to decode reportBlob", + lookup: &StreamsLookup{ + feedParamKey: feedIDs, + feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + timeParamKey: timestamp, + time: big.NewInt(123456), + upkeepId: upkeepId, + }, + response: &MercuryV03Response{ + Reports: []MercuryV03Report{ + { + FeedID: "0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", + ValidFromTimestamp: 123456, + ObservationsTimestamp: 123456, + FullReport: "qerwiu", // invalid hex blob + }, + { + FeedID: "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000", + ValidFromTimestamp: 123458, + ObservationsTimestamp: 123458, + FullReport: "0xab2123dc00000016", + }, + }, + }, + statusCode: http.StatusOK, + retryable: false, + errorMessage: "All attempts fail:\n#1: hex string without 0x prefix", + }, { name: "failure - returns retryable", lookup: &StreamsLookup{ @@ -839,26 +868,26 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { firstResponse: &MercuryV03Response{ Reports: []MercuryV03Report{ { - FeedID: hexutil.MustDecode("0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"), + FeedID: "0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", ValidFromTimestamp: 123456, ObservationsTimestamp: 123456, - FullReport: hexutil.MustDecode("0xab2123dc00000012"), + FullReport: "0xab2123dc00000012", }, }, }, response: &MercuryV03Response{ Reports: []MercuryV03Report{ { - FeedID: hexutil.MustDecode("0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"), + FeedID: "0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", ValidFromTimestamp: 123456, ObservationsTimestamp: 123456, - FullReport: hexutil.MustDecode("0xab2123dc00000012"), + FullReport: "0xab2123dc00000012", }, { - FeedID: hexutil.MustDecode("0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"), + FeedID: "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000", ValidFromTimestamp: 123458, ObservationsTimestamp: 123458, - FullReport: hexutil.MustDecode("0xab2123dc00000019"), + FullReport: "0xab2123dc00000019", }, }, }, @@ -930,7 +959,8 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { assert.Nil(t, m.Error) var reports [][]byte for _, rsp := range tt.response.Reports { - reports = append(reports, rsp.FullReport) + b, _ := hexutil.Decode(rsp.FullReport) + reports = append(reports, b) } assert.Equal(t, reports, m.Bytes) } From c1348edea7f0a860ee80493886994eb07d992ae4 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 27 Sep 2023 11:44:17 -0500 Subject: [PATCH 26/84] core/plugins: fix logger field reference (#10815) --- plugins/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/server.go b/plugins/server.go index b1d43612480..3b0348a68b4 100644 --- a/plugins/server.go +++ b/plugins/server.go @@ -68,7 +68,7 @@ func (s *Server) start() error { if err != nil { return fmt.Errorf("error getting environment configuration: %w", err) } - s.PromServer = NewPromServer(envCfg.PrometheusPort(), s.lggr) + s.PromServer = NewPromServer(envCfg.PrometheusPort(), s.Logger) err = s.PromServer.Start() if err != nil { return fmt.Errorf("error starting prometheus server: %w", err) From f684afc690304cd9a711044ace3f945dbdd11cc0 Mon Sep 17 00:00:00 2001 From: Tate Date: Wed, 27 Sep 2023 11:26:09 -0600 Subject: [PATCH 27/84] Mark solana test matrix as required check (#10811) --- .github/workflows/integration-tests.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index fd61f9b3384..60a751a8c07 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -663,7 +663,7 @@ jobs: - run: echo "this exists so we don't have to run anything else if the build is skipped" if: needs.changes.outputs.src == 'false' || needs.solana-test-image-exists.outputs.exists == 'true' - solana-smoke-tests: + solana-smoke-tests-matrix: if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} environment: integration permissions: @@ -674,7 +674,7 @@ jobs: strategy: matrix: image: - - name: "" + - name: (base) tag-suffix: "" - name: (plugins) tag-suffix: -plugins @@ -732,6 +732,26 @@ jobs: path: /tmp/gotest.log retention-days: 7 continue-on-error: true + + ### Used to check the required checks box when the matrix completes + solana-smoke-tests: + if: always() + runs-on: ubuntu-latest + name: Solana Smoke Tests + needs: [solana-smoke-tests-matrix] + steps: + - name: Check smoke test matrix status + if: needs.solana-smoke-tests-matrix.result != 'success' + run: exit 1 + - name: Collect Metrics + if: always() + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec + with: + basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} + this-job-name: Solana Smoke Tests + continue-on-error: true ### End Solana Section ### Start Live Testnet Section From 17772f37116b824a22672291fe923d14fcbfab88 Mon Sep 17 00:00:00 2001 From: Chris Cushman <104409744+vreff@users.noreply.github.com> Date: Thu, 28 Sep 2023 05:33:59 -0400 Subject: [PATCH 28/84] [VRF-616] Fix test flake for trusted BHS (#10728) * [VRF-616] Fix test flake for trusted BHS * Modulate waitblocks on trusted bhs added delay test * fix merge conflict --- core/services/vrf/v1/integration_test.go | 2 +- core/services/vrf/v2/bhs_feeder_test.go | 2 +- core/services/vrf/v2/integration_helpers_test.go | 9 +++++++-- core/services/vrf/v2/integration_v2_test.go | 1 - core/services/vrf/vrftesthelpers/helpers.go | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/core/services/vrf/v1/integration_test.go b/core/services/vrf/v1/integration_test.go index 14cbb36c9d6..8626b43dd23 100644 --- a/core/services/vrf/v1/integration_test.go +++ b/core/services/vrf/v1/integration_test.go @@ -150,7 +150,7 @@ func TestIntegration_VRF_WithBHS(t *testing.T) { // Create BHS Job and start it bhsJob := vrftesthelpers.CreateAndStartBHSJob(t, sendingKeys, app, cu.BHSContractAddress.String(), - cu.RootContractAddress.String(), "", "", "", 0, 200, 0) + cu.RootContractAddress.String(), "", "", "", 0, 200, 0, 100) // Ensure log poller is ready and has all logs. require.NoError(t, app.GetRelayers().LegacyEVMChains().Slice()[0].LogPoller().Ready()) diff --git a/core/services/vrf/v2/bhs_feeder_test.go b/core/services/vrf/v2/bhs_feeder_test.go index b843dbca9eb..0da28378d01 100644 --- a/core/services/vrf/v2/bhs_feeder_test.go +++ b/core/services/vrf/v2/bhs_feeder_test.go @@ -82,7 +82,7 @@ func TestStartHeartbeats(t *testing.T) { _ = vrftesthelpers.CreateAndStartBHSJob( t, bhsKeyAddresses, app, uni.bhsContractAddress.String(), "", - v2CoordinatorAddress, v2PlusCoordinatorAddress, "", 0, 200, heartbeatPeriod) + v2CoordinatorAddress, v2PlusCoordinatorAddress, "", 0, 200, heartbeatPeriod, 100) // Ensure log poller is ready and has all logs. require.NoError(t, app.GetRelayers().LegacyEVMChains().Slice()[0].LogPoller().Ready()) diff --git a/core/services/vrf/v2/integration_helpers_test.go b/core/services/vrf/v2/integration_helpers_test.go index 81f3edfbb2e..262ac7ef48c 100644 --- a/core/services/vrf/v2/integration_helpers_test.go +++ b/core/services/vrf/v2/integration_helpers_test.go @@ -241,7 +241,7 @@ func testMultipleConsumersNeedBHS( _ = vrftesthelpers.CreateAndStartBHSJob( t, bhsKeyAddresses, app, uni.bhsContractAddress.String(), "", - v2CoordinatorAddress, v2PlusCoordinatorAddress, "", 0, 200, 0) + v2CoordinatorAddress, v2PlusCoordinatorAddress, "", 0, 200, 0, 100) // Ensure log poller is ready and has all logs. require.NoError(t, app.GetRelayers().LegacyEVMChains().Slice()[0].LogPoller().Ready()) @@ -350,6 +350,7 @@ func testMultipleConsumersNeedTrustedBHS( config, db := heavyweight.FullTestDBV2(t, "vrfv2_needs_trusted_blockhash_store", func(c *chainlink.Config, s *chainlink.Secrets) { simulatedOverrides(t, assets.GWei(10), keySpecificOverrides...)(c, s) c.EVM[0].MinIncomingConfirmations = ptr[uint32](2) + c.EVM[0].GasEstimator.LimitDefault = ptr(uint32(5_000_000)) c.Feature.LogPoller = ptr(true) c.EVM[0].FinalityDepth = ptr[uint32](2) c.EVM[0].LogPollInterval = models.MustNewDuration(time.Second) @@ -384,9 +385,13 @@ func testMultipleConsumersNeedTrustedBHS( v2PlusCoordinatorAddress = coordinatorAddress.String() } + waitBlocks := 100 + if addedDelay { + waitBlocks = 400 + } _ = vrftesthelpers.CreateAndStartBHSJob( t, bhsKeyAddressesStrings, app, "", "", - v2CoordinatorAddress, v2PlusCoordinatorAddress, uni.trustedBhsContractAddress.String(), 20, 1000, 0) + v2CoordinatorAddress, v2PlusCoordinatorAddress, uni.trustedBhsContractAddress.String(), 20, 1000, 0, waitBlocks) // Ensure log poller is ready and has all logs. chain := app.GetRelayers().LegacyEVMChains().Slice()[0] diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index 1f6a9dd3f92..531c7ebb663 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -1320,7 +1320,6 @@ func TestVRFV2Integration_SingleConsumer_NeedsTrustedBlockhashStore(t *testing.T } func TestVRFV2Integration_SingleConsumer_NeedsTrustedBlockhashStore_AfterDelay(t *testing.T) { - t.Skip("TODO: VRF-616") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 2, true) diff --git a/core/services/vrf/vrftesthelpers/helpers.go b/core/services/vrf/vrftesthelpers/helpers.go index 15af16f6fd9..f36fb1ea027 100644 --- a/core/services/vrf/vrftesthelpers/helpers.go +++ b/core/services/vrf/vrftesthelpers/helpers.go @@ -51,7 +51,7 @@ func CreateAndStartBHSJob( app *cltest.TestApplication, bhsAddress, coordinatorV1Address, coordinatorV2Address, coordinatorV2PlusAddress string, trustedBlockhashStoreAddress string, trustedBlockhashStoreBatchSize int32, lookback int, - heartbeatPeriod time.Duration, + heartbeatPeriod time.Duration, waitBlocks int, ) job.Job { jid := uuid.New() s := testspecs.GenerateBlockhashStoreSpec(testspecs.BlockhashStoreSpecParams{ @@ -60,7 +60,7 @@ func CreateAndStartBHSJob( CoordinatorV1Address: coordinatorV1Address, CoordinatorV2Address: coordinatorV2Address, CoordinatorV2PlusAddress: coordinatorV2PlusAddress, - WaitBlocks: 100, + WaitBlocks: waitBlocks, LookbackBlocks: lookback, HeartbeatPeriod: heartbeatPeriod, BlockhashStoreAddress: bhsAddress, From 71d314fe1b6aa1c35fc7c7e6d65525fee3d18bdd Mon Sep 17 00:00:00 2001 From: Cedric Date: Thu, 28 Sep 2023 10:45:33 +0100 Subject: [PATCH 29/84] [BCF-2674] Make BalanceMonitor test deterministic; add WorkDone to *sleeperTask for tests. (#10821) * Fix balance monitor flakey test * Refactor session reaper test to use the WorkDone() test helper method --- core/chains/evm/monitor/balance.go | 4 ++- .../evm/monitor/balance_helpers_test.go | 7 ++++ core/chains/evm/monitor/balance_test.go | 18 ++++------- core/sessions/reaper.go | 20 ++---------- core/sessions/reaper_helper_test.go | 5 --- core/sessions/reaper_test.go | 8 ++--- core/utils/sleeper_task.go | 32 ++++++++++++++----- 7 files changed, 46 insertions(+), 48 deletions(-) create mode 100644 core/chains/evm/monitor/balance_helpers_test.go delete mode 100644 core/sessions/reaper_helper_test.go diff --git a/core/chains/evm/monitor/balance.go b/core/chains/evm/monitor/balance.go index 8dbd4ed8507..28682f2509a 100644 --- a/core/chains/evm/monitor/balance.go +++ b/core/chains/evm/monitor/balance.go @@ -47,8 +47,10 @@ type ( NullBalanceMonitor struct{} ) +var _ BalanceMonitor = (*balanceMonitor)(nil) + // NewBalanceMonitor returns a new balanceMonitor -func NewBalanceMonitor(ethClient evmclient.Client, ethKeyStore keystore.Eth, logger logger.Logger) BalanceMonitor { +func NewBalanceMonitor(ethClient evmclient.Client, ethKeyStore keystore.Eth, logger logger.Logger) *balanceMonitor { chainId := ethClient.ConfiguredChainID() bm := &balanceMonitor{ utils.StartStopOnce{}, diff --git a/core/chains/evm/monitor/balance_helpers_test.go b/core/chains/evm/monitor/balance_helpers_test.go new file mode 100644 index 00000000000..624aa69f061 --- /dev/null +++ b/core/chains/evm/monitor/balance_helpers_test.go @@ -0,0 +1,7 @@ +package monitor + +func (bm *balanceMonitor) WorkDone() <-chan struct{} { + return bm.sleeperTask.(interface { + WorkDone() <-chan struct{} + }).WorkDone() +} diff --git a/core/chains/evm/monitor/balance_test.go b/core/chains/evm/monitor/balance_test.go index c908c395671..d6417381815 100644 --- a/core/chains/evm/monitor/balance_test.go +++ b/core/chains/evm/monitor/balance_test.go @@ -169,12 +169,9 @@ func TestBalanceMonitor_OnNewLongestChain_UpdatesBalance(t *testing.T) { // Do the thing bm.OnNewLongestChain(testutils.Context(t), head) - gomega.NewWithT(t).Eventually(func() *big.Int { - return bm.GetEthBalance(k0Addr).ToInt() - }).Should(gomega.Equal(k0bal)) - gomega.NewWithT(t).Eventually(func() *big.Int { - return bm.GetEthBalance(k1Addr).ToInt() - }).Should(gomega.Equal(k1bal)) + <-bm.WorkDone() + assert.Equal(t, k0bal, bm.GetEthBalance(k0Addr).ToInt()) + assert.Equal(t, k1bal, bm.GetEthBalance(k1Addr).ToInt()) // Do it again k0bal2 := big.NewInt(142) @@ -187,12 +184,9 @@ func TestBalanceMonitor_OnNewLongestChain_UpdatesBalance(t *testing.T) { bm.OnNewLongestChain(testutils.Context(t), head) - gomega.NewWithT(t).Eventually(func() *big.Int { - return bm.GetEthBalance(k0Addr).ToInt() - }).Should(gomega.Equal(k0bal2)) - gomega.NewWithT(t).Eventually(func() *big.Int { - return bm.GetEthBalance(k1Addr).ToInt() - }).Should(gomega.Equal(k1bal2)) + <-bm.WorkDone() + assert.Equal(t, k0bal2, bm.GetEthBalance(k0Addr).ToInt()) + assert.Equal(t, k1bal2, bm.GetEthBalance(k1Addr).ToInt()) }) } diff --git a/core/sessions/reaper.go b/core/sessions/reaper.go index a80f0124bb6..c4f0ed6796c 100644 --- a/core/sessions/reaper.go +++ b/core/sessions/reaper.go @@ -13,10 +13,6 @@ type sessionReaper struct { db *sql.DB config SessionReaperConfig lggr logger.Logger - - // Receive from this for testing via sr.RunSignal() - // to be notified after each reaper run. - runSignal chan struct{} } type SessionReaperConfig interface { @@ -26,18 +22,11 @@ type SessionReaperConfig interface { // NewSessionReaper creates a reaper that cleans stale sessions from the store. func NewSessionReaper(db *sql.DB, config SessionReaperConfig, lggr logger.Logger) utils.SleeperTask { - return utils.NewSleeperTask(NewSessionReaperWorker(db, config, lggr)) -} - -func NewSessionReaperWorker(db *sql.DB, config SessionReaperConfig, lggr logger.Logger) *sessionReaper { - return &sessionReaper{ + return utils.NewSleeperTask(&sessionReaper{ db, config, lggr.Named("SessionReaper"), - - // For testing only. - make(chan struct{}, 10), - } + }) } func (sr *sessionReaper) Name() string { @@ -51,11 +40,6 @@ func (sr *sessionReaper) Work() { if err != nil { sr.lggr.Error("unable to reap stale sessions: ", err) } - - select { - case sr.runSignal <- struct{}{}: - default: - } } // DeleteStaleSessions deletes all sessions before the passed time. diff --git a/core/sessions/reaper_helper_test.go b/core/sessions/reaper_helper_test.go deleted file mode 100644 index cec9b72d7ee..00000000000 --- a/core/sessions/reaper_helper_test.go +++ /dev/null @@ -1,5 +0,0 @@ -package sessions - -func (sr *sessionReaper) RunSignal() <-chan struct{} { - return sr.runSignal -} diff --git a/core/sessions/reaper_test.go b/core/sessions/reaper_test.go index 1e325ea5063..a96c3822ef5 100644 --- a/core/sessions/reaper_test.go +++ b/core/sessions/reaper_test.go @@ -10,7 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/sessions" "github.com/smartcontractkit/chainlink/v2/core/store/models" - "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -34,8 +33,7 @@ func TestSessionReaper_ReapSessions(t *testing.T) { lggr := logger.TestLogger(t) orm := sessions.NewORM(db, config.SessionTimeout().Duration(), lggr, pgtest.NewQConfig(true), audit.NoopLogger) - rw := sessions.NewSessionReaperWorker(db.DB, config, lggr) - r := utils.NewSleeperTask(rw) + r := sessions.NewSessionReaper(db.DB, config, lggr) t.Cleanup(func() { assert.NoError(t, r.Stop()) @@ -70,7 +68,9 @@ func TestSessionReaper_ReapSessions(t *testing.T) { }) r.WakeUp() - <-rw.RunSignal() + <-r.(interface { + WorkDone() <-chan struct{} + }).WorkDone() sessions, err := orm.Sessions(0, 10) assert.NoError(t, err) diff --git a/core/utils/sleeper_task.go b/core/utils/sleeper_task.go index d020799a9c6..0b45507a82f 100644 --- a/core/utils/sleeper_task.go +++ b/core/utils/sleeper_task.go @@ -19,10 +19,11 @@ type Worker interface { } type sleeperTask struct { - worker Worker - chQueue chan struct{} - chStop chan struct{} - chDone chan struct{} + worker Worker + chQueue chan struct{} + chStop chan struct{} + chDone chan struct{} + chWorkDone chan struct{} StartStopOnce } @@ -36,10 +37,11 @@ type sleeperTask struct { // WakeUp does not block. func NewSleeperTask(worker Worker) SleeperTask { s := &sleeperTask{ - worker: worker, - chQueue: make(chan struct{}, 1), - chStop: make(chan struct{}), - chDone: make(chan struct{}), + worker: worker, + chQueue: make(chan struct{}, 1), + chStop: make(chan struct{}), + chDone: make(chan struct{}), + chWorkDone: make(chan struct{}, 10), } _ = s.StartOnce("SleeperTask-"+worker.Name(), func() error { @@ -83,6 +85,19 @@ func (s *sleeperTask) WakeUp() { } } +func (s *sleeperTask) workDone() { + select { + case s.chWorkDone <- struct{}{}: + default: + } +} + +// WorkDone isn't part of the SleeperTask interface, but can be +// useful in tests to assert that the work has been done. +func (s *sleeperTask) WorkDone() <-chan struct{} { + return s.chWorkDone +} + func (s *sleeperTask) workerLoop() { defer close(s.chDone) @@ -90,6 +105,7 @@ func (s *sleeperTask) workerLoop() { select { case <-s.chQueue: s.worker.Work() + s.workDone() case <-s.chStop: return } From bfdd7d19b609e0cd1cc3ffd068c31dcd27e20fa9 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 28 Sep 2023 11:53:57 -0400 Subject: [PATCH 30/84] Increase error log detail for enhanced telemetry (#10822) - Relates to MERC-1957 --- core/services/ocrcommon/telemetry.go | 31 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/core/services/ocrcommon/telemetry.go b/core/services/ocrcommon/telemetry.go index 636a18262e1..3a0ba049036 100644 --- a/core/services/ocrcommon/telemetry.go +++ b/core/services/ocrcommon/telemetry.go @@ -3,6 +3,7 @@ package ocrcommon import ( "context" "encoding/json" + "fmt" "github.com/ethereum/go-ethereum/common" @@ -361,9 +362,13 @@ func (e *EnhancedTelemetryService[T]) getPricesFromResults(startTask pipeline.Ta return 0, 0, 0 } if benchmarkPriceTask.Task.Type() == pipeline.TaskTypeJSONParse { - benchmarkPrice, ok = benchmarkPriceTask.Result.Value.(float64) - if !ok { - e.lggr.Warnf("cannot parse enhanced EA telemetry benchmark price, job %d, id %s", e.job.ID, benchmarkPriceTask.Task.DotID()) + if benchmarkPriceTask.Result.Error != nil { + e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry benchmark price, job %d, id %s: %s", e.job.ID, benchmarkPriceTask.Task.DotID(), benchmarkPriceTask.Result.Error), "err", benchmarkPriceTask.Result.Error) + } else { + benchmarkPrice, ok = benchmarkPriceTask.Result.Value.(float64) + if !ok { + e.lggr.Warnf("cannot parse enhanced EA telemetry benchmark price, job %d, id %s (expected float64, got type: %T)", e.job.ID, benchmarkPriceTask.Task.DotID(), benchmarkPriceTask.Result.Value) + } } } @@ -373,9 +378,13 @@ func (e *EnhancedTelemetryService[T]) getPricesFromResults(startTask pipeline.Ta return 0, 0, 0 } if bidTask.Task.Type() == pipeline.TaskTypeJSONParse { - bidPrice, ok = bidTask.Result.Value.(float64) - if !ok { - e.lggr.Warnf("cannot parse enhanced EA telemetry bid price, job %d, id %s", e.job.ID, bidTask.Task.DotID()) + if bidTask.Result.Error != nil { + e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry bid price, job %d, id %s: %s", e.job.ID, bidTask.Task.DotID(), bidTask.Result.Error), "err", bidTask.Result.Error) + } else { + bidPrice, ok = bidTask.Result.Value.(float64) + if !ok { + e.lggr.Warnf("cannot parse enhanced EA telemetry bid price, job %d, id %s (expected float64, got type: %T)", e.job.ID, bidTask.Task.DotID(), bidTask.Result.Value) + } } } @@ -385,9 +394,13 @@ func (e *EnhancedTelemetryService[T]) getPricesFromResults(startTask pipeline.Ta return 0, 0, 0 } if askTask.Task.Type() == pipeline.TaskTypeJSONParse { - askPrice, ok = askTask.Result.Value.(float64) - if !ok { - e.lggr.Warnf("cannot parse enhanced EA telemetry ask price, job %d, id %s", e.job.ID, askTask.Task.DotID()) + if bidTask.Result.Error != nil { + e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry ask price, job %d, id %s: %s", e.job.ID, askTask.Task.DotID(), askTask.Result.Error), "err", askTask.Result.Error) + } else { + askPrice, ok = askTask.Result.Value.(float64) + if !ok { + e.lggr.Warnf("cannot parse enhanced EA telemetry ask price, job %d, id %s (expected float64, got type: %T)", e.job.ID, askTask.Task.DotID(), askTask.Result.Value) + } } } From de737a5c08d43ed3304151f4ac66592d8bdb9376 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 28 Sep 2023 13:22:31 -0400 Subject: [PATCH 31/84] Better Log Collection (#10824) --- integration-tests/docker/test_env/test_env.go | 80 +++++++++---------- integration-tests/example.env | 2 +- 2 files changed, 40 insertions(+), 42 deletions(-) diff --git a/integration-tests/docker/test_env/test_env.go b/integration-tests/docker/test_env/test_env.go index e3a9037da2c..7f805f5fb8a 100644 --- a/integration-tests/docker/test_env/test_env.go +++ b/integration-tests/docker/test_env/test_env.go @@ -248,6 +248,45 @@ func (te *CLClusterTestEnv) Cleanup(t *testing.T) error { return errors.New("chainlink nodes are nil, unable to return funds from chainlink nodes") } + // TODO: This is an imperfect and temporary solution, see TT-590 for a more sustainable solution + // Collect logs if the test fails, or if we just want them + if t.Failed() || os.Getenv("TEST_LOG_COLLECT") == "true" { + folder := fmt.Sprintf("./logs/%s-%s", t.Name(), time.Now().Format("2006-01-02T15-04-05")) + if err := os.MkdirAll(folder, os.ModePerm); err != nil { + return err + } + + te.l.Info().Msg("Collecting test logs") + eg := &errgroup.Group{} + for _, n := range te.CLNodes { + node := n + eg.Go(func() error { + logFileName := filepath.Join(folder, fmt.Sprintf("node-%s.log", node.ContainerName)) + logFile, err := os.OpenFile(logFileName, os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + return err + } + defer logFile.Close() + logReader, err := node.Container.Logs(context.Background()) + if err != nil { + return err + } + _, err = io.Copy(logFile, logReader) + if err != nil { + return err + } + te.l.Info().Str("Node", node.ContainerName).Str("File", logFileName).Msg("Wrote Logs") + return nil + }) + } + + if err := eg.Wait(); err != nil { + return err + } + + te.l.Info().Str("Logs Location", folder).Msg("Wrote test logs") + } + // Check if we need to return funds if te.EVMClient.NetworkSimulated() { te.l.Info().Str("Network Name", te.EVMClient.GetNetworkName()). @@ -277,46 +316,5 @@ func (te *CLClusterTestEnv) Cleanup(t *testing.T) error { } } - // TODO: This is an imperfect and temporary solution, see TT-590 for a more sustainable solution - // Collect logs if the test failed - if !t.Failed() { - return nil - } - - folder := fmt.Sprintf("./logs/%s-%s", t.Name(), time.Now().Format("2006-01-02T15-04-05")) - if err := os.MkdirAll(folder, os.ModePerm); err != nil { - return err - } - - te.l.Warn().Msg("Test failed, collecting logs") - eg := &errgroup.Group{} - for _, n := range te.CLNodes { - node := n - eg.Go(func() error { - logFileName := filepath.Join(folder, fmt.Sprintf("node-%s.log", node.ContainerName)) - logFile, err := os.OpenFile(logFileName, os.O_CREATE|os.O_WRONLY, 0644) - if err != nil { - return err - } - defer logFile.Close() - logReader, err := node.Container.Logs(context.Background()) - if err != nil { - return err - } - _, err = io.Copy(logFile, logReader) - if err != nil { - return err - } - te.l.Info().Str("Node", node.ContainerName).Str("File", logFileName).Msg("Wrote Logs") - return nil - }) - } - - if err := eg.Wait(); err != nil { - return err - } - - te.l.Info().Str("Logs Location", folder).Msg("Wrote Logs for Failed Test") - return nil } diff --git a/integration-tests/example.env b/integration-tests/example.env index 428f76b914e..3e27ac2c7ab 100644 --- a/integration-tests/example.env +++ b/integration-tests/example.env @@ -2,11 +2,11 @@ # `source ./integration-tests/.env` ########## General Test Settings ########## -export KEEP_ENVIRONMENTS="Never" # Always | OnFail | Never export CHAINLINK_IMAGE="public.ecr.aws/chainlink/chainlink" # Image repo to pull the Chainlink image from export CHAINLINK_VERSION="2.4.0" # Version of the Chainlink image to pull export CHAINLINK_ENV_USER="Satoshi-Nakamoto" # Name of the person running the tests (change to your own) export TEST_LOG_LEVEL="info" # info | debug | trace +export TEST_LOG_COLLECT="false" # true | false, whether to collect the test logs after the test is complete, this will always be done if the test fails, regardless of this setting ########## Soak/Chaos/Load Test Specific Settings ########## # Remote Runner From 24dce590b260d50dc05a99080b24f6eee84fc9a1 Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Thu, 28 Sep 2023 20:48:12 +0200 Subject: [PATCH 32/84] Moving observability for LogPoller closer to the database layer (#10674) * Moving observability for LogPoller closer to the database layer * Minor fixes * Post rebase fixes * Post rebase fixes --- core/chains/evm/chain.go | 2 +- core/chains/evm/logpoller/helper_test.go | 2 +- core/chains/evm/logpoller/log_poller.go | 30 +-- .../evm/logpoller/log_poller_internal_test.go | 2 +- core/chains/evm/logpoller/log_poller_test.go | 8 +- core/chains/evm/logpoller/observability.go | 206 +++++++++++++----- .../evm/logpoller/observability_test.go | 69 +++--- core/chains/evm/logpoller/orm.go | 115 +++++++--- core/chains/evm/logpoller/orm_test.go | 70 +++--- 9 files changed, 319 insertions(+), 185 deletions(-) diff --git a/core/chains/evm/chain.go b/core/chains/evm/chain.go index 8704d0c1fc8..b4986ad0c25 100644 --- a/core/chains/evm/chain.go +++ b/core/chains/evm/chain.go @@ -250,7 +250,7 @@ func newChain(ctx context.Context, cfg *evmconfig.ChainScoped, nodes []*toml.Nod if opts.GenLogPoller != nil { logPoller = opts.GenLogPoller(chainID) } else { - logPoller = logpoller.NewObservedLogPoller(logpoller.NewORM(chainID, db, l, cfg.Database()), client, l, cfg.EVM().LogPollInterval(), int64(cfg.EVM().FinalityDepth()), int64(cfg.EVM().LogBackfillBatchSize()), int64(cfg.EVM().RPCDefaultBatchSize()), int64(cfg.EVM().LogKeepBlocksDepth())) + logPoller = logpoller.NewLogPoller(logpoller.NewObservedORM(chainID, db, l, cfg.Database()), client, l, cfg.EVM().LogPollInterval(), int64(cfg.EVM().FinalityDepth()), int64(cfg.EVM().LogBackfillBatchSize()), int64(cfg.EVM().RPCDefaultBatchSize()), int64(cfg.EVM().LogKeepBlocksDepth())) } } diff --git a/core/chains/evm/logpoller/helper_test.go b/core/chains/evm/logpoller/helper_test.go index 4c764d7d74f..447a4673588 100644 --- a/core/chains/evm/logpoller/helper_test.go +++ b/core/chains/evm/logpoller/helper_test.go @@ -36,7 +36,7 @@ type TestHarness struct { Lggr logger.Logger // Chain2/ORM2 is just a dummy second chain, doesn't have a client. ChainID, ChainID2 *big.Int - ORM, ORM2 *logpoller.ORM + ORM, ORM2 *logpoller.DbORM LogPoller logpoller.LogPollerTest Client *backends.SimulatedBackend Owner *bind.TransactOpts diff --git a/core/chains/evm/logpoller/log_poller.go b/core/chains/evm/logpoller/log_poller.go index b9d1ba2e98a..f4b3a7f4f0d 100644 --- a/core/chains/evm/logpoller/log_poller.go +++ b/core/chains/evm/logpoller/log_poller.go @@ -87,7 +87,7 @@ var ( type logPoller struct { utils.StartStopOnce ec Client - orm *ORM + orm ORM lggr logger.Logger pollPeriod time.Duration // poll period set by block production rate finalityDepth int64 // finality depth is taken to mean that block (head - finality) is finalized @@ -119,7 +119,7 @@ type logPoller struct { // // How fast that can be done depends largely on network speed and DB, but even for the fastest // support chain, polygon, which has 2s block times, we need RPCs roughly with <= 500ms latency -func NewLogPoller(orm *ORM, ec Client, lggr logger.Logger, pollPeriod time.Duration, +func NewLogPoller(orm ORM, ec Client, lggr logger.Logger, pollPeriod time.Duration, finalityDepth int64, backfillBatchSize int64, rpcBatchSize int64, keepBlocksDepth int64) *logPoller { return &logPoller{ @@ -676,7 +676,7 @@ func (lp *logPoller) backfill(ctx context.Context, start, end int64) error { } lp.lggr.Debugw("Backfill found logs", "from", from, "to", to, "logs", len(gethLogs), "blocks", blocks) - err = lp.orm.q.WithOpts(pg.WithParentCtx(ctx)).Transaction(func(tx pg.Queryer) error { + err = lp.orm.Q().WithOpts(pg.WithParentCtx(ctx)).Transaction(func(tx pg.Queryer) error { return lp.orm.InsertLogs(convertLogs(gethLogs, blocks, lp.lggr, lp.ec.ConfiguredChainID()), pg.WithQueryer(tx)) }) if err != nil { @@ -747,7 +747,7 @@ func (lp *logPoller) getCurrentBlockMaybeHandleReorg(ctx context.Context, curren // the canonical set per read. Typically, if an application took action on a log // it would be saved elsewhere e.g. evm.txes, so it seems better to just support the fast reads. // Its also nicely analogous to reading from the chain itself. - err2 = lp.orm.q.WithOpts(pg.WithParentCtx(ctx)).Transaction(func(tx pg.Queryer) error { + err2 = lp.orm.Q().WithOpts(pg.WithParentCtx(ctx)).Transaction(func(tx pg.Queryer) error { // These deletes are bounded by reorg depth, so they are // fast and should not slow down the log readers. err3 := lp.orm.DeleteBlocksAfter(blockAfterLCA.Number, pg.WithQueryer(tx)) @@ -844,7 +844,7 @@ func (lp *logPoller) PollAndSaveLogs(ctx context.Context, currentBlockNumber int return } lp.lggr.Debugw("Unfinalized log query", "logs", len(logs), "currentBlockNumber", currentBlockNumber, "blockHash", currentBlock.Hash, "timestamp", currentBlock.Timestamp.Unix()) - err = lp.orm.q.WithOpts(pg.WithParentCtx(ctx)).Transaction(func(tx pg.Queryer) error { + err = lp.orm.Q().WithOpts(pg.WithParentCtx(ctx)).Transaction(func(tx pg.Queryer) error { if err2 := lp.orm.InsertBlock(h, currentBlockNumber, currentBlock.Timestamp, pg.WithQueryer(tx)); err2 != nil { return err2 } @@ -937,11 +937,11 @@ func (lp *logPoller) pruneOldBlocks(ctx context.Context) error { // Logs returns logs matching topics and address (exactly) in the given block range, // which are canonical at time of query. func (lp *logPoller) Logs(start, end int64, eventSig common.Hash, address common.Address, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectLogsByBlockRangeFilter(start, end, address, eventSig, qopts...) + return lp.orm.SelectLogs(start, end, address, eventSig, qopts...) } func (lp *logPoller) LogsWithSigs(start, end int64, eventSigs []common.Hash, address common.Address, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectLogsWithSigsByBlockRangeFilter(start, end, address, eventSigs, qopts...) + return lp.orm.SelectLogsWithSigs(start, end, address, eventSigs, qopts...) } func (lp *logPoller) LogsCreatedAfter(eventSig common.Hash, address common.Address, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { @@ -955,7 +955,7 @@ func (lp *logPoller) IndexedLogs(eventSig common.Hash, address common.Address, t // IndexedLogsByBlockRange finds all the logs that have a topic value in topicValues at index topicIndex within the block range func (lp *logPoller) IndexedLogsByBlockRange(start, end int64, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectIndexedLogsByBlockRangeFilter(start, end, address, eventSig, topicIndex, topicValues, qopts...) + return lp.orm.SelectIndexedLogsByBlockRange(start, end, address, eventSig, topicIndex, topicValues, qopts...) } func (lp *logPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { @@ -968,28 +968,28 @@ func (lp *logPoller) IndexedLogsByTxHash(eventSig common.Hash, txHash common.Has // LogsDataWordGreaterThan note index is 0 based. func (lp *logPoller) LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, confs, qopts...) + return lp.orm.SelectLogsDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, confs, qopts...) } // LogsDataWordRange note index is 0 based. func (lp *logPoller) LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectDataWordRange(address, eventSig, wordIndex, wordValueMin, wordValueMax, confs, qopts...) + return lp.orm.SelectLogsDataWordRange(address, eventSig, wordIndex, wordValueMin, wordValueMax, confs, qopts...) } // IndexedLogsTopicGreaterThan finds all the logs that have a topic value greater than topicValueMin at index topicIndex. // Only works for integer topics. func (lp *logPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectIndexLogsTopicGreaterThan(address, eventSig, topicIndex, topicValueMin, confs, qopts...) + return lp.orm.SelectIndexedLogsTopicGreaterThan(address, eventSig, topicIndex, topicValueMin, confs, qopts...) } // LogsUntilBlockHashDataWordGreaterThan note index is 0 based. // If the blockhash is not found (i.e. a stale fork) it will error. func (lp *logPoller) LogsUntilBlockHashDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectUntilBlockHashDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, untilBlockHash, qopts...) + return lp.orm.SelectLogsUntilBlockHashDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, untilBlockHash, qopts...) } func (lp *logPoller) IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return lp.orm.SelectIndexLogsTopicRange(address, eventSig, topicIndex, topicValueMin, topicValueMax, confs, qopts...) + return lp.orm.SelectIndexedLogsTopicRange(address, eventSig, topicIndex, topicValueMin, topicValueMax, confs, qopts...) } // LatestBlock returns the latest block the log poller is on. It tracks blocks to be able @@ -1009,7 +1009,7 @@ func (lp *logPoller) BlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, // LatestLogByEventSigWithConfs finds the latest log that has confs number of blocks on top of the log. func (lp *logPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { - return lp.orm.SelectLatestLogEventSigWithConfs(eventSig, address, confs, qopts...) + return lp.orm.SelectLatestLogByEventSigWithConfs(eventSig, address, confs, qopts...) } func (lp *logPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) ([]Log, error) { @@ -1017,7 +1017,7 @@ func (lp *logPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs } func (lp *logPoller) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { - return lp.orm.SelectLatestBlockNumberEventSigsAddrsWithConfs(fromBlock, eventSigs, addresses, confs, qopts...) + return lp.orm.SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock, eventSigs, addresses, confs, qopts...) } // GetBlocksRange tries to get the specified block numbers from the log pollers diff --git a/core/chains/evm/logpoller/log_poller_internal_test.go b/core/chains/evm/logpoller/log_poller_internal_test.go index 5f1c21a5b81..271d8c2a582 100644 --- a/core/chains/evm/logpoller/log_poller_internal_test.go +++ b/core/chains/evm/logpoller/log_poller_internal_test.go @@ -31,7 +31,7 @@ var ( ) // Validate that filters stored in log_filters_table match the filters stored in memory -func validateFiltersTable(t *testing.T, lp *logPoller, orm *ORM) { +func validateFiltersTable(t *testing.T, lp *logPoller, orm *DbORM) { filters, err := orm.LoadFilters() require.NoError(t, err) require.Equal(t, len(filters), len(lp.filters)) diff --git a/core/chains/evm/logpoller/log_poller_test.go b/core/chains/evm/logpoller/log_poller_test.go index 3d4218d6ffd..e21fc0f3838 100644 --- a/core/chains/evm/logpoller/log_poller_test.go +++ b/core/chains/evm/logpoller/log_poller_test.go @@ -43,7 +43,7 @@ func logRuntime(t testing.TB, start time.Time) { t.Log("runtime", time.Since(start)) } -func populateDatabase(t testing.TB, o *logpoller.ORM, chainID *big.Int) (common.Hash, common.Address, common.Address) { +func populateDatabase(t testing.TB, o *logpoller.DbORM, chainID *big.Int) (common.Hash, common.Address, common.Address) { event1 := EmitterABI.Events["Log1"].ID address1 := common.HexToAddress("0x2ab9a2Dc53736b361b72d900CdF9F78F9406fbbb") address2 := common.HexToAddress("0x6E225058950f237371261C985Db6bDe26df2200E") @@ -110,7 +110,7 @@ func TestPopulateLoadedDB(t *testing.T) { func() { defer logRuntime(t, time.Now()) - _, err1 := o.SelectLogsByBlockRangeFilter(750000, 800000, address1, event1) + _, err1 := o.SelectLogs(750000, 800000, address1, event1) require.NoError(t, err1) }() func() { @@ -123,7 +123,7 @@ func TestPopulateLoadedDB(t *testing.T) { require.NoError(t, o.InsertBlock(common.HexToHash("0x10"), 1000000, time.Now())) func() { defer logRuntime(t, time.Now()) - lgs, err1 := o.SelectDataWordRange(address1, event1, 0, logpoller.EvmWord(500000), logpoller.EvmWord(500020), 0) + lgs, err1 := o.SelectLogsDataWordRange(address1, event1, 0, logpoller.EvmWord(500000), logpoller.EvmWord(500020), 0) require.NoError(t, err1) // 10 since every other log is for address1 assert.Equal(t, 10, len(lgs)) @@ -138,7 +138,7 @@ func TestPopulateLoadedDB(t *testing.T) { func() { defer logRuntime(t, time.Now()) - lgs, err1 := o.SelectIndexLogsTopicRange(address1, event1, 1, logpoller.EvmWord(500000), logpoller.EvmWord(500020), 0) + lgs, err1 := o.SelectIndexedLogsTopicRange(address1, event1, 1, logpoller.EvmWord(500000), logpoller.EvmWord(500020), 0) require.NoError(t, err1) assert.Equal(t, 10, len(lgs)) }() diff --git a/core/chains/evm/logpoller/observability.go b/core/chains/evm/logpoller/observability.go index 8dfa6e81d0d..4e0ebe74184 100644 --- a/core/chains/evm/logpoller/observability.go +++ b/core/chains/evm/logpoller/observability.go @@ -1,11 +1,13 @@ package logpoller import ( + "math/big" "time" "github.com/ethereum/go-ethereum/common" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/smartcontractkit/sqlx" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -46,113 +48,199 @@ var ( }, []string{"evmChainID", "query"}) ) -// ObservedLogPoller is a decorator layer for LogPoller, responsible for pushing Prometheus metrics reporting duration and size of result set for some of the queries. -// It doesn't change internal logic, because all calls are delegated to the origin LogPoller -type ObservedLogPoller struct { - LogPoller +// ObservedORM is a decorator layer for ORM used by LogPoller, responsible for pushing Prometheus metrics reporting duration and size of result set for the queries. +// It doesn't change internal logic, because all calls are delegated to the origin ORM +type ObservedORM struct { + ORM queryDuration *prometheus.HistogramVec datasetSize *prometheus.GaugeVec chainId string } -// NewObservedLogPoller creates an observed version of log poller created by NewLogPoller +// NewObservedORM creates an observed version of log poller's ORM created by NewORM // Please see ObservedLogPoller for more details on how latencies are measured -func NewObservedLogPoller(orm *ORM, ec Client, lggr logger.Logger, pollPeriod time.Duration, - finalityDepth int64, backfillBatchSize int64, rpcBatchSize int64, keepBlocksDepth int64) LogPoller { - - return &ObservedLogPoller{ - LogPoller: NewLogPoller(orm, ec, lggr, pollPeriod, finalityDepth, backfillBatchSize, rpcBatchSize, keepBlocksDepth), +func NewObservedORM(chainID *big.Int, db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig) *ObservedORM { + return &ObservedORM{ + ORM: NewORM(chainID, db, lggr, cfg), queryDuration: lpQueryDuration, datasetSize: lpQueryDataSets, - chainId: orm.chainID.String(), + chainId: chainID.String(), } } -func (o *ObservedLogPoller) LogsCreatedAfter(eventSig common.Hash, address common.Address, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "LogsCreatedAfter", func() ([]Log, error) { - return o.LogPoller.LogsCreatedAfter(eventSig, address, after, confs, qopts...) +func (o *ObservedORM) Q() pg.Q { + return o.ORM.Q() +} + +func (o *ObservedORM) InsertLogs(logs []Log, qopts ...pg.QOpt) error { + return withObservedExec(o, "InsertLogs", func() error { + return o.ORM.InsertLogs(logs, qopts...) + }) +} + +func (o *ObservedORM) InsertBlock(h common.Hash, n int64, t time.Time, qopts ...pg.QOpt) error { + return withObservedExec(o, "InsertBlock", func() error { + return o.ORM.InsertBlock(h, n, t, qopts...) + }) +} + +func (o *ObservedORM) InsertFilter(filter Filter, qopts ...pg.QOpt) error { + return withObservedExec(o, "InsertFilter", func() error { + return o.ORM.InsertFilter(filter, qopts...) + }) +} + +func (o *ObservedORM) LoadFilters(qopts ...pg.QOpt) (map[string]Filter, error) { + return withObservedQuery(o, "LoadFilters", func() (map[string]Filter, error) { + return o.ORM.LoadFilters(qopts...) + }) +} + +func (o *ObservedORM) DeleteFilter(name string, qopts ...pg.QOpt) error { + return withObservedExec(o, "DeleteFilter", func() error { + return o.ORM.DeleteFilter(name, qopts...) + }) +} + +func (o *ObservedORM) DeleteBlocksAfter(start int64, qopts ...pg.QOpt) error { + return withObservedExec(o, "DeleteBlocksAfter", func() error { + return o.ORM.DeleteBlocksAfter(start, qopts...) + }) +} + +func (o *ObservedORM) DeleteBlocksBefore(end int64, qopts ...pg.QOpt) error { + return withObservedExec(o, "DeleteBlocksBefore", func() error { + return o.ORM.DeleteBlocksBefore(end, qopts...) + }) +} + +func (o *ObservedORM) DeleteLogsAfter(start int64, qopts ...pg.QOpt) error { + return withObservedExec(o, "DeleteLogsAfter", func() error { + return o.ORM.DeleteLogsAfter(start, qopts...) + }) +} + +func (o *ObservedORM) DeleteExpiredLogs(qopts ...pg.QOpt) error { + return withObservedExec(o, "DeleteExpiredLogs", func() error { + return o.ORM.DeleteExpiredLogs(qopts...) + }) +} + +func (o *ObservedORM) SelectBlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, error) { + return withObservedQuery(o, "SelectBlockByNumber", func() (*LogPollerBlock, error) { + return o.ORM.SelectBlockByNumber(n, qopts...) + }) +} + +func (o *ObservedORM) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error) { + return withObservedQuery(o, "SelectLatestBlock", func() (*LogPollerBlock, error) { + return o.ORM.SelectLatestBlock(qopts...) + }) +} + +func (o *ObservedORM) SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { + return withObservedQuery(o, "SelectLatestLogByEventSigWithConfs", func() (*Log, error) { + return o.ORM.SelectLatestLogByEventSigWithConfs(eventSig, address, confs, qopts...) + }) +} + +func (o *ObservedORM) SelectLogsWithSigs(start, end int64, address common.Address, eventSigs []common.Hash, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectLogsWithSigs", func() ([]Log, error) { + return o.ORM.SelectLogsWithSigs(start, end, address, eventSigs, qopts...) }) } -func (o *ObservedLogPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { - return withObservedQuery(o, "LatestLogByEventSigWithConfs", func() (*Log, error) { - return o.LogPoller.LatestLogByEventSigWithConfs(eventSig, address, confs, qopts...) +func (o *ObservedORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectLogsCreatedAfter", func() ([]Log, error) { + return o.ORM.SelectLogsCreatedAfter(address, eventSig, after, confs, qopts...) }) } -func (o *ObservedLogPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "LatestLogEventSigsAddrsWithConfs", func() ([]Log, error) { - return o.LogPoller.LatestLogEventSigsAddrsWithConfs(fromBlock, eventSigs, addresses, confs, qopts...) +func (o *ObservedORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectIndexedLogs", func() ([]Log, error) { + return o.ORM.SelectIndexedLogs(address, eventSig, topicIndex, topicValues, confs, qopts...) }) } -func (o *ObservedLogPoller) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { - return withObservedQuery(o, "LatestBlockByEventSigsAddrsWithConfs", func() (int64, error) { - return o.LogPoller.LatestBlockByEventSigsAddrsWithConfs(fromBlock, eventSigs, addresses, confs, qopts...) +func (o *ObservedORM) SelectIndexedLogsByBlockRange(start, end int64, address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectIndexedLogsByBlockRange", func() ([]Log, error) { + return o.ORM.SelectIndexedLogsByBlockRange(start, end, address, eventSig, topicIndex, topicValues, qopts...) }) } -func (o *ObservedLogPoller) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "IndexedLogs", func() ([]Log, error) { - return o.LogPoller.IndexedLogs(eventSig, address, topicIndex, topicValues, confs, qopts...) +func (o *ObservedORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectIndexedLogsCreatedAfter", func() ([]Log, error) { + return o.ORM.SelectIndexedLogsCreatedAfter(address, eventSig, topicIndex, topicValues, after, confs, qopts...) }) } -func (o *ObservedLogPoller) IndexedLogsByBlockRange(start, end int64, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "IndexedLogsByBlockRange", func() ([]Log, error) { - return o.LogPoller.IndexedLogsByBlockRange(start, end, eventSig, address, topicIndex, topicValues, qopts...) +func (o *ObservedORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectIndexedLogsWithSigsExcluding", func() ([]Log, error) { + return o.ORM.SelectIndexedLogsWithSigsExcluding(sigA, sigB, topicIndex, address, startBlock, endBlock, confs, qopts...) }) } -func (o *ObservedLogPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "IndexedLogsCreatedAfter", func() ([]Log, error) { - return o.LogPoller.IndexedLogsCreatedAfter(eventSig, address, topicIndex, topicValues, after, confs, qopts...) +func (o *ObservedORM) SelectLogs(start, end int64, address common.Address, eventSig common.Hash, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectLogs", func() ([]Log, error) { + return o.ORM.SelectLogs(start, end, address, eventSig, qopts...) }) } -func (o *ObservedLogPoller) IndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) IndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "IndexedLogsByTxHash", func() ([]Log, error) { - return o.LogPoller.IndexedLogsByTxHash(eventSig, txHash, qopts...) + return o.ORM.SelectIndexedLogsByTxHash(eventSig, txHash, qopts...) }) } -func (o *ObservedLogPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "IndexedLogsTopicGreaterThan", func() ([]Log, error) { - return o.LogPoller.IndexedLogsTopicGreaterThan(eventSig, address, topicIndex, topicValueMin, confs, qopts...) +func (o *ObservedORM) GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]LogPollerBlock, error) { + return withObservedQueryAndResults(o, "GetBlocksRange", func() ([]LogPollerBlock, error) { + return o.ORM.GetBlocksRange(start, end, qopts...) }) } -func (o *ObservedLogPoller) IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "IndexedLogsTopicRange", func() ([]Log, error) { - return o.LogPoller.IndexedLogsTopicRange(eventSig, address, topicIndex, topicValueMin, topicValueMax, confs, qopts...) +func (o *ObservedORM) SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectLatestLogEventSigsAddrsWithConfs", func() ([]Log, error) { + return o.ORM.SelectLatestLogEventSigsAddrsWithConfs(fromBlock, addresses, eventSigs, confs, qopts...) }) } -func (o *ObservedLogPoller) IndexedLogsWithSigsExcluding(address common.Address, eventSigA, eventSigB common.Hash, topicIndex int, fromBlock, toBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "IndexedLogsWithSigsExcluding", func() ([]Log, error) { - return o.LogPoller.IndexedLogsWithSigsExcluding(address, eventSigA, eventSigB, topicIndex, fromBlock, toBlock, confs, qopts...) +func (o *ObservedORM) SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { + return withObservedQuery(o, "SelectLatestBlockByEventSigsAddrsWithConfs", func() (int64, error) { + return o.ORM.SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock, eventSigs, addresses, confs, qopts...) }) } -func (o *ObservedLogPoller) LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "LogsDataWordRange", func() ([]Log, error) { - return o.LogPoller.LogsDataWordRange(eventSig, address, wordIndex, wordValueMin, wordValueMax, confs, qopts...) +func (o *ObservedORM) SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectLogsDataWordRange", func() ([]Log, error) { + return o.ORM.SelectLogsDataWordRange(address, eventSig, wordIndex, wordValueMin, wordValueMax, confs, qopts...) }) } -func (o *ObservedLogPoller) LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "LogsDataWordGreaterThan", func() ([]Log, error) { - return o.LogPoller.LogsDataWordGreaterThan(eventSig, address, wordIndex, wordValueMin, confs, qopts...) +func (o *ObservedORM) SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectLogsDataWordGreaterThan", func() ([]Log, error) { + return o.ORM.SelectLogsDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, confs, qopts...) }) } -func (o *ObservedLogPoller) LogsUntilBlockHashDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { - return withObservedQueryAndResults(o, "LogsUntilBlockHashDataWordGreaterThan", func() ([]Log, error) { - return o.LogPoller.LogsUntilBlockHashDataWordGreaterThan(eventSig, address, wordIndex, wordValueMin, untilBlockHash, qopts...) +func (o *ObservedORM) SelectLogsUntilBlockHashDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectLogsUntilBlockHashDataWordGreaterThan", func() ([]Log, error) { + return o.ORM.SelectLogsUntilBlockHashDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, untilBlockHash, qopts...) }) } -func withObservedQueryAndResults[T any](o *ObservedLogPoller, queryName string, query func() ([]T, error)) ([]T, error) { +func (o *ObservedORM) SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectIndexedLogsTopicGreaterThan", func() ([]Log, error) { + return o.ORM.SelectIndexedLogsTopicGreaterThan(address, eventSig, topicIndex, topicValueMin, confs, qopts...) + }) +} + +func (o *ObservedORM) SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { + return withObservedQueryAndResults(o, "SelectIndexedLogsTopicRange", func() ([]Log, error) { + return o.ORM.SelectIndexedLogsTopicRange(address, eventSig, topicIndex, topicValueMin, topicValueMax, confs, qopts...) + }) +} + +func withObservedQueryAndResults[T any](o *ObservedORM, queryName string, query func() ([]T, error)) ([]T, error) { results, err := withObservedQuery(o, queryName, query) if err == nil { o.datasetSize. @@ -162,7 +250,7 @@ func withObservedQueryAndResults[T any](o *ObservedLogPoller, queryName string, return results, err } -func withObservedQuery[T any](o *ObservedLogPoller, queryName string, query func() (T, error)) (T, error) { +func withObservedQuery[T any](o *ObservedORM, queryName string, query func() (T, error)) (T, error) { queryStarted := time.Now() defer func() { o.queryDuration. @@ -171,3 +259,13 @@ func withObservedQuery[T any](o *ObservedLogPoller, queryName string, query func }() return query() } + +func withObservedExec(o *ObservedORM, query string, exec func() error) error { + queryStarted := time.Now() + defer func() { + o.queryDuration. + WithLabelValues(o.chainId, query). + Observe(float64(time.Since(queryStarted))) + }() + return exec() +} diff --git a/core/chains/evm/logpoller/observability_test.go b/core/chains/evm/logpoller/observability_test.go index 5bd0a772d96..c26b487bbd0 100644 --- a/core/chains/evm/logpoller/observability_test.go +++ b/core/chains/evm/logpoller/observability_test.go @@ -25,20 +25,22 @@ func TestMultipleMetricsArePublished(t *testing.T) { lp := createObservedPollLogger(t, 100) require.Equal(t, 0, testutil.CollectAndCount(lp.queryDuration)) - _, _ = lp.IndexedLogs(common.Hash{}, common.Address{}, 1, []common.Hash{}, 1, pg.WithParentCtx(ctx)) - _, _ = lp.IndexedLogsByBlockRange(0, 1, common.Hash{}, common.Address{}, 1, []common.Hash{}, pg.WithParentCtx(ctx)) - _, _ = lp.IndexedLogsTopicGreaterThan(common.Hash{}, common.Address{}, 1, common.Hash{}, 1, pg.WithParentCtx(ctx)) - _, _ = lp.IndexedLogsTopicRange(common.Hash{}, common.Address{}, 1, common.Hash{}, common.Hash{}, 1, pg.WithParentCtx(ctx)) - _, _ = lp.IndexedLogsWithSigsExcluding(common.Address{}, common.Hash{}, common.Hash{}, 1, 0, 1, 1, pg.WithParentCtx(ctx)) - _, _ = lp.LogsDataWordRange(common.Hash{}, common.Address{}, 0, common.Hash{}, common.Hash{}, 1, pg.WithParentCtx(ctx)) - _, _ = lp.LogsDataWordGreaterThan(common.Hash{}, common.Address{}, 0, common.Hash{}, 1, pg.WithParentCtx(ctx)) - _, _ = lp.LogsCreatedAfter(common.Hash{}, common.Address{}, time.Now(), 0, pg.WithParentCtx(ctx)) - _, _ = lp.LatestLogByEventSigWithConfs(common.Hash{}, common.Address{}, 0, pg.WithParentCtx(ctx)) - _, _ = lp.LatestLogEventSigsAddrsWithConfs(0, []common.Hash{{}}, []common.Address{{}}, 1, pg.WithParentCtx(ctx)) - _, _ = lp.IndexedLogsCreatedAfter(common.Hash{}, common.Address{}, 0, []common.Hash{}, time.Now(), 0, pg.WithParentCtx(ctx)) - _, _ = lp.LogsUntilBlockHashDataWordGreaterThan(common.Hash{}, common.Address{}, 0, common.Hash{}, common.Hash{}, pg.WithParentCtx(ctx)) - - require.Equal(t, 12, testutil.CollectAndCount(lp.queryDuration)) + _, _ = lp.SelectIndexedLogs(common.Address{}, common.Hash{}, 1, []common.Hash{}, 1, pg.WithParentCtx(ctx)) + _, _ = lp.SelectIndexedLogsByBlockRange(0, 1, common.Address{}, common.Hash{}, 1, []common.Hash{}, pg.WithParentCtx(ctx)) + _, _ = lp.SelectIndexedLogsTopicGreaterThan(common.Address{}, common.Hash{}, 1, common.Hash{}, 1, pg.WithParentCtx(ctx)) + _, _ = lp.SelectIndexedLogsTopicRange(common.Address{}, common.Hash{}, 1, common.Hash{}, common.Hash{}, 1, pg.WithParentCtx(ctx)) + _, _ = lp.SelectIndexedLogsWithSigsExcluding(common.Hash{}, common.Hash{}, 1, common.Address{}, 0, 1, 1, pg.WithParentCtx(ctx)) + _, _ = lp.SelectLogsDataWordRange(common.Address{}, common.Hash{}, 0, common.Hash{}, common.Hash{}, 1, pg.WithParentCtx(ctx)) + _, _ = lp.SelectLogsDataWordGreaterThan(common.Address{}, common.Hash{}, 0, common.Hash{}, 1, pg.WithParentCtx(ctx)) + _, _ = lp.SelectLogsCreatedAfter(common.Address{}, common.Hash{}, time.Now(), 0, pg.WithParentCtx(ctx)) + _, _ = lp.SelectLatestLogByEventSigWithConfs(common.Hash{}, common.Address{}, 0, pg.WithParentCtx(ctx)) + _, _ = lp.SelectLatestLogEventSigsAddrsWithConfs(0, []common.Address{{}}, []common.Hash{{}}, 1, pg.WithParentCtx(ctx)) + _, _ = lp.SelectIndexedLogsCreatedAfter(common.Address{}, common.Hash{}, 0, []common.Hash{}, time.Now(), 0, pg.WithParentCtx(ctx)) + _, _ = lp.SelectLogsUntilBlockHashDataWordGreaterThan(common.Address{}, common.Hash{}, 0, common.Hash{}, common.Hash{}, pg.WithParentCtx(ctx)) + _ = lp.InsertLogs([]Log{}, pg.WithParentCtx(ctx)) + _ = lp.InsertBlock(common.Hash{}, 0, time.Now(), pg.WithParentCtx(ctx)) + + require.Equal(t, 14, testutil.CollectAndCount(lp.queryDuration)) require.Equal(t, 10, testutil.CollectAndCount(lp.datasetSize)) resetMetrics(*lp) } @@ -48,31 +50,15 @@ func TestShouldPublishDurationInCaseOfError(t *testing.T) { lp := createObservedPollLogger(t, 200) require.Equal(t, 0, testutil.CollectAndCount(lp.queryDuration)) - _, err := lp.LatestLogByEventSigWithConfs(common.Hash{}, common.Address{}, 0, pg.WithParentCtx(ctx)) + _, err := lp.SelectLatestLogByEventSigWithConfs(common.Hash{}, common.Address{}, 0, pg.WithParentCtx(ctx)) require.Error(t, err) require.Equal(t, 1, testutil.CollectAndCount(lp.queryDuration)) - require.Equal(t, 1, counterFromHistogramByLabels(t, lp.queryDuration, "200", "LatestLogByEventSigWithConfs")) + require.Equal(t, 1, counterFromHistogramByLabels(t, lp.queryDuration, "200", "SelectLatestLogByEventSigWithConfs")) resetMetrics(*lp) } -func TestNotObservedFunctions(t *testing.T) { - ctx := testutils.Context(t) - lp := createObservedPollLogger(t, 300) - require.Equal(t, 0, testutil.CollectAndCount(lp.queryDuration)) - - _, err := lp.Logs(0, 1, common.Hash{}, common.Address{}, pg.WithParentCtx(ctx)) - require.NoError(t, err) - - _, err = lp.LogsWithSigs(0, 1, []common.Hash{{}}, common.Address{}, pg.WithParentCtx(ctx)) - require.NoError(t, err) - - require.Equal(t, 0, testutil.CollectAndCount(lp.queryDuration)) - require.Equal(t, 0, testutil.CollectAndCount(lp.datasetSize)) - resetMetrics(*lp) -} - func TestMetricsAreProperlyPopulatedWithLabels(t *testing.T) { lp := createObservedPollLogger(t, 420) expectedCount := 9 @@ -105,16 +91,23 @@ func TestNotPublishingDatasetSizeInCaseOfError(t *testing.T) { require.Equal(t, 0, counterFromGaugeByLabels(lp.datasetSize, "420", "errorQuery")) } -func createObservedPollLogger(t *testing.T, chainId int64) *ObservedLogPoller { +func TestMetricsAreProperlyPopulatedForWrites(t *testing.T) { + lp := createObservedPollLogger(t, 420) + require.NoError(t, withObservedExec(lp, "execQuery", func() error { return nil })) + require.Error(t, withObservedExec(lp, "execQuery", func() error { return fmt.Errorf("error") })) + + require.Equal(t, 2, counterFromHistogramByLabels(t, lp.queryDuration, "420", "execQuery")) +} + +func createObservedPollLogger(t *testing.T, chainId int64) *ObservedORM { lggr, _ := logger.TestLoggerObserved(t, zapcore.ErrorLevel) db := pgtest.NewSqlxDB(t) - orm := NewORM(big.NewInt(chainId), db, lggr, pgtest.NewQConfig(true)) - return NewObservedLogPoller( - orm, nil, lggr, 1, 1, 1, 1, 1000, - ).(*ObservedLogPoller) + return NewObservedORM( + big.NewInt(chainId), db, lggr, pgtest.NewQConfig(true), + ) } -func resetMetrics(lp ObservedLogPoller) { +func resetMetrics(lp ObservedORM) { lp.queryDuration.Reset() lp.datasetSize.Reset() } diff --git a/core/chains/evm/logpoller/orm.go b/core/chains/evm/logpoller/orm.go index b26c4ac7df6..8cb80094c0f 100644 --- a/core/chains/evm/logpoller/orm.go +++ b/core/chains/evm/logpoller/orm.go @@ -16,23 +16,67 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -type ORM struct { +// ORM represents the persistent data access layer used by the log poller. At this moment, it's a bit leaky abstraction, because +// it exposes some of the database implementation details (e.g. pg.Q). Ideally it should be agnostic and could be applied to any persistence layer. +// What is more, LogPoller should not be aware of the underlying database implementation and delegate all the queries to the ORM. +type ORM interface { + Q() pg.Q + InsertLogs(logs []Log, qopts ...pg.QOpt) error + InsertBlock(h common.Hash, n int64, t time.Time, qopts ...pg.QOpt) error + InsertFilter(filter Filter, qopts ...pg.QOpt) error + + LoadFilters(qopts ...pg.QOpt) (map[string]Filter, error) + DeleteFilter(name string, qopts ...pg.QOpt) error + + DeleteBlocksAfter(start int64, qopts ...pg.QOpt) error + DeleteBlocksBefore(end int64, qopts ...pg.QOpt) error + DeleteLogsAfter(start int64, qopts ...pg.QOpt) error + DeleteExpiredLogs(qopts ...pg.QOpt) error + + GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]LogPollerBlock, error) + SelectBlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, error) + SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error) + + SelectLogs(start, end int64, address common.Address, eventSig common.Hash, qopts ...pg.QOpt) ([]Log, error) + SelectLogsWithSigs(start, end int64, address common.Address, eventSigs []common.Hash, qopts ...pg.QOpt) ([]Log, error) + SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) + SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) + + SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsByBlockRange(start, end int64, address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, qopts ...pg.QOpt) ([]Log, error) + SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectLogsUntilBlockHashDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) +} + +type DbORM struct { chainID *big.Int q pg.Q } -// NewORM creates an ORM scoped to chainID. -func NewORM(chainID *big.Int, db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig) *ORM { +// NewORM creates a DbORM scoped to chainID. +func NewORM(chainID *big.Int, db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig) *DbORM { namedLogger := lggr.Named("Configs") q := pg.NewQ(db, namedLogger, cfg) - return &ORM{ + return &DbORM{ chainID: chainID, q: q, } } +func (o *DbORM) Q() pg.Q { + return o.q +} + // InsertBlock is idempotent to support replays. -func (o *ORM) InsertBlock(h common.Hash, n int64, t time.Time, qopts ...pg.QOpt) error { +func (o *DbORM) InsertBlock(h common.Hash, n int64, t time.Time, qopts ...pg.QOpt) error { q := o.q.WithOpts(qopts...) err := q.ExecQ(`INSERT INTO evm.log_poller_blocks (evm_chain_id, block_hash, block_number, block_timestamp, created_at) VALUES ($1, $2, $3, $4, NOW()) ON CONFLICT DO NOTHING`, utils.NewBig(o.chainID), h[:], n, t) @@ -43,7 +87,7 @@ func (o *ORM) InsertBlock(h common.Hash, n int64, t time.Time, qopts ...pg.QOpt) // // Each address/event pair must have a unique job id, so it may be removed when the job is deleted. // If a second job tries to overwrite the same pair, this should fail. -func (o *ORM) InsertFilter(filter Filter, qopts ...pg.QOpt) (err error) { +func (o *DbORM) InsertFilter(filter Filter, qopts ...pg.QOpt) (err error) { q := o.q.WithOpts(qopts...) addresses := make([][]byte, 0) events := make([][]byte, 0) @@ -65,13 +109,13 @@ func (o *ORM) InsertFilter(filter Filter, qopts ...pg.QOpt) (err error) { } // DeleteFilter removes all events,address pairs associated with the Filter -func (o *ORM) DeleteFilter(name string, qopts ...pg.QOpt) error { +func (o *DbORM) DeleteFilter(name string, qopts ...pg.QOpt) error { q := o.q.WithOpts(qopts...) return q.ExecQ(`DELETE FROM evm.log_poller_filters WHERE name = $1 AND evm_chain_id = $2`, name, utils.NewBig(o.chainID)) } // LoadFiltersForChain returns all filters for this chain -func (o *ORM) LoadFilters(qopts ...pg.QOpt) (map[string]Filter, error) { +func (o *DbORM) LoadFilters(qopts ...pg.QOpt) (map[string]Filter, error) { q := o.q.WithOpts(qopts...) rows := make([]Filter, 0) err := q.Select(&rows, `SELECT name, @@ -88,7 +132,7 @@ func (o *ORM) LoadFilters(qopts ...pg.QOpt) (map[string]Filter, error) { return filters, err } -func (o *ORM) SelectBlockByHash(h common.Hash, qopts ...pg.QOpt) (*LogPollerBlock, error) { +func (o *DbORM) SelectBlockByHash(h common.Hash, qopts ...pg.QOpt) (*LogPollerBlock, error) { q := o.q.WithOpts(qopts...) var b LogPollerBlock if err := q.Get(&b, `SELECT * FROM evm.log_poller_blocks WHERE block_hash = $1 AND evm_chain_id = $2`, h, utils.NewBig(o.chainID)); err != nil { @@ -97,7 +141,7 @@ func (o *ORM) SelectBlockByHash(h common.Hash, qopts ...pg.QOpt) (*LogPollerBloc return &b, nil } -func (o *ORM) SelectBlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, error) { +func (o *DbORM) SelectBlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, error) { q := o.q.WithOpts(qopts...) var b LogPollerBlock if err := q.Get(&b, `SELECT * FROM evm.log_poller_blocks WHERE block_number = $1 AND evm_chain_id = $2`, n, utils.NewBig(o.chainID)); err != nil { @@ -106,7 +150,7 @@ func (o *ORM) SelectBlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, e return &b, nil } -func (o *ORM) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error) { +func (o *DbORM) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error) { q := o.q.WithOpts(qopts...) var b LogPollerBlock if err := q.Get(&b, `SELECT * FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1`, utils.NewBig(o.chainID)); err != nil { @@ -115,7 +159,7 @@ func (o *ORM) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error) { return &b, nil } -func (o *ORM) SelectLatestLogEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { +func (o *DbORM) SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { q := o.q.WithOpts(qopts...) var l Log if err := q.Get(&l, `SELECT * FROM evm.logs @@ -130,19 +174,19 @@ func (o *ORM) SelectLatestLogEventSigWithConfs(eventSig common.Hash, address com } // DeleteBlocksAfter delete all blocks after and including start. -func (o *ORM) DeleteBlocksAfter(start int64, qopts ...pg.QOpt) error { +func (o *DbORM) DeleteBlocksAfter(start int64, qopts ...pg.QOpt) error { q := o.q.WithOpts(qopts...) return q.ExecQ(`DELETE FROM evm.log_poller_blocks WHERE block_number >= $1 AND evm_chain_id = $2`, start, utils.NewBig(o.chainID)) } // DeleteBlocksBefore delete all blocks before and including end. -func (o *ORM) DeleteBlocksBefore(end int64, qopts ...pg.QOpt) error { +func (o *DbORM) DeleteBlocksBefore(end int64, qopts ...pg.QOpt) error { q := o.q.WithOpts(qopts...) _, err := q.Exec(`DELETE FROM evm.log_poller_blocks WHERE block_number <= $1 AND evm_chain_id = $2`, end, utils.NewBig(o.chainID)) return err } -func (o *ORM) DeleteLogsAfter(start int64, qopts ...pg.QOpt) error { +func (o *DbORM) DeleteLogsAfter(start int64, qopts ...pg.QOpt) error { q := o.q.WithOpts(qopts...) return q.ExecQ(`DELETE FROM evm.logs WHERE block_number >= $1 AND evm_chain_id = $2`, start, utils.NewBig(o.chainID)) } @@ -155,7 +199,7 @@ type Exp struct { ShouldDelete bool } -func (o *ORM) DeleteExpiredLogs(qopts ...pg.QOpt) error { +func (o *DbORM) DeleteExpiredLogs(qopts ...pg.QOpt) error { qopts = append(qopts, pg.WithLongQueryTimeout()) q := o.q.WithOpts(qopts...) @@ -170,7 +214,7 @@ func (o *ORM) DeleteExpiredLogs(qopts ...pg.QOpt) error { } // InsertLogs is idempotent to support replays. -func (o *ORM) InsertLogs(logs []Log, qopts ...pg.QOpt) error { +func (o *DbORM) InsertLogs(logs []Log, qopts ...pg.QOpt) error { for _, log := range logs { if o.chainID.Cmp(log.EvmChainId.ToInt()) != 0 { return errors.Errorf("invalid chainID in log got %v want %v", log.EvmChainId.ToInt(), o.chainID) @@ -203,7 +247,7 @@ func (o *ORM) InsertLogs(logs []Log, qopts ...pg.QOpt) error { return nil } -func (o *ORM) SelectLogsByBlockRange(start, end int64) ([]Log, error) { +func (o *DbORM) SelectLogsByBlockRange(start, end int64) ([]Log, error) { var logs []Log err := o.q.Select(&logs, ` SELECT * FROM evm.logs @@ -216,7 +260,7 @@ func (o *ORM) SelectLogsByBlockRange(start, end int64) ([]Log, error) { } // SelectLogsByBlockRangeFilter finds the logs in a given block range. -func (o *ORM) SelectLogsByBlockRangeFilter(start, end int64, address common.Address, eventSig common.Hash, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectLogs(start, end int64, address common.Address, eventSig common.Hash, qopts ...pg.QOpt) ([]Log, error) { var logs []Log q := o.q.WithOpts(qopts...) err := q.Select(&logs, ` @@ -231,7 +275,7 @@ func (o *ORM) SelectLogsByBlockRangeFilter(start, end int64, address common.Addr } // SelectLogsCreatedAfter finds logs created after some timestamp. -func (o *ORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { minBlock, maxBlock, err := o.blocksRangeAfterTimestamp(after, confs, qopts...) if err != nil { return nil, err @@ -255,7 +299,7 @@ func (o *ORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Has // SelectLogsWithSigsByBlockRangeFilter finds the logs in the given block range with the given event signatures // emitted from the given address. -func (o *ORM) SelectLogsWithSigsByBlockRangeFilter(start, end int64, address common.Address, eventSigs []common.Hash, qopts ...pg.QOpt) (logs []Log, err error) { +func (o *DbORM) SelectLogsWithSigs(start, end int64, address common.Address, eventSigs []common.Hash, qopts ...pg.QOpt) (logs []Log, err error) { q := o.q.WithOpts(qopts...) sigs := make([][]byte, 0, len(eventSigs)) for _, sig := range eventSigs { @@ -293,7 +337,7 @@ ORDER BY (evm.logs.block_number, evm.logs.log_index)`, a) return logs, err } -func (o *ORM) GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]LogPollerBlock, error) { +func (o *DbORM) GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]LogPollerBlock, error) { var blocks []LogPollerBlock q := o.q.WithOpts(qopts...) err := q.Select(&blocks, ` @@ -307,7 +351,7 @@ func (o *ORM) GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]LogP } // SelectLatestLogEventSigsAddrsWithConfs finds the latest log by (address, event) combination that matches a list of Addresses and list of events -func (o *ORM) SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { var logs []Log sigs := concatBytes(eventSigs) addrs := concatBytes(addresses) @@ -332,7 +376,7 @@ func (o *ORM) SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses } // SelectLatestBlockNumberEventSigsAddrsWithConfs finds the latest block number that matches a list of Addresses and list of events. It returns 0 if there is no matching block -func (o *ORM) SelectLatestBlockNumberEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { +func (o *DbORM) SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { var blockNumber int64 sigs := concatBytes(eventSigs) addrs := concatBytes(addresses) @@ -352,7 +396,7 @@ func (o *ORM) SelectLatestBlockNumberEventSigsAddrsWithConfs(fromBlock int64, ev return blockNumber, nil } -func (o *ORM) SelectDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { var logs []Log q := o.q.WithOpts(qopts...) err := q.Select(&logs, @@ -369,7 +413,7 @@ func (o *ORM) SelectDataWordRange(address common.Address, eventSig common.Hash, return logs, nil } -func (o *ORM) SelectDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { var logs []Log q := o.q.WithOpts(qopts...) err := q.Select(&logs, @@ -385,7 +429,7 @@ func (o *ORM) SelectDataWordGreaterThan(address common.Address, eventSig common. return logs, nil } -func (o *ORM) SelectIndexLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { if err := validateTopicIndex(topicIndex); err != nil { return nil, err } @@ -405,7 +449,7 @@ func (o *ORM) SelectIndexLogsTopicGreaterThan(address common.Address, eventSig c return logs, nil } -func (o *ORM) SelectUntilBlockHashDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectLogsUntilBlockHashDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { var logs []Log q := o.q.WithOpts(qopts...) err := q.Transaction(func(tx pg.Queryer) error { @@ -430,7 +474,7 @@ func (o *ORM) SelectUntilBlockHashDataWordGreaterThan(address common.Address, ev return logs, nil } -func (o *ORM) SelectIndexLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { if err := validateTopicIndex(topicIndex); err != nil { return nil, err } @@ -451,7 +495,7 @@ func (o *ORM) SelectIndexLogsTopicRange(address common.Address, eventSig common. return logs, nil } -func (o *ORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { if err := validateTopicIndex(topicIndex); err != nil { return nil, err } @@ -474,7 +518,7 @@ func (o *ORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, to } // SelectIndexedLogsByBlockRangeFilter finds the indexed logs in a given block range. -func (o *ORM) SelectIndexedLogsByBlockRangeFilter(start, end int64, address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectIndexedLogsByBlockRange(start, end int64, address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) { if err := validateTopicIndex(topicIndex); err != nil { return nil, err } @@ -502,12 +546,11 @@ func validateTopicIndex(index int) error { return nil } -func (o *ORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { minBlock, maxBlock, err := o.blocksRangeAfterTimestamp(after, confs, qopts...) if err != nil { return nil, err } - var logs []Log q := o.q.WithOpts(qopts...) topicValuesBytes := concatBytes(topicValues) @@ -527,7 +570,7 @@ func (o *ORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig com return logs, nil } -func (o *ORM) SelectIndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectIndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { q := o.q.WithOpts(qopts...) var logs []Log err := q.Select(&logs, ` @@ -544,7 +587,7 @@ func (o *ORM) SelectIndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash } // SelectIndexedLogsWithSigsExcluding query's for logs that have signature A and exclude logs that have a corresponding signature B, matching is done based on the topic index both logs should be inside the block range and have the minimum number of confirmations -func (o *ORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *DbORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) { if err := validateTopicIndex(topicIndex); err != nil { return nil, err } @@ -582,7 +625,7 @@ func (o *ORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIn return logs, nil } -func (o *ORM) blocksRangeAfterTimestamp(after time.Time, confs int, qopts ...pg.QOpt) (int64, int64, error) { +func (o *DbORM) blocksRangeAfterTimestamp(after time.Time, confs int, qopts ...pg.QOpt) (int64, int64, error) { type blockRange struct { MinBlockNumber int64 `db:"min_block"` MaxBlockNumber int64 `db:"max_block"` diff --git a/core/chains/evm/logpoller/orm_test.go b/core/chains/evm/logpoller/orm_test.go index f9b51000bb1..531aec2ff30 100644 --- a/core/chains/evm/logpoller/orm_test.go +++ b/core/chains/evm/logpoller/orm_test.go @@ -293,36 +293,36 @@ func TestORM(t *testing.T) { require.Equal(t, 1, len(logs)) assert.Equal(t, []byte("hello"), logs[0].Data) - logs, err = o1.SelectLogsByBlockRangeFilter(1, 1, common.HexToAddress("0x1234"), topic) + logs, err = o1.SelectLogs(1, 1, common.HexToAddress("0x1234"), topic) require.NoError(t, err) assert.Equal(t, 0, len(logs)) - logs, err = o1.SelectLogsByBlockRangeFilter(10, 10, common.HexToAddress("0x1234"), topic) + logs, err = o1.SelectLogs(10, 10, common.HexToAddress("0x1234"), topic) require.NoError(t, err) require.Equal(t, 1, len(logs)) // With no blocks, should be an error - _, err = o1.SelectLatestLogEventSigWithConfs(topic, common.HexToAddress("0x1234"), 0) + _, err = o1.SelectLatestLogByEventSigWithConfs(topic, common.HexToAddress("0x1234"), 0) require.Error(t, err) assert.True(t, errors.Is(err, sql.ErrNoRows)) // With block 10, only 0 confs should work require.NoError(t, o1.InsertBlock(common.HexToHash("0x1234"), 10, time.Now())) - log, err := o1.SelectLatestLogEventSigWithConfs(topic, common.HexToAddress("0x1234"), 0) + log, err := o1.SelectLatestLogByEventSigWithConfs(topic, common.HexToAddress("0x1234"), 0) require.NoError(t, err) assert.Equal(t, int64(10), log.BlockNumber) - _, err = o1.SelectLatestLogEventSigWithConfs(topic, common.HexToAddress("0x1234"), 1) + _, err = o1.SelectLatestLogByEventSigWithConfs(topic, common.HexToAddress("0x1234"), 1) require.Error(t, err) assert.True(t, errors.Is(err, sql.ErrNoRows)) // With block 12, anything <=2 should work require.NoError(t, o1.DeleteBlocksAfter(10)) require.NoError(t, o1.InsertBlock(common.HexToHash("0x1234"), 11, time.Now())) require.NoError(t, o1.InsertBlock(common.HexToHash("0x1235"), 12, time.Now())) - _, err = o1.SelectLatestLogEventSigWithConfs(topic, common.HexToAddress("0x1234"), 0) + _, err = o1.SelectLatestLogByEventSigWithConfs(topic, common.HexToAddress("0x1234"), 0) require.NoError(t, err) - _, err = o1.SelectLatestLogEventSigWithConfs(topic, common.HexToAddress("0x1234"), 1) + _, err = o1.SelectLatestLogByEventSigWithConfs(topic, common.HexToAddress("0x1234"), 1) require.NoError(t, err) - _, err = o1.SelectLatestLogEventSigWithConfs(topic, common.HexToAddress("0x1234"), 2) + _, err = o1.SelectLatestLogByEventSigWithConfs(topic, common.HexToAddress("0x1234"), 2) require.NoError(t, err) - _, err = o1.SelectLatestLogEventSigWithConfs(topic, common.HexToAddress("0x1234"), 3) + _, err = o1.SelectLatestLogByEventSigWithConfs(topic, common.HexToAddress("0x1234"), 3) require.Error(t, err) assert.True(t, errors.Is(err, sql.ErrNoRows)) @@ -423,7 +423,7 @@ func TestORM(t *testing.T) { require.Zero(t, len(logs)) } -func insertLogsTopicValueRange(t *testing.T, chainID *big.Int, o *logpoller.ORM, addr common.Address, blockNumber int, eventSig common.Hash, start, stop int) { +func insertLogsTopicValueRange(t *testing.T, chainID *big.Int, o *logpoller.DbORM, addr common.Address, blockNumber int, eventSig common.Hash, start, stop int) { var lgs []logpoller.Log for i := start; i <= stop; i++ { lgs = append(lgs, logpoller.Log{ @@ -459,45 +459,45 @@ func TestORM_IndexedLogs(t *testing.T) { require.NoError(t, err) assert.Equal(t, 2, len(lgs)) - lgs, err = o1.SelectIndexedLogsByBlockRangeFilter(1, 1, addr, eventSig, 1, []common.Hash{logpoller.EvmWord(1)}) + lgs, err = o1.SelectIndexedLogsByBlockRange(1, 1, addr, eventSig, 1, []common.Hash{logpoller.EvmWord(1)}) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) - lgs, err = o1.SelectIndexedLogsByBlockRangeFilter(1, 2, addr, eventSig, 1, []common.Hash{logpoller.EvmWord(2)}) + lgs, err = o1.SelectIndexedLogsByBlockRange(1, 2, addr, eventSig, 1, []common.Hash{logpoller.EvmWord(2)}) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) - lgs, err = o1.SelectIndexedLogsByBlockRangeFilter(1, 2, addr, eventSig, 1, []common.Hash{logpoller.EvmWord(1)}) + lgs, err = o1.SelectIndexedLogsByBlockRange(1, 2, addr, eventSig, 1, []common.Hash{logpoller.EvmWord(1)}) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) - _, err = o1.SelectIndexedLogsByBlockRangeFilter(1, 2, addr, eventSig, 0, []common.Hash{logpoller.EvmWord(1)}) + _, err = o1.SelectIndexedLogsByBlockRange(1, 2, addr, eventSig, 0, []common.Hash{logpoller.EvmWord(1)}) require.Error(t, err) assert.Contains(t, err.Error(), "invalid index for topic: 0") - _, err = o1.SelectIndexedLogsByBlockRangeFilter(1, 2, addr, eventSig, 4, []common.Hash{logpoller.EvmWord(1)}) + _, err = o1.SelectIndexedLogsByBlockRange(1, 2, addr, eventSig, 4, []common.Hash{logpoller.EvmWord(1)}) require.Error(t, err) assert.Contains(t, err.Error(), "invalid index for topic: 4") - lgs, err = o1.SelectIndexLogsTopicGreaterThan(addr, eventSig, 1, logpoller.EvmWord(2), 0) + lgs, err = o1.SelectIndexedLogsTopicGreaterThan(addr, eventSig, 1, logpoller.EvmWord(2), 0) require.NoError(t, err) assert.Equal(t, 2, len(lgs)) - lgs, err = o1.SelectIndexLogsTopicRange(addr, eventSig, 1, logpoller.EvmWord(3), logpoller.EvmWord(3), 0) + lgs, err = o1.SelectIndexedLogsTopicRange(addr, eventSig, 1, logpoller.EvmWord(3), logpoller.EvmWord(3), 0) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) assert.Equal(t, logpoller.EvmWord(3).Bytes(), lgs[0].GetTopics()[1].Bytes()) - lgs, err = o1.SelectIndexLogsTopicRange(addr, eventSig, 1, logpoller.EvmWord(1), logpoller.EvmWord(3), 0) + lgs, err = o1.SelectIndexedLogsTopicRange(addr, eventSig, 1, logpoller.EvmWord(1), logpoller.EvmWord(3), 0) require.NoError(t, err) assert.Equal(t, 3, len(lgs)) // Check confirmations work as expected. require.NoError(t, o1.InsertBlock(common.HexToHash("0x2"), 2, time.Now())) - lgs, err = o1.SelectIndexLogsTopicRange(addr, eventSig, 1, logpoller.EvmWord(4), logpoller.EvmWord(4), 1) + lgs, err = o1.SelectIndexedLogsTopicRange(addr, eventSig, 1, logpoller.EvmWord(4), logpoller.EvmWord(4), 1) require.NoError(t, err) assert.Equal(t, 0, len(lgs)) require.NoError(t, o1.InsertBlock(common.HexToHash("0x3"), 3, time.Now())) - lgs, err = o1.SelectIndexLogsTopicRange(addr, eventSig, 1, logpoller.EvmWord(4), logpoller.EvmWord(4), 1) + lgs, err = o1.SelectIndexedLogsTopicRange(addr, eventSig, 1, logpoller.EvmWord(4), logpoller.EvmWord(4), 1) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) } @@ -600,48 +600,48 @@ func TestORM_DataWords(t *testing.T) { }, })) // Outside range should fail. - lgs, err := o1.SelectDataWordRange(addr, eventSig, 0, logpoller.EvmWord(2), logpoller.EvmWord(2), 0) + lgs, err := o1.SelectLogsDataWordRange(addr, eventSig, 0, logpoller.EvmWord(2), logpoller.EvmWord(2), 0) require.NoError(t, err) assert.Equal(t, 0, len(lgs)) // Range including log should succeed - lgs, err = o1.SelectDataWordRange(addr, eventSig, 0, logpoller.EvmWord(1), logpoller.EvmWord(2), 0) + lgs, err = o1.SelectLogsDataWordRange(addr, eventSig, 0, logpoller.EvmWord(1), logpoller.EvmWord(2), 0) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) // Range only covering log should succeed - lgs, err = o1.SelectDataWordRange(addr, eventSig, 0, logpoller.EvmWord(1), logpoller.EvmWord(1), 0) + lgs, err = o1.SelectLogsDataWordRange(addr, eventSig, 0, logpoller.EvmWord(1), logpoller.EvmWord(1), 0) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) // Cannot query for unconfirmed second log. - lgs, err = o1.SelectDataWordRange(addr, eventSig, 1, logpoller.EvmWord(3), logpoller.EvmWord(3), 0) + lgs, err = o1.SelectLogsDataWordRange(addr, eventSig, 1, logpoller.EvmWord(3), logpoller.EvmWord(3), 0) require.NoError(t, err) assert.Equal(t, 0, len(lgs)) // Confirm it, then can query. require.NoError(t, o1.InsertBlock(common.HexToHash("0x2"), 2, time.Now())) - lgs, err = o1.SelectDataWordRange(addr, eventSig, 1, logpoller.EvmWord(3), logpoller.EvmWord(3), 0) + lgs, err = o1.SelectLogsDataWordRange(addr, eventSig, 1, logpoller.EvmWord(3), logpoller.EvmWord(3), 0) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) assert.Equal(t, lgs[0].Data, append(logpoller.EvmWord(2).Bytes(), logpoller.EvmWord(3).Bytes()...)) // Check greater than 1 yields both logs. - lgs, err = o1.SelectDataWordGreaterThan(addr, eventSig, 0, logpoller.EvmWord(1), 0) + lgs, err = o1.SelectLogsDataWordGreaterThan(addr, eventSig, 0, logpoller.EvmWord(1), 0) require.NoError(t, err) assert.Equal(t, 2, len(lgs)) // Unknown hash should an error - lgs, err = o1.SelectUntilBlockHashDataWordGreaterThan(addr, eventSig, 0, logpoller.EvmWord(1), common.HexToHash("0x3")) + lgs, err = o1.SelectLogsUntilBlockHashDataWordGreaterThan(addr, eventSig, 0, logpoller.EvmWord(1), common.HexToHash("0x3")) require.Error(t, err) assert.Equal(t, 0, len(lgs)) // 1 block should include first log - lgs, err = o1.SelectUntilBlockHashDataWordGreaterThan(addr, eventSig, 0, logpoller.EvmWord(1), common.HexToHash("0x1")) + lgs, err = o1.SelectLogsUntilBlockHashDataWordGreaterThan(addr, eventSig, 0, logpoller.EvmWord(1), common.HexToHash("0x1")) require.NoError(t, err) assert.Equal(t, 1, len(lgs)) // 2 block should include both - lgs, err = o1.SelectUntilBlockHashDataWordGreaterThan(addr, eventSig, 0, logpoller.EvmWord(1), common.HexToHash("0x2")) + lgs, err = o1.SelectLogsUntilBlockHashDataWordGreaterThan(addr, eventSig, 0, logpoller.EvmWord(1), common.HexToHash("0x2")) require.NoError(t, err) assert.Equal(t, 2, len(lgs)) } @@ -651,7 +651,7 @@ func TestORM_SelectLogsWithSigsByBlockRangeFilter(t *testing.T) { o1 := th.ORM // Insert logs on different topics, should be able to read them - // back using SelectLogsWithSigsByBlockRangeFilter and specifying + // back using SelectLogsWithSigs and specifying // said topics. topic := common.HexToHash("0x1599") topic2 := common.HexToHash("0x1600") @@ -727,7 +727,7 @@ func TestORM_SelectLogsWithSigsByBlockRangeFilter(t *testing.T) { require.NoError(t, o1.InsertLogs(inputLogs)) startBlock, endBlock := int64(10), int64(15) - logs, err := o1.SelectLogsWithSigsByBlockRangeFilter(startBlock, endBlock, sourceAddr, []common.Hash{ + logs, err := o1.SelectLogsWithSigs(startBlock, endBlock, sourceAddr, []common.Hash{ topic, topic2, }) @@ -792,7 +792,7 @@ func TestLogPoller_Logs(t *testing.T) { assert.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000000005", lgs[5].BlockHash.String()) // Filter by Address and topic - lgs, err = th.ORM.SelectLogsByBlockRangeFilter(1, 3, address1, event1) + lgs, err = th.ORM.SelectLogs(1, 3, address1, event1) require.NoError(t, err) require.Equal(t, 2, len(lgs)) assert.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000000003", lgs[0].BlockHash.String()) @@ -802,7 +802,7 @@ func TestLogPoller_Logs(t *testing.T) { assert.Equal(t, address1, lgs[1].Address) // Filter by block - lgs, err = th.ORM.SelectLogsByBlockRangeFilter(2, 2, address2, event1) + lgs, err = th.ORM.SelectLogs(2, 2, address2, event1) require.NoError(t, err) require.Equal(t, 1, len(lgs)) assert.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000000004", lgs[0].BlockHash.String()) @@ -832,7 +832,7 @@ func BenchmarkLogs(b *testing.B) { require.NoError(b, o.InsertLogs(lgs)) b.ResetTimer() for n := 0; n < b.N; n++ { - _, err := o.SelectDataWordRange(addr, EmitterABI.Events["Log1"].ID, 0, logpoller.EvmWord(8000), logpoller.EvmWord(8002), 0) + _, err := o.SelectLogsDataWordRange(addr, EmitterABI.Events["Log1"].ID, 0, logpoller.EvmWord(8000), logpoller.EvmWord(8002), 0) require.NoError(b, err) } } @@ -1165,7 +1165,7 @@ func TestSelectLatestBlockNumberEventSigsAddrsWithConfs(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - blockNumber, err := th.ORM.SelectLatestBlockNumberEventSigsAddrsWithConfs(tt.fromBlock, tt.events, tt.addrs, tt.confs) + blockNumber, err := th.ORM.SelectLatestBlockByEventSigsAddrsWithConfs(tt.fromBlock, tt.events, tt.addrs, tt.confs) require.NoError(t, err) assert.Equal(t, tt.expectedBlockNumber, blockNumber) }) From f935479c240ed5668ca7b1ef22da4f028b13d269 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 28 Sep 2023 18:44:57 -0400 Subject: [PATCH 33/84] [TT-609] Fix Bad Context Cancel (#10826) * Fix Bad Context Cancel * Update * Move cancel to the right spot --- integration-tests/testsetups/ocr.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/testsetups/ocr.go b/integration-tests/testsetups/ocr.go index 5f12995cc06..259831189db 100644 --- a/integration-tests/testsetups/ocr.go +++ b/integration-tests/testsetups/ocr.go @@ -555,14 +555,13 @@ func (o *OCRSoakTest) setFilterQuery() { func (o *OCRSoakTest) observeOCREvents() error { eventLogs := make(chan types.Log) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() eventSub, err := o.chainClient.SubscribeFilterLogs(ctx, o.filterQuery, eventLogs) + cancel() if err != nil { return err } go func() { - defer cancel() for { select { case event := <-eventLogs: @@ -589,6 +588,7 @@ func (o *OCRSoakTest) observeOCREvents() error { Msg("Error while subscribed to OCR Logs. Resubscribing") ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second) eventSub, err = o.chainClient.SubscribeFilterLogs(ctx, o.filterQuery, eventLogs) + cancel() } } } From eff698d7552312180f397c77c9265e5d2105b4d2 Mon Sep 17 00:00:00 2001 From: Lukasz <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 29 Sep 2023 13:50:51 +0200 Subject: [PATCH 34/84] Add Mercury v0.3 contract wrappers for E2E tests (#10823) * wip * wip 2 * Add go wrapper for werc20 mock * Add wrapper function * fix * Add new functions for werc20 wrapper * Fix werc20 wrapper location --- .../scripts/native_solc_compile_all_shared | 1 + ...rapper-dependency-versions-do-not-edit.txt | 1 + .../generated/werc20_mock/werc20_mock.go | 1052 +++++++++++++++++ ...rapper-dependency-versions-do-not-edit.txt | 1 + core/gethwrappers/shared/go_generate.go | 1 + .../contracts/contract_deployer.go | 100 ++ .../contracts/contract_loader.go | 74 +- .../contracts/contract_models.go | 26 +- .../contracts/ethereum_contracts.go | 180 ++- 9 files changed, 1421 insertions(+), 15 deletions(-) create mode 100644 core/gethwrappers/shared/generated/werc20_mock/werc20_mock.go diff --git a/contracts/scripts/native_solc_compile_all_shared b/contracts/scripts/native_solc_compile_all_shared index e7199f81feb..705cedce7ab 100755 --- a/contracts/scripts/native_solc_compile_all_shared +++ b/contracts/scripts/native_solc_compile_all_shared @@ -27,4 +27,5 @@ compileContract () { compileContract shared/token/ERC677/BurnMintERC677.sol compileContract shared/token/ERC677/LinkToken.sol +compileContract shared/mocks/WERC20Mock.sol compileContract vendor/openzeppelin-solidity/v4.8.0/contracts/token/ERC20/ERC20.sol diff --git a/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 4bb84a770a1..abc3b47db2c 100644 --- a/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -7,3 +7,4 @@ llo_feeds_test: ../../../contracts/solc/v0.8.16/ExposedVerifier.abi ../../../con reward_manager: ../../../contracts/solc/v0.8.16/RewardManager.abi ../../../contracts/solc/v0.8.16/RewardManager.bin db73e9062b17a1d5aa14c06881fe2be49bd95b00b7f1a8943910c5e4ded5b221 verifier: ../../../contracts/solc/v0.8.16/Verifier.abi ../../../contracts/solc/v0.8.16/Verifier.bin df12786bbeccf3a8f3389479cf93c055b4efd5904b9f99a4835f81af43fe62bf verifier_proxy: ../../../contracts/solc/v0.8.16/VerifierProxy.abi ../../../contracts/solc/v0.8.16/VerifierProxy.bin 6393443d0a323f2dbe9687dc30fd77f8dfa918944b61c651759746ff2d76e4e5 +werc20_mock: ../../../contracts/solc/v0.8.19/WERC20Mock.abi ../../../contracts/solc/v0.8.19/WERC20Mock.bin ff2ca3928b2aa9c412c892cb8226c4d754c73eeb291bb7481c32c48791b2aa94 diff --git a/core/gethwrappers/shared/generated/werc20_mock/werc20_mock.go b/core/gethwrappers/shared/generated/werc20_mock/werc20_mock.go new file mode 100644 index 00000000000..3d8660c701d --- /dev/null +++ b/core/gethwrappers/shared/generated/werc20_mock/werc20_mock.go @@ -0,0 +1,1052 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package werc20_mock + +import ( + "errors" + "fmt" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var WERC20MockMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60806040523480156200001157600080fd5b506040518060400160405280600a8152602001695745524332304d6f636b60b01b815250604051806040016040528060048152602001635745524360e01b815250816003908162000063919062000120565b50600462000072828262000120565b505050620001ec565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620000a657607f821691505b602082108103620000c757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200011b57600081815260208120601f850160051c81016020861015620000f65750805b601f850160051c820191505b81811015620001175782815560010162000102565b5050505b505050565b81516001600160401b038111156200013c576200013c6200007b565b62000154816200014d845462000091565b84620000cd565b602080601f8311600181146200018c5760008415620001735750858301515b600019600386901b1c1916600185901b17855562000117565b600085815260208120601f198616915b82811015620001bd578886015182559484019460019091019084016200019c565b5085821015620001dc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b610fc980620001fc6000396000f3fe6080604052600436106100ec5760003560e01c806340c10f191161008a578063a457c2d711610059578063a457c2d71461028e578063a9059cbb146102ae578063d0e30db0146102ce578063dd62ed3e146102d657600080fd5b806340c10f19146101f657806370a082311461021657806395d89b41146102595780639dc29fac1461026e57600080fd5b806323b872dd116100c657806323b872dd1461017a5780632e1a7d4d1461019a578063313ce567146101ba57806339509351146101d657600080fd5b806306fdde0314610100578063095ea7b31461012b57806318160ddd1461015b57600080fd5b366100fb576100f9610329565b005b600080fd5b34801561010c57600080fd5b5061011561036a565b6040516101229190610dc6565b60405180910390f35b34801561013757600080fd5b5061014b610146366004610e5b565b6103fc565b6040519015158152602001610122565b34801561016757600080fd5b506002545b604051908152602001610122565b34801561018657600080fd5b5061014b610195366004610e85565b610416565b3480156101a657600080fd5b506100f96101b5366004610ec1565b61043a565b3480156101c657600080fd5b5060405160128152602001610122565b3480156101e257600080fd5b5061014b6101f1366004610e5b565b6104c6565b34801561020257600080fd5b506100f9610211366004610e5b565b610512565b34801561022257600080fd5b5061016c610231366004610eda565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b34801561026557600080fd5b50610115610520565b34801561027a57600080fd5b506100f9610289366004610e5b565b61052f565b34801561029a57600080fd5b5061014b6102a9366004610e5b565b610539565b3480156102ba57600080fd5b5061014b6102c9366004610e5b565b61060f565b6100f9610329565b3480156102e257600080fd5b5061016c6102f1366004610efc565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b610333333461061d565b60405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b60606003805461037990610f2f565b80601f01602080910402602001604051908101604052809291908181526020018280546103a590610f2f565b80156103f25780601f106103c7576101008083540402835291602001916103f2565b820191906000526020600020905b8154815290600101906020018083116103d557829003601f168201915b5050505050905090565b60003361040a818585610710565b60019150505b92915050565b6000336104248582856108c4565b61042f85858561099b565b506001949350505050565b3360009081526020819052604090205481111561045657600080fd5b6104603382610c0a565b604051339082156108fc029083906000818181858888f1935050505015801561048d573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061040a908290869061050d908790610f82565b610710565b61051c828261061d565b5050565b60606004805461037990610f2f565b61051c8282610c0a565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610602576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61042f8286868403610710565b60003361040a81858561099b565b73ffffffffffffffffffffffffffffffffffffffff821661069a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105f9565b80600260008282546106ac9190610f82565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff83166107b2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016105f9565b73ffffffffffffffffffffffffffffffffffffffff8216610855576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016105f9565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146109955781811015610988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016105f9565b6109958484848403610710565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610a3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016105f9565b73ffffffffffffffffffffffffffffffffffffffff8216610ae1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016105f9565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610b97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016105f9565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610995565b73ffffffffffffffffffffffffffffffffffffffff8216610cad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016105f9565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015610d63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016105f9565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016108b7565b600060208083528351808285015260005b81811015610df357858101830151858201604001528201610dd7565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610e5657600080fd5b919050565b60008060408385031215610e6e57600080fd5b610e7783610e32565b946020939093013593505050565b600080600060608486031215610e9a57600080fd5b610ea384610e32565b9250610eb160208501610e32565b9150604084013590509250925092565b600060208284031215610ed357600080fd5b5035919050565b600060208284031215610eec57600080fd5b610ef582610e32565b9392505050565b60008060408385031215610f0f57600080fd5b610f1883610e32565b9150610f2660208401610e32565b90509250929050565b600181811c90821680610f4357607f821691505b602082108103610f7c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b80820180821115610410577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea164736f6c6343000813000a", +} + +var WERC20MockABI = WERC20MockMetaData.ABI + +var WERC20MockBin = WERC20MockMetaData.Bin + +func DeployWERC20Mock(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WERC20Mock, error) { + parsed, err := WERC20MockMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(WERC20MockBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &WERC20Mock{WERC20MockCaller: WERC20MockCaller{contract: contract}, WERC20MockTransactor: WERC20MockTransactor{contract: contract}, WERC20MockFilterer: WERC20MockFilterer{contract: contract}}, nil +} + +type WERC20Mock struct { + address common.Address + abi abi.ABI + WERC20MockCaller + WERC20MockTransactor + WERC20MockFilterer +} + +type WERC20MockCaller struct { + contract *bind.BoundContract +} + +type WERC20MockTransactor struct { + contract *bind.BoundContract +} + +type WERC20MockFilterer struct { + contract *bind.BoundContract +} + +type WERC20MockSession struct { + Contract *WERC20Mock + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type WERC20MockCallerSession struct { + Contract *WERC20MockCaller + CallOpts bind.CallOpts +} + +type WERC20MockTransactorSession struct { + Contract *WERC20MockTransactor + TransactOpts bind.TransactOpts +} + +type WERC20MockRaw struct { + Contract *WERC20Mock +} + +type WERC20MockCallerRaw struct { + Contract *WERC20MockCaller +} + +type WERC20MockTransactorRaw struct { + Contract *WERC20MockTransactor +} + +func NewWERC20Mock(address common.Address, backend bind.ContractBackend) (*WERC20Mock, error) { + abi, err := abi.JSON(strings.NewReader(WERC20MockABI)) + if err != nil { + return nil, err + } + contract, err := bindWERC20Mock(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &WERC20Mock{address: address, abi: abi, WERC20MockCaller: WERC20MockCaller{contract: contract}, WERC20MockTransactor: WERC20MockTransactor{contract: contract}, WERC20MockFilterer: WERC20MockFilterer{contract: contract}}, nil +} + +func NewWERC20MockCaller(address common.Address, caller bind.ContractCaller) (*WERC20MockCaller, error) { + contract, err := bindWERC20Mock(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &WERC20MockCaller{contract: contract}, nil +} + +func NewWERC20MockTransactor(address common.Address, transactor bind.ContractTransactor) (*WERC20MockTransactor, error) { + contract, err := bindWERC20Mock(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &WERC20MockTransactor{contract: contract}, nil +} + +func NewWERC20MockFilterer(address common.Address, filterer bind.ContractFilterer) (*WERC20MockFilterer, error) { + contract, err := bindWERC20Mock(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &WERC20MockFilterer{contract: contract}, nil +} + +func bindWERC20Mock(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := WERC20MockMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_WERC20Mock *WERC20MockRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _WERC20Mock.Contract.WERC20MockCaller.contract.Call(opts, result, method, params...) +} + +func (_WERC20Mock *WERC20MockRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WERC20Mock.Contract.WERC20MockTransactor.contract.Transfer(opts) +} + +func (_WERC20Mock *WERC20MockRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _WERC20Mock.Contract.WERC20MockTransactor.contract.Transact(opts, method, params...) +} + +func (_WERC20Mock *WERC20MockCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _WERC20Mock.Contract.contract.Call(opts, result, method, params...) +} + +func (_WERC20Mock *WERC20MockTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WERC20Mock.Contract.contract.Transfer(opts) +} + +func (_WERC20Mock *WERC20MockTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _WERC20Mock.Contract.contract.Transact(opts, method, params...) +} + +func (_WERC20Mock *WERC20MockCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _WERC20Mock.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_WERC20Mock *WERC20MockSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _WERC20Mock.Contract.Allowance(&_WERC20Mock.CallOpts, owner, spender) +} + +func (_WERC20Mock *WERC20MockCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _WERC20Mock.Contract.Allowance(&_WERC20Mock.CallOpts, owner, spender) +} + +func (_WERC20Mock *WERC20MockCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _WERC20Mock.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_WERC20Mock *WERC20MockSession) BalanceOf(account common.Address) (*big.Int, error) { + return _WERC20Mock.Contract.BalanceOf(&_WERC20Mock.CallOpts, account) +} + +func (_WERC20Mock *WERC20MockCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _WERC20Mock.Contract.BalanceOf(&_WERC20Mock.CallOpts, account) +} + +func (_WERC20Mock *WERC20MockCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _WERC20Mock.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_WERC20Mock *WERC20MockSession) Decimals() (uint8, error) { + return _WERC20Mock.Contract.Decimals(&_WERC20Mock.CallOpts) +} + +func (_WERC20Mock *WERC20MockCallerSession) Decimals() (uint8, error) { + return _WERC20Mock.Contract.Decimals(&_WERC20Mock.CallOpts) +} + +func (_WERC20Mock *WERC20MockCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _WERC20Mock.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_WERC20Mock *WERC20MockSession) Name() (string, error) { + return _WERC20Mock.Contract.Name(&_WERC20Mock.CallOpts) +} + +func (_WERC20Mock *WERC20MockCallerSession) Name() (string, error) { + return _WERC20Mock.Contract.Name(&_WERC20Mock.CallOpts) +} + +func (_WERC20Mock *WERC20MockCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _WERC20Mock.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_WERC20Mock *WERC20MockSession) Symbol() (string, error) { + return _WERC20Mock.Contract.Symbol(&_WERC20Mock.CallOpts) +} + +func (_WERC20Mock *WERC20MockCallerSession) Symbol() (string, error) { + return _WERC20Mock.Contract.Symbol(&_WERC20Mock.CallOpts) +} + +func (_WERC20Mock *WERC20MockCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _WERC20Mock.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_WERC20Mock *WERC20MockSession) TotalSupply() (*big.Int, error) { + return _WERC20Mock.Contract.TotalSupply(&_WERC20Mock.CallOpts) +} + +func (_WERC20Mock *WERC20MockCallerSession) TotalSupply() (*big.Int, error) { + return _WERC20Mock.Contract.TotalSupply(&_WERC20Mock.CallOpts) +} + +func (_WERC20Mock *WERC20MockTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "approve", spender, amount) +} + +func (_WERC20Mock *WERC20MockSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Approve(&_WERC20Mock.TransactOpts, spender, amount) +} + +func (_WERC20Mock *WERC20MockTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Approve(&_WERC20Mock.TransactOpts, spender, amount) +} + +func (_WERC20Mock *WERC20MockTransactor) Burn(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "burn", account, amount) +} + +func (_WERC20Mock *WERC20MockSession) Burn(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Burn(&_WERC20Mock.TransactOpts, account, amount) +} + +func (_WERC20Mock *WERC20MockTransactorSession) Burn(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Burn(&_WERC20Mock.TransactOpts, account, amount) +} + +func (_WERC20Mock *WERC20MockTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +func (_WERC20Mock *WERC20MockSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.DecreaseAllowance(&_WERC20Mock.TransactOpts, spender, subtractedValue) +} + +func (_WERC20Mock *WERC20MockTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.DecreaseAllowance(&_WERC20Mock.TransactOpts, spender, subtractedValue) +} + +func (_WERC20Mock *WERC20MockTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "deposit") +} + +func (_WERC20Mock *WERC20MockSession) Deposit() (*types.Transaction, error) { + return _WERC20Mock.Contract.Deposit(&_WERC20Mock.TransactOpts) +} + +func (_WERC20Mock *WERC20MockTransactorSession) Deposit() (*types.Transaction, error) { + return _WERC20Mock.Contract.Deposit(&_WERC20Mock.TransactOpts) +} + +func (_WERC20Mock *WERC20MockTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +func (_WERC20Mock *WERC20MockSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.IncreaseAllowance(&_WERC20Mock.TransactOpts, spender, addedValue) +} + +func (_WERC20Mock *WERC20MockTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.IncreaseAllowance(&_WERC20Mock.TransactOpts, spender, addedValue) +} + +func (_WERC20Mock *WERC20MockTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "mint", account, amount) +} + +func (_WERC20Mock *WERC20MockSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Mint(&_WERC20Mock.TransactOpts, account, amount) +} + +func (_WERC20Mock *WERC20MockTransactorSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Mint(&_WERC20Mock.TransactOpts, account, amount) +} + +func (_WERC20Mock *WERC20MockTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "transfer", to, amount) +} + +func (_WERC20Mock *WERC20MockSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Transfer(&_WERC20Mock.TransactOpts, to, amount) +} + +func (_WERC20Mock *WERC20MockTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Transfer(&_WERC20Mock.TransactOpts, to, amount) +} + +func (_WERC20Mock *WERC20MockTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "transferFrom", from, to, amount) +} + +func (_WERC20Mock *WERC20MockSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.TransferFrom(&_WERC20Mock.TransactOpts, from, to, amount) +} + +func (_WERC20Mock *WERC20MockTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.TransferFrom(&_WERC20Mock.TransactOpts, from, to, amount) +} + +func (_WERC20Mock *WERC20MockTransactor) Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { + return _WERC20Mock.contract.Transact(opts, "withdraw", wad) +} + +func (_WERC20Mock *WERC20MockSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Withdraw(&_WERC20Mock.TransactOpts, wad) +} + +func (_WERC20Mock *WERC20MockTransactorSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _WERC20Mock.Contract.Withdraw(&_WERC20Mock.TransactOpts, wad) +} + +func (_WERC20Mock *WERC20MockTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WERC20Mock.contract.RawTransact(opts, nil) +} + +func (_WERC20Mock *WERC20MockSession) Receive() (*types.Transaction, error) { + return _WERC20Mock.Contract.Receive(&_WERC20Mock.TransactOpts) +} + +func (_WERC20Mock *WERC20MockTransactorSession) Receive() (*types.Transaction, error) { + return _WERC20Mock.Contract.Receive(&_WERC20Mock.TransactOpts) +} + +type WERC20MockApprovalIterator struct { + Event *WERC20MockApproval + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *WERC20MockApprovalIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(WERC20MockApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(WERC20MockApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *WERC20MockApprovalIterator) Error() error { + return it.fail +} + +func (it *WERC20MockApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type WERC20MockApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log +} + +func (_WERC20Mock *WERC20MockFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*WERC20MockApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _WERC20Mock.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &WERC20MockApprovalIterator{contract: _WERC20Mock.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +func (_WERC20Mock *WERC20MockFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *WERC20MockApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _WERC20Mock.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(WERC20MockApproval) + if err := _WERC20Mock.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_WERC20Mock *WERC20MockFilterer) ParseApproval(log types.Log) (*WERC20MockApproval, error) { + event := new(WERC20MockApproval) + if err := _WERC20Mock.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type WERC20MockDepositIterator struct { + Event *WERC20MockDeposit + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *WERC20MockDepositIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(WERC20MockDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(WERC20MockDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *WERC20MockDepositIterator) Error() error { + return it.fail +} + +func (it *WERC20MockDepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type WERC20MockDeposit struct { + Dst common.Address + Wad *big.Int + Raw types.Log +} + +func (_WERC20Mock *WERC20MockFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*WERC20MockDepositIterator, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WERC20Mock.contract.FilterLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return &WERC20MockDepositIterator{contract: _WERC20Mock.contract, event: "Deposit", logs: logs, sub: sub}, nil +} + +func (_WERC20Mock *WERC20MockFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *WERC20MockDeposit, dst []common.Address) (event.Subscription, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WERC20Mock.contract.WatchLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(WERC20MockDeposit) + if err := _WERC20Mock.contract.UnpackLog(event, "Deposit", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_WERC20Mock *WERC20MockFilterer) ParseDeposit(log types.Log) (*WERC20MockDeposit, error) { + event := new(WERC20MockDeposit) + if err := _WERC20Mock.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type WERC20MockTransferIterator struct { + Event *WERC20MockTransfer + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *WERC20MockTransferIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(WERC20MockTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(WERC20MockTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *WERC20MockTransferIterator) Error() error { + return it.fail +} + +func (it *WERC20MockTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type WERC20MockTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log +} + +func (_WERC20Mock *WERC20MockFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*WERC20MockTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _WERC20Mock.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &WERC20MockTransferIterator{contract: _WERC20Mock.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +func (_WERC20Mock *WERC20MockFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *WERC20MockTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _WERC20Mock.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(WERC20MockTransfer) + if err := _WERC20Mock.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_WERC20Mock *WERC20MockFilterer) ParseTransfer(log types.Log) (*WERC20MockTransfer, error) { + event := new(WERC20MockTransfer) + if err := _WERC20Mock.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type WERC20MockWithdrawalIterator struct { + Event *WERC20MockWithdrawal + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *WERC20MockWithdrawalIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(WERC20MockWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(WERC20MockWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *WERC20MockWithdrawalIterator) Error() error { + return it.fail +} + +func (it *WERC20MockWithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type WERC20MockWithdrawal struct { + Src common.Address + Wad *big.Int + Raw types.Log +} + +func (_WERC20Mock *WERC20MockFilterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*WERC20MockWithdrawalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _WERC20Mock.contract.FilterLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return &WERC20MockWithdrawalIterator{contract: _WERC20Mock.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +func (_WERC20Mock *WERC20MockFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *WERC20MockWithdrawal, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _WERC20Mock.contract.WatchLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(WERC20MockWithdrawal) + if err := _WERC20Mock.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_WERC20Mock *WERC20MockFilterer) ParseWithdrawal(log types.Log) (*WERC20MockWithdrawal, error) { + event := new(WERC20MockWithdrawal) + if err := _WERC20Mock.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_WERC20Mock *WERC20Mock) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _WERC20Mock.abi.Events["Approval"].ID: + return _WERC20Mock.ParseApproval(log) + case _WERC20Mock.abi.Events["Deposit"].ID: + return _WERC20Mock.ParseDeposit(log) + case _WERC20Mock.abi.Events["Transfer"].ID: + return _WERC20Mock.ParseTransfer(log) + case _WERC20Mock.abi.Events["Withdrawal"].ID: + return _WERC20Mock.ParseWithdrawal(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (WERC20MockApproval) Topic() common.Hash { + return common.HexToHash("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925") +} + +func (WERC20MockDeposit) Topic() common.Hash { + return common.HexToHash("0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c") +} + +func (WERC20MockTransfer) Topic() common.Hash { + return common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") +} + +func (WERC20MockWithdrawal) Topic() common.Hash { + return common.HexToHash("0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65") +} + +func (_WERC20Mock *WERC20Mock) Address() common.Address { + return _WERC20Mock.address +} + +type WERC20MockInterface interface { + Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) + + BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) + + Decimals(opts *bind.CallOpts) (uint8, error) + + Name(opts *bind.CallOpts) (string, error) + + Symbol(opts *bind.CallOpts) (string, error) + + TotalSupply(opts *bind.CallOpts) (*big.Int, error) + + Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) + + Burn(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) + + DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) + + Deposit(opts *bind.TransactOpts) (*types.Transaction, error) + + IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) + + Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) + + Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) + + TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) + + Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) + + Receive(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*WERC20MockApprovalIterator, error) + + WatchApproval(opts *bind.WatchOpts, sink chan<- *WERC20MockApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) + + ParseApproval(log types.Log) (*WERC20MockApproval, error) + + FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*WERC20MockDepositIterator, error) + + WatchDeposit(opts *bind.WatchOpts, sink chan<- *WERC20MockDeposit, dst []common.Address) (event.Subscription, error) + + ParseDeposit(log types.Log) (*WERC20MockDeposit, error) + + FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*WERC20MockTransferIterator, error) + + WatchTransfer(opts *bind.WatchOpts, sink chan<- *WERC20MockTransfer, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseTransfer(log types.Log) (*WERC20MockTransfer, error) + + FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*WERC20MockWithdrawalIterator, error) + + WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *WERC20MockWithdrawal, src []common.Address) (event.Subscription, error) + + ParseWithdrawal(log types.Log) (*WERC20MockWithdrawal, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 3094b1a94f0..7ac7e77a4b8 100644 --- a/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/shared/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -2,3 +2,4 @@ GETH_VERSION: 1.12.0 burn_mint_erc677: ../../../contracts/solc/v0.8.19/BurnMintERC677.abi ../../../contracts/solc/v0.8.19/BurnMintERC677.bin 405c9016171e614b17e10588653ef8d33dcea21dd569c3fddc596a46fcff68a3 erc20: ../../../contracts/solc/v0.8.19/ERC20.abi ../../../contracts/solc/v0.8.19/ERC20.bin 5b1a93d9b24f250e49a730c96335a8113c3f7010365cba578f313b483001d4fc link_token: ../../../contracts/solc/v0.8.19/LinkToken.abi ../../../contracts/solc/v0.8.19/LinkToken.bin c0ef9b507103aae541ebc31d87d051c2764ba9d843076b30ec505d37cdfffaba +werc20_mock: ../../../contracts/solc/v0.8.19/WERC20Mock.abi ../../../contracts/solc/v0.8.19/WERC20Mock.bin ff2ca3928b2aa9c412c892cb8226c4d754c73eeb291bb7481c32c48791b2aa94 diff --git a/core/gethwrappers/shared/go_generate.go b/core/gethwrappers/shared/go_generate.go index 169a87b9b2d..85a01670c9a 100644 --- a/core/gethwrappers/shared/go_generate.go +++ b/core/gethwrappers/shared/go_generate.go @@ -5,3 +5,4 @@ package gethwrappers //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/BurnMintERC677.abi ../../../contracts/solc/v0.8.19/BurnMintERC677.bin BurnMintERC677 burn_mint_erc677 //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/LinkToken.abi ../../../contracts/solc/v0.8.19/LinkToken.bin LinkToken link_token //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/ERC20.abi ../../../contracts/solc/v0.8.19/ERC20.bin ERC20 erc20 +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/WERC20Mock.abi ../../../contracts/solc/v0.8.19/WERC20Mock.bin WERC20Mock werc20_mock diff --git a/integration-tests/contracts/contract_deployer.go b/integration-tests/contracts/contract_deployer.go index dcf81edede7..e92b3870faf 100644 --- a/integration-tests/contracts/contract_deployer.go +++ b/integration-tests/contracts/contract_deployer.go @@ -51,6 +51,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/oracle_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/test_api_consumer_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/upkeep_transcoder" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/fee_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/reward_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/werc20_mock" ) // ContractDeployer is an interface for abstracting the contract deployment methods across network implementations @@ -60,6 +65,7 @@ type ContractDeployer interface { DeployFlags(rac string) (Flags, error) DeployFluxAggregatorContract(linkAddr string, fluxOptions FluxAggregatorOptions) (FluxAggregator, error) DeployLinkTokenContract() (LinkToken, error) + DeployWERC20Mock() (WERC20Mock, error) LoadLinkToken(address common.Address) (LinkToken, error) DeployOffChainAggregator(linkAddr string, offchainOptions OffchainOptions) (OffchainAggregator, error) LoadOffChainAggregator(address *common.Address) (OffchainAggregator, error) @@ -117,6 +123,10 @@ type ContractDeployer interface { DeployKeeperRegistry11Mock() (KeeperRegistry11Mock, error) DeployKeeperRegistrar12Mock() (KeeperRegistrar12Mock, error) DeployKeeperGasWrapperMock() (KeeperGasWrapperMock, error) + DeployMercuryVerifierContract(verifierProxyAddr common.Address) (MercuryVerifier, error) + DeployMercuryVerifierProxyContract(accessControllerAddr common.Address) (MercuryVerifierProxy, error) + DeployMercuryFeeManager(linkAddress common.Address, nativeAddress common.Address, proxyAddress common.Address, rewardManagerAddress common.Address) (MercuryFeeManager, error) + DeployMercuryRewardManager(linkAddress common.Address) (MercuryRewardManager, error) } // NewContractDeployer returns an instance of a contract deployer based on the client type @@ -1436,3 +1446,93 @@ func (e *EthereumContractDeployer) DeployOffchainAggregatorV2( l: e.l, }, err } + +func (e *EthereumContractDeployer) DeployMercuryVerifierContract(verifierProxyAddr common.Address) (MercuryVerifier, error) { + address, _, instance, err := e.client.DeployContract("Mercury Verifier", func( + auth *bind.TransactOpts, + backend bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return verifier.DeployVerifier(auth, backend, verifierProxyAddr) + }) + if err != nil { + return nil, err + } + return &EthereumMercuryVerifier{ + client: e.client, + instance: instance.(*verifier.Verifier), + address: *address, + l: e.l, + }, err +} + +func (e *EthereumContractDeployer) DeployMercuryVerifierProxyContract(accessControllerAddr common.Address) (MercuryVerifierProxy, error) { + address, _, instance, err := e.client.DeployContract("Mercury Verifier Proxy", func( + auth *bind.TransactOpts, + backend bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return verifier_proxy.DeployVerifierProxy(auth, backend, accessControllerAddr) + }) + if err != nil { + return nil, err + } + return &EthereumMercuryVerifierProxy{ + client: e.client, + instance: instance.(*verifier_proxy.VerifierProxy), + address: *address, + l: e.l, + }, err +} + +func (e *EthereumContractDeployer) DeployMercuryFeeManager(linkAddress common.Address, nativeAddress common.Address, proxyAddress common.Address, rewardManagerAddress common.Address) (MercuryFeeManager, error) { + address, _, instance, err := e.client.DeployContract("Mercury Fee Manager", func( + auth *bind.TransactOpts, + backend bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return fee_manager.DeployFeeManager(auth, backend, linkAddress, nativeAddress, proxyAddress, rewardManagerAddress) + }) + if err != nil { + return nil, err + } + return &EthereumMercuryFeeManager{ + client: e.client, + instance: instance.(*fee_manager.FeeManager), + address: *address, + l: e.l, + }, err +} + +func (e *EthereumContractDeployer) DeployMercuryRewardManager(linkAddress common.Address) (MercuryRewardManager, error) { + address, _, instance, err := e.client.DeployContract("Mercury Reward Manager", func( + auth *bind.TransactOpts, + backend bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return reward_manager.DeployRewardManager(auth, backend, linkAddress) + }) + if err != nil { + return nil, err + } + return &EthereumMercuryRewardManager{ + client: e.client, + instance: instance.(*reward_manager.RewardManager), + address: *address, + l: e.l, + }, err +} + +func (e *EthereumContractDeployer) DeployWERC20Mock() (WERC20Mock, error) { + address, _, instance, err := e.client.DeployContract("WERC20 Mock", func( + auth *bind.TransactOpts, + backend bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return werc20_mock.DeployWERC20Mock(auth, backend) + }) + if err != nil { + return nil, err + } + return &EthereumWERC20Mock{ + client: e.client, + instance: instance.(*werc20_mock.WERC20Mock), + address: *address, + l: e.l, + }, err +} diff --git a/integration-tests/contracts/contract_loader.go b/integration-tests/contracts/contract_loader.go index a790747e38d..fc0272b107e 100644 --- a/integration-tests/contracts/contract_loader.go +++ b/integration-tests/contracts/contract_loader.go @@ -14,8 +14,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/authorized_forwarder" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/operator_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/fee_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/reward_manager" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/werc20_mock" ) // ContractLoader is an interface for abstracting the contract loading methods across network implementations @@ -30,8 +33,12 @@ type ContractLoader interface { LoadFunctionsLoadTestClient(addr string) (FunctionsLoadTestClient, error) // Mercury - LoadMercuryVerifier(addr string) (MercuryVerifier, error) - LoadMercuryVerifierProxy(addr string) (MercuryVerifierProxy, error) + LoadMercuryVerifier(addr common.Address) (MercuryVerifier, error) + LoadMercuryVerifierProxy(addr common.Address) (MercuryVerifierProxy, error) + LoadMercuryFeeManager(addr common.Address) (MercuryFeeManager, error) + LoadMercuryRewardManager(addr common.Address) (MercuryRewardManager, error) + + LoadWERC20Mock(addr common.Address) (WERC20Mock, error) } // NewContractLoader returns an instance of a contract Loader based on the client type @@ -204,8 +211,8 @@ func (e *EthereumContractLoader) LoadAuthorizedForwarder(address common.Address) } // LoadMercuryVerifier returns Verifier contract deployed on given address -func (e *EthereumContractLoader) LoadMercuryVerifier(addr string) (MercuryVerifier, error) { - instance, err := e.client.LoadContract("Mercury Verifier", common.HexToAddress(addr), func( +func (e *EthereumContractLoader) LoadMercuryVerifier(addr common.Address) (MercuryVerifier, error) { + instance, err := e.client.LoadContract("Mercury Verifier", addr, func( address common.Address, backend bind.ContractBackend, ) (interface{}, error) { @@ -217,13 +224,13 @@ func (e *EthereumContractLoader) LoadMercuryVerifier(addr string) (MercuryVerifi return &EthereumMercuryVerifier{ client: e.client, instance: instance.(*verifier.Verifier), - address: common.HexToAddress(addr), + address: addr, }, err } // LoadMercuryVerifierProxy returns VerifierProxy contract deployed on given address -func (e *EthereumContractLoader) LoadMercuryVerifierProxy(addr string) (MercuryVerifierProxy, error) { - instance, err := e.client.LoadContract("Mercury Verifier Proxy", common.HexToAddress(addr), func( +func (e *EthereumContractLoader) LoadMercuryVerifierProxy(addr common.Address) (MercuryVerifierProxy, error) { + instance, err := e.client.LoadContract("Mercury Verifier Proxy", addr, func( address common.Address, backend bind.ContractBackend, ) (interface{}, error) { @@ -235,6 +242,57 @@ func (e *EthereumContractLoader) LoadMercuryVerifierProxy(addr string) (MercuryV return &EthereumMercuryVerifierProxy{ client: e.client, instance: instance.(*verifier_proxy.VerifierProxy), - address: common.HexToAddress(addr), + address: addr, + }, err +} + +func (e *EthereumContractLoader) LoadMercuryFeeManager(addr common.Address) (MercuryFeeManager, error) { + instance, err := e.client.LoadContract("Mercury Fee Manager", addr, func( + address common.Address, + backend bind.ContractBackend, + ) (interface{}, error) { + return fee_manager.NewFeeManager(address, backend) + }) + if err != nil { + return nil, err + } + return &EthereumMercuryFeeManager{ + client: e.client, + instance: instance.(*fee_manager.FeeManager), + address: addr, + }, err +} + +func (e *EthereumContractLoader) LoadMercuryRewardManager(addr common.Address) (MercuryRewardManager, error) { + instance, err := e.client.LoadContract("Mercury Reward Manager", addr, func( + address common.Address, + backend bind.ContractBackend, + ) (interface{}, error) { + return reward_manager.NewRewardManager(address, backend) + }) + if err != nil { + return nil, err + } + return &EthereumMercuryRewardManager{ + client: e.client, + instance: instance.(*reward_manager.RewardManager), + address: addr, + }, err +} + +func (e *EthereumContractLoader) LoadWERC20Mock(addr common.Address) (WERC20Mock, error) { + instance, err := e.client.LoadContract("WERC20 Mock", addr, func( + address common.Address, + backend bind.ContractBackend, + ) (interface{}, error) { + return werc20_mock.NewWERC20Mock(address, backend) + }) + if err != nil { + return nil, err + } + return &EthereumWERC20Mock{ + client: e.client, + instance: instance.(*werc20_mock.WERC20Mock), + address: addr, }, err } diff --git a/integration-tests/contracts/contract_models.go b/integration-tests/contracts/contract_models.go index 9f1130dce9f..51fce7cb120 100644 --- a/integration-tests/contracts/contract_models.go +++ b/integration-tests/contracts/contract_models.go @@ -17,6 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/functions_billing_registry_events_mock" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/operator_factory" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" ) type FluxAggregatorOptions struct { @@ -369,12 +370,33 @@ type FunctionsLoadTestClient interface { } type MercuryVerifier interface { - Address() string + Address() common.Address Verify(signedReport []byte, sender common.Address) error + SetConfig(feedId [32]byte, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []verifier.CommonAddressAndWeight) (*types.Transaction, error) + LatestConfigDetails(ctx context.Context, feedId [32]byte) (verifier.LatestConfigDetails, error) } type MercuryVerifierProxy interface { - Address() string + Address() common.Address + InitializeVerifier(verifierAddress common.Address) (*types.Transaction, error) Verify(signedReport []byte, parameterPayload []byte, value *big.Int) (*types.Transaction, error) VerifyBulk(signedReports [][]byte, parameterPayload []byte, value *big.Int) (*types.Transaction, error) + SetFeeManager(feeManager common.Address) (*types.Transaction, error) +} + +type MercuryFeeManager interface { + Address() common.Address +} + +type MercuryRewardManager interface { + Address() common.Address + SetFeeManager(feeManager common.Address) (*types.Transaction, error) +} + +type WERC20Mock interface { + Address() common.Address + BalanceOf(ctx context.Context, addr string) (*big.Int, error) + Approve(to string, amount *big.Int) error + Transfer(to string, amount *big.Int) error + Mint(account common.Address, amount *big.Int) (*types.Transaction, error) } diff --git a/integration-tests/contracts/ethereum_contracts.go b/integration-tests/contracts/ethereum_contracts.go index d3db6913c50..fdeccfedad1 100644 --- a/integration-tests/contracts/ethereum_contracts.go +++ b/integration-tests/contracts/ethereum_contracts.go @@ -47,8 +47,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/operator_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/oracle_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/test_api_consumer_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/fee_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/reward_manager" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/werc20_mock" ) // EthereumOracle oracle for "directrequest" job tests @@ -2269,10 +2272,11 @@ type EthereumMercuryVerifier struct { address common.Address client blockchain.EVMClient instance *verifier.Verifier + l zerolog.Logger } -func (e *EthereumMercuryVerifier) Address() string { - return e.address.Hex() +func (e *EthereumMercuryVerifier) Address() common.Address { + return e.address } func (e *EthereumMercuryVerifier) Verify(signedReport []byte, sender common.Address) error { @@ -2287,14 +2291,57 @@ func (e *EthereumMercuryVerifier) Verify(signedReport []byte, sender common.Addr return e.client.ProcessTransaction(tx) } +func (e *EthereumMercuryVerifier) SetConfig(feedId [32]byte, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []verifier.CommonAddressAndWeight) (*types.Transaction, error) { + opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) + if err != nil { + return nil, err + } + tx, err := e.instance.SetConfig(opts, feedId, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, recipientAddressesAndWeights) + e.l.Info().Err(err).Str("contractAddress", e.address.Hex()).Hex("feedId", feedId[:]).Msg("Called EthereumMercuryVerifier.SetConfig()") + if err != nil { + return nil, err + } + return tx, e.client.ProcessTransaction(tx) +} + +func (e *EthereumMercuryVerifier) LatestConfigDetails(ctx context.Context, feedId [32]byte) (verifier.LatestConfigDetails, error) { + opts := &bind.CallOpts{ + From: common.HexToAddress(e.client.GetDefaultWallet().Address()), + Context: ctx, + } + d, err := e.instance.LatestConfigDetails(opts, feedId) + e.l.Info().Err(err).Str("contractAddress", e.address.Hex()).Hex("feedId", feedId[:]). + Interface("details", d). + Msg("Called EthereumMercuryVerifier.LatestConfigDetails()") + if err != nil { + return verifier.LatestConfigDetails{}, err + } + return d, nil +} + type EthereumMercuryVerifierProxy struct { address common.Address client blockchain.EVMClient instance *verifier_proxy.VerifierProxy + l zerolog.Logger } -func (e *EthereumMercuryVerifierProxy) Address() string { - return e.address.Hex() +func (e *EthereumMercuryVerifierProxy) Address() common.Address { + return e.address +} + +func (e *EthereumMercuryVerifierProxy) InitializeVerifier(verifierAddress common.Address) (*types.Transaction, error) { + opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) + if err != nil { + return nil, err + } + tx, err := e.instance.InitializeVerifier(opts, verifierAddress) + e.l.Info().Err(err).Str("contractAddress", e.address.Hex()).Str("verifierAddress", verifierAddress.Hex()). + Msg("Called EthereumMercuryVerifierProxy.InitializeVerifier()") + if err != nil { + return nil, err + } + return tx, e.client.ProcessTransaction(tx) } func (e *EthereumMercuryVerifierProxy) Verify(signedReport []byte, parameterPayload []byte, value *big.Int) (*types.Transaction, error) { @@ -2305,7 +2352,7 @@ func (e *EthereumMercuryVerifierProxy) Verify(signedReport []byte, parameterPayl if err != nil { return nil, err } - tx, err := e.instance.Verify(opts, parameterPayload, signedReport) + tx, err := e.instance.Verify(opts, signedReport, parameterPayload) if err != nil { return nil, err } @@ -2326,3 +2373,126 @@ func (e *EthereumMercuryVerifierProxy) VerifyBulk(signedReports [][]byte, parame } return tx, e.client.ProcessTransaction(tx) } + +func (e *EthereumMercuryVerifierProxy) SetFeeManager(feeManager common.Address) (*types.Transaction, error) { + opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) + if err != nil { + return nil, err + } + tx, err := e.instance.SetFeeManager(opts, feeManager) + e.l.Info().Err(err).Str("feeManager", feeManager.Hex()).Msg("Called MercuryVerifierProxy.SetFeeManager()") + if err != nil { + return nil, err + } + return tx, e.client.ProcessTransaction(tx) +} + +type EthereumMercuryFeeManager struct { + address common.Address + client blockchain.EVMClient + instance *fee_manager.FeeManager + l zerolog.Logger +} + +func (e *EthereumMercuryFeeManager) Address() common.Address { + return e.address +} + +type EthereumMercuryRewardManager struct { + address common.Address + client blockchain.EVMClient + instance *reward_manager.RewardManager + l zerolog.Logger +} + +func (e *EthereumMercuryRewardManager) Address() common.Address { + return e.address +} + +func (e *EthereumMercuryRewardManager) SetFeeManager(feeManager common.Address) (*types.Transaction, error) { + opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) + if err != nil { + return nil, err + } + tx, err := e.instance.SetFeeManager(opts, feeManager) + e.l.Info().Err(err).Str("feeManager", feeManager.Hex()).Msg("Called EthereumMercuryRewardManager.SetFeeManager()") + if err != nil { + return nil, err + } + return tx, e.client.ProcessTransaction(tx) +} + +type EthereumWERC20Mock struct { + address common.Address + client blockchain.EVMClient + instance *werc20_mock.WERC20Mock + l zerolog.Logger +} + +func (e *EthereumWERC20Mock) Address() common.Address { + return e.address +} + +func (l *EthereumWERC20Mock) Approve(to string, amount *big.Int) error { + opts, err := l.client.TransactionOpts(l.client.GetDefaultWallet()) + if err != nil { + return err + } + l.l.Info(). + Str("From", l.client.GetDefaultWallet().Address()). + Str("To", to). + Str("Amount", amount.String()). + Uint64("Nonce", opts.Nonce.Uint64()). + Msg("Approving LINK Transfer") + tx, err := l.instance.Approve(opts, common.HexToAddress(to), amount) + if err != nil { + return err + } + return l.client.ProcessTransaction(tx) +} + +func (l *EthereumWERC20Mock) BalanceOf(ctx context.Context, addr string) (*big.Int, error) { + opts := &bind.CallOpts{ + From: common.HexToAddress(l.client.GetDefaultWallet().Address()), + Context: ctx, + } + balance, err := l.instance.BalanceOf(opts, common.HexToAddress(addr)) + if err != nil { + return nil, err + } + return balance, nil +} + +func (l *EthereumWERC20Mock) Transfer(to string, amount *big.Int) error { + opts, err := l.client.TransactionOpts(l.client.GetDefaultWallet()) + if err != nil { + return err + } + l.l.Info(). + Str("From", l.client.GetDefaultWallet().Address()). + Str("To", to). + Str("Amount", amount.String()). + Uint64("Nonce", opts.Nonce.Uint64()). + Msg("EthereumWERC20Mock.Transfer()") + tx, err := l.instance.Transfer(opts, common.HexToAddress(to), amount) + if err != nil { + return err + } + return l.client.ProcessTransaction(tx) +} + +func (l *EthereumWERC20Mock) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + opts, err := l.client.TransactionOpts(l.client.GetDefaultWallet()) + if err != nil { + return nil, err + } + l.l.Info(). + Str("account", account.Hex()). + Str("amount", amount.String()). + Msg("EthereumWERC20Mock.Mint()") + tx, err := l.instance.Mint(opts, account, amount) + if err != nil { + return tx, err + } + return tx, l.client.ProcessTransaction(tx) +} From 5233de330fc25a916566a12dddd87b2a3dd30cd5 Mon Sep 17 00:00:00 2001 From: george-dorin <120329946+george-dorin@users.noreply.github.com> Date: Fri, 29 Sep 2023 16:37:54 +0300 Subject: [PATCH 35/84] Fix enhanced EA Mercury telemetry prices are 0 when task result is not float64 (#10828) * Use utils.ToDecimal instead of casting to float64 * Add CHANGELOG * - Update logging --- core/services/ocrcommon/telemetry.go | 34 +++++++++++++++-------- core/services/ocrcommon/telemetry_test.go | 6 ++-- docs/CHANGELOG.md | 1 + 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/core/services/ocrcommon/telemetry.go b/core/services/ocrcommon/telemetry.go index 3a0ba049036..54a5002093d 100644 --- a/core/services/ocrcommon/telemetry.go +++ b/core/services/ocrcommon/telemetry.go @@ -354,7 +354,7 @@ func ShouldCollectEnhancedTelemetryMercury(job *job.Job) bool { // bid and ask. This functions expects the pipeline.TaskRunResults to be correctly ordered func (e *EnhancedTelemetryService[T]) getPricesFromResults(startTask pipeline.TaskRunResult, allTasks *pipeline.TaskRunResults) (float64, float64, float64) { var benchmarkPrice, askPrice, bidPrice float64 - var ok bool + var err error //We rely on task results to be sorted in the correct order benchmarkPriceTask := allTasks.GetNextTaskOf(startTask) if benchmarkPriceTask == nil { @@ -365,9 +365,9 @@ func (e *EnhancedTelemetryService[T]) getPricesFromResults(startTask pipeline.Ta if benchmarkPriceTask.Result.Error != nil { e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry benchmark price, job %d, id %s: %s", e.job.ID, benchmarkPriceTask.Task.DotID(), benchmarkPriceTask.Result.Error), "err", benchmarkPriceTask.Result.Error) } else { - benchmarkPrice, ok = benchmarkPriceTask.Result.Value.(float64) - if !ok { - e.lggr.Warnf("cannot parse enhanced EA telemetry benchmark price, job %d, id %s (expected float64, got type: %T)", e.job.ID, benchmarkPriceTask.Task.DotID(), benchmarkPriceTask.Result.Value) + benchmarkPrice, err = getResultFloat64(benchmarkPriceTask) + if err != nil { + e.lggr.Warnw(fmt.Sprintf("cannot parse enhanced EA telemetry benchmark price, job %d, id %s", e.job.ID, benchmarkPriceTask.Task.DotID()), "err", err) } } } @@ -375,15 +375,15 @@ func (e *EnhancedTelemetryService[T]) getPricesFromResults(startTask pipeline.Ta bidTask := allTasks.GetNextTaskOf(*benchmarkPriceTask) if bidTask == nil { e.lggr.Warnf("cannot parse enhanced EA telemetry bid price, task is nil, job %d, id %s", e.job.ID) - return 0, 0, 0 + return benchmarkPrice, 0, 0 } if bidTask.Task.Type() == pipeline.TaskTypeJSONParse { if bidTask.Result.Error != nil { e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry bid price, job %d, id %s: %s", e.job.ID, bidTask.Task.DotID(), bidTask.Result.Error), "err", bidTask.Result.Error) } else { - bidPrice, ok = bidTask.Result.Value.(float64) - if !ok { - e.lggr.Warnf("cannot parse enhanced EA telemetry bid price, job %d, id %s (expected float64, got type: %T)", e.job.ID, bidTask.Task.DotID(), bidTask.Result.Value) + bidPrice, err = getResultFloat64(bidTask) + if err != nil { + e.lggr.Warnw(fmt.Sprintf("cannot parse enhanced EA telemetry bid price, job %d, id %s", e.job.ID, bidTask.Task.DotID()), "err", err) } } } @@ -391,15 +391,15 @@ func (e *EnhancedTelemetryService[T]) getPricesFromResults(startTask pipeline.Ta askTask := allTasks.GetNextTaskOf(*bidTask) if askTask == nil { e.lggr.Warnf("cannot parse enhanced EA telemetry ask price, task is nil, job %d, id %s", e.job.ID) - return 0, 0, 0 + return benchmarkPrice, bidPrice, 0 } if askTask.Task.Type() == pipeline.TaskTypeJSONParse { if bidTask.Result.Error != nil { e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry ask price, job %d, id %s: %s", e.job.ID, askTask.Task.DotID(), askTask.Result.Error), "err", askTask.Result.Error) } else { - askPrice, ok = askTask.Result.Value.(float64) - if !ok { - e.lggr.Warnf("cannot parse enhanced EA telemetry ask price, job %d, id %s (expected float64, got type: %T)", e.job.ID, askTask.Task.DotID(), askTask.Result.Value) + askPrice, err = getResultFloat64(askTask) + if err != nil { + e.lggr.Warnw(fmt.Sprintf("cannot parse enhanced EA telemetry ask price, job %d, id %s", e.job.ID, askTask.Task.DotID()), "err", err) } } } @@ -431,3 +431,13 @@ func EnqueueEnhancedTelem[T EnhancedTelemetryData | EnhancedTelemetryMercuryData default: } } + +// getResultFloat64 will check the result type and force it to float64 or returns an error if the conversion cannot be made +func getResultFloat64(task *pipeline.TaskRunResult) (float64, error) { + result, err := utils.ToDecimal(task.Result.Value) + if err != nil { + return 0, err + } + resultFloat64, _ := result.Float64() + return resultFloat64, nil +} diff --git a/core/services/ocrcommon/telemetry_test.go b/core/services/ocrcommon/telemetry_test.go index e7c41c46761..495dc6fe788 100644 --- a/core/services/ocrcommon/telemetry_test.go +++ b/core/services/ocrcommon/telemetry_test.go @@ -416,7 +416,7 @@ var trrsMercury = pipeline.TaskRunResults{ BaseTask: pipeline.NewBaseTask(3, "ds3_ask", nil, nil, 3), }, Result: pipeline.Result{ - Value: float64(123456789.1), + Value: int64(321123), }, }, } @@ -461,7 +461,7 @@ func TestGetPricesFromResults(t *testing.T) { benchmarkPrice, bid, ask := e.getPricesFromResults(trrsMercury[0], &trrsMercury) require.Equal(t, 123456.123456, benchmarkPrice) require.Equal(t, 1234567.1234567, bid) - require.Equal(t, 123456789.1, ask) + require.Equal(t, float64(321123), ask) benchmarkPrice, bid, ask = e.getPricesFromResults(trrsMercury[0], &pipeline.TaskRunResults{}) require.Equal(t, float64(0), benchmarkPrice) @@ -601,7 +601,7 @@ func TestCollectMercuryEnhancedTelemetry(t *testing.T) { DataSource: "data-source-name", DpBenchmarkPrice: 123456.123456, DpBid: 1234567.1234567, - DpAsk: 123456789.1, + DpAsk: 321123, CurrentBlockNumber: 123456789, CurrentBlockHash: common.HexToHash("0x123321").String(), CurrentBlockTimestamp: 987654321, diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 299e248428c..64bace19935 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -41,6 +41,7 @@ All nodes will have to remove the following configuration field: `ExplorerURL` - Fixed a bug where `evmChainId` is requested instead of `id` or `evm-chain-id` in CLI error verbatim - Fixed a bug that would cause the node to shut down while performing backup - Fixed health checker to include more services in the prometheus `health` metric and HTTP `/health` endpoint +- Fixed a bug where prices would not be parsed correctly in telemetry data From 55c7baa1181aaa04026b4a1043117596c4e31e5a Mon Sep 17 00:00:00 2001 From: Tate Date: Fri, 29 Sep 2023 11:22:51 -0600 Subject: [PATCH 36/84] [TT-414] Test Env E2E Builder Changes for Non EVM Chains (#10753) * [TT-414] Test Env E2E Builder Changes for Non Geth Chains * Add comments to new functions * Merge conflict fixes --- .github/workflows/integration-tests.yml | 2 +- integration-tests/docker/test_env/test_env.go | 35 ++-- .../docker/test_env/test_env_builder.go | 155 ++++++++++-------- 3 files changed, 104 insertions(+), 88 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 60a751a8c07..aee2fb2edee 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -674,7 +674,7 @@ jobs: strategy: matrix: image: - - name: (base) + - name: (legacy) tag-suffix: "" - name: (plugins) tag-suffix: -plugins diff --git a/integration-tests/docker/test_env/test_env.go b/integration-tests/docker/test_env/test_env.go index 7f805f5fb8a..88b32f85be3 100644 --- a/integration-tests/docker/test_env/test_env.go +++ b/integration-tests/docker/test_env/test_env.go @@ -60,15 +60,25 @@ func NewTestEnv() (*CLClusterTestEnv, error) { if err != nil { return nil, err } - networks := []string{network.Name} + n := []string{network.Name} return &CLClusterTestEnv{ + Geth: test_env.NewGeth(n), + MockServer: test_env.NewMockServer(n), Network: network, - Geth: test_env.NewGeth(networks), - MockServer: test_env.NewMockServer(networks), l: log.Logger, }, nil } +// WithTestEnvConfig sets the test environment cfg. +// Sets up the Geth and MockServer containers with the provided cfg. +func (te *CLClusterTestEnv) WithTestEnvConfig(cfg *TestEnvConfig) *CLClusterTestEnv { + te.Cfg = cfg + n := []string{te.Network.Name} + te.Geth = test_env.NewGeth(n, test_env.WithContainerName(cfg.Geth.ContainerName)) + te.MockServer = test_env.NewMockServer(n, test_env.WithContainerName(cfg.MockServer.ContainerName)) + return te +} + func (te *CLClusterTestEnv) WithTestLogger(t *testing.T) *CLClusterTestEnv { te.t = t te.l = logging.GetTestLogger(t) @@ -77,23 +87,6 @@ func (te *CLClusterTestEnv) WithTestLogger(t *testing.T) *CLClusterTestEnv { return te } -func NewTestEnvFromCfg(l zerolog.Logger, cfg *TestEnvConfig) (*CLClusterTestEnv, error) { - utils.SetupCoreDockerEnvLogger() - network, err := docker.CreateNetwork(log.Logger) - if err != nil { - return nil, err - } - networks := []string{network.Name} - l.Info().Interface("Cfg", cfg).Send() - return &CLClusterTestEnv{ - Cfg: cfg, - Network: network, - Geth: test_env.NewGeth(networks, test_env.WithContainerName(cfg.Geth.ContainerName)), - MockServer: test_env.NewMockServer(networks, test_env.WithContainerName(cfg.MockServer.ContainerName)), - l: log.Logger, - }, nil -} - func (te *CLClusterTestEnv) ParallelTransactions(enabled bool) { te.EVMClient.ParallelTransactions(enabled) } @@ -124,7 +117,7 @@ func (te *CLClusterTestEnv) StartPrivateChain() error { for _, chain := range te.PrivateChain { primaryNode := chain.GetPrimaryNode() if primaryNode == nil { - return errors.WithStack(fmt.Errorf("Primary node is nil in PrivateChain interface")) + return errors.WithStack(fmt.Errorf("primary node is nil in PrivateChain interface")) } err := primaryNode.Start() if err != nil { diff --git a/integration-tests/docker/test_env/test_env_builder.go b/integration-tests/docker/test_env/test_env_builder.go index 19fd49fe11a..7eeeff2489f 100644 --- a/integration-tests/docker/test_env/test_env_builder.go +++ b/integration-tests/docker/test_env/test_env_builder.go @@ -35,6 +35,8 @@ type CLTestEnvBuilder struct { defaultNodeCsaKeys []string l zerolog.Logger t *testing.T + te *CLClusterTestEnv + isNonEVM bool /* funding */ ETHFunds *big.Float @@ -47,6 +49,38 @@ func NewCLTestEnvBuilder() *CLTestEnvBuilder { } } +// WithTestEnv sets the test environment to use for the test. +// If nil, a new test environment is created. +// If not nil, the test environment is used as-is. +// If TEST_ENV_CONFIG_PATH is set, the test environment is created with the config at that path. +func (b *CLTestEnvBuilder) WithTestEnv(te *CLClusterTestEnv) (*CLTestEnvBuilder, error) { + envConfigPath, isSet := os.LookupEnv("TEST_ENV_CONFIG_PATH") + var cfg *TestEnvConfig + var err error + if isSet { + cfg, err = NewTestEnvConfigFromFile(envConfigPath) + if err != nil { + return nil, err + } + } + + if te != nil { + b.te = te + } else { + b.te, err = NewTestEnv() + if err != nil { + return nil, err + } + } + + if cfg != nil { + b.te = b.te.WithTestEnvConfig(cfg) + } + return b, nil +} + +// WithTestLogger sets the test logger to use for the test. +// Useful for parallel tests so the logging will be separated correctly in the results views. func (b *CLTestEnvBuilder) WithTestLogger(t *testing.T) *CLTestEnvBuilder { b.t = t b.l = logging.GetTestLogger(t) @@ -99,20 +133,20 @@ func (b *CLTestEnvBuilder) WithMockServer(externalAdapterCount int) *CLTestEnvBu return b } +// WithNonEVM sets the test environment to not use EVM when built. +func (b *CLTestEnvBuilder) WithNonEVM() *CLTestEnvBuilder { + b.isNonEVM = true + return b +} + func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { - envConfigPath, isSet := os.LookupEnv("TEST_ENV_CONFIG_PATH") - if isSet { - cfg, err := NewTestEnvConfigFromFile(envConfigPath) + if b.te == nil { + var err error + b, err = b.WithTestEnv(nil) if err != nil { return nil, err } - _ = os.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true") - return b.buildNewEnv(cfg) } - return b.buildNewEnv(nil) -} - -func (b *CLTestEnvBuilder) buildNewEnv(cfg *TestEnvConfig) (*CLClusterTestEnv, error) { b.l.Info(). Bool("hasGeth", b.hasGeth). Bool("hasMockServer", b.hasMockServer). @@ -122,52 +156,39 @@ func (b *CLTestEnvBuilder) buildNewEnv(cfg *TestEnvConfig) (*CLClusterTestEnv, e Strs("defaultNodeCsaKeys", b.defaultNodeCsaKeys). Msg("Building CL cluster test environment..") - var te *CLClusterTestEnv var err error - if cfg != nil { - te, err = NewTestEnvFromCfg(b.l, cfg) - if err != nil { - return nil, err - } - } else { - te, err = NewTestEnv() - if err != nil { - return nil, err - } - } - if b.t != nil { - te.WithTestLogger(b.t) + b.te.WithTestLogger(b.t) } if b.hasLogWatch { - te.LogWatch, err = logwatch.NewLogWatch(nil, nil) + b.te.LogWatch, err = logwatch.NewLogWatch(nil, nil) if err != nil { return nil, err } } if b.hasMockServer { - err = te.StartMockServer() + err = b.te.StartMockServer() if err != nil { return nil, err } - err = te.MockServer.SetExternalAdapterMocks(b.externalAdapterCount) + err = b.te.MockServer.SetExternalAdapterMocks(b.externalAdapterCount) if err != nil { return nil, err } } if b.nonDevGethNetworks != nil { - te.WithPrivateChain(b.nonDevGethNetworks) - err := te.StartPrivateChain() + b.te.WithPrivateChain(b.nonDevGethNetworks) + err := b.te.StartPrivateChain() if err != nil { - return te, err + return b.te, err } var nonDevNetworks []blockchain.EVMNetwork - for i, n := range te.PrivateChain { + for i, n := range b.te.PrivateChain { primaryNode := n.GetPrimaryNode() if primaryNode == nil { - return te, errors.WithStack(fmt.Errorf("Primary node is nil in PrivateChain interface")) + return b.te, errors.WithStack(fmt.Errorf("primary node is nil in PrivateChain interface")) } nonDevNetworks = append(nonDevNetworks, *n.GetNetworkConfig()) nonDevNetworks[i].URLs = []string{primaryNode.GetInternalWsUrl()} @@ -177,40 +198,41 @@ func (b *CLTestEnvBuilder) buildNewEnv(cfg *TestEnvConfig) (*CLClusterTestEnv, e return nil, errors.New("cannot create nodes with custom config without nonDevNetworks") } - err = te.StartClNodes(b.clNodeConfig, b.clNodesCount, b.secretsConfig) + err = b.te.StartClNodes(b.clNodeConfig, b.clNodesCount, b.secretsConfig) if err != nil { return nil, err } - return te, nil + return b.te, nil } networkConfig := networks.SelectedNetwork var internalDockerUrls test_env.InternalDockerUrls if b.hasGeth && networkConfig.Simulated { - networkConfig, internalDockerUrls, err = te.StartGeth() + networkConfig, internalDockerUrls, err = b.te.StartGeth() if err != nil { return nil, err } } - bc, err := blockchain.NewEVMClientFromNetwork(networkConfig, b.l) - if err != nil { - return nil, err - } - - te.EVMClient = bc + if !b.isNonEVM { + bc, err := blockchain.NewEVMClientFromNetwork(networkConfig, b.l) + if err != nil { + return nil, err + } - cd, err := contracts.NewContractDeployer(bc, b.l) - if err != nil { - return nil, err - } - te.ContractDeployer = cd + b.te.EVMClient = bc + cd, err := contracts.NewContractDeployer(bc, b.l) + if err != nil { + return nil, err + } + b.te.ContractDeployer = cd - cl, err := contracts.NewContractLoader(bc, b.l) - if err != nil { - return nil, err + cl, err := contracts.NewContractLoader(bc, b.l) + if err != nil { + return nil, err + } + b.te.ContractLoader = cl } - te.ContractLoader = cl var nodeCsaKeys []string @@ -225,26 +247,27 @@ func (b *CLTestEnvBuilder) buildNewEnv(cfg *TestEnvConfig) (*CLClusterTestEnv, e node.WithP2Pv1(), ) } - //node.SetDefaultSimulatedGeth(cfg, te.Geth.InternalWsUrl, te.Geth.InternalHttpUrl, b.hasForwarders) - var httpUrls []string - var wsUrls []string - if networkConfig.Simulated { - httpUrls = []string{internalDockerUrls.HttpUrl} - wsUrls = []string{internalDockerUrls.WsUrl} - } else { - httpUrls = networkConfig.HTTPURLs - wsUrls = networkConfig.URLs - } + if !b.isNonEVM { + var httpUrls []string + var wsUrls []string + if networkConfig.Simulated { + httpUrls = []string{internalDockerUrls.HttpUrl} + wsUrls = []string{internalDockerUrls.WsUrl} + } else { + httpUrls = networkConfig.HTTPURLs + wsUrls = networkConfig.URLs + } - node.SetChainConfig(cfg, wsUrls, httpUrls, networkConfig, b.hasForwarders) + node.SetChainConfig(cfg, wsUrls, httpUrls, networkConfig, b.hasForwarders) + } - err := te.StartClNodes(cfg, b.clNodesCount, b.secretsConfig) + err := b.te.StartClNodes(cfg, b.clNodesCount, b.secretsConfig) if err != nil { return nil, err } - nodeCsaKeys, err = te.GetNodeCSAKeys() + nodeCsaKeys, err = b.te.GetNodeCSAKeys() if err != nil { return nil, err } @@ -252,12 +275,12 @@ func (b *CLTestEnvBuilder) buildNewEnv(cfg *TestEnvConfig) (*CLClusterTestEnv, e } if b.hasGeth && b.clNodesCount > 0 && b.ETHFunds != nil { - te.ParallelTransactions(true) - defer te.ParallelTransactions(false) - if err := te.FundChainlinkNodes(b.ETHFunds); err != nil { + b.te.ParallelTransactions(true) + defer b.te.ParallelTransactions(false) + if err := b.te.FundChainlinkNodes(b.ETHFunds); err != nil { return nil, err } } - return te, nil + return b.te, nil } From 6ae09dc36d0d40ccffd4026520915a1cf4fa5abe Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:03:48 -0700 Subject: [PATCH 37/84] updates to bump chainlink-env and new chainlink charts (#10831) * updates to bump chainlink-env and new chainlink charts * more fixes * update to chaos tests * update replica data type --- .../chaos/automation_chaos_test.go | 8 +++---- integration-tests/chaos/ocr2vrf_chaos_test.go | 6 ++--- integration-tests/chaos/ocr_chaos_test.go | 8 +++---- integration-tests/go.mod | 12 +++++----- integration-tests/go.sum | 23 ++++++++++--------- integration-tests/performance/cron_test.go | 11 +++++---- .../performance/directrequest_test.go | 11 +++++---- integration-tests/performance/flux_test.go | 11 +++++---- integration-tests/performance/keeper_test.go | 11 +++++---- integration-tests/performance/ocr_test.go | 11 +++++---- integration-tests/performance/vrf_test.go | 8 +++---- .../reorg/automation_reorg_test.go | 10 ++++---- integration-tests/reorg/reorg_test.go | 9 ++++---- integration-tests/smoke/ocr2_test.go | 10 ++++---- integration-tests/smoke/ocr2vrf_test.go | 9 ++++---- integration-tests/testsetups/ocr.go | 11 +++++---- 16 files changed, 89 insertions(+), 80 deletions(-) diff --git a/integration-tests/chaos/automation_chaos_test.go b/integration-tests/chaos/automation_chaos_test.go index 1b18b9f6ab7..c292c130c5a 100644 --- a/integration-tests/chaos/automation_chaos_test.go +++ b/integration-tests/chaos/automation_chaos_test.go @@ -42,7 +42,7 @@ AnnounceAddresses = ["0.0.0.0:6690"] ListenAddresses = ["0.0.0.0:6690"]` defaultAutomationSettings = map[string]interface{}{ - "replicas": "6", + "replicas": 6, "toml": client.AddNetworksConfig(baseTOML, networks.SelectedNetwork), "db": map[string]interface{}{ "stateful": true, @@ -194,11 +194,11 @@ func TestAutomationChaos(t *testing.T) { return } - err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=", 1, 2, ChaosGroupMinority) + err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=node-", 1, 2, ChaosGroupMinority) require.NoError(t, err) - err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=", 3, 5, ChaosGroupMajority) + err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=node-", 3, 5, ChaosGroupMajority) require.NoError(t, err) - err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=", 2, 5, ChaosGroupMajorityPlus) + err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=node-", 2, 5, ChaosGroupMajorityPlus) require.NoError(t, err) chainClient, err := blockchain.NewEVMClient(network, testEnvironment, l) diff --git a/integration-tests/chaos/ocr2vrf_chaos_test.go b/integration-tests/chaos/ocr2vrf_chaos_test.go index fd51fa55db5..1d7f61f783c 100644 --- a/integration-tests/chaos/ocr2vrf_chaos_test.go +++ b/integration-tests/chaos/ocr2vrf_chaos_test.go @@ -34,7 +34,7 @@ func TestOCR2VRFChaos(t *testing.T) { loadedNetwork := networks.SelectedNetwork defaultOCR2VRFSettings := map[string]interface{}{ - "replicas": "6", + "replicas": 6, "toml": client.AddNetworkDetailedConfig( config.BaseOCR2Config, config.DefaultOCR2VRFNetworkDetailTomlConfig, @@ -135,9 +135,9 @@ func TestOCR2VRFChaos(t *testing.T) { return } - err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=", 1, 2, ChaosGroupMinority) + err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=node-", 1, 2, ChaosGroupMinority) require.NoError(t, err) - err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=", 3, 5, ChaosGroupMajority) + err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=node-", 3, 5, ChaosGroupMajority) require.NoError(t, err) chainClient, err := blockchain.NewEVMClient(testNetwork, testEnvironment, l) diff --git a/integration-tests/chaos/ocr_chaos_test.go b/integration-tests/chaos/ocr_chaos_test.go index 569a0d1b70c..f3ee12046fb 100644 --- a/integration-tests/chaos/ocr_chaos_test.go +++ b/integration-tests/chaos/ocr_chaos_test.go @@ -32,7 +32,7 @@ import ( var ( defaultOCRSettings = map[string]interface{}{ - "replicas": "6", + "replicas": 6, "db": map[string]interface{}{ "stateful": true, "capacity": "1Gi", @@ -146,11 +146,11 @@ func TestOCRChaos(t *testing.T) { return } - err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=", 1, 2, ChaosGroupMinority) + err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=node-", 1, 2, ChaosGroupMinority) require.NoError(t, err) - err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=", 3, 5, ChaosGroupMajority) + err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=node-", 3, 5, ChaosGroupMajority) require.NoError(t, err) - err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=", 2, 5, ChaosGroupMajorityPlus) + err = testEnvironment.Client.LabelChaosGroup(testEnvironment.Cfg.Namespace, "instance=node-", 2, 5, ChaosGroupMajorityPlus) require.NoError(t, err) chainClient, err := blockchain.NewEVMClient(blockchain.SimulatedEVMNetwork, testEnvironment, l) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 9aa09350013..ded6216b540 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -19,7 +19,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.30.0 github.com/slack-go/slack v0.12.2 - github.com/smartcontractkit/chainlink-env v0.36.0 + github.com/smartcontractkit/chainlink-env v0.38.0 github.com/smartcontractkit/chainlink-testing-framework v1.17.0 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 @@ -447,15 +447,15 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect golang.org/x/arch v0.4.0 // indirect - golang.org/x/crypto v0.12.0 // indirect + golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.14.0 // indirect + golang.org/x/net v0.15.0 // indirect golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/term v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.11.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index bd4a8b977c0..90e85c816cd 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2358,8 +2358,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 h1:vdieOW3CZGdD2R5zvCSMS+0vksyExPN3/Fa1uVfld/A= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8= -github.com/smartcontractkit/chainlink-env v0.36.0 h1:CFOjs0c0y3lrHi/fl5qseCH9EQa5W/6CFyOvmhe2VnA= -github.com/smartcontractkit/chainlink-env v0.36.0/go.mod h1:NbRExHmJGnKSYXmvNuJx5VErSx26GtE1AEN/CRzYOg8= +github.com/smartcontractkit/chainlink-env v0.38.0 h1:3LaqV5wSRCVPK0haV5jC2zdZITV2Q0BPyUMUM3tyJ7o= +github.com/smartcontractkit/chainlink-env v0.38.0/go.mod h1:ICN9gOBY+NehK8mIxxM9CrWDohgkCQ1vgX9FazCbg8I= github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 h1:Db333w+fSm2e18LMikcIQHIZqgxZruW9uCUGJLUC9mI= github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE= @@ -2703,8 +2703,8 @@ golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2852,8 +2852,8 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -3032,8 +3032,9 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -3044,8 +3045,8 @@ golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -3061,8 +3062,8 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/integration-tests/performance/cron_test.go b/integration-tests/performance/cron_test.go index c66a1803564..b5fc9c48b09 100644 --- a/integration-tests/performance/cron_test.go +++ b/integration-tests/performance/cron_test.go @@ -120,10 +120,11 @@ func setupCronTest(t *testing.T) (testEnvironment *environment.Environment) { } baseTOML := `[WebServer] HTTPWriteTimout = '300s'` - cd, err := chainlink.NewDeployment(1, map[string]interface{}{ - "toml": client.AddNetworksConfig(baseTOML, network), + cd := chainlink.New(0, map[string]interface{}{ + "replicas": 1, + "toml": client.AddNetworksConfig(baseTOML, network), }) - require.NoError(t, err, "Error creating chainlink deployment") + testEnvironment = environment.New(&environment.Config{ NamespacePrefix: fmt.Sprintf("performance-cron-%s", strings.ReplaceAll(strings.ToLower(network.Name), " ", "-")), Test: t, @@ -131,8 +132,8 @@ HTTPWriteTimout = '300s'` AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). AddHelm(evmConfig). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(t, err, "Error launching test environment") return testEnvironment } diff --git a/integration-tests/performance/directrequest_test.go b/integration-tests/performance/directrequest_test.go index 98c03c2bb96..1b3009043fd 100644 --- a/integration-tests/performance/directrequest_test.go +++ b/integration-tests/performance/directrequest_test.go @@ -140,10 +140,11 @@ func setupDirectRequestTest(t *testing.T) (testEnvironment *environment.Environm } baseTOML := `[WebServer] HTTPWriteTimout = '300s'` - cd, err := chainlink.NewDeployment(1, map[string]interface{}{ - "toml": client.AddNetworksConfig(baseTOML, network), + cd := chainlink.New(0, map[string]interface{}{ + "replicas": 1, + "toml": client.AddNetworksConfig(baseTOML, network), }) - require.NoError(t, err, "Error creating chainlink deployment") + testEnvironment = environment.New(&environment.Config{ NamespacePrefix: fmt.Sprintf("performance-cron-%s", strings.ReplaceAll(strings.ToLower(network.Name), " ", "-")), Test: t, @@ -151,8 +152,8 @@ HTTPWriteTimout = '300s'` AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). AddHelm(evmConfig). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(t, err, "Error launching test environment") return testEnvironment } diff --git a/integration-tests/performance/flux_test.go b/integration-tests/performance/flux_test.go index 2c33096a356..5ca5ae80962 100644 --- a/integration-tests/performance/flux_test.go +++ b/integration-tests/performance/flux_test.go @@ -187,10 +187,11 @@ HTTPWriteTimout = '300s' [OCR] Enabled = true` - cd, err := chainlink.NewDeployment(3, map[string]interface{}{ - "toml": client.AddNetworksConfig(baseTOML, testNetwork), + cd := chainlink.New(0, map[string]interface{}{ + "replicas": 3, + "toml": client.AddNetworksConfig(baseTOML, testNetwork), }) - require.NoError(t, err, "Error creating chainlink deployment") + testEnvironment = environment.New(&environment.Config{ NamespacePrefix: fmt.Sprintf("performance-flux-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), Test: t, @@ -198,8 +199,8 @@ Enabled = true` AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). AddHelm(evmConf). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(t, err, "Error running test environment") return testEnvironment, testNetwork } diff --git a/integration-tests/performance/keeper_test.go b/integration-tests/performance/keeper_test.go index 7ab0f53d0d0..e1ffecd28c4 100644 --- a/integration-tests/performance/keeper_test.go +++ b/integration-tests/performance/keeper_test.go @@ -153,10 +153,11 @@ TurnLookBack = 0 SyncInterval = '5s' PerformGasOverhead = 150_000` networkName := strings.ReplaceAll(strings.ToLower(network.Name), " ", "-") - cd, err := chainlink.NewDeployment(5, map[string]interface{}{ - "toml": client.AddNetworksConfig(baseTOML, network), + cd := chainlink.New(0, map[string]interface{}{ + "replicas": 5, + "toml": client.AddNetworksConfig(baseTOML, network), }) - require.NoError(t, err, "Error creating chainlink deployment") + testEnvironment := environment.New( &environment.Config{ NamespacePrefix: fmt.Sprintf("performance-keeper-%s-%s", testName, networkName), @@ -166,8 +167,8 @@ PerformGasOverhead = 150_000` AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). AddHelm(evmConfig). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(t, err, "Error deploying test environment") if testEnvironment.WillUseRemoteRunner() { return testEnvironment, nil, nil, nil, nil diff --git a/integration-tests/performance/ocr_test.go b/integration-tests/performance/ocr_test.go index d3d29049653..3df0700c6ea 100644 --- a/integration-tests/performance/ocr_test.go +++ b/integration-tests/performance/ocr_test.go @@ -107,10 +107,11 @@ Enabled = true Enabled = true ListenIP = '0.0.0.0' ListenPort = 6690` - cd, err := chainlink.NewDeployment(6, map[string]interface{}{ - "toml": client.AddNetworksConfig(baseTOML, testNetwork), + cd := chainlink.New(0, map[string]interface{}{ + "replicas": 6, + "toml": client.AddNetworksConfig(baseTOML, testNetwork), }) - require.NoError(t, err, "Error creating chainlink deployment") + testEnvironment = environment.New(&environment.Config{ NamespacePrefix: fmt.Sprintf("performance-ocr-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), Test: t, @@ -118,8 +119,8 @@ ListenPort = 6690` AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). AddHelm(evmConfig). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(t, err, "Error running test environment") return testEnvironment, testNetwork } diff --git a/integration-tests/performance/vrf_test.go b/integration-tests/performance/vrf_test.go index af3a3ecba81..4f86c6585bd 100644 --- a/integration-tests/performance/vrf_test.go +++ b/integration-tests/performance/vrf_test.go @@ -146,17 +146,17 @@ func setupVRFTest(t *testing.T) (testEnvironment *environment.Environment, testN } baseTOML := `[WebServer] HTTPWriteTimout = '300s'` - cd, err := chainlink.NewDeployment(0, map[string]interface{}{ + cd := chainlink.New(0, map[string]interface{}{ "toml": client.AddNetworksConfig(baseTOML, testNetwork), }) - require.NoError(t, err, "Error creating chainlink deployment") + testEnvironment = environment.New(&environment.Config{ NamespacePrefix: fmt.Sprintf("smoke-vrf-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), Test: t, }). AddHelm(evmConfig). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(t, err, "Error running test environment") return testEnvironment, testNetwork } diff --git a/integration-tests/reorg/automation_reorg_test.go b/integration-tests/reorg/automation_reorg_test.go index ab439e59f29..2f8db75f749 100644 --- a/integration-tests/reorg/automation_reorg_test.go +++ b/integration-tests/reorg/automation_reorg_test.go @@ -77,7 +77,7 @@ LimitDefault = 5_000_000` "networkId": "1337", }, "miner": map[string]interface{}{ - "replicas": "2", + "replicas": 2, }, }, }, @@ -126,9 +126,9 @@ const ( func TestAutomationReorg(t *testing.T) { l := logging.GetTestLogger(t) network := networks.SelectedNetwork + defaultAutomationSettings["replicas"] = numberOfNodes + cd := chainlink.New(0, defaultAutomationSettings) - cd, err := chainlink.NewDeployment(numberOfNodes, defaultAutomationSettings) - require.NoError(t, err, "Error creating chainlink deployment") testEnvironment := environment. New(&environment.Config{ NamespacePrefix: fmt.Sprintf("automation-reorg-%d", automationReorgBlocks), @@ -139,8 +139,8 @@ func TestAutomationReorg(t *testing.T) { Name: "geth-blockscout", WsURL: activeEVMNetwork.URL, HttpURL: activeEVMNetwork.HTTPURLs[0]})). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(t, err, "Error setting up test environment") if testEnvironment.WillUseRemoteRunner() { diff --git a/integration-tests/reorg/reorg_test.go b/integration-tests/reorg/reorg_test.go index 5666d8c7540..74468b92536 100644 --- a/integration-tests/reorg/reorg_test.go +++ b/integration-tests/reorg/reorg_test.go @@ -125,11 +125,12 @@ func TestDirectRequestReorg(t *testing.T) { time.Sleep(90 * time.Second) activeEVMNetwork = networks.SimulatedEVMNonDev netCfg := fmt.Sprintf(networkDRTOML, EVMFinalityDepth, EVMTrackerHistoryDepth) - chainlinkDeployment, err := chainlink.NewDeployment(1, map[string]interface{}{ - "toml": client.AddNetworkDetailedConfig(baseDRTOML, netCfg, activeEVMNetwork), + chainlinkDeployment := chainlink.New(0, map[string]interface{}{ + "replicas": 1, + "toml": client.AddNetworkDetailedConfig(baseDRTOML, netCfg, activeEVMNetwork), }) - require.NoError(t, err, "Error building Chainlink deployment") - err = testEnvironment.AddHelmCharts(chainlinkDeployment).Run() + + err = testEnvironment.AddHelm(chainlinkDeployment).Run() require.NoError(t, err, "Error adding to test environment") chainClient, err := blockchain.NewEVMClient(networkSettings, testEnvironment, l) diff --git a/integration-tests/smoke/ocr2_test.go b/integration-tests/smoke/ocr2_test.go index a1ad9fa5296..c6804e48d01 100644 --- a/integration-tests/smoke/ocr2_test.go +++ b/integration-tests/smoke/ocr2_test.go @@ -126,10 +126,10 @@ func setupOCR2Test(t *testing.T, forwardersEnabled bool) ( toml = client.AddNetworksConfig(config.BaseOCR2Config, testNetwork) } - chainlinkChart, err := chainlink.NewDeployment(6, map[string]interface{}{ - "toml": toml, + chainlinkChart := chainlink.New(0, map[string]interface{}{ + "replicas": 6, + "toml": toml, }) - require.NoError(t, err, "Error creating chainlink deployment") testEnvironment = environment.New(&environment.Config{ NamespacePrefix: fmt.Sprintf("smoke-ocr2-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), @@ -138,8 +138,8 @@ func setupOCR2Test(t *testing.T, forwardersEnabled bool) ( AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). AddHelm(evmConfig). - AddHelmCharts(chainlinkChart) - err = testEnvironment.Run() + AddHelm(chainlinkChart) + err := testEnvironment.Run() require.NoError(t, err, "Error running test environment") return testEnvironment, testNetwork } diff --git a/integration-tests/smoke/ocr2vrf_test.go b/integration-tests/smoke/ocr2vrf_test.go index c9f689ca7ae..81488639187 100644 --- a/integration-tests/smoke/ocr2vrf_test.go +++ b/integration-tests/smoke/ocr2vrf_test.go @@ -159,21 +159,22 @@ func setupOCR2VRFEnvironment(t *testing.T) (testEnvironment *environment.Environ }) } - cd, err := chainlink.NewDeployment(6, map[string]interface{}{ + cd := chainlink.New(0, map[string]interface{}{ + "replicas": 6, "toml": client.AddNetworkDetailedConfig( config.BaseOCR2Config, config.DefaultOCR2VRFNetworkDetailTomlConfig, testNetwork, ), }) - require.NoError(t, err, "Error creating Chainlink deployment") + testEnvironment = environment.New(&environment.Config{ NamespacePrefix: fmt.Sprintf("smoke-ocr2vrf-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), Test: t, }). AddHelm(evmConfig). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(t, err, "Error running test environment") diff --git a/integration-tests/testsetups/ocr.go b/integration-tests/testsetups/ocr.go index 259831189db..b53fe9a7978 100644 --- a/integration-tests/testsetups/ocr.go +++ b/integration-tests/testsetups/ocr.go @@ -136,13 +136,14 @@ func (o *OCRSoakTest) DeployEnvironment(customChainlinkNetworkTOML string) { Test: o.t, } - cd, err := chainlink.NewDeployment(6, map[string]any{ - "toml": client.AddNetworkDetailedConfig(config.BaseOCRP2PV1Config, customChainlinkNetworkTOML, network), + cd := chainlink.New(0, map[string]any{ + "replicas": 6, + "toml": client.AddNetworkDetailedConfig(config.BaseOCRP2PV1Config, customChainlinkNetworkTOML, network), "db": map[string]any{ "stateful": true, // stateful DB by default for soak tests }, }) - require.NoError(o.t, err, "Error creating chainlink deployment") + testEnvironment := environment.New(baseEnvironmentConfig). AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). @@ -151,8 +152,8 @@ func (o *OCRSoakTest) DeployEnvironment(customChainlinkNetworkTOML string) { Simulated: network.Simulated, WsURLs: network.URLs, })). - AddHelmCharts(cd) - err = testEnvironment.Run() + AddHelm(cd) + err := testEnvironment.Run() require.NoError(o.t, err, "Error launching test environment") o.testEnvironment = testEnvironment o.namespace = testEnvironment.Cfg.Namespace From 07d4038c9fd5480632c93ed3c4450c8979a07b0d Mon Sep 17 00:00:00 2001 From: Sri Kidambi <1702865+kidambisrinivas@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:11:09 +0300 Subject: [PATCH 38/84] Pass through extraArgs from user to VRFV2PlusWrapper (#10816) * Pass through extraArgs from user to VRFV2PlusWrapper via VRFV2PlusWrapperConsumerBase * Generate go wrappers and prettify * Remove abi.decode, removeDomainSeparator and add a simpler checkPaymentMode * Fix issue in VRFV2PlusWrapperLoadTestConsumer::makeRequests * Fix comments --------- Co-authored-by: Sri Kidambi Co-authored-by: Makram --- .../interfaces/VRFV2PlusWrapperInterface.sol | 3 +- .../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol | 43 ++++++++++++++++--- .../dev/vrf/VRFV2PlusWrapperConsumerBase.sol | 11 +++-- .../VRFV2PlusWrapperConsumerExample.sol | 7 ++- .../VRFV2PlusWrapperLoadTestConsumer.sol | 7 ++- .../vrfv2plus_client/vrfv2plus_client.go | 2 +- .../vrfv2plus_wrapper/vrfv2plus_wrapper.go | 40 +++++++++++++---- .../vrfv2plus_wrapper_consumer_example.go | 2 +- .../vrfv2plus_wrapper_load_test_consumer.go | 2 +- ...rapper-dependency-versions-do-not-edit.txt | 8 ++-- 10 files changed, 95 insertions(+), 30 deletions(-) diff --git a/contracts/src/v0.8/dev/interfaces/VRFV2PlusWrapperInterface.sol b/contracts/src/v0.8/dev/interfaces/VRFV2PlusWrapperInterface.sol index 998ccba85f3..72f1af5d2fb 100644 --- a/contracts/src/v0.8/dev/interfaces/VRFV2PlusWrapperInterface.sol +++ b/contracts/src/v0.8/dev/interfaces/VRFV2PlusWrapperInterface.sol @@ -65,6 +65,7 @@ interface VRFV2PlusWrapperInterface { function requestRandomWordsInNative( uint32 _callbackGasLimit, uint16 _requestConfirmations, - uint32 _numWords + uint32 _numWords, + bytes memory extraArgs ) external payable returns (uint256 requestId); } diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol index cd453c2639a..51487a692ff 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol @@ -20,6 +20,9 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume error LinkAlreadySet(); error FailedToTransferLink(); + error IncorrectExtraArgsLength(uint16 expectedMinimumLength, uint16 actualLength); + error NativePaymentInOnTokenTransfer(); + error LINKPaymentInRequestRandomWordsInNative(); /* Storage Slot 1: BEGIN */ // s_keyHash is the key hash to use when requesting randomness. Fees are paid based on current gas @@ -104,6 +107,8 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume // s_maxNumWords is the max number of words that can be requested in a single wrapped VRF request. uint8 s_maxNumWords; + + uint16 private constant EXPECTED_MIN_LENGTH = 36; /* Storage Slot 8: END */ struct Callback { @@ -358,10 +363,11 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume function onTokenTransfer(address _sender, uint256 _amount, bytes calldata _data) external onlyConfiguredNotDisabled { require(msg.sender == address(s_link), "only callable from LINK"); - (uint32 callbackGasLimit, uint16 requestConfirmations, uint32 numWords) = abi.decode( + (uint32 callbackGasLimit, uint16 requestConfirmations, uint32 numWords, bytes memory extraArgs) = abi.decode( _data, - (uint32, uint16, uint32) + (uint32, uint16, uint32, bytes) ); + checkPaymentMode(extraArgs, true); uint32 eip150Overhead = getEIP150Overhead(callbackGasLimit); int256 weiPerUnitLink = getFeedData(); uint256 price = calculateRequestPriceInternal(callbackGasLimit, tx.gasprice, weiPerUnitLink); @@ -373,7 +379,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume requestConfirmations: requestConfirmations, callbackGasLimit: callbackGasLimit + eip150Overhead + s_wrapperGasOverhead, numWords: numWords, - extraArgs: "" // empty extraArgs defaults to link payment + extraArgs: extraArgs // empty extraArgs defaults to link payment }); uint256 requestId = s_vrfCoordinator.requestRandomWords(req); s_callbacks[requestId] = Callback({ @@ -384,11 +390,38 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume lastRequestId = requestId; } + function checkPaymentMode(bytes memory extraArgs, bool isLinkMode) public pure { + // If extraArgs is empty, payment mode is LINK by default + if (extraArgs.length == 0) { + if (!isLinkMode) { + revert LINKPaymentInRequestRandomWordsInNative(); + } + return; + } + if (extraArgs.length < EXPECTED_MIN_LENGTH) { + revert IncorrectExtraArgsLength(EXPECTED_MIN_LENGTH, uint16(extraArgs.length)); + } + // ExtraArgsV1 only has struct {bool nativePayment} as of now + // The following condition checks if nativePayment in abi.encode of + // ExtraArgsV1 matches the appropriate function call (onTokenTransfer + // for LINK and requestRandomWordsInNative for Native payment) + bool nativePayment = extraArgs[35] == hex"01"; + if (nativePayment && isLinkMode) { + revert NativePaymentInOnTokenTransfer(); + } + if (!nativePayment && !isLinkMode) { + revert LINKPaymentInRequestRandomWordsInNative(); + } + } + function requestRandomWordsInNative( uint32 _callbackGasLimit, uint16 _requestConfirmations, - uint32 _numWords + uint32 _numWords, + bytes calldata extraArgs ) external payable override returns (uint256 requestId) { + checkPaymentMode(extraArgs, false); + uint32 eip150Overhead = getEIP150Overhead(_callbackGasLimit); uint256 price = calculateRequestPriceNativeInternal(_callbackGasLimit, tx.gasprice); require(msg.value >= price, "fee too low"); @@ -399,7 +432,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume requestConfirmations: _requestConfirmations, callbackGasLimit: _callbackGasLimit + eip150Overhead + s_wrapperGasOverhead, numWords: _numWords, - extraArgs: VRFV2PlusClient._argsToBytes(VRFV2PlusClient.ExtraArgsV1({nativePayment: true})) + extraArgs: extraArgs }); requestId = s_vrfCoordinator.requestRandomWords(req); s_callbacks[requestId] = Callback({ diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol index c9ddad2f778..098f0558660 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol @@ -73,12 +73,13 @@ abstract contract VRFV2PlusWrapperConsumerBase { function requestRandomness( uint32 _callbackGasLimit, uint16 _requestConfirmations, - uint32 _numWords + uint32 _numWords, + bytes memory extraArgs ) internal returns (uint256 requestId) { LINK.transferAndCall( address(VRF_V2_PLUS_WRAPPER), VRF_V2_PLUS_WRAPPER.calculateRequestPrice(_callbackGasLimit), - abi.encode(_callbackGasLimit, _requestConfirmations, _numWords) + abi.encode(_callbackGasLimit, _requestConfirmations, _numWords, extraArgs) ); return VRF_V2_PLUS_WRAPPER.lastRequestId(); } @@ -86,14 +87,16 @@ abstract contract VRFV2PlusWrapperConsumerBase { function requestRandomnessPayInNative( uint32 _callbackGasLimit, uint16 _requestConfirmations, - uint32 _numWords + uint32 _numWords, + bytes memory extraArgs ) internal returns (uint256 requestId) { uint256 requestPrice = VRF_V2_PLUS_WRAPPER.calculateRequestPriceNative(_callbackGasLimit); return VRF_V2_PLUS_WRAPPER.requestRandomWordsInNative{value: requestPrice}( _callbackGasLimit, _requestConfirmations, - _numWords + _numWords, + extraArgs ); } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol index 5851d2c5df7..206d56ea321 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.6; import "../VRFV2PlusWrapperConsumerBase.sol"; import "../../../shared/access/ConfirmedOwner.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; contract VRFV2PlusWrapperConsumerExample is VRFV2PlusWrapperConsumerBase, ConfirmedOwner { event WrappedRequestFulfilled(uint256 requestId, uint256[] randomWords, uint256 payment); @@ -27,7 +28,8 @@ contract VRFV2PlusWrapperConsumerExample is VRFV2PlusWrapperConsumerBase, Confir uint16 _requestConfirmations, uint32 _numWords ) external onlyOwner returns (uint256 requestId) { - requestId = requestRandomness(_callbackGasLimit, _requestConfirmations, _numWords); + bytes memory extraArgs = VRFV2PlusClient._argsToBytes(VRFV2PlusClient.ExtraArgsV1({nativePayment: false})); + requestId = requestRandomness(_callbackGasLimit, _requestConfirmations, _numWords, extraArgs); uint256 paid = VRF_V2_PLUS_WRAPPER.calculateRequestPrice(_callbackGasLimit); s_requests[requestId] = RequestStatus({paid: paid, randomWords: new uint256[](0), fulfilled: false, native: false}); emit WrapperRequestMade(requestId, paid); @@ -39,7 +41,8 @@ contract VRFV2PlusWrapperConsumerExample is VRFV2PlusWrapperConsumerBase, Confir uint16 _requestConfirmations, uint32 _numWords ) external onlyOwner returns (uint256 requestId) { - requestId = requestRandomnessPayInNative(_callbackGasLimit, _requestConfirmations, _numWords); + bytes memory extraArgs = VRFV2PlusClient._argsToBytes(VRFV2PlusClient.ExtraArgsV1({nativePayment: true})); + requestId = requestRandomnessPayInNative(_callbackGasLimit, _requestConfirmations, _numWords, extraArgs); uint256 paid = VRF_V2_PLUS_WRAPPER.calculateRequestPriceNative(_callbackGasLimit); s_requests[requestId] = RequestStatus({paid: paid, randomWords: new uint256[](0), fulfilled: false, native: true}); emit WrapperRequestMade(requestId, paid); diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol index 4f63bc0e32a..6c7849b2581 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.6; import "../VRFV2PlusWrapperConsumerBase.sol"; import "../../../shared/access/ConfirmedOwner.sol"; import "../../../ChainSpecificUtil.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, ConfirmedOwner { uint256 public s_responseCount; @@ -42,7 +43,8 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi uint16 _requestCount ) external onlyOwner { for (uint16 i = 0; i < _requestCount; i++) { - uint256 requestId = requestRandomness(_callbackGasLimit, _requestConfirmations, _numWords); + bytes memory extraArgs = VRFV2PlusClient._argsToBytes(VRFV2PlusClient.ExtraArgsV1({nativePayment: false})); + uint256 requestId = requestRandomness(_callbackGasLimit, _requestConfirmations, _numWords, extraArgs); s_lastRequestId = requestId; uint256 requestBlockNumber = ChainSpecificUtil.getBlockNumber(); @@ -70,7 +72,8 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi uint16 _requestCount ) external onlyOwner { for (uint16 i = 0; i < _requestCount; i++) { - uint256 requestId = requestRandomnessPayInNative(_callbackGasLimit, _requestConfirmations, _numWords); + bytes memory extraArgs = VRFV2PlusClient._argsToBytes(VRFV2PlusClient.ExtraArgsV1({nativePayment: true})); + uint256 requestId = requestRandomnessPayInNative(_callbackGasLimit, _requestConfirmations, _numWords, extraArgs); s_lastRequestId = requestId; uint256 requestBlockNumber = ChainSpecificUtil.getBlockNumber(); diff --git a/core/gethwrappers/generated/vrfv2plus_client/vrfv2plus_client.go b/core/gethwrappers/generated/vrfv2plus_client/vrfv2plus_client.go index 9fd983e2cf0..91112ff856f 100644 --- a/core/gethwrappers/generated/vrfv2plus_client/vrfv2plus_client.go +++ b/core/gethwrappers/generated/vrfv2plus_client/vrfv2plus_client.go @@ -30,7 +30,7 @@ var ( var VRFV2PlusClientMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"EXTRA_ARGS_V1_TAG\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6088610038600b82828239805160001a607314602b57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060335760003560e01c8063f7514ab4146038575b600080fd5b605e7f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa81565b6040516001600160e01b0319909116815260200160405180910390f3fea164736f6c6343000806000a", + Bin: "0x60a0610038600b82828239805160001a607314602b57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060335760003560e01c8063f7514ab4146038575b600080fd5b605e7f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa81565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f3fea164736f6c6343000806000a", } var VRFV2PlusClientABI = VRFV2PlusClientMetaData.ABI diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go index 2dcb2439466..dcb532440f9 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go @@ -31,8 +31,8 @@ var ( ) var VRFV2PlusWrapperMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b5060405162002df438038062002df48339810160408190526200004c9162000323565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200025a565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b6002546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e491600480830192602092919082900301818787803b158015620001a957600080fd5b505af1158015620001be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e491906200036d565b6080819052600254604051632fb1302360e21b8152600481018390523060248201529192506001600160a01b03169063bec4c08c90604401600060405180830381600087803b1580156200023757600080fd5b505af11580156200024c573d6000803e3d6000fd5b505050505050505062000387565b6001600160a01b038116331415620002b55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031e57600080fd5b919050565b6000806000606084860312156200033957600080fd5b620003448462000306565b9250620003546020850162000306565b9150620003646040850162000306565b90509250925092565b6000602082840312156200038057600080fd5b5051919050565b608051612a43620003b1600039600081816101e401528181610cfc01526115fa0152612a436000f3fe6080604052600436106101cd5760003560e01c80638ea98117116100f7578063bf17e55911610095578063f254bdc711610064578063f254bdc7146106c7578063f2fde38b14610704578063f3fef3a314610724578063fc2a88c31461074457600080fd5b8063bf17e559146105a6578063c3f909d4146105c6578063cdd8d88514610650578063da4f5e6d1461068a57600080fd5b8063a3907d71116100d1578063a3907d7114610532578063a4c0ed3614610547578063a608a1e114610567578063bed41a931461058657600080fd5b80638ea98117146104c55780639eccacf6146104e5578063a02e06161461051257600080fd5b806348baa1c51161016f578063650596541161013e578063650596541461042457806379ba5097146104445780637fb5d19d146104595780638da5cb5b1461047957600080fd5b806348baa1c5146102fc5780634b160935146103c757806357a8070a146103e757806362a504fc1461041157600080fd5b80631fe543e3116101ab5780631fe543e3146102875780632f2770db146102a75780633255c456146102bc5780634306d354146102dc57600080fd5b8063030932bb146101d257806307b18bde14610219578063181f5a771461023b575b600080fd5b3480156101de57600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561022557600080fd5b506102396102343660046123e5565b61075a565b005b34801561024757600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021091906127fb565b34801561029357600080fd5b506102396102a23660046124ea565b610836565b3480156102b357600080fd5b506102396108b7565b3480156102c857600080fd5b506102066102d736600461268a565b6108ed565b3480156102e857600080fd5b506102066102f7366004612623565b6109e5565b34801561030857600080fd5b506103866103173660046124b8565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff1690820152606001610210565b3480156103d357600080fd5b506102066103e2366004612623565b610aec565b3480156103f357600080fd5b506008546104019060ff1681565b6040519015158152602001610210565b61020661041f36600461263e565b610be3565b34801561043057600080fd5b5061023961043f3660046123ca565b610f1a565b34801561045057600080fd5b50610239610f65565b34801561046557600080fd5b5061020661047436600461268a565b611062565b34801561048557600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610210565b3480156104d157600080fd5b506102396104e03660046123ca565b611168565b3480156104f157600080fd5b506002546104a09073ffffffffffffffffffffffffffffffffffffffff1681565b34801561051e57600080fd5b5061023961052d3660046123ca565b611273565b34801561053e57600080fd5b5061023961131e565b34801561055357600080fd5b5061023961056236600461240f565b611350565b34801561057357600080fd5b5060085461040190610100900460ff1681565b34801561059257600080fd5b506102396105a13660046126a6565b611836565b3480156105b257600080fd5b506102396105c1366004612623565b61198c565b3480156105d257600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e082015261010001610210565b34801561065c57600080fd5b5060075461067590640100000000900463ffffffff1681565b60405163ffffffff9091168152602001610210565b34801561069657600080fd5b506006546104a0906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106d357600080fd5b506007546104a0906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561071057600080fd5b5061023961071f3660046123ca565b6119d3565b34801561073057600080fd5b5061023961073f3660046123e5565b6119e7565b34801561075057600080fd5b5061020660045481565b610762611ae2565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107bc576040519150601f19603f3d011682016040523d82523d6000602084013e6107c1565b606091505b5050905080610831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108a9576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610828565b6108b38282611b65565b5050565b6108bf611ae2565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff1661095c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff16156109ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b6109de8363ffffffff1683611d4d565b9392505050565b60085460009060ff16610a54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff1615610ac6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b6000610ad0611e23565b9050610ae38363ffffffff163a83611f83565b9150505b919050565b60085460009060ff16610b5b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff1615610bcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b610bdd8263ffffffff163a611d4d565b92915050565b600080610bef85612075565b90506000610c038663ffffffff163a611d4d565b905080341015610c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610828565b6008546301000000900460ff1663ffffffff85161115610ceb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610828565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff16610d48868b6128d1565b610d5291906128d1565b63ffffffff1681526020018663ffffffff168152602001610d8360405180602001604052806001151581525061208d565b90526002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e90610ddc90849060040161280e565b602060405180830381600087803b158015610df657600080fd5b505af1158015610e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2e91906124d1565b6040805160608101825233815263ffffffff808b16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff9190911617179290921691909117905593505050509392505050565b610f22611ae2565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610fe6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610828565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff166110d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff1615611143576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b600061114d611e23565b90506111608463ffffffff168483611f83565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906111a8575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561122c57336111cd60005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610828565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61127b611ae2565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16156112db576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611326611ae2565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff166113bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610828565b600854610100900460ff161561142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610828565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146114bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610828565b600080806114cf8486018661263e565b92509250925060006114e084612075565b905060006114ec611e23565b905060006115018663ffffffff163a84611f83565b90508089101561156d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610828565b6008546301000000900460ff1663ffffffff851611156115e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610828565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff87169181019190915260075460009190606082019063ffffffff16611646878b6128d1565b61165091906128d1565b63ffffffff1681526020018663ffffffff1681526020016040518060200160405280600081525081525090506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639b1c385e836040518263ffffffff1660e01b81526004016116d9919061280e565b602060405180830381600087803b1580156116f357600080fd5b505af1158015611707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172b91906124d1565b905060405180606001604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018963ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555090505080600481905550505050505050505050505050565b61183e611ae2565b6007805463ffffffff9a8b167fffffffffffffffffffffffffffffffffffffffff00000000ffffffff000000009091161768010000000000000000998b168a02179055600880546003979097557fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9096166201000060ff988916027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009590971694909402959095177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117909355600680546005949094557fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff9187167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009094169390931764010000000094871694909402939093179290921691909316909102179055565b611994611ae2565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b6119db611ae2565b6119e481612149565b50565b6119ef611ae2565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611a7457600080fd5b505af1158015611a88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aac9190612496565b6108b3576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611b63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610828565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611c5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610828565b600080631fe543e360e01b8585604051602401611c7d92919061286b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611cf7846020015163ffffffff1685600001518461223f565b905080611d4557835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6007546000908190611d6c90640100000000900463ffffffff1661228b565b60075463ffffffff680100000000000000008204811691611d8e9116876128b9565b611d9891906128b9565b611da29085612955565b611dac91906128b9565b6008549091508190600090606490611dcd9062010000900460ff16826128f9565b611dda9060ff1684612955565b611de4919061291e565b600654909150600090611e0e9068010000000000000000900463ffffffff1664e8d4a51000612955565b611e1890836128b9565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b158015611eb057600080fd5b505afa158015611ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee89190612740565b509450909250849150508015611f0e5750611f038242612992565b60065463ffffffff16105b15611f1857506005545b60008112156109de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610828565b6007546000908190611fa290640100000000900463ffffffff1661228b565b60075463ffffffff680100000000000000008204811691611fc49116886128b9565b611fce91906128b9565b611fd89086612955565b611fe291906128b9565b9050600083611ff983670de0b6b3a7640000612955565b612003919061291e565b6008549091506000906064906120229062010000900460ff16826128f9565b61202f9060ff1684612955565b612039919061291e565b60065490915060009061205f90640100000000900463ffffffff1664e8d4a51000612955565b61206990836128b9565b98975050505050505050565b6000612082603f83612932565b610bdd9060016128d1565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa826040516024016120c691511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b73ffffffffffffffffffffffffffffffffffffffff81163314156121c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610828565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561225157600080fd5b61138881039050846040820482031161226957600080fd5b50823b61227557600080fd5b60008083516020850160008789f1949350505050565b60004661229781612344565b1561233b576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b1580156122e557600080fd5b505afa1580156122f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061231d91906125d9565b5050505091505083608c61233191906128b9565b6111609082612955565b50600092915050565b600061a4b1821480612358575062066eed82145b80610bdd57505062066eee1490565b803573ffffffffffffffffffffffffffffffffffffffff81168114610ae757600080fd5b803563ffffffff81168114610ae757600080fd5b803560ff81168114610ae757600080fd5b805169ffffffffffffffffffff81168114610ae757600080fd5b6000602082840312156123dc57600080fd5b6109de82612367565b600080604083850312156123f857600080fd5b61240183612367565b946020939093013593505050565b6000806000806060858703121561242557600080fd5b61242e85612367565b935060208501359250604085013567ffffffffffffffff8082111561245257600080fd5b818701915087601f83011261246657600080fd5b81358181111561247557600080fd5b88602082850101111561248757600080fd5b95989497505060200194505050565b6000602082840312156124a857600080fd5b815180151581146109de57600080fd5b6000602082840312156124ca57600080fd5b5035919050565b6000602082840312156124e357600080fd5b5051919050565b600080604083850312156124fd57600080fd5b8235915060208084013567ffffffffffffffff8082111561251d57600080fd5b818601915086601f83011261253157600080fd5b81358181111561254357612543612a07565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561258657612586612a07565b604052828152858101935084860182860187018b10156125a557600080fd5b600095505b838610156125c85780358552600195909501949386019386016125aa565b508096505050505050509250929050565b60008060008060008060c087890312156125f257600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561263557600080fd5b6109de8261238b565b60008060006060848603121561265357600080fd5b61265c8461238b565b9250602084013561ffff8116811461267357600080fd5b91506126816040850161238b565b90509250925092565b6000806040838503121561269d57600080fd5b6124018361238b565b60008060008060008060008060006101208a8c0312156126c557600080fd5b6126ce8a61238b565b98506126dc60208b0161238b565b97506126ea60408b0161239f565b965060608a013595506126ff60808b0161239f565b945061270d60a08b0161238b565b935060c08a0135925061272260e08b0161238b565b91506127316101008b0161238b565b90509295985092959850929598565b600080600080600060a0868803121561275857600080fd5b612761866123b0565b9450602086015193506040860151925060608601519150612784608087016123b0565b90509295509295909350565b6000815180845260005b818110156127b65760208185018101518683018201520161279a565b818111156127c8576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006109de6020830184612790565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c08084015261116060e0840182612790565b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156128ac57845183529383019391830191600101612890565b5090979650505050505050565b600082198211156128cc576128cc6129a9565b500190565b600063ffffffff8083168185168083038211156128f0576128f06129a9565b01949350505050565b600060ff821660ff84168060ff03821115612916576129166129a9565b019392505050565b60008261292d5761292d6129d8565b500490565b600063ffffffff80841680612949576129496129d8565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561298d5761298d6129a9565b500290565b6000828210156129a4576129a46129a9565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"expectedMinimumLength\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"actualLength\",\"type\":\"uint16\"}],\"name\":\"IncorrectExtraArgsLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LINKPaymentInRequestRandomWordsInNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NativePaymentInOnTokenTransfer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isLinkMode\",\"type\":\"bool\"}],\"name\":\"checkPaymentMode\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b5060405162003126380380620031268339810160408190526200004c9162000323565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200025a565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b6002546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e491600480830192602092919082900301818787803b158015620001a957600080fd5b505af1158015620001be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e491906200036d565b6080819052600254604051632fb1302360e21b8152600481018390523060248201529192506001600160a01b03169063bec4c08c90604401600060405180830381600087803b1580156200023757600080fd5b505af11580156200024c573d6000803e3d6000fd5b505050505050505062000387565b6001600160a01b038116331415620002b55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031e57600080fd5b919050565b6000806000606084860312156200033957600080fd5b620003448462000306565b9250620003546020850162000306565b9150620003646040850162000306565b90509250925092565b6000602082840312156200038057600080fd5b5051919050565b608051612d75620003b1600039600081816101ef0152818161123301526118040152612d756000f3fe6080604052600436106101d85760003560e01c80638ea9811711610102578063bf17e55911610095578063f254bdc711610064578063f254bdc7146106f2578063f2fde38b1461072f578063f3fef3a31461074f578063fc2a88c31461076f57600080fd5b8063bf17e559146105d1578063c3f909d4146105f1578063cdd8d8851461067b578063da4f5e6d146106b557600080fd5b8063a3907d71116100d1578063a3907d711461055d578063a4c0ed3614610572578063a608a1e114610592578063bed41a93146105b157600080fd5b80638ea98117146104dd5780639cfc058e146104fd5780639eccacf614610510578063a02e06161461053d57600080fd5b80634306d3541161017a5780636505965411610149578063650596541461043c57806379ba50971461045c5780637fb5d19d146104715780638da5cb5b1461049157600080fd5b80634306d3541461030757806348baa1c5146103275780634b160935146103f257806357a8070a1461041257600080fd5b806318b6f4c8116101b657806318b6f4c8146102925780631fe543e3146102b25780632f2770db146102d25780633255c456146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f366004612608565b610785565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612aa1565b34801561029e57600080fd5b506102446102ad3660046126a9565b610861565b3480156102be57600080fd5b506102446102cd36600461272d565b6109d8565b3480156102de57600080fd5b50610244610a55565b3480156102f357600080fd5b50610211610302366004612930565b610a8b565b34801561031357600080fd5b50610211610322366004612830565b610b83565b34801561033357600080fd5b506103b16103423660046126fb565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161021b565b3480156103fe57600080fd5b5061021161040d366004612830565b610c8a565b34801561041e57600080fd5b5060085461042c9060ff1681565b604051901515815260200161021b565b34801561044857600080fd5b506102446104573660046125ed565b610d81565b34801561046857600080fd5b50610244610dcc565b34801561047d57600080fd5b5061021161048c366004612930565b610ec9565b34801561049d57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b3480156104e957600080fd5b506102446104f83660046125ed565b610fcf565b61021161050b36600461284b565b6110da565b34801561051c57600080fd5b506002546104b89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561054957600080fd5b506102446105583660046125ed565b61146f565b34801561056957600080fd5b5061024461151a565b34801561057e57600080fd5b5061024461058d366004612632565b61154c565b34801561059e57600080fd5b5060085461042c90610100900460ff1681565b3480156105bd57600080fd5b506102446105cc36600461294c565b611a2c565b3480156105dd57600080fd5b506102446105ec366004612830565b611b82565b3480156105fd57600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e08201526101000161021b565b34801561068757600080fd5b506007546106a090640100000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106c157600080fd5b506006546104b8906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106fe57600080fd5b506007546104b8906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561073b57600080fd5b5061024461074a3660046125ed565b611bc9565b34801561075b57600080fd5b5061024461076a366004612608565b611bdd565b34801561077b57600080fd5b5061021160045481565b61078d611cd8565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107e7576040519150601f19603f3d011682016040523d82523d6000602084013e6107ec565b606091505b505090508061085c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b81516108a2578061089e576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b8151602411156108f35781516040517f51200dce0000000000000000000000000000000000000000000000000000000081526108539160249160040161ffff92831681529116602082015260400190565b60008260238151811061090857610908612cfc565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f010000000000000000000000000000000000000000000000000000000000000014905080801561095e5750815b15610995576040517f6048aa6800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b801580156109a1575081155b1561085c576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025473ffffffffffffffffffffffffffffffffffffffff163314610a4b576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610853565b61089e8282611d5b565b610a5d611cd8565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff16610afa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610b6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b610b7c8363ffffffff1683611f43565b9392505050565b60085460009060ff16610bf2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610c64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6000610c6e612019565b9050610c818363ffffffff163a83612179565b9150505b919050565b60085460009060ff16610cf9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610d6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b610d7b8263ffffffff163a611f43565b92915050565b610d89611cd8565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610853565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16610f38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610faa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6000610fb4612019565b9050610fc78463ffffffff168483612179565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331480159061100f575060025473ffffffffffffffffffffffffffffffffffffffff163314155b15611093573361103460005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610853565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600061111b83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250610861915050565b60006111268761226b565b9050600061113a8863ffffffff163a611f43565b9050803410156111a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610853565b6008546301000000900460ff1663ffffffff87161115611222576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610853565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff89169181019190915260075460009190606082019063ffffffff1661127f868d612bc6565b6112899190612bc6565b63ffffffff1681526020018863ffffffff16815260200187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e9061132f908490600401612ab4565b602060405180830381600087803b15801561134957600080fd5b505af115801561135d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113819190612714565b6040805160608101825233815263ffffffff808d16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff91909116171792909216919091179055935050505095945050505050565b611477611cd8565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16156114d7576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611522611cd8565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff166115b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff161561162a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146116bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610853565b60008080806116cc858701876128c1565b93509350935093506116df816001610861565b60006116ea8561226b565b905060006116f6612019565b9050600061170b8763ffffffff163a84612179565b9050808a1015611777576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610853565b6008546301000000900460ff1663ffffffff861611156117f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610853565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff88169181019190915260075460009190606082019063ffffffff16611850878c612bc6565b61185a9190612bc6565b63ffffffff908116825288166020820152604090810187905260025490517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e906118ce908590600401612ab4565b602060405180830381600087803b1580156118e857600080fd5b505af11580156118fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119209190612714565b905060405180606001604052808e73ffffffffffffffffffffffffffffffffffffffff1681526020018a63ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050508060048190555050505050505050505050505050565b611a34611cd8565b6007805463ffffffff9a8b167fffffffffffffffffffffffffffffffffffffffff00000000ffffffff000000009091161768010000000000000000998b168a02179055600880546003979097557fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9096166201000060ff988916027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009590971694909402959095177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117909355600680546005949094557fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff9187167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009094169390931764010000000094871694909402939093179290921691909316909102179055565b611b8a611cd8565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b611bd1611cd8565b611bda81612283565b50565b611be5611cd8565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611c6a57600080fd5b505af1158015611c7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca2919061268c565b61089e576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611d59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610853565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611e55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610853565b600080631fe543e360e01b8585604051602401611e73929190612b11565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611eed846020015163ffffffff16856000015184612379565b905080611f3b57835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6007546000908190611f6290640100000000900463ffffffff166123c5565b60075463ffffffff680100000000000000008204811691611f84911687612bae565b611f8e9190612bae565b611f989085612c4a565b611fa29190612bae565b6008549091508190600090606490611fc39062010000900460ff1682612bee565b611fd09060ff1684612c4a565b611fda9190612c13565b6006549091506000906120049068010000000000000000900463ffffffff1664e8d4a51000612c4a565b61200e9083612bae565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b1580156120a657600080fd5b505afa1580156120ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120de91906129e6565b50945090925084915050801561210457506120f98242612c87565b60065463ffffffff16105b1561210e57506005545b6000811215610b7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610853565b600754600090819061219890640100000000900463ffffffff166123c5565b60075463ffffffff6801000000000000000082048116916121ba911688612bae565b6121c49190612bae565b6121ce9086612c4a565b6121d89190612bae565b90506000836121ef83670de0b6b3a7640000612c4a565b6121f99190612c13565b6008549091506000906064906122189062010000900460ff1682612bee565b6122259060ff1684612c4a565b61222f9190612c13565b60065490915060009061225590640100000000900463ffffffff1664e8d4a51000612c4a565b61225f9083612bae565b98975050505050505050565b6000612278603f83612c27565b610d7b906001612bc6565b73ffffffffffffffffffffffffffffffffffffffff8116331415612303576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610853565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561238b57600080fd5b6113888103905084604082048203116123a357600080fd5b50823b6123af57600080fd5b60008083516020850160008789f1949350505050565b6000466123d18161247e565b15612475576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561241f57600080fd5b505afa158015612433573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245791906127e6565b5050505091505083608c61246b9190612bae565b610fc79082612c4a565b50600092915050565b600061a4b1821480612492575062066eed82145b80610d7b57505062066eee1490565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c8557600080fd5b60008083601f8401126124d757600080fd5b50813567ffffffffffffffff8111156124ef57600080fd5b60208301915083602082850101111561250757600080fd5b9250929050565b600082601f83011261251f57600080fd5b813567ffffffffffffffff81111561253957612539612d2b565b61256a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612b5f565b81815284602083860101111561257f57600080fd5b816020850160208301376000918101602001919091529392505050565b803561ffff81168114610c8557600080fd5b803563ffffffff81168114610c8557600080fd5b803560ff81168114610c8557600080fd5b805169ffffffffffffffffffff81168114610c8557600080fd5b6000602082840312156125ff57600080fd5b610b7c826124a1565b6000806040838503121561261b57600080fd5b612624836124a1565b946020939093013593505050565b6000806000806060858703121561264857600080fd5b612651856124a1565b935060208501359250604085013567ffffffffffffffff81111561267457600080fd5b612680878288016124c5565b95989497509550505050565b60006020828403121561269e57600080fd5b8151610b7c81612d5a565b600080604083850312156126bc57600080fd5b823567ffffffffffffffff8111156126d357600080fd5b6126df8582860161250e565b92505060208301356126f081612d5a565b809150509250929050565b60006020828403121561270d57600080fd5b5035919050565b60006020828403121561272657600080fd5b5051919050565b6000806040838503121561274057600080fd5b8235915060208084013567ffffffffffffffff8082111561276057600080fd5b818601915086601f83011261277457600080fd5b81358181111561278657612786612d2b565b8060051b9150612797848301612b5f565b8181528481019084860184860187018b10156127b257600080fd5b600095505b838610156127d55780358352600195909501949186019186016127b7565b508096505050505050509250929050565b60008060008060008060c087890312156127ff57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561284257600080fd5b610b7c826125ae565b60008060008060006080868803121561286357600080fd5b61286c866125ae565b945061287a6020870161259c565b9350612888604087016125ae565b9250606086013567ffffffffffffffff8111156128a457600080fd5b6128b0888289016124c5565b969995985093965092949392505050565b600080600080608085870312156128d757600080fd5b6128e0856125ae565b93506128ee6020860161259c565b92506128fc604086016125ae565b9150606085013567ffffffffffffffff81111561291857600080fd5b6129248782880161250e565b91505092959194509250565b6000806040838503121561294357600080fd5b612624836125ae565b60008060008060008060008060006101208a8c03121561296b57600080fd5b6129748a6125ae565b985061298260208b016125ae565b975061299060408b016125c2565b965060608a013595506129a560808b016125c2565b94506129b360a08b016125ae565b935060c08a013592506129c860e08b016125ae565b91506129d76101008b016125ae565b90509295985092959850929598565b600080600080600060a086880312156129fe57600080fd5b612a07866125d3565b9450602086015193506040860151925060608601519150612a2a608087016125d3565b90509295509295909350565b6000815180845260005b81811015612a5c57602081850181015186830182015201612a40565b81811115612a6e576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610b7c6020830184612a36565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c080840152610fc760e0840182612a36565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612b5257845183529383019391830191600101612b36565b5090979650505050505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612ba657612ba6612d2b565b604052919050565b60008219821115612bc157612bc1612c9e565b500190565b600063ffffffff808316818516808303821115612be557612be5612c9e565b01949350505050565b600060ff821660ff84168060ff03821115612c0b57612c0b612c9e565b019392505050565b600082612c2257612c22612ccd565b500490565b600063ffffffff80841680612c3e57612c3e612ccd565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c8257612c82612c9e565b500290565b600082821015612c9957612c99612c9e565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114611bda57600080fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperABI = VRFV2PlusWrapperMetaData.ABI @@ -237,6 +237,26 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperCallerSession) CalculateRequestPriceNat return _VRFV2PlusWrapper.Contract.CalculateRequestPriceNative(&_VRFV2PlusWrapper.CallOpts, _callbackGasLimit) } +func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) CheckPaymentMode(opts *bind.CallOpts, extraArgs []byte, isLinkMode bool) error { + var out []interface{} + err := _VRFV2PlusWrapper.contract.Call(opts, &out, "checkPaymentMode", extraArgs, isLinkMode) + + if err != nil { + return err + } + + return err + +} + +func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) CheckPaymentMode(extraArgs []byte, isLinkMode bool) error { + return _VRFV2PlusWrapper.Contract.CheckPaymentMode(&_VRFV2PlusWrapper.CallOpts, extraArgs, isLinkMode) +} + +func (_VRFV2PlusWrapper *VRFV2PlusWrapperCallerSession) CheckPaymentMode(extraArgs []byte, isLinkMode bool) error { + return _VRFV2PlusWrapper.Contract.CheckPaymentMode(&_VRFV2PlusWrapper.CallOpts, extraArgs, isLinkMode) +} + func (_VRFV2PlusWrapper *VRFV2PlusWrapperCaller) EstimateRequestPrice(opts *bind.CallOpts, _callbackGasLimit uint32, _requestGasPriceWei *big.Int) (*big.Int, error) { var out []interface{} err := _VRFV2PlusWrapper.contract.Call(opts, &out, "estimateRequestPrice", _callbackGasLimit, _requestGasPriceWei) @@ -606,16 +626,16 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) RawFulfillRandomWord return _VRFV2PlusWrapper.Contract.RawFulfillRandomWords(&_VRFV2PlusWrapper.TransactOpts, requestId, randomWords) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) RequestRandomWordsInNative(opts *bind.TransactOpts, _callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32) (*types.Transaction, error) { - return _VRFV2PlusWrapper.contract.Transact(opts, "requestRandomWordsInNative", _callbackGasLimit, _requestConfirmations, _numWords) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) RequestRandomWordsInNative(opts *bind.TransactOpts, _callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32, extraArgs []byte) (*types.Transaction, error) { + return _VRFV2PlusWrapper.contract.Transact(opts, "requestRandomWordsInNative", _callbackGasLimit, _requestConfirmations, _numWords, extraArgs) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) RequestRandomWordsInNative(_callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32) (*types.Transaction, error) { - return _VRFV2PlusWrapper.Contract.RequestRandomWordsInNative(&_VRFV2PlusWrapper.TransactOpts, _callbackGasLimit, _requestConfirmations, _numWords) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) RequestRandomWordsInNative(_callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32, extraArgs []byte) (*types.Transaction, error) { + return _VRFV2PlusWrapper.Contract.RequestRandomWordsInNative(&_VRFV2PlusWrapper.TransactOpts, _callbackGasLimit, _requestConfirmations, _numWords, extraArgs) } -func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) RequestRandomWordsInNative(_callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32) (*types.Transaction, error) { - return _VRFV2PlusWrapper.Contract.RequestRandomWordsInNative(&_VRFV2PlusWrapper.TransactOpts, _callbackGasLimit, _requestConfirmations, _numWords) +func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) RequestRandomWordsInNative(_callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32, extraArgs []byte) (*types.Transaction, error) { + return _VRFV2PlusWrapper.Contract.RequestRandomWordsInNative(&_VRFV2PlusWrapper.TransactOpts, _callbackGasLimit, _requestConfirmations, _numWords, extraArgs) } func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) SetConfig(opts *bind.TransactOpts, _wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeLinkPPM uint32, fulfillmentFlatFeeNativePPM uint32) (*types.Transaction, error) { @@ -1175,6 +1195,8 @@ type VRFV2PlusWrapperInterface interface { CalculateRequestPriceNative(opts *bind.CallOpts, _callbackGasLimit uint32) (*big.Int, error) + CheckPaymentMode(opts *bind.CallOpts, extraArgs []byte, isLinkMode bool) error + EstimateRequestPrice(opts *bind.CallOpts, _callbackGasLimit uint32, _requestGasPriceWei *big.Int) (*big.Int, error) EstimateRequestPriceNative(opts *bind.CallOpts, _callbackGasLimit uint32, _requestGasPriceWei *big.Int) (*big.Int, error) @@ -1215,7 +1237,7 @@ type VRFV2PlusWrapperInterface interface { RawFulfillRandomWords(opts *bind.TransactOpts, requestId *big.Int, randomWords []*big.Int) (*types.Transaction, error) - RequestRandomWordsInNative(opts *bind.TransactOpts, _callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32) (*types.Transaction, error) + RequestRandomWordsInNative(opts *bind.TransactOpts, _callbackGasLimit uint32, _requestConfirmations uint16, _numWords uint32, extraArgs []byte) (*types.Transaction, error) SetConfig(opts *bind.TransactOpts, _wrapperGasOverhead uint32, _coordinatorGasOverhead uint32, _wrapperPremiumPercentage uint8, _keyHash [32]byte, _maxNumWords uint8, stalenessSeconds uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeLinkPPM uint32, fulfillmentFlatFeeNativePPM uint32) (*types.Transaction, error) diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper_consumer_example/vrfv2plus_wrapper_consumer_example.go b/core/gethwrappers/generated/vrfv2plus_wrapper_consumer_example/vrfv2plus_wrapper_consumer_example.go index ef1d4c30892..534f70a585f 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper_consumer_example/vrfv2plus_wrapper_consumer_example.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper_consumer_example/vrfv2plus_wrapper_consumer_example.go @@ -32,7 +32,7 @@ var ( var VRFV2PlusWrapperConsumerExampleMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vrfV2Wrapper\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"LINKAlreadySet\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"WrappedRequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"}],\"name\":\"WrapperRequestMade\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"makeRequest\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"}],\"name\":\"makeRequestNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"}],\"name\":\"setLinkToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLink\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60806040523480156200001157600080fd5b5060405162001650380380620016508339810160408190526200003491620001e2565b3380600084846001600160a01b038216156200006657600080546001600160a01b0319166001600160a01b0384161790555b600180546001600160a01b0319166001600160a01b03928316179055831615159050620000da5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b03848116919091179091558116156200010d576200010d8162000118565b50505050506200021a565b6001600160a01b038116331415620001735760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000d1565b600380546001600160a01b0319166001600160a01b03838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b80516001600160a01b0381168114620001dd57600080fd5b919050565b60008060408385031215620001f657600080fd5b6200020183620001c5565b91506200021160208401620001c5565b90509250929050565b611426806200022a6000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c806384276d8111610081578063a168fa891161005b578063a168fa8914610185578063d8a4676f146101d7578063f2fde38b146101f957600080fd5b806384276d81146101375780638da5cb5b1461014a5780639c24ea401461017257600080fd5b80631fe543e3116100b25780631fe543e31461010757806379ba50971461011c5780637a8042bd1461012457600080fd5b80630c09b832146100ce5780631e1a3499146100f4575b600080fd5b6100e16100dc366004611281565b61020c565b6040519081526020015b60405180910390f35b6100e1610102366004611281565b6103d1565b61011a610115366004611192565b61051e565b005b61011a6105d7565b61011a610132366004611160565b6106d8565b61011a610145366004611160565b6107c2565b60025460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100eb565b61011a610180366004611101565b6108b2565b6101ba610193366004611160565b600460205260009081526040902080546001820154600390920154909160ff908116911683565b6040805193845291151560208401521515908201526060016100eb565b6101ea6101e5366004611160565b610949565b6040516100eb939291906113c9565b61011a610207366004611101565b610a6b565b6000610216610a7f565b610221848484610b02565b6001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8716600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634306d3549060240160206040518083038186803b15801561029657600080fd5b505afa1580156102aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ce9190611179565b6040805160808101825282815260006020808301828152845183815280830186528486019081526060850184905288845260048352949092208351815591516001830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055925180519495509193909261035a926002850192910190611088565b5060609190910151600390910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560405181815282907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec49060200160405180910390a2509392505050565b60006103db610a7f565b6103e6848484610d07565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff8716600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b15801561045b57600080fd5b505afa15801561046f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104939190611179565b604080516080810182528281526000602080830182815284518381528083018652848601908152600160608601819052898552600484529590932084518155905194810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169515159590951790945590518051949550919361035a9260028501920190611088565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105c9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f6e6c792056524620563220506c757320777261707065722063616e2066756c60448201527f66696c6c0000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105d38282610e7a565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff163314610658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016105c0565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560038054909116905560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b6106e0610a7f565b60005473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61071d60025473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401602060405180830381600087803b15801561078a57600080fd5b505af115801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d3919061113e565b6107ca610a7f565b60006107eb60025473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610842576040519150601f19603f3d011682016040523d82523d6000602084013e610847565b606091505b50509050806105d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f77697468647261774e6174697665206661696c6564000000000000000000000060448201526064016105c0565b60005473ffffffffffffffffffffffffffffffffffffffff1615610902576040517f64f778ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60008181526004602052604081205481906060906109c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016105c0565b6000848152600460209081526040808320815160808101835281548152600182015460ff16151581850152600282018054845181870281018701865281815292959394860193830182828015610a3857602002820191906000526020600020905b815481526020019060010190808311610a24575b50505091835250506003919091015460ff1615156020918201528151908201516040909201519097919650945092505050565b610a73610a7f565b610a7c81610f91565b50565b60025473ffffffffffffffffffffffffffffffffffffffff163314610b00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016105c0565b565b600080546001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8716600482015273ffffffffffffffffffffffffffffffffffffffff92831692634000aea09216908190634306d3549060240160206040518083038186803b158015610b7f57600080fd5b505afa158015610b93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb79190611179565b6040805163ffffffff808b16602083015261ffff8a169282019290925290871660608201526080016040516020818303038152906040526040518463ffffffff1660e01b8152600401610c0c93929190611308565b602060405180830381600087803b158015610c2657600080fd5b505af1158015610c3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5e919061113e565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc757600080fd5b505afa158015610cdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cff9190611179565b949350505050565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff85166004820152600091829173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b158015610d7b57600080fd5b505afa158015610d8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db39190611179565b6001546040517f62a504fc00000000000000000000000000000000000000000000000000000000815263ffffffff808916600483015261ffff881660248301528616604482015291925073ffffffffffffffffffffffffffffffffffffffff16906362a504fc9083906064016020604051808303818588803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e719190611179565b95945050505050565b600082815260046020526040902054610eef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016105c0565b6000828152600460209081526040909120600181810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790558251610f4292600290920191840190611088565b50600082815260046020526040908190205490517f6c84e12b4c188e61f1b4727024a5cf05c025fa58467e5eedf763c0744c89da7b91610f8591859185916113a0565b60405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff8116331415611011576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016105c0565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b8280548282559060005260206000209081019282156110c3579160200282015b828111156110c35782518255916020019190600101906110a8565b506110cf9291506110d3565b5090565b5b808211156110cf57600081556001016110d4565b803563ffffffff811681146110fc57600080fd5b919050565b60006020828403121561111357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461113757600080fd5b9392505050565b60006020828403121561115057600080fd5b8151801515811461113757600080fd5b60006020828403121561117257600080fd5b5035919050565b60006020828403121561118b57600080fd5b5051919050565b600080604083850312156111a557600080fd5b8235915060208084013567ffffffffffffffff808211156111c557600080fd5b818601915086601f8301126111d957600080fd5b8135818111156111eb576111eb6113ea565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561122e5761122e6113ea565b604052828152858101935084860182860187018b101561124d57600080fd5b600095505b83861015611270578035855260019590950194938601938601611252565b508096505050505050509250929050565b60008060006060848603121561129657600080fd5b61129f846110e8565b9250602084013561ffff811681146112b657600080fd5b91506112c4604085016110e8565b90509250925092565b600081518084526020808501945080840160005b838110156112fd578151875295820195908201906001016112e1565b509495945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815260006020848184015260606040840152835180606085015260005b818110156113585785810183015185820160800152820161133c565b8181111561136a576000608083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160800195945050505050565b8381526060602082015260006113b960608301856112cd565b9050826040830152949350505050565b8381528215156020820152606060408201526000610e7160608301846112cd565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x60806040523480156200001157600080fd5b506040516200176a3803806200176a8339810160408190526200003491620001e2565b3380600084846001600160a01b038216156200006657600080546001600160a01b0319166001600160a01b0384161790555b600180546001600160a01b0319166001600160a01b03928316179055831615159050620000da5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b03848116919091179091558116156200010d576200010d8162000118565b50505050506200021a565b6001600160a01b038116331415620001735760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000d1565b600380546001600160a01b0319166001600160a01b03838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b80516001600160a01b0381168114620001dd57600080fd5b919050565b60008060408385031215620001f657600080fd5b6200020183620001c5565b91506200021160208401620001c5565b90509250929050565b611540806200022a6000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c806384276d8111610081578063a168fa891161005b578063a168fa8914610185578063d8a4676f146101d7578063f2fde38b146101f957600080fd5b806384276d81146101375780638da5cb5b1461014a5780639c24ea401461017257600080fd5b80631fe543e3116100b25780631fe543e31461010757806379ba50971461011c5780637a8042bd1461012457600080fd5b80630c09b832146100ce5780631e1a3499146100f4575b600080fd5b6100e16100dc366004611360565b61020c565b6040519081526020015b60405180910390f35b6100e1610102366004611360565b6103f1565b61011a610115366004611271565b61055d565b005b61011a610616565b61011a61013236600461123f565b610717565b61011a61014536600461123f565b610801565b60025460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100eb565b61011a6101803660046111e0565b6108f1565b6101ba61019336600461123f565b600460205260009081526040902080546001820154600390920154909160ff908116911683565b6040805193845291151560208401521515908201526060016100eb565b6101ea6101e536600461123f565b610988565b6040516100eb939291906114b0565b61011a6102073660046111e0565b610aaa565b6000610216610abe565b6000610232604051806020016040528060001515815250610b41565b905061024085858584610bfd565b6001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8816600482015291935060009173ffffffffffffffffffffffffffffffffffffffff90911690634306d3549060240160206040518083038186803b1580156102b557600080fd5b505afa1580156102c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ed9190611258565b6040805160808101825282815260006020808301828152845183815280830186528486019081526060850184905289845260048352949092208351815591516001830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790559251805194955091939092610379926002850192910190611167565b5060609190910151600390910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560405181815283907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec49060200160405180910390a250509392505050565b60006103fb610abe565b6000610417604051806020016040528060011515815250610b41565b905061042585858584610df2565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff8816600482015291935060009173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b15801561049a57600080fd5b505afa1580156104ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d29190611258565b6040805160808101825282815260006020808301828152845183815280830186528486019081526001606086018190528a8552600484529590932084518155905194810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016951515959095179094559051805194955091936103799260028501920190611167565b60015473ffffffffffffffffffffffffffffffffffffffff163314610608576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f6e6c792056524620563220506c757320777261707065722063616e2066756c60448201527f66696c6c0000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6106128282610f59565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff163314610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016105ff565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560038054909116905560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b61071f610abe565b60005473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61075c60025473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401602060405180830381600087803b1580156107c957600080fd5b505af11580156107dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610612919061121d565b610809610abe565b600061082a60025473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610881576040519150601f19603f3d011682016040523d82523d6000602084013e610886565b606091505b5050905080610612576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f77697468647261774e6174697665206661696c6564000000000000000000000060448201526064016105ff565b60005473ffffffffffffffffffffffffffffffffffffffff1615610941576040517f64f778ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000818152600460205260408120548190606090610a02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016105ff565b6000848152600460209081526040808320815160808101835281548152600182015460ff16151581850152600282018054845181870281018701865281815292959394860193830182828015610a7757602002820191906000526020600020905b815481526020019060010190808311610a63575b50505091835250506003919091015460ff1615156020918201528151908201516040909201519097919650945092505050565b610ab2610abe565b610abb81611070565b50565b60025473ffffffffffffffffffffffffffffffffffffffff163314610b3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016105ff565b565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401610b7a91511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b600080546001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8816600482015273ffffffffffffffffffffffffffffffffffffffff92831692634000aea09216908190634306d3549060240160206040518083038186803b158015610c7a57600080fd5b505afa158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb29190611258565b88888888604051602001610cc994939291906114d1565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610cf693929190611452565b602060405180830381600087803b158015610d1057600080fd5b505af1158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d48919061121d565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b815260040160206040518083038186803b158015610db157600080fd5b505afa158015610dc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de99190611258565b95945050505050565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff86166004820152600091829173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b158015610e6657600080fd5b505afa158015610e7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9e9190611258565b6001546040517f9cfc058e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639cfc058e908390610efd908a908a908a908a906004016114d1565b6020604051808303818588803b158015610f1657600080fd5b505af1158015610f2a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f4f9190611258565b9695505050505050565b600082815260046020526040902054610fce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016105ff565b6000828152600460209081526040909120600181810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055825161102192600290920191840190611167565b50600082815260046020526040908190205490517f6c84e12b4c188e61f1b4727024a5cf05c025fa58467e5eedf763c0744c89da7b916110649185918591611487565b60405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff81163314156110f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016105ff565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b8280548282559060005260206000209081019282156111a2579160200282015b828111156111a2578251825591602001919060010190611187565b506111ae9291506111b2565b5090565b5b808211156111ae57600081556001016111b3565b803563ffffffff811681146111db57600080fd5b919050565b6000602082840312156111f257600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461121657600080fd5b9392505050565b60006020828403121561122f57600080fd5b8151801515811461121657600080fd5b60006020828403121561125157600080fd5b5035919050565b60006020828403121561126a57600080fd5b5051919050565b6000806040838503121561128457600080fd5b8235915060208084013567ffffffffffffffff808211156112a457600080fd5b818601915086601f8301126112b857600080fd5b8135818111156112ca576112ca611504565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561130d5761130d611504565b604052828152858101935084860182860187018b101561132c57600080fd5b600095505b8386101561134f578035855260019590950194938601938601611331565b508096505050505050509250929050565b60008060006060848603121561137557600080fd5b61137e846111c7565b9250602084013561ffff8116811461139557600080fd5b91506113a3604085016111c7565b90509250925092565b600081518084526020808501945080840160005b838110156113dc578151875295820195908201906001016113c0565b509495945050505050565b6000815180845260005b8181101561140d576020818501810151868301820152016113f1565b8181111561141f576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201526000610de960608301846113e7565b8381526060602082015260006114a060608301856113ac565b9050826040830152949350505050565b8381528215156020820152606060408201526000610de960608301846113ac565b600063ffffffff808716835261ffff8616602084015280851660408401525060806060830152610f4f60808301846113e7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperConsumerExampleABI = VRFV2PlusWrapperConsumerExampleMetaData.ABI diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go b/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go index 4318b4bdeaf..98ab26fc295 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go @@ -32,7 +32,7 @@ var ( var VRFV2PlusWrapperLoadTestConsumerMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vrfV2PlusWrapper\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"LINKAlreadySet\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"WrappedRequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"}],\"name\":\"WrapperRequestMade\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWrapper\",\"outputs\":[{\"internalType\":\"contractVRFV2PlusWrapperInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"makeRequests\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"makeRequestsNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"}],\"name\":\"setLinkToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLink\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x6080604052600060065560006007556103e76008553480156200002157600080fd5b5060405162001def38038062001def8339810160408190526200004491620001f2565b3380600084846001600160a01b038216156200007657600080546001600160a01b0319166001600160a01b0384161790555b600180546001600160a01b0319166001600160a01b03928316179055831615159050620000ea5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b03848116919091179091558116156200011d576200011d8162000128565b50505050506200022a565b6001600160a01b038116331415620001835760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000e1565b600380546001600160a01b0319166001600160a01b03838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b80516001600160a01b0381168114620001ed57600080fd5b919050565b600080604083850312156200020657600080fd5b6200021183620001d5565b91506200022160208401620001d5565b90509250929050565b611bb5806200023a6000396000f3fe6080604052600436106101635760003560e01c80638f6b7070116100c0578063d826f88f11610074578063dc1670db11610059578063dc1670db14610421578063f176596214610437578063f2fde38b1461045757600080fd5b8063d826f88f146103c2578063d8a4676f146103ee57600080fd5b8063a168fa89116100a5578063a168fa89146102f7578063afacbf9c1461038c578063b1e21749146103ac57600080fd5b80638f6b7070146102ac5780639c24ea40146102d757600080fd5b806374dba124116101175780637a8042bd116100fc5780637a8042bd1461022057806384276d81146102405780638da5cb5b1461026057600080fd5b806374dba124146101f557806379ba50971461020b57600080fd5b80631fe543e3116101485780631fe543e3146101a7578063557d2e92146101c9578063737144bc146101df57600080fd5b806312065fe01461016f5780631757f11c1461019157600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b50475b6040519081526020015b60405180910390f35b34801561019d57600080fd5b5061017e60075481565b3480156101b357600080fd5b506101c76101c23660046117c2565b610477565b005b3480156101d557600080fd5b5061017e60055481565b3480156101eb57600080fd5b5061017e60065481565b34801561020157600080fd5b5061017e60085481565b34801561021757600080fd5b506101c7610530565b34801561022c57600080fd5b506101c761023b366004611790565b610631565b34801561024c57600080fd5b506101c761025b366004611790565b61071b565b34801561026c57600080fd5b5060025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610188565b3480156102b857600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff16610287565b3480156102e357600080fd5b506101c76102f2366004611731565b61080b565b34801561030357600080fd5b50610355610312366004611790565b600b602052600090815260409020805460018201546003830154600484015460058501546006860154600790960154949560ff9485169593949293919290911687565b604080519788529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e001610188565b34801561039857600080fd5b506101c76103a73660046118b1565b6108a2565b3480156103b857600080fd5b5061017e60095481565b3480156103ce57600080fd5b506101c76000600681905560078190556103e76008556005819055600455565b3480156103fa57600080fd5b5061040e610409366004611790565b610b12565b6040516101889796959493929190611a01565b34801561042d57600080fd5b5061017e60045481565b34801561044357600080fd5b506101c76104523660046118b1565b610c95565b34801561046357600080fd5b506101c7610472366004611731565b610efd565b60015473ffffffffffffffffffffffffffffffffffffffff163314610522576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f6e6c792056524620563220506c757320777261707065722063616e2066756c60448201527f66696c6c0000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61052c8282610f11565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146105b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610519565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560038054909116905560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b6106396110f0565b60005473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61067660025473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401602060405180830381600087803b1580156106e357600080fd5b505af11580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052c919061176e565b6107236110f0565b600061074460025473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461079b576040519150601f19603f3d011682016040523d82523d6000602084013e6107a0565b606091505b505090508061052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f77697468647261774e6174697665206661696c656400000000000000000000006044820152606401610519565b60005473ffffffffffffffffffffffffffffffffffffffff161561085b576040517f64f778ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6108aa6110f0565b60005b8161ffff168161ffff161015610b0b5760006108ca868686611173565b6009819055905060006108db611378565b6001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8a16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634306d3549060240160206040518083038186803b15801561095057600080fd5b505afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098891906117a9565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c0850184905260e08501849052898452600b8352949092208351815591516001830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790559251805194955091939092610a309260028501929101906116a6565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610aa383611b11565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610aed9084815260200190565b60405180910390a25050508080610b0390611aef565b9150506108ad565b5050505050565b6000818152600b602052604081205481906060908290819081908190610b94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000888152600b6020908152604080832081516101008101835281548152600182015460ff16151581850152600282018054845181870281018701865281815292959394860193830182828015610c0a57602002820191906000526020600020905b815481526020019060010190808311610bf6575b50505050508152602001600382015481526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff1615151515815250509050806000015181602001518260400151836060015184608001518560a001518660c00151975097509750975097509750975050919395979092949650565b610c9d6110f0565b60005b8161ffff168161ffff161015610b0b576000610cbd868686611415565b600981905590506000610cce611378565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff8a16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b158015610d4357600080fd5b505afa158015610d57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7b91906117a9565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c08501849052600160e086018190528a8552600b84529590932084518155905194810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001695151595909517909455905180519495509193610e2292600285019201906116a6565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610e9583611b11565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610edf9084815260200190565b60405180910390a25050508080610ef590611aef565b915050610ca0565b610f056110f0565b610f0e81611588565b50565b6000828152600b6020526040902054610f86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000610f90611378565b6000848152600a602052604081205491925090610fad9083611ad8565b90506000610fbe82620f4240611a9b565b9050600754821115610fd05760078290555b6008548210610fe157600854610fe3565b815b600855600454610ff35780611026565b600454611001906001611a48565b816004546006546110129190611a9b565b61101c9190611a48565b6110269190611a60565b6006556004805490600061103983611b11565b90915550506000858152600b60209081526040909120600181810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790558551611091926002909201918701906116a6565b506000858152600b602052604090819020426004820155600681018590555490517f6c84e12b4c188e61f1b4727024a5cf05c025fa58467e5eedf763c0744c89da7b916110e191889188916119d8565b60405180910390a15050505050565b60025473ffffffffffffffffffffffffffffffffffffffff163314611171576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610519565b565b600080546001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8716600482015273ffffffffffffffffffffffffffffffffffffffff92831692634000aea09216908190634306d3549060240160206040518083038186803b1580156111f057600080fd5b505afa158015611204573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122891906117a9565b6040805163ffffffff808b16602083015261ffff8a169282019290925290871660608201526080016040516020818303038152906040526040518463ffffffff1660e01b815260040161127d93929190611940565b602060405180830381600087803b15801561129757600080fd5b505af11580156112ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112cf919061176e565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b815260040160206040518083038186803b15801561133857600080fd5b505afa15801561134c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137091906117a9565b949350505050565b6000466113848161167f565b1561140e57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113d057600080fd5b505afa1580156113e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140891906117a9565b91505090565b4391505090565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff85166004820152600091829173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c191906117a9565b6001546040517f62a504fc00000000000000000000000000000000000000000000000000000000815263ffffffff808916600483015261ffff881660248301528616604482015291925073ffffffffffffffffffffffffffffffffffffffff16906362a504fc9083906064016020604051808303818588803b15801561154657600080fd5b505af115801561155a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061157f91906117a9565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8116331415611608576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610519565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b600061a4b1821480611693575062066eed82145b806116a0575062066eee82145b92915050565b8280548282559060005260206000209081019282156116e1579160200282015b828111156116e15782518255916020019190600101906116c6565b506116ed9291506116f1565b5090565b5b808211156116ed57600081556001016116f2565b803561ffff8116811461171857600080fd5b919050565b803563ffffffff8116811461171857600080fd5b60006020828403121561174357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461176757600080fd5b9392505050565b60006020828403121561178057600080fd5b8151801515811461176757600080fd5b6000602082840312156117a257600080fd5b5035919050565b6000602082840312156117bb57600080fd5b5051919050565b600080604083850312156117d557600080fd5b8235915060208084013567ffffffffffffffff808211156117f557600080fd5b818601915086601f83011261180957600080fd5b81358181111561181b5761181b611b79565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561185e5761185e611b79565b604052828152858101935084860182860187018b101561187d57600080fd5b600095505b838610156118a0578035855260019590950194938601938601611882565b508096505050505050509250929050565b600080600080608085870312156118c757600080fd5b6118d08561171d565b93506118de60208601611706565b92506118ec6040860161171d565b91506118fa60608601611706565b905092959194509250565b600081518084526020808501945080840160005b8381101561193557815187529582019590820190600101611919565b509495945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815260006020848184015260606040840152835180606085015260005b8181101561199057858101830151858201608001528201611974565b818111156119a2576000608083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160800195945050505050565b8381526060602082015260006119f16060830185611905565b9050826040830152949350505050565b878152861515602082015260e060408201526000611a2260e0830188611905565b90508560608301528460808301528360a08301528260c083015298975050505050505050565b60008219821115611a5b57611a5b611b4a565b500190565b600082611a96577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611ad357611ad3611b4a565b500290565b600082821015611aea57611aea611b4a565b500390565b600061ffff80831681811415611b0757611b07611b4a565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611b4357611b43611b4a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x6080604052600060065560006007556103e76008553480156200002157600080fd5b5060405162001f0a38038062001f0a8339810160408190526200004491620001f2565b3380600084846001600160a01b038216156200007657600080546001600160a01b0319166001600160a01b0384161790555b600180546001600160a01b0319166001600160a01b03928316179055831615159050620000ea5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b03848116919091179091558116156200011d576200011d8162000128565b50505050506200022a565b6001600160a01b038116331415620001835760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000e1565b600380546001600160a01b0319166001600160a01b03838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b80516001600160a01b0381168114620001ed57600080fd5b919050565b600080604083850312156200020657600080fd5b6200021183620001d5565b91506200022160208401620001d5565b90509250929050565b611cd0806200023a6000396000f3fe6080604052600436106101635760003560e01c80638f6b7070116100c0578063d826f88f11610074578063dc1670db11610059578063dc1670db14610421578063f176596214610437578063f2fde38b1461045757600080fd5b8063d826f88f146103c2578063d8a4676f146103ee57600080fd5b8063a168fa89116100a5578063a168fa89146102f7578063afacbf9c1461038c578063b1e21749146103ac57600080fd5b80638f6b7070146102ac5780639c24ea40146102d757600080fd5b806374dba124116101175780637a8042bd116100fc5780637a8042bd1461022057806384276d81146102405780638da5cb5b1461026057600080fd5b806374dba124146101f557806379ba50971461020b57600080fd5b80631fe543e3116101485780631fe543e3146101a7578063557d2e92146101c9578063737144bc146101df57600080fd5b806312065fe01461016f5780631757f11c1461019157600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b50475b6040519081526020015b60405180910390f35b34801561019d57600080fd5b5061017e60075481565b3480156101b357600080fd5b506101c76101c23660046118a2565b610477565b005b3480156101d557600080fd5b5061017e60055481565b3480156101eb57600080fd5b5061017e60065481565b34801561020157600080fd5b5061017e60085481565b34801561021757600080fd5b506101c7610530565b34801561022c57600080fd5b506101c761023b366004611870565b610631565b34801561024c57600080fd5b506101c761025b366004611870565b61071b565b34801561026c57600080fd5b5060025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610188565b3480156102b857600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff16610287565b3480156102e357600080fd5b506101c76102f2366004611811565b61080b565b34801561030357600080fd5b50610355610312366004611870565b600b602052600090815260409020805460018201546003830154600484015460058501546006860154600790960154949560ff9485169593949293919290911687565b604080519788529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e001610188565b34801561039857600080fd5b506101c76103a7366004611991565b6108a2565b3480156103b857600080fd5b5061017e60095481565b3480156103ce57600080fd5b506101c76000600681905560078190556103e76008556005819055600455565b3480156103fa57600080fd5b5061040e610409366004611870565b610b32565b6040516101889796959493929190611ae9565b34801561042d57600080fd5b5061017e60045481565b34801561044357600080fd5b506101c7610452366004611991565b610cb5565b34801561046357600080fd5b506101c7610472366004611811565b610f3d565b60015473ffffffffffffffffffffffffffffffffffffffff163314610522576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f6e6c792056524620563220506c757320777261707065722063616e2066756c60448201527f66696c6c0000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61052c8282610f51565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146105b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610519565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560038054909116905560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b610639611130565b60005473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61067660025473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401602060405180830381600087803b1580156106e357600080fd5b505af11580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052c919061184e565b610723611130565b600061074460025473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461079b576040519150601f19603f3d011682016040523d82523d6000602084013e6107a0565b606091505b505090508061052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f77697468647261774e6174697665206661696c656400000000000000000000006044820152606401610519565b60005473ffffffffffffffffffffffffffffffffffffffff161561085b576040517f64f778ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6108aa611130565b60005b8161ffff168161ffff161015610b2b5760006108d96040518060200160405280600015158152506111b3565b905060006108e98787878561126f565b6009819055905060006108fa611464565b6001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8b16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634306d3549060240160206040518083038186803b15801561096f57600080fd5b505afa158015610983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a79190611889565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c0850184905260e08501849052898452600b8352949092208351815591516001830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790559251805194955091939092610a4f926002850192910190611786565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610ac283611c2c565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610b0c9084815260200190565b60405180910390a2505050508080610b2390611c0a565b9150506108ad565b5050505050565b6000818152600b602052604081205481906060908290819081908190610bb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000888152600b6020908152604080832081516101008101835281548152600182015460ff16151581850152600282018054845181870281018701865281815292959394860193830182828015610c2a57602002820191906000526020600020905b815481526020019060010190808311610c16575b50505050508152602001600382015481526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff1615151515815250509050806000015181602001518260400151836060015184608001518560a001518660c00151975097509750975097509750975050919395979092949650565b610cbd611130565b60005b8161ffff168161ffff161015610b2b576000610cec6040518060200160405280600115158152506111b3565b90506000610cfc87878785611501565b600981905590506000610d0d611464565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff8b16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b158015610d8257600080fd5b505afa158015610d96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dba9190611889565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c08501849052600160e086018190528a8552600b84529590932084518155905194810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001695151595909517909455905180519495509193610e619260028501920190611786565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610ed483611c2c565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610f1e9084815260200190565b60405180910390a2505050508080610f3590611c0a565b915050610cc0565b610f45611130565b610f4e81611668565b50565b6000828152600b6020526040902054610fc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000610fd0611464565b6000848152600a602052604081205491925090610fed9083611bf3565b90506000610ffe82620f4240611bb6565b90506007548211156110105760078290555b600854821061102157600854611023565b815b6008556004546110335780611066565b600454611041906001611b63565b816004546006546110529190611bb6565b61105c9190611b63565b6110669190611b7b565b6006556004805490600061107983611c2c565b90915550506000858152600b60209081526040909120600181810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909117905585516110d192600290920191870190611786565b506000858152600b602052604090819020426004820155600681018590555490517f6c84e12b4c188e61f1b4727024a5cf05c025fa58467e5eedf763c0744c89da7b916111219188918891611ac0565b60405180910390a15050505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146111b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610519565b565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa826040516024016111ec91511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b600080546001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8816600482015273ffffffffffffffffffffffffffffffffffffffff92831692634000aea09216908190634306d3549060240160206040518083038186803b1580156112ec57600080fd5b505afa158015611300573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113249190611889565b8888888860405160200161133b9493929190611b30565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161136893929190611a8b565b602060405180830381600087803b15801561138257600080fd5b505af1158015611396573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ba919061184e565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b815260040160206040518083038186803b15801561142357600080fd5b505afa158015611437573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145b9190611889565b95945050505050565b6000466114708161175f565b156114fa57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156114bc57600080fd5b505afa1580156114d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f49190611889565b91505090565b4391505090565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff86166004820152600091829173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b15801561157557600080fd5b505afa158015611589573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ad9190611889565b6001546040517f9cfc058e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639cfc058e90839061160c908a908a908a908a90600401611b30565b6020604051808303818588803b15801561162557600080fd5b505af1158015611639573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061165e9190611889565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff81163314156116e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610519565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b600061a4b1821480611773575062066eed82145b80611780575062066eee82145b92915050565b8280548282559060005260206000209081019282156117c1579160200282015b828111156117c15782518255916020019190600101906117a6565b506117cd9291506117d1565b5090565b5b808211156117cd57600081556001016117d2565b803561ffff811681146117f857600080fd5b919050565b803563ffffffff811681146117f857600080fd5b60006020828403121561182357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461184757600080fd5b9392505050565b60006020828403121561186057600080fd5b8151801515811461184757600080fd5b60006020828403121561188257600080fd5b5035919050565b60006020828403121561189b57600080fd5b5051919050565b600080604083850312156118b557600080fd5b8235915060208084013567ffffffffffffffff808211156118d557600080fd5b818601915086601f8301126118e957600080fd5b8135818111156118fb576118fb611c94565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561193e5761193e611c94565b604052828152858101935084860182860187018b101561195d57600080fd5b600095505b83861015611980578035855260019590950194938601938601611962565b508096505050505050509250929050565b600080600080608085870312156119a757600080fd5b6119b0856117fd565b93506119be602086016117e6565b92506119cc604086016117fd565b91506119da606086016117e6565b905092959194509250565b600081518084526020808501945080840160005b83811015611a15578151875295820195908201906001016119f9565b509495945050505050565b6000815180845260005b81811015611a4657602081850181015186830182015201611a2a565b81811115611a58576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8416815282602082015260606040820152600061145b6060830184611a20565b838152606060208201526000611ad960608301856119e5565b9050826040830152949350505050565b878152861515602082015260e060408201526000611b0a60e08301886119e5565b90508560608301528460808301528360a08301528260c083015298975050505050505050565b600063ffffffff808716835261ffff861660208401528085166040840152506080606083015261165e6080830184611a20565b60008219821115611b7657611b76611c65565b500190565b600082611bb1577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611bee57611bee611c65565b500290565b600082821015611c0557611c05611c65565b500390565b600061ffff80831681811415611c2257611c22611c65565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611c5e57611c5e611c65565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperLoadTestConsumerABI = VRFV2PlusWrapperLoadTestConsumerMetaData.ABI diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index c9e6ed06309..e1c577e8d01 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -97,10 +97,10 @@ vrfv2_transparent_upgradeable_proxy: ../../contracts/solc/v0.8.6/VRFV2Transparen vrfv2_wrapper: ../../contracts/solc/v0.8.6/VRFV2Wrapper.abi ../../contracts/solc/v0.8.6/VRFV2Wrapper.bin 7682891b23b7cae7f79803b662556637c52d295c415fbb0708dbec1e5303c01a vrfv2_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample.bin 3c5c9f1c501e697a7e77e959b48767e2a0bb1372393fd7686f7aaef3eb794231 vrfv2_wrapper_interface: ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.abi ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.bin ff8560169de171a68b360b7438d13863682d07040d984fd0fb096b2379421003 -vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contracts/solc/v0.8.6/VRFV2PlusClient.bin bec10896851c433bb5997c96d96d9871b335924a59a8ab07d7062fcbc3992c6e +vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contracts/solc/v0.8.6/VRFV2PlusClient.bin 3ffbfa4971a7e5f46051a26b1722613f265d89ea1867547ecec58500953a9501 vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 2c480a6d7955d33a00690fdd943486d95802e48a03f3cc243df314448e4ddb2c vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin e5ae923d5fdfa916303cd7150b8474ccd912e14bafe950c6431f6ec94821f642 vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 -vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin af73d5757129d4de1d287716ecdc560427904bc2a68b7dace4e6b5ac02539a31 -vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin d4ddf86da21b87c013f551b2563ab68712ea9d4724894664d5778f6b124f4e78 -vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 4e8dcc8f60568aa09cc1adc800a56161f46642edc77768c3efab222a30a0e5ae +vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin abbc47c56be3aef960abb9682f71c7a2e46ee7aab9fbe7d47030f01330329de4 +vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin 4b3da45ff177e09b1e731b5b0cf4e050033a600ef8b0d32e79eec97db5c72408 +vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin b1ba4c41b6fafe94fdf2f9ad273b4f95ff1c07129ced2883be75fad230836b09 From 0adc90ce249919e0a269a4bf01b975ad7020fbe4 Mon Sep 17 00:00:00 2001 From: george-dorin <120329946+george-dorin@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:53:00 +0300 Subject: [PATCH 39/84] Force RPC switching interval (#10726) * Initial draft * - Fix tests - Add subscriber count * - Fix resolver test * - Update SubscribersCount check * - Update CHANGELOG.md * - Fix typo in CHANGELOG.md * - Fix typo in CONFIG.md * - Update naming * - Update config comment * - Fix data race in test * - Update LeaseDuration definition - Add read lock for SubscribersCount - Change log level when LeaseDuration is disabled * - Add waitgroup - Reset lease when new best node is selected * - Don't cancel alive loop subscription - Change active node when doing lease check * - Update config description --- core/chains/evm/chain.go | 2 +- core/chains/evm/client/client.go | 4 +- core/chains/evm/client/erroring_node.go | 6 ++ core/chains/evm/client/helpers_test.go | 6 +- core/chains/evm/client/node.go | 25 +++++++ core/chains/evm/client/pool.go | 52 +++++++++++++- core/chains/evm/client/pool_test.go | 70 ++++++++++++++++++- .../evm/config/chain_scoped_node_pool.go | 4 ++ core/chains/evm/config/config.go | 1 + core/chains/evm/config/toml/config.go | 4 ++ .../evm/config/toml/defaults/fallback.toml | 1 + core/chains/evm/mocks/node.go | 19 +++++ core/config/docs/chains-evm.toml | 8 +++ core/services/chainlink/config_test.go | 3 + .../chainlink/testdata/config-full.toml | 1 + .../config-multi-chain-effective.toml | 3 + core/web/resolver/testdata/config-full.toml | 1 + .../config-multi-chain-effective.toml | 3 + docs/CHANGELOG.md | 1 + docs/CONFIG.md | 51 ++++++++++++++ .../disk-based-logging-disabled.txtar | 1 + .../validate/disk-based-logging-no-dir.txtar | 1 + .../node/validate/disk-based-logging.txtar | 1 + testdata/scripts/node/validate/invalid.txtar | 1 + testdata/scripts/node/validate/valid.txtar | 1 + 25 files changed, 261 insertions(+), 9 deletions(-) diff --git a/core/chains/evm/chain.go b/core/chains/evm/chain.go index b4986ad0c25..2b6ee55474a 100644 --- a/core/chains/evm/chain.go +++ b/core/chains/evm/chain.go @@ -484,7 +484,7 @@ func newEthClientFromChain(cfg evmconfig.NodePool, noNewHeadsThreshold time.Dura primaries = append(primaries, primary) } } - return evmclient.NewClientWithNodes(lggr, cfg.SelectionMode(), noNewHeadsThreshold, primaries, sendonlys, chainID, chainType) + return evmclient.NewClientWithNodes(lggr, cfg.SelectionMode(), cfg.LeaseDuration(), noNewHeadsThreshold, primaries, sendonlys, chainID, chainType) } func newPrimary(cfg evmconfig.NodePool, noNewHeadsThreshold time.Duration, lggr logger.Logger, n *toml.Node, id int32, chainID *big.Int) (evmclient.Node, error) { diff --git a/core/chains/evm/client/client.go b/core/chains/evm/client/client.go index 339542f4ce1..3a3b8b23a92 100644 --- a/core/chains/evm/client/client.go +++ b/core/chains/evm/client/client.go @@ -108,8 +108,8 @@ var _ htrktypes.Client[*evmtypes.Head, ethereum.Subscription, *big.Int, common.H // NewClientWithNodes instantiates a client from a list of nodes // Currently only supports one primary -func NewClientWithNodes(logger logger.Logger, selectionMode string, noNewHeadsThreshold time.Duration, primaryNodes []Node, sendOnlyNodes []SendOnlyNode, chainID *big.Int, chainType config.ChainType) (*client, error) { - pool := NewPool(logger, selectionMode, noNewHeadsThreshold, primaryNodes, sendOnlyNodes, chainID, chainType) +func NewClientWithNodes(logger logger.Logger, selectionMode string, leaseDuration time.Duration, noNewHeadsThreshold time.Duration, primaryNodes []Node, sendOnlyNodes []SendOnlyNode, chainID *big.Int, chainType config.ChainType) (*client, error) { + pool := NewPool(logger, selectionMode, leaseDuration, noNewHeadsThreshold, primaryNodes, sendOnlyNodes, chainID, chainType) return &client{ logger: logger, pool: pool, diff --git a/core/chains/evm/client/erroring_node.go b/core/chains/evm/client/erroring_node.go index 152b52a7acb..21c4d269ea4 100644 --- a/core/chains/evm/client/erroring_node.go +++ b/core/chains/evm/client/erroring_node.go @@ -20,6 +20,12 @@ type erroringNode struct { errMsg string } +func (e *erroringNode) UnsubscribeAllExceptAliveLoop() {} + +func (e *erroringNode) SubscribersCount() int32 { + return 0 +} + func (e *erroringNode) ChainID() (chainID *big.Int) { return nil } func (e *erroringNode) Start(ctx context.Context) error { return errors.New(e.errMsg) } diff --git a/core/chains/evm/client/helpers_test.go b/core/chains/evm/client/helpers_test.go index 8a660eb38db..342a9143432 100644 --- a/core/chains/evm/client/helpers_test.go +++ b/core/chains/evm/client/helpers_test.go @@ -19,12 +19,16 @@ type TestNodePoolConfig struct { NodePollInterval time.Duration NodeSelectionMode string NodeSyncThreshold uint32 + NodeLeaseDuration time.Duration } func (tc TestNodePoolConfig) PollFailureThreshold() uint32 { return tc.NodePollFailureThreshold } func (tc TestNodePoolConfig) PollInterval() time.Duration { return tc.NodePollInterval } func (tc TestNodePoolConfig) SelectionMode() string { return tc.NodeSelectionMode } func (tc TestNodePoolConfig) SyncThreshold() uint32 { return tc.NodeSyncThreshold } +func (tc TestNodePoolConfig) LeaseDuration() time.Duration { + return tc.NodeLeaseDuration +} func NewClientWithTestNode(t *testing.T, nodePoolCfg config.NodePool, noNewHeadsThreshold time.Duration, rpcUrl string, rpcHTTPURL *url.URL, sendonlyRPCURLs []url.URL, id int32, chainID *big.Int) (*client, error) { parsed, err := url.ParseRequestURI(rpcUrl) @@ -50,7 +54,7 @@ func NewClientWithTestNode(t *testing.T, nodePoolCfg config.NodePool, noNewHeads sendonlys = append(sendonlys, s) } - pool := NewPool(lggr, nodePoolCfg.SelectionMode(), noNewHeadsThreshold, primaries, sendonlys, chainID, "") + pool := NewPool(lggr, nodePoolCfg.SelectionMode(), nodePoolCfg.LeaseDuration(), noNewHeadsThreshold, primaries, sendonlys, chainID, "") c := &client{logger: lggr, pool: pool} t.Cleanup(c.Close) return c, nil diff --git a/core/chains/evm/client/node.go b/core/chains/evm/client/node.go index 84344a5a076..4f7132a6cc4 100644 --- a/core/chains/evm/client/node.go +++ b/core/chains/evm/client/node.go @@ -94,6 +94,8 @@ type Node interface { Name() string ChainID() *big.Int Order() int32 + SubscribersCount() int32 + UnsubscribeAllExceptAliveLoop() CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error BatchCallContext(ctx context.Context, b []rpc.BatchElem) error @@ -153,6 +155,9 @@ type node struct { // close the underlying subscription subs []ethereum.Subscription + // Need to track the aliveLoop subscription, so we do not cancel it when checking lease + aliveLoopSub ethereum.Subscription + // chStopInFlight can be closed to immediately cancel all in-flight requests on // this node. Closing and replacing should be serialized through // stateMu since it can happen on state transitions as well as node Close. @@ -380,6 +385,26 @@ func (n *node) disconnectAll() { n.unsubscribeAll() } +// SubscribersCount returns the number of client subscribed to the node +func (n *node) SubscribersCount() int32 { + n.stateMu.RLock() + defer n.stateMu.RUnlock() + return int32(len(n.subs)) +} + +// UnsubscribeAllExceptAliveLoop disconnects all subscriptions to the node except the alive loop subscription +// while holding the n.stateMu lock +func (n *node) UnsubscribeAllExceptAliveLoop() { + n.stateMu.Lock() + defer n.stateMu.Unlock() + + for _, s := range n.subs { + if s != n.aliveLoopSub { + s.Unsubscribe() + } + } +} + // cancelInflightRequests closes and replaces the chStopInFlight // WARNING: NOT THREAD-SAFE // This must be called from within the n.stateMu lock diff --git a/core/chains/evm/client/pool.go b/core/chains/evm/client/pool.go index f9dca7e9cf8..7e4667623de 100644 --- a/core/chains/evm/client/pool.go +++ b/core/chains/evm/client/pool.go @@ -51,6 +51,7 @@ type NodeSelector interface { type PoolConfig interface { NodeSelectionMode() string NodeNoNewHeadsThreshold() time.Duration + LeaseDuration() time.Duration } // Pool represents an abstraction over one or more primary nodes @@ -65,6 +66,8 @@ type Pool struct { selectionMode string noNewHeadsThreshold time.Duration nodeSelector NodeSelector + leaseDuration time.Duration + leaseTicker *time.Ticker activeMu sync.RWMutex activeNode Node @@ -73,7 +76,7 @@ type Pool struct { wg sync.WaitGroup } -func NewPool(logger logger.Logger, selectionMode string, noNewHeadsTreshold time.Duration, nodes []Node, sendonlys []SendOnlyNode, chainID *big.Int, chainType config.ChainType) *Pool { +func NewPool(logger logger.Logger, selectionMode string, leaseDuration time.Duration, noNewHeadsTreshold time.Duration, nodes []Node, sendonlys []SendOnlyNode, chainID *big.Int, chainType config.ChainType) *Pool { if chainID == nil { panic("chainID is required") } @@ -105,6 +108,7 @@ func NewPool(logger logger.Logger, selectionMode string, noNewHeadsTreshold time noNewHeadsThreshold: noNewHeadsTreshold, nodeSelector: nodeSelector, chStop: make(chan struct{}), + leaseDuration: leaseDuration, } p.logger.Debugf("The pool is configured to use NodeSelectionMode: %s", selectionMode) @@ -150,6 +154,14 @@ func (p *Pool) Dial(ctx context.Context) error { p.wg.Add(1) go p.runLoop() + if p.leaseDuration.Seconds() > 0 && p.selectionMode != NodeSelectionMode_RoundRobin { + p.logger.Infof("The pool will switch to best node every %s", p.leaseDuration.String()) + p.wg.Add(1) + go p.checkLeaseLoop() + } else { + p.logger.Info("Best node switching is disabled") + } + return nil }) } @@ -172,6 +184,39 @@ func (p *Pool) nLiveNodes() (nLiveNodes int, blockNumber int64, totalDifficulty return } +func (p *Pool) checkLease() { + bestNode := p.nodeSelector.Select() + for _, n := range p.nodes { + // Terminate client subscriptions. Services are responsible for reconnecting, which will be routed to the new + // best node. Only terminate connections with more than 1 subscription to account for the aliveLoop subscription + if n.State() == NodeStateAlive && n != bestNode && n.SubscribersCount() > 1 { + p.logger.Infof("Switching to best node from %q to %q", n.String(), bestNode.String()) + n.UnsubscribeAllExceptAliveLoop() + } + } + + if bestNode != p.activeNode { + p.activeMu.Lock() + p.activeNode = bestNode + p.activeMu.Unlock() + } +} + +func (p *Pool) checkLeaseLoop() { + defer p.wg.Done() + p.leaseTicker = time.NewTicker(p.leaseDuration) + defer p.leaseTicker.Stop() + + for { + select { + case <-p.leaseTicker.C: + p.checkLease() + case <-p.chStop: + return + } + } +} + func (p *Pool) runLoop() { defer p.wg.Done() @@ -271,6 +316,9 @@ func (p *Pool) selectNode() (node Node) { return &erroringNode{errMsg: errmsg.Error()} } + if p.leaseTicker != nil { + p.leaseTicker.Reset(p.leaseDuration) + } return p.activeNode } @@ -317,7 +365,7 @@ func (p *Pool) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error return main.BatchCallContext(ctx, b) } -// Wrapped Geth client methods +// SendTransaction wrapped Geth client methods func (p *Pool) SendTransaction(ctx context.Context, tx *types.Transaction) error { main := p.selectNode() var all []SendOnlyNode diff --git a/core/chains/evm/client/pool_test.go b/core/chains/evm/client/pool_test.go index 00c42597c36..15a6484756d 100644 --- a/core/chains/evm/client/pool_test.go +++ b/core/chains/evm/client/pool_test.go @@ -5,6 +5,7 @@ import ( "math/big" "net/http/httptest" "net/url" + "sync" "testing" "time" @@ -27,6 +28,7 @@ import ( type poolConfig struct { selectionMode string noNewHeadsThreshold time.Duration + leaseDuration time.Duration } func (c poolConfig) NodeSelectionMode() string { @@ -37,9 +39,14 @@ func (c poolConfig) NodeNoNewHeadsThreshold() time.Duration { return c.noNewHeadsThreshold } +func (c poolConfig) LeaseDuration() time.Duration { + return c.leaseDuration +} + var defaultConfig evmclient.PoolConfig = &poolConfig{ selectionMode: evmclient.NodeSelectionMode_RoundRobin, noNewHeadsThreshold: 0, + leaseDuration: time.Second * 0, } func TestPool_Dial(t *testing.T) { @@ -157,7 +164,7 @@ func TestPool_Dial(t *testing.T) { for i, n := range test.sendNodes { sendNodes[i] = n.newSendOnlyNode(t, test.sendNodeChainID) } - p := evmclient.NewPool(logger.TestLogger(t), defaultConfig.NodeSelectionMode(), time.Second*0, nodes, sendNodes, test.poolChainID, "") + p := evmclient.NewPool(logger.TestLogger(t), defaultConfig.NodeSelectionMode(), defaultConfig.LeaseDuration(), time.Second*0, nodes, sendNodes, test.poolChainID, "") err := p.Dial(ctx) if err == nil { t.Cleanup(func() { assert.NoError(t, p.Close()) }) @@ -250,7 +257,7 @@ func TestUnit_Pool_RunLoop(t *testing.T) { nodes := []evmclient.Node{n1, n2, n3} lggr, observedLogs := logger.TestLoggerObserved(t, zap.ErrorLevel) - p := evmclient.NewPool(lggr, defaultConfig.NodeSelectionMode(), time.Second*0, nodes, []evmclient.SendOnlyNode{}, &cltest.FixtureChainID, "") + p := evmclient.NewPool(lggr, defaultConfig.NodeSelectionMode(), defaultConfig.LeaseDuration(), time.Second*0, nodes, []evmclient.SendOnlyNode{}, &cltest.FixtureChainID, "") n1.On("String").Maybe().Return("n1") n2.On("String").Maybe().Return("n2") @@ -324,9 +331,66 @@ func TestUnit_Pool_BatchCallContextAll(t *testing.T) { sendonlys = append(sendonlys, s) } - p := evmclient.NewPool(logger.TestLogger(t), defaultConfig.NodeSelectionMode(), time.Second*0, nodes, sendonlys, &cltest.FixtureChainID, "") + p := evmclient.NewPool(logger.TestLogger(t), defaultConfig.NodeSelectionMode(), defaultConfig.LeaseDuration(), time.Second*0, nodes, sendonlys, &cltest.FixtureChainID, "") assert.True(t, p.ChainType().IsValid()) assert.False(t, p.ChainType().IsL2()) require.NoError(t, p.BatchCallContextAll(ctx, b)) } + +func TestUnit_Pool_LeaseDuration(t *testing.T) { + t.Parallel() + + n1 := evmmocks.NewNode(t) + n2 := evmmocks.NewNode(t) + nodes := []evmclient.Node{n1, n2} + type nodeStateSwitch struct { + isAlive bool + mu sync.RWMutex + } + + nodeSwitch := nodeStateSwitch{ + isAlive: true, + mu: sync.RWMutex{}, + } + + n1.On("String").Maybe().Return("n1") + n2.On("String").Maybe().Return("n2") + n1.On("Close").Maybe().Return(nil) + n2.On("Close").Maybe().Return(nil) + n2.On("UnsubscribeAllExceptAliveLoop").Return() + n2.On("SubscribersCount").Return(int32(2)) + + n1.On("Start", mock.Anything).Return(nil).Once() + n1.On("State").Return(func() evmclient.NodeState { + nodeSwitch.mu.RLock() + defer nodeSwitch.mu.RUnlock() + if nodeSwitch.isAlive { + return evmclient.NodeStateAlive + } + return evmclient.NodeStateOutOfSync + }) + n1.On("Order").Return(int32(1)) + n1.On("ChainID").Return(testutils.FixtureChainID).Once() + + n2.On("Start", mock.Anything).Return(nil).Once() + n2.On("State").Return(evmclient.NodeStateAlive) + n2.On("Order").Return(int32(2)) + n2.On("ChainID").Return(testutils.FixtureChainID).Once() + + lggr, observedLogs := logger.TestLoggerObserved(t, zap.InfoLevel) + p := evmclient.NewPool(lggr, "PriorityLevel", time.Second*2, time.Second*0, nodes, []evmclient.SendOnlyNode{}, &cltest.FixtureChainID, "") + require.NoError(t, p.Dial(testutils.Context(t))) + t.Cleanup(func() { assert.NoError(t, p.Close()) }) + + testutils.WaitForLogMessage(t, observedLogs, "The pool will switch to best node every 2s") + nodeSwitch.mu.Lock() + nodeSwitch.isAlive = false + nodeSwitch.mu.Unlock() + testutils.WaitForLogMessage(t, observedLogs, "At least one EVM primary node is dead") + nodeSwitch.mu.Lock() + nodeSwitch.isAlive = true + nodeSwitch.mu.Unlock() + testutils.WaitForLogMessage(t, observedLogs, `Switching to best node from "n2" to "n1"`) + +} diff --git a/core/chains/evm/config/chain_scoped_node_pool.go b/core/chains/evm/config/chain_scoped_node_pool.go index 2f26aaab0c7..8244d620a53 100644 --- a/core/chains/evm/config/chain_scoped_node_pool.go +++ b/core/chains/evm/config/chain_scoped_node_pool.go @@ -25,3 +25,7 @@ func (n *nodePoolConfig) SelectionMode() string { func (n *nodePoolConfig) SyncThreshold() uint32 { return *n.c.SyncThreshold } + +func (n *nodePoolConfig) LeaseDuration() time.Duration { + return n.c.LeaseDuration.Duration() +} diff --git a/core/chains/evm/config/config.go b/core/chains/evm/config/config.go index 18c075dc24a..f8ec030969e 100644 --- a/core/chains/evm/config/config.go +++ b/core/chains/evm/config/config.go @@ -125,6 +125,7 @@ type NodePool interface { PollInterval() time.Duration SelectionMode() string SyncThreshold() uint32 + LeaseDuration() time.Duration } // TODO BCF-2509 does the chainscopedconfig really need the entire app config? diff --git a/core/chains/evm/config/toml/config.go b/core/chains/evm/config/toml/config.go index a62c554a21e..8097f752dc5 100644 --- a/core/chains/evm/config/toml/config.go +++ b/core/chains/evm/config/toml/config.go @@ -689,6 +689,7 @@ type NodePool struct { PollInterval *models.Duration SelectionMode *string SyncThreshold *uint32 + LeaseDuration *models.Duration } func (p *NodePool) setFrom(f *NodePool) { @@ -704,6 +705,9 @@ func (p *NodePool) setFrom(f *NodePool) { if v := f.SyncThreshold; v != nil { p.SyncThreshold = v } + if v := f.LeaseDuration; v != nil { + p.LeaseDuration = v + } } type OCR struct { diff --git a/core/chains/evm/config/toml/defaults/fallback.toml b/core/chains/evm/config/toml/defaults/fallback.toml index a0c4f9b4c6b..a75cfa0bf3b 100644 --- a/core/chains/evm/config/toml/defaults/fallback.toml +++ b/core/chains/evm/config/toml/defaults/fallback.toml @@ -58,6 +58,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 diff --git a/core/chains/evm/mocks/node.go b/core/chains/evm/mocks/node.go index 9470bd39387..f993ff6e8f1 100644 --- a/core/chains/evm/mocks/node.go +++ b/core/chains/evm/mocks/node.go @@ -591,6 +591,20 @@ func (_m *Node) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, return r0, r1 } +// SubscribersCount provides a mock function with given fields: +func (_m *Node) SubscribersCount() int32 { + ret := _m.Called() + + var r0 int32 + if rf, ok := ret.Get(0).(func() int32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int32) + } + + return r0 +} + // SuggestGasPrice provides a mock function with given fields: ctx func (_m *Node) SuggestGasPrice(ctx context.Context) (*big.Int, error) { ret := _m.Called(ctx) @@ -695,6 +709,11 @@ func (_m *Node) TransactionReceipt(ctx context.Context, txHash common.Hash) (*ty return r0, r1 } +// UnsubscribeAllExceptAliveLoop provides a mock function with given fields: +func (_m *Node) UnsubscribeAllExceptAliveLoop() { + _m.Called() +} + type mockConstructorTestingTNewNode interface { mock.TestingT Cleanup(func()) diff --git a/core/config/docs/chains-evm.toml b/core/config/docs/chains-evm.toml index 7517eff61be..c8b5395d6d7 100644 --- a/core/config/docs/chains-evm.toml +++ b/core/config/docs/chains-evm.toml @@ -311,6 +311,7 @@ PollInterval = '10s' # Default # SelectionMode controls node selection strategy: # - HighestHead: use the node with the highest head number # - RoundRobin: rotate through nodes, per-request +# - PriorityLevel: use the node with the smallest order number # - TotalDifficulty: use the node with the greatest total difficulty SelectionMode = 'HighestHead' # Default # SyncThreshold controls how far a node may lag behind the best node before being marked out-of-sync. @@ -318,6 +319,13 @@ SelectionMode = 'HighestHead' # Default # # Set to 0 to disable this check. SyncThreshold = 5 # Default +# LeaseDuration is the minimum duration that the selected "best" node (as defined by SelectionMode) will be used, +# before switching to a better one if available. It also controls how often the lease check is done. +# Setting this to a low value (under 1m) might cause RPC to switch too aggressively. +# Recommended value is over 5m +# +# Set to '0s' to disable +LeaseDuration = '0s' # Default [EVM.OCR] # ContractConfirmations sets `OCR.ContractConfirmations` for this EVM chain. diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index 480d06b5806..46b7b97cedd 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -191,6 +191,7 @@ var ( ) func TestConfig_Marshal(t *testing.T) { + zeroSeconds := models.MustMakeDuration(time.Second * 0) second := models.MustMakeDuration(time.Second) minute := models.MustMakeDuration(time.Minute) hour := models.MustMakeDuration(time.Hour) @@ -528,6 +529,7 @@ func TestConfig_Marshal(t *testing.T) { PollInterval: &minute, SelectionMode: &selectionMode, SyncThreshold: ptr[uint32](13), + LeaseDuration: &zeroSeconds, }, OCR: evmcfg.OCR{ ContractConfirmations: ptr[uint16](11), @@ -926,6 +928,7 @@ PollFailureThreshold = 5 PollInterval = '1m0s' SelectionMode = 'HighestHead' SyncThreshold = 13 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 11 diff --git a/core/services/chainlink/testdata/config-full.toml b/core/services/chainlink/testdata/config-full.toml index 92d0b553d6e..c919d766ead 100644 --- a/core/services/chainlink/testdata/config-full.toml +++ b/core/services/chainlink/testdata/config-full.toml @@ -290,6 +290,7 @@ PollFailureThreshold = 5 PollInterval = '1m0s' SelectionMode = 'HighestHead' SyncThreshold = 13 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 11 diff --git a/core/services/chainlink/testdata/config-multi-chain-effective.toml b/core/services/chainlink/testdata/config-multi-chain-effective.toml index 665de9be8cb..63a37101305 100644 --- a/core/services/chainlink/testdata/config-multi-chain-effective.toml +++ b/core/services/chainlink/testdata/config-multi-chain-effective.toml @@ -271,6 +271,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -355,6 +356,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -433,6 +435,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 diff --git a/core/web/resolver/testdata/config-full.toml b/core/web/resolver/testdata/config-full.toml index ff7eb832c9c..35d338224bd 100644 --- a/core/web/resolver/testdata/config-full.toml +++ b/core/web/resolver/testdata/config-full.toml @@ -289,6 +289,7 @@ PollFailureThreshold = 5 PollInterval = '1m0s' SelectionMode = 'HighestHead' SyncThreshold = 13 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 11 diff --git a/core/web/resolver/testdata/config-multi-chain-effective.toml b/core/web/resolver/testdata/config-multi-chain-effective.toml index 665de9be8cb..63a37101305 100644 --- a/core/web/resolver/testdata/config-multi-chain-effective.toml +++ b/core/web/resolver/testdata/config-multi-chain-effective.toml @@ -271,6 +271,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -355,6 +356,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -433,6 +435,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 64bace19935..724c95af6da 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Simple password use in production builds is now disallowed - nodes with this configuration will not boot and will not pass config validation. - Helper migrations function for injecting env vars into goose migrations. This was done to inject chainID into evm chain id not null in specs migrations. - OCR2 jobs now support querying the state contract for configurations if it has been deployed. This can help on chains such as BSC which "manage" state bloat by arbitrarily deleting logs older than a certain date. In this case, if logs are missing we will query the contract directly and retrieve the latest config from chain state. Chainlink will perform no extra RPC calls unless the job spec has this feature explicitly enabled. On chains that require this, nops may see an increase in RPC calls. This can be enabled for OCR2 jobs by specifying `ConfigContractAddress` in the relay config TOML. +- Added new configuration field named `LeaseDuration` for `EVM.NodePool` that will periodically check if internal subscriptions are connected to the "best" (as defined by the `SelectionMode`) node and switch to it if necessary. Setting this value to `0s` will disable this feature. ### Removed diff --git a/docs/CONFIG.md b/docs/CONFIG.md index ceb3d3dfe08..0105a8c0e80 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -1490,6 +1490,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -1568,6 +1569,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -1646,6 +1648,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -1724,6 +1727,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -1803,6 +1807,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -1881,6 +1886,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -1959,6 +1965,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2038,6 +2045,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2116,6 +2124,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2193,6 +2202,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2270,6 +2280,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2348,6 +2359,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2427,6 +2439,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2505,6 +2518,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2583,6 +2597,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2661,6 +2676,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -2740,6 +2756,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -2818,6 +2835,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -2895,6 +2913,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -2973,6 +2992,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3050,6 +3070,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3128,6 +3149,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -3205,6 +3227,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3283,6 +3306,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3362,6 +3386,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3440,6 +3465,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3518,6 +3544,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3596,6 +3623,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3674,6 +3702,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3752,6 +3781,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -3830,6 +3860,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3909,6 +3940,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -3988,6 +4020,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 10 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -4065,6 +4098,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -4142,6 +4176,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 1 @@ -4220,6 +4255,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -4298,6 +4334,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -4376,6 +4413,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [OCR] ContractConfirmations = 4 @@ -4996,6 +5034,7 @@ PollFailureThreshold = 5 # Default PollInterval = '10s' # Default SelectionMode = 'HighestHead' # Default SyncThreshold = 5 # Default +LeaseDuration = '0s' # Default ``` The node pool manages multiple RPC endpoints. @@ -5024,6 +5063,7 @@ SelectionMode = 'HighestHead' # Default SelectionMode controls node selection strategy: - HighestHead: use the node with the highest head number - RoundRobin: rotate through nodes, per-request +- PriorityLevel: use the node with the smallest order number - TotalDifficulty: use the node with the greatest total difficulty ### SyncThreshold @@ -5035,6 +5075,17 @@ Depending on `SelectionMode`, this represents a difference in the number of bloc Set to 0 to disable this check. +### LeaseDuration +```toml +LeaseDuration = '0s' # Default +``` +LeaseDuration is the minimum duration that the selected "best" node (as defined by SelectionMode) will be used, +before switching to a better one if available. It also controls how often the lease check is done. +Setting this to a low value (under 1m) might cause RPC to switch too aggressively. +Recommended value is over 5m + +Set to '0s' to disable + ## EVM.OCR ```toml [EVM.OCR] diff --git a/testdata/scripts/node/validate/disk-based-logging-disabled.txtar b/testdata/scripts/node/validate/disk-based-logging-disabled.txtar index 5f02793ff57..beb0f341c48 100644 --- a/testdata/scripts/node/validate/disk-based-logging-disabled.txtar +++ b/testdata/scripts/node/validate/disk-based-logging-disabled.txtar @@ -327,6 +327,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 diff --git a/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar b/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar index 527a739f7ca..32007bb53b8 100644 --- a/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar +++ b/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar @@ -327,6 +327,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 diff --git a/testdata/scripts/node/validate/disk-based-logging.txtar b/testdata/scripts/node/validate/disk-based-logging.txtar index 791a8aad076..4750e37ee3c 100644 --- a/testdata/scripts/node/validate/disk-based-logging.txtar +++ b/testdata/scripts/node/validate/disk-based-logging.txtar @@ -327,6 +327,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 diff --git a/testdata/scripts/node/validate/invalid.txtar b/testdata/scripts/node/validate/invalid.txtar index e9db92fb8f7..b523b1a2cf1 100644 --- a/testdata/scripts/node/validate/invalid.txtar +++ b/testdata/scripts/node/validate/invalid.txtar @@ -317,6 +317,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 diff --git a/testdata/scripts/node/validate/valid.txtar b/testdata/scripts/node/validate/valid.txtar index f48fa1926d8..69a46dfb7a0 100644 --- a/testdata/scripts/node/validate/valid.txtar +++ b/testdata/scripts/node/validate/valid.txtar @@ -324,6 +324,7 @@ PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' SyncThreshold = 5 +LeaseDuration = '0s' [EVM.OCR] ContractConfirmations = 4 From 16361f3af45316e2d2acb5577ca0a3b433173e82 Mon Sep 17 00:00:00 2001 From: Tate Date: Mon, 2 Oct 2023 15:39:00 -0600 Subject: [PATCH 40/84] Update chainlink-env and PreventPodEviction settings (#10841) --- integration-tests/benchmark/keeper_test.go | 3 ++- integration-tests/go.mod | 4 ++-- integration-tests/go.sum | 8 ++++---- integration-tests/performance/cron_test.go | 5 +++-- integration-tests/performance/directrequest_test.go | 5 +++-- integration-tests/performance/flux_test.go | 5 +++-- integration-tests/performance/keeper_test.go | 5 +++-- integration-tests/performance/ocr_test.go | 5 +++-- integration-tests/performance/vrf_test.go | 5 +++-- integration-tests/testsetups/ocr.go | 3 +-- 10 files changed, 27 insertions(+), 21 deletions(-) diff --git a/integration-tests/benchmark/keeper_test.go b/integration-tests/benchmark/keeper_test.go index 59406e51583..e016a72576d 100644 --- a/integration-tests/benchmark/keeper_test.go +++ b/integration-tests/benchmark/keeper_test.go @@ -316,7 +316,8 @@ func SetupAutomationBenchmarkEnv(t *testing.T) (*environment.Environment, blockc strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-"), strings.ReplaceAll(strings.ToLower(RegistryToTest), "_", "-"), ), - Test: t, + Test: t, + PreventPodEviction: true, }) // propagate TEST_INPUTS to remote runner if testEnvironment.WillUseRemoteRunner() { diff --git a/integration-tests/go.mod b/integration-tests/go.mod index ded6216b540..fdff2624659 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -19,8 +19,8 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.30.0 github.com/slack-go/slack v0.12.2 - github.com/smartcontractkit/chainlink-env v0.38.0 - github.com/smartcontractkit/chainlink-testing-framework v1.17.0 + github.com/smartcontractkit/chainlink-env v0.38.1 + github.com/smartcontractkit/chainlink-testing-framework v1.17.3 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 github.com/smartcontractkit/ocr2keepers v0.7.27 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 90e85c816cd..83fd5ed0e5f 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2358,16 +2358,16 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 h1:vdieOW3CZGdD2R5zvCSMS+0vksyExPN3/Fa1uVfld/A= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8= -github.com/smartcontractkit/chainlink-env v0.38.0 h1:3LaqV5wSRCVPK0haV5jC2zdZITV2Q0BPyUMUM3tyJ7o= -github.com/smartcontractkit/chainlink-env v0.38.0/go.mod h1:ICN9gOBY+NehK8mIxxM9CrWDohgkCQ1vgX9FazCbg8I= +github.com/smartcontractkit/chainlink-env v0.38.1 h1:jIn+BTtWOlQ2IInPgJEjwwuVG2eGDClybg56gsswv8o= +github.com/smartcontractkit/chainlink-env v0.38.1/go.mod h1:ICN9gOBY+NehK8mIxxM9CrWDohgkCQ1vgX9FazCbg8I= github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 h1:Db333w+fSm2e18LMikcIQHIZqgxZruW9uCUGJLUC9mI= github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918/go.mod h1:/yp/sqD8Iz5GU5fcercjrw0ivJF7HDcupYg+Gjr7EPg= -github.com/smartcontractkit/chainlink-testing-framework v1.17.0 h1:JcJwfawW7jfLBG+By5hGTVcNgKQ7bJCqvN9TEF3qBis= -github.com/smartcontractkit/chainlink-testing-framework v1.17.0/go.mod h1:Ry6fRPr8TwrIsYVNEF1pguAgzE3QW1s54tbLWnFtfI4= +github.com/smartcontractkit/chainlink-testing-framework v1.17.3 h1:lX6JgzW1UuwN/Y6/ri0RcS9mHY9+qdN8lkponjr+0xM= +github.com/smartcontractkit/chainlink-testing-framework v1.17.3/go.mod h1:izzRx4cNihkVP9XY15isSCMW1QAlRK1w5eE23/MbZHM= github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 h1:x3kNwgFlDmbE/n0gTSRMt9GBDfsfGrs4X9b9arPZtFI= github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/integration-tests/performance/cron_test.go b/integration-tests/performance/cron_test.go index b5fc9c48b09..959cb0fa3e1 100644 --- a/integration-tests/performance/cron_test.go +++ b/integration-tests/performance/cron_test.go @@ -126,8 +126,9 @@ HTTPWriteTimout = '300s'` }) testEnvironment = environment.New(&environment.Config{ - NamespacePrefix: fmt.Sprintf("performance-cron-%s", strings.ReplaceAll(strings.ToLower(network.Name), " ", "-")), - Test: t, + NamespacePrefix: fmt.Sprintf("performance-cron-%s", strings.ReplaceAll(strings.ToLower(network.Name), " ", "-")), + Test: t, + PreventPodEviction: true, }). AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). diff --git a/integration-tests/performance/directrequest_test.go b/integration-tests/performance/directrequest_test.go index 1b3009043fd..4ff2b856195 100644 --- a/integration-tests/performance/directrequest_test.go +++ b/integration-tests/performance/directrequest_test.go @@ -146,8 +146,9 @@ HTTPWriteTimout = '300s'` }) testEnvironment = environment.New(&environment.Config{ - NamespacePrefix: fmt.Sprintf("performance-cron-%s", strings.ReplaceAll(strings.ToLower(network.Name), " ", "-")), - Test: t, + NamespacePrefix: fmt.Sprintf("performance-cron-%s", strings.ReplaceAll(strings.ToLower(network.Name), " ", "-")), + Test: t, + PreventPodEviction: true, }). AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). diff --git a/integration-tests/performance/flux_test.go b/integration-tests/performance/flux_test.go index 5ca5ae80962..3f9db27c106 100644 --- a/integration-tests/performance/flux_test.go +++ b/integration-tests/performance/flux_test.go @@ -193,8 +193,9 @@ Enabled = true` }) testEnvironment = environment.New(&environment.Config{ - NamespacePrefix: fmt.Sprintf("performance-flux-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), - Test: t, + NamespacePrefix: fmt.Sprintf("performance-flux-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), + Test: t, + PreventPodEviction: true, }). AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). diff --git a/integration-tests/performance/keeper_test.go b/integration-tests/performance/keeper_test.go index e1ffecd28c4..08ea95b4340 100644 --- a/integration-tests/performance/keeper_test.go +++ b/integration-tests/performance/keeper_test.go @@ -160,8 +160,9 @@ PerformGasOverhead = 150_000` testEnvironment := environment.New( &environment.Config{ - NamespacePrefix: fmt.Sprintf("performance-keeper-%s-%s", testName, networkName), - Test: t, + NamespacePrefix: fmt.Sprintf("performance-keeper-%s-%s", testName, networkName), + Test: t, + PreventPodEviction: true, }, ). AddHelm(mockservercfg.New(nil)). diff --git a/integration-tests/performance/ocr_test.go b/integration-tests/performance/ocr_test.go index 3df0700c6ea..b18d7f1f791 100644 --- a/integration-tests/performance/ocr_test.go +++ b/integration-tests/performance/ocr_test.go @@ -113,8 +113,9 @@ ListenPort = 6690` }) testEnvironment = environment.New(&environment.Config{ - NamespacePrefix: fmt.Sprintf("performance-ocr-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), - Test: t, + NamespacePrefix: fmt.Sprintf("performance-ocr-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), + Test: t, + PreventPodEviction: true, }). AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). diff --git a/integration-tests/performance/vrf_test.go b/integration-tests/performance/vrf_test.go index 4f86c6585bd..510e378eb82 100644 --- a/integration-tests/performance/vrf_test.go +++ b/integration-tests/performance/vrf_test.go @@ -151,8 +151,9 @@ HTTPWriteTimout = '300s'` }) testEnvironment = environment.New(&environment.Config{ - NamespacePrefix: fmt.Sprintf("smoke-vrf-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), - Test: t, + NamespacePrefix: fmt.Sprintf("smoke-vrf-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), + Test: t, + PreventPodEviction: true, }). AddHelm(evmConfig). AddHelm(cd) diff --git a/integration-tests/testsetups/ocr.go b/integration-tests/testsetups/ocr.go index b53fe9a7978..7781e6c114f 100644 --- a/integration-tests/testsetups/ocr.go +++ b/integration-tests/testsetups/ocr.go @@ -4,7 +4,6 @@ package testsetups import ( "context" "fmt" - "io/ioutil" "math/big" "math/rand" "os" @@ -359,7 +358,7 @@ func (o *OCRSoakTest) LoadState() error { } testState := &OCRSoakTestState{} - saveData, err := ioutil.ReadFile(saveFileLocation) + saveData, err := os.ReadFile(saveFileLocation) if err != nil { return err } From 9a65ab2e1abf03c6e587f56bdaabac26a0f28205 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 3 Oct 2023 04:25:34 -0500 Subject: [PATCH 41/84] core/services: remove unused pg.QOpts from Delegate.ServicesForSpec (#10844) --- core/services/blockhashstore/delegate.go | 2 +- core/services/blockheaderfeeder/delegate.go | 2 +- core/services/cron/delegate.go | 2 +- core/services/directrequest/delegate.go | 2 +- core/services/fluxmonitorv2/delegate.go | 3 ++- core/services/gateway/delegate.go | 2 +- core/services/job/spawner.go | 7 ++++--- core/services/job/spawner_test.go | 2 +- core/services/keeper/delegate.go | 3 ++- core/services/ocr/delegate.go | 2 +- core/services/ocr2/delegate.go | 2 +- core/services/ocrbootstrap/delegate.go | 2 +- core/services/vrf/delegate.go | 2 +- core/services/webhook/delegate.go | 2 +- 14 files changed, 19 insertions(+), 16 deletions(-) diff --git a/core/services/blockhashstore/delegate.go b/core/services/blockhashstore/delegate.go index ccd4d3463f5..90819f27a1d 100644 --- a/core/services/blockhashstore/delegate.go +++ b/core/services/blockhashstore/delegate.go @@ -50,7 +50,7 @@ func (d *Delegate) JobType() job.Type { } // ServicesForSpec satisfies the job.Delegate interface. -func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceCtx, error) { +func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { if jb.BlockhashStoreSpec == nil { return nil, errors.Errorf( "blockhashstore.Delegate expects a BlockhashStoreSpec to be present, got %+v", jb) diff --git a/core/services/blockheaderfeeder/delegate.go b/core/services/blockheaderfeeder/delegate.go index 2f37991f741..02ab34821f6 100644 --- a/core/services/blockheaderfeeder/delegate.go +++ b/core/services/blockheaderfeeder/delegate.go @@ -48,7 +48,7 @@ func (d *Delegate) JobType() job.Type { } // ServicesForSpec satisfies the job.Delegate interface. -func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceCtx, error) { +func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { if jb.BlockHeaderFeederSpec == nil { return nil, errors.Errorf("Delegate expects a BlockHeaderFeederSpec to be present, got %+v", jb) } diff --git a/core/services/cron/delegate.go b/core/services/cron/delegate.go index a411a120128..c227fd60d00 100644 --- a/core/services/cron/delegate.go +++ b/core/services/cron/delegate.go @@ -33,7 +33,7 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) {} func (d *Delegate) OnDeleteJob(spec job.Job, q pg.Queryer) error { return nil } // ServicesForSpec returns the scheduler to be used for running cron jobs -func (d *Delegate) ServicesForSpec(spec job.Job, qopts ...pg.QOpt) (services []job.ServiceCtx, err error) { +func (d *Delegate) ServicesForSpec(spec job.Job) (services []job.ServiceCtx, err error) { if spec.CronSpec == nil { return nil, errors.Errorf("services.Delegate expects a *jobSpec.CronSpec to be present, got %v", spec) } diff --git a/core/services/directrequest/delegate.go b/core/services/directrequest/delegate.go index 39564b8c8bd..4ccaf55b645 100644 --- a/core/services/directrequest/delegate.go +++ b/core/services/directrequest/delegate.go @@ -68,7 +68,7 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) {} func (d *Delegate) OnDeleteJob(spec job.Job, q pg.Queryer) error { return nil } // ServicesForSpec returns the log listener service for a direct request job -func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceCtx, error) { +func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { if jb.DirectRequestSpec == nil { return nil, errors.Errorf("DirectRequest: directrequest.Delegate expects a *job.DirectRequestSpec to be present, got %v", jb) } diff --git a/core/services/fluxmonitorv2/delegate.go b/core/services/fluxmonitorv2/delegate.go index 0564eecaee4..d380122f715 100644 --- a/core/services/fluxmonitorv2/delegate.go +++ b/core/services/fluxmonitorv2/delegate.go @@ -2,6 +2,7 @@ package fluxmonitorv2 import ( "github.com/pkg/errors" + "github.com/smartcontractkit/sqlx" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" @@ -59,7 +60,7 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) {} func (d *Delegate) OnDeleteJob(spec job.Job, q pg.Queryer) error { return nil } // ServicesForSpec returns the flux monitor service for the job spec -func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) (services []job.ServiceCtx, err error) { +func (d *Delegate) ServicesForSpec(jb job.Job) (services []job.ServiceCtx, err error) { if jb.FluxMonitorSpec == nil { return nil, errors.Errorf("Delegate expects a *job.FluxMonitorSpec to be present, got %v", jb) } diff --git a/core/services/gateway/delegate.go b/core/services/gateway/delegate.go index c42e61b8785..909ca21ad73 100644 --- a/core/services/gateway/delegate.go +++ b/core/services/gateway/delegate.go @@ -37,7 +37,7 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) {} func (d *Delegate) OnDeleteJob(spec job.Job, q pg.Queryer) error { return nil } // ServicesForSpec returns the scheduler to be used for running observer jobs -func (d *Delegate) ServicesForSpec(spec job.Job, qopts ...pg.QOpt) (services []job.ServiceCtx, err error) { +func (d *Delegate) ServicesForSpec(spec job.Job) (services []job.ServiceCtx, err error) { if spec.GatewaySpec == nil { return nil, errors.Errorf("services.Delegate expects a *jobSpec.GatewaySpec to be present, got %v", spec) } diff --git a/core/services/job/spawner.go b/core/services/job/spawner.go index d766faa092a..504bd70ca48 100644 --- a/core/services/job/spawner.go +++ b/core/services/job/spawner.go @@ -8,6 +8,7 @@ import ( "sync" pkgerrors "github.com/pkg/errors" + "github.com/smartcontractkit/sqlx" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -63,7 +64,7 @@ type ( // job. In case a given job type relies upon well-defined startup/shutdown // ordering for services, they are started in the order they are given // and stopped in reverse order. - ServicesForSpec(spec Job, qopts ...pg.QOpt) ([]ServiceCtx, error) + ServicesForSpec(spec Job) ([]ServiceCtx, error) AfterJobCreated(spec Job) BeforeJobDeleted(spec Job) // OnDeleteJob will be called from within DELETE db transaction. Any db @@ -208,7 +209,7 @@ func (js *spawner) StartService(ctx context.Context, jb Job, qopts ...pg.QOpt) e jb.PipelineSpec.GasLimit = &jb.GasLimit.Uint32 } - srvs, err := delegate.ServicesForSpec(jb, qopts...) + srvs, err := delegate.ServicesForSpec(jb) if err != nil { lggr.Errorw("Error creating services for job", "err", err) cctx, cancel := js.chStop.NewCtx() @@ -384,7 +385,7 @@ func (n *NullDelegate) JobType() Type { } // ServicesForSpec does no-op. -func (n *NullDelegate) ServicesForSpec(spec Job, qopts ...pg.QOpt) (s []ServiceCtx, err error) { +func (n *NullDelegate) ServicesForSpec(spec Job) (s []ServiceCtx, err error) { return } diff --git a/core/services/job/spawner_test.go b/core/services/job/spawner_test.go index 7dbf811f783..dc230518d61 100644 --- a/core/services/job/spawner_test.go +++ b/core/services/job/spawner_test.go @@ -52,7 +52,7 @@ func (d delegate) JobType() job.Type { } // ServicesForSpec satisfies the job.Delegate interface. -func (d delegate) ServicesForSpec(js job.Job, qopts ...pg.QOpt) ([]job.ServiceCtx, error) { +func (d delegate) ServicesForSpec(js job.Job) ([]job.ServiceCtx, error) { if js.Type != d.jobType { return nil, nil } diff --git a/core/services/keeper/delegate.go b/core/services/keeper/delegate.go index cdb085f743e..6c68203f843 100644 --- a/core/services/keeper/delegate.go +++ b/core/services/keeper/delegate.go @@ -2,6 +2,7 @@ package keeper import ( "github.com/pkg/errors" + "github.com/smartcontractkit/sqlx" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" @@ -54,7 +55,7 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) {} func (d *Delegate) OnDeleteJob(spec job.Job, q pg.Queryer) error { return nil } // ServicesForSpec satisfies the job.Delegate interface. -func (d *Delegate) ServicesForSpec(spec job.Job, qopts ...pg.QOpt) (services []job.ServiceCtx, err error) { +func (d *Delegate) ServicesForSpec(spec job.Job) (services []job.ServiceCtx, err error) { if spec.KeeperSpec == nil { return nil, errors.Errorf("Delegate expects a *job.KeeperSpec to be present, got %v", spec) } diff --git a/core/services/ocr/delegate.go b/core/services/ocr/delegate.go index 9ed22d01e72..1ca35f84154 100644 --- a/core/services/ocr/delegate.go +++ b/core/services/ocr/delegate.go @@ -87,7 +87,7 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) {} func (d *Delegate) OnDeleteJob(spec job.Job, q pg.Queryer) error { return nil } // ServicesForSpec returns the OCR services that need to run for this job -func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) (services []job.ServiceCtx, err error) { +func (d *Delegate) ServicesForSpec(jb job.Job) (services []job.ServiceCtx, err error) { if jb.OCROracleSpec == nil { return nil, errors.Errorf("offchainreporting.Delegate expects an *job.OffchainreportingOracleSpec to be present, got %v", jb) } diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index 2086eaa6a80..9ce04ac407f 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -315,7 +315,7 @@ func (d *Delegate) cleanupEVM(jb job.Job, q pg.Queryer, relayID relay.ID) error } // ServicesForSpec returns the OCR2 services that need to run for this job -func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceCtx, error) { +func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { spec := jb.OCR2OracleSpec if spec == nil { return nil, errors.Errorf("offchainreporting2.Delegate expects an *job.OCR2OracleSpec to be present, got %v", jb) diff --git a/core/services/ocrbootstrap/delegate.go b/core/services/ocrbootstrap/delegate.go index 9f9efca68e2..3910ca05d38 100644 --- a/core/services/ocrbootstrap/delegate.go +++ b/core/services/ocrbootstrap/delegate.go @@ -76,7 +76,7 @@ func (d *Delegate) BeforeJobCreated(spec job.Job) { } // ServicesForSpec satisfies the job.Delegate interface. -func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) (services []job.ServiceCtx, err error) { +func (d *Delegate) ServicesForSpec(jb job.Job) (services []job.ServiceCtx, err error) { spec := jb.BootstrapSpec if spec == nil { return nil, errors.Errorf("Bootstrap.Delegate expects an *job.BootstrapSpec to be present, got %v", jb) diff --git a/core/services/vrf/delegate.go b/core/services/vrf/delegate.go index b5fe6cda76f..b2e630b020e 100644 --- a/core/services/vrf/delegate.go +++ b/core/services/vrf/delegate.go @@ -73,7 +73,7 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) {} func (d *Delegate) OnDeleteJob(spec job.Job, q pg.Queryer) error { return nil } // ServicesForSpec satisfies the job.Delegate interface. -func (d *Delegate) ServicesForSpec(jb job.Job, qopts ...pg.QOpt) ([]job.ServiceCtx, error) { +func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { if jb.VRFSpec == nil || jb.PipelineSpec == nil { return nil, errors.Errorf("vrf.Delegate expects a VRFSpec and PipelineSpec to be present, got %+v", jb) } diff --git a/core/services/webhook/delegate.go b/core/services/webhook/delegate.go index ca85a4d1621..f5a8d553f23 100644 --- a/core/services/webhook/delegate.go +++ b/core/services/webhook/delegate.go @@ -69,7 +69,7 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) { func (d *Delegate) OnDeleteJob(jb job.Job, q pg.Queryer) error { return nil } // ServicesForSpec satisfies the job.Delegate interface. -func (d *Delegate) ServicesForSpec(spec job.Job, qopts ...pg.QOpt) ([]job.ServiceCtx, error) { +func (d *Delegate) ServicesForSpec(spec job.Job) ([]job.ServiceCtx, error) { service := &pseudoService{ spec: spec, webhookJobRunner: d.webhookJobRunner, From b536d6779c7e95a9f2a3bf1f0dd5ea6283453997 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 3 Oct 2023 10:28:31 -0400 Subject: [PATCH 42/84] Improves Fund Return (#10842) --- integration-tests/actions/actions.go | 2 +- integration-tests/actions/automation_ocr_helpers.go | 4 ++-- .../actions/automation_ocr_helpers_local.go | 12 ++++++------ .../actions/vrfv2_actions/vrfv2_steps.go | 6 ++++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/integration-tests/actions/actions.go b/integration-tests/actions/actions.go index e37c3738ff8..b09782e9e8a 100644 --- a/integration-tests/actions/actions.go +++ b/integration-tests/actions/actions.go @@ -369,7 +369,7 @@ func ReturnFunds(chainlinkNodes []*client.ChainlinkK8sClient, blockchainClient b } err = blockchainClient.ReturnFunds(decryptedKey.PrivateKey) if err != nil { - return err + log.Error().Err(err).Str("Address", fundedKeys[0].Address).Msg("Error returning funds from Chainlink node") } } } diff --git a/integration-tests/actions/automation_ocr_helpers.go b/integration-tests/actions/automation_ocr_helpers.go index fb94d6109b4..26bf2ac75ed 100644 --- a/integration-tests/actions/automation_ocr_helpers.go +++ b/integration-tests/actions/automation_ocr_helpers.go @@ -11,6 +11,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/lib/pq" + "github.com/stretchr/testify/require" + "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink-testing-framework/logging" @@ -22,8 +24,6 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocr2keepers20config "github.com/smartcontractkit/ocr2keepers/pkg/v2/config" ocr2keepers30config "github.com/smartcontractkit/ocr2keepers/pkg/v3/config" - "github.com/stretchr/testify/require" - "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" diff --git a/integration-tests/actions/automation_ocr_helpers_local.go b/integration-tests/actions/automation_ocr_helpers_local.go index 86738b0247d..1449847786e 100644 --- a/integration-tests/actions/automation_ocr_helpers_local.go +++ b/integration-tests/actions/automation_ocr_helpers_local.go @@ -12,18 +12,18 @@ import ( "github.com/rs/zerolog" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink/integration-tests/client" - "github.com/smartcontractkit/chainlink/integration-tests/contracts" - "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/store/models" ocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocr3 "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocr2keepers20config "github.com/smartcontractkit/ocr2keepers/pkg/v2/config" ocr2keepers30config "github.com/smartcontractkit/ocr2keepers/pkg/v3/config" - "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" - "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" ) func BuildAutoOCR2ConfigVarsLocal( diff --git a/integration-tests/actions/vrfv2_actions/vrfv2_steps.go b/integration-tests/actions/vrfv2_actions/vrfv2_steps.go index b59f8c761f1..bdf0cf1f927 100644 --- a/integration-tests/actions/vrfv2_actions/vrfv2_steps.go +++ b/integration-tests/actions/vrfv2_actions/vrfv2_steps.go @@ -3,13 +3,15 @@ package vrfv2_actions import ( "context" "fmt" - "github.com/smartcontractkit/chainlink/integration-tests/actions" - chainlinkutils "github.com/smartcontractkit/chainlink/v2/core/utils" "math/big" "github.com/google/uuid" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + chainlinkutils "github.com/smartcontractkit/chainlink/v2/core/utils" + + "github.com/smartcontractkit/chainlink/integration-tests/actions" vrfConst "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2_actions/vrfv2_constants" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" diff --git a/integration-tests/go.mod b/integration-tests/go.mod index fdff2624659..8b25f52f70a 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -20,7 +20,7 @@ require ( github.com/rs/zerolog v1.30.0 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-env v0.38.1 - github.com/smartcontractkit/chainlink-testing-framework v1.17.3 + github.com/smartcontractkit/chainlink-testing-framework v1.17.4 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 github.com/smartcontractkit/ocr2keepers v0.7.27 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 83fd5ed0e5f..89e796d51f2 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2366,8 +2366,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97ac github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918/go.mod h1:/yp/sqD8Iz5GU5fcercjrw0ivJF7HDcupYg+Gjr7EPg= -github.com/smartcontractkit/chainlink-testing-framework v1.17.3 h1:lX6JgzW1UuwN/Y6/ri0RcS9mHY9+qdN8lkponjr+0xM= -github.com/smartcontractkit/chainlink-testing-framework v1.17.3/go.mod h1:izzRx4cNihkVP9XY15isSCMW1QAlRK1w5eE23/MbZHM= +github.com/smartcontractkit/chainlink-testing-framework v1.17.4 h1:N7YK1VZrSxG3PEwY0S7NXJQgSiEvWHR6uKhytfHMTjA= +github.com/smartcontractkit/chainlink-testing-framework v1.17.4/go.mod h1:izzRx4cNihkVP9XY15isSCMW1QAlRK1w5eE23/MbZHM= github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 h1:x3kNwgFlDmbE/n0gTSRMt9GBDfsfGrs4X9b9arPZtFI= github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= From c5f9904dcea66a85085cb5d3cd75a89624a70636 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 3 Oct 2023 15:16:56 -0500 Subject: [PATCH 43/84] bump hashicorp/go-plugin to 1.5.2 (#10849) --- core/scripts/go.mod | 6 +++--- core/scripts/go.sum | 8 ++++---- go.mod | 6 +++--- go.sum | 8 ++++---- integration-tests/go.mod | 6 +++--- integration-tests/go.sum | 8 ++++---- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index bb4b33eb521..00ab2f871d0 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -164,7 +164,7 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/golang-lru v0.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect @@ -300,7 +300,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 // indirect - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 // indirect + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect @@ -386,7 +386,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 - github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 + github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 571b9b0e8ef..f4c6d6acfbb 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1454,14 +1454,14 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 h1:vdieOW3CZGdD2R5zvCSMS+0vksyExPN3/Fa1uVfld/A= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 h1:Db333w+fSm2e18LMikcIQHIZqgxZruW9uCUGJLUC9mI= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd h1:5r6SDRgZfi0kxc7D6sFV7h/bX+D7yewDq3FkyE0VMIM= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd/go.mod h1:agmAM21+teJkw0aj9KYj3q3s1sFkx3PXo5ibWJIrDfU= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918/go.mod h1:/yp/sqD8Iz5GU5fcercjrw0ivJF7HDcupYg+Gjr7EPg= -github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 h1:x3kNwgFlDmbE/n0gTSRMt9GBDfsfGrs4X9b9arPZtFI= -github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= +github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 h1:eSo9r53fARv2MnIO5pqYvQOXMBsTlAwhHyQ6BAVp6bY= diff --git a/go.mod b/go.mod index d0fd99a8287..5ffcb338675 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/grafana/pyroscope-go v1.0.2 github.com/graph-gophers/dataloader v5.0.0+incompatible github.com/graph-gophers/graphql-go v1.3.0 - github.com/hashicorp/go-plugin v1.4.10 + github.com/hashicorp/go-plugin v1.5.2 github.com/hdevalence/ed25519consensus v0.1.0 github.com/jackc/pgconn v1.14.1 github.com/jackc/pgtype v1.14.0 @@ -67,7 +67,7 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 @@ -378,7 +378,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 - github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 + github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f diff --git a/go.sum b/go.sum index 59356146049..8df4ccfc30c 100644 --- a/go.sum +++ b/go.sum @@ -1457,14 +1457,14 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 h1:vdieOW3CZGdD2R5zvCSMS+0vksyExPN3/Fa1uVfld/A= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 h1:Db333w+fSm2e18LMikcIQHIZqgxZruW9uCUGJLUC9mI= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd h1:5r6SDRgZfi0kxc7D6sFV7h/bX+D7yewDq3FkyE0VMIM= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd/go.mod h1:agmAM21+teJkw0aj9KYj3q3s1sFkx3PXo5ibWJIrDfU= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918/go.mod h1:/yp/sqD8Iz5GU5fcercjrw0ivJF7HDcupYg+Gjr7EPg= -github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 h1:x3kNwgFlDmbE/n0gTSRMt9GBDfsfGrs4X9b9arPZtFI= -github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= +github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 h1:eSo9r53fARv2MnIO5pqYvQOXMBsTlAwhHyQ6BAVp6bY= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 8b25f52f70a..97a1da1665f 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -221,7 +221,7 @@ require ( github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/golang-lru v0.6.0 // indirect @@ -384,7 +384,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47 // indirect - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 // indirect + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 // indirect github.com/smartcontractkit/sqlx v1.3.5-0.20210805004948-4be295aacbeb // indirect @@ -504,7 +504,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 - github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 + github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 89e796d51f2..17bdc669e72 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2360,16 +2360,16 @@ github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc4 github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230913032705-f924d753cc47/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8= github.com/smartcontractkit/chainlink-env v0.38.1 h1:jIn+BTtWOlQ2IInPgJEjwwuVG2eGDClybg56gsswv8o= github.com/smartcontractkit/chainlink-env v0.38.1/go.mod h1:ICN9gOBY+NehK8mIxxM9CrWDohgkCQ1vgX9FazCbg8I= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1 h1:Db333w+fSm2e18LMikcIQHIZqgxZruW9uCUGJLUC9mI= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230926113942-a871b2976dc1/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd h1:5r6SDRgZfi0kxc7D6sFV7h/bX+D7yewDq3FkyE0VMIM= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231003135342-5e581164f8dd/go.mod h1:agmAM21+teJkw0aj9KYj3q3s1sFkx3PXo5ibWJIrDfU= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918/go.mod h1:/yp/sqD8Iz5GU5fcercjrw0ivJF7HDcupYg+Gjr7EPg= github.com/smartcontractkit/chainlink-testing-framework v1.17.4 h1:N7YK1VZrSxG3PEwY0S7NXJQgSiEvWHR6uKhytfHMTjA= github.com/smartcontractkit/chainlink-testing-framework v1.17.4/go.mod h1:izzRx4cNihkVP9XY15isSCMW1QAlRK1w5eE23/MbZHM= -github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 h1:x3kNwgFlDmbE/n0gTSRMt9GBDfsfGrs4X9b9arPZtFI= -github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= +github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 h1:eSo9r53fARv2MnIO5pqYvQOXMBsTlAwhHyQ6BAVp6bY= From 34d0500e70d42496e2b1e7f1c42a86ca13ad94fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 21:52:43 +0000 Subject: [PATCH 44/84] Bump reviewdog/action-actionlint from 1.39.0 to 1.39.1 (#10856) Bumps [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) from 1.39.0 to 1.39.1. - [Release notes](https://github.com/reviewdog/action-actionlint/releases) - [Commits](https://github.com/reviewdog/action-actionlint/compare/17ea0452ae2cd009a22ca629732a9ce7f49a55e6...82693e9e3b239f213108d6e412506f8b54003586) --- updated-dependencies: - dependency-name: reviewdog/action-actionlint dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jordan Krage --- .github/workflows/lint-gh-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-gh-workflows.yml b/.github/workflows/lint-gh-workflows.yml index 66c69420606..f5ac97cfb4b 100644 --- a/.github/workflows/lint-gh-workflows.yml +++ b/.github/workflows/lint-gh-workflows.yml @@ -9,7 +9,7 @@ jobs: - name: Check out Code uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Run actionlint - uses: reviewdog/action-actionlint@17ea0452ae2cd009a22ca629732a9ce7f49a55e6 # v1.39.0 + uses: reviewdog/action-actionlint@82693e9e3b239f213108d6e412506f8b54003586 # v1.39.1 - name: Collect Metrics if: always() id: collect-gha-metrics From 7547e57f4c9a335c2f34abfb0f36544334643b70 Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Wed, 4 Oct 2023 09:24:45 +0200 Subject: [PATCH 45/84] ORM layer refactoring before adding finality (#10846) * ORM layer refactoring before adding finality * Using named query for insertion --- .../evm/forwarders/forwarder_manager.go | 2 +- core/chains/evm/logpoller/disabled.go | 22 +- core/chains/evm/logpoller/log_poller.go | 50 +- core/chains/evm/logpoller/mocks/log_poller.go | 88 +-- core/chains/evm/logpoller/observability.go | 24 +- .../evm/logpoller/observability_test.go | 2 +- core/chains/evm/logpoller/orm.go | 683 ++++++++++-------- core/chains/evm/logpoller/orm_test.go | 16 +- core/chains/evm/logpoller/query.go | 143 ++++ core/chains/evm/logpoller/query_test.go | 82 +++ .../ocr2/plugins/ocr2keeper/evm21/registry.go | 4 +- .../evm21/registry_check_pipeline_test.go | 4 +- .../plugins/ocr2keeper/evm21/registry_test.go | 14 +- .../ocr2keeper/evm21/upkeepstate/scanner.go | 2 +- .../ocr2vrf/coordinator/coordinator.go | 4 +- .../ocr2vrf/coordinator/coordinator_test.go | 17 +- core/services/pg/q.go | 9 + 17 files changed, 745 insertions(+), 421 deletions(-) create mode 100644 core/chains/evm/logpoller/query.go create mode 100644 core/chains/evm/logpoller/query_test.go diff --git a/core/chains/evm/forwarders/forwarder_manager.go b/core/chains/evm/forwarders/forwarder_manager.go index 80b8b3d8b94..0c94f1ed601 100644 --- a/core/chains/evm/forwarders/forwarder_manager.go +++ b/core/chains/evm/forwarders/forwarder_manager.go @@ -253,7 +253,7 @@ func (f *FwdMgr) runLoop() { f.latestBlock, []common.Hash{authChangedTopic}, addrs, - int(f.cfg.FinalityDepth()), + evmlogpoller.Confirmations(f.cfg.FinalityDepth()), pg.WithParentCtx(f.ctx), ) if err != nil { diff --git a/core/chains/evm/logpoller/disabled.go b/core/chains/evm/logpoller/disabled.go index d6fb2b7cb0d..06f0b9200a3 100644 --- a/core/chains/evm/logpoller/disabled.go +++ b/core/chains/evm/logpoller/disabled.go @@ -53,15 +53,15 @@ func (disabled) LogsWithSigs(start, end int64, eventSigs []common.Hash, address return nil, ErrDisabled } -func (disabled) LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { +func (disabled) LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs Confirmations, qopts ...pg.QOpt) (*Log, error) { return nil, ErrDisabled } -func (disabled) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (disabled) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } -func (disabled) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (disabled) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } @@ -73,35 +73,35 @@ func (d disabled) IndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, return nil, ErrDisabled } -func (disabled) IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (disabled) IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } -func (disabled) IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (disabled) IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } -func (disabled) LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (disabled) LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } -func (disabled) LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (disabled) LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } -func (d disabled) IndexedLogsWithSigsExcluding(address common.Address, eventSigA, eventSigB common.Hash, topicIndex int, fromBlock, toBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (d disabled) IndexedLogsWithSigsExcluding(address common.Address, eventSigA, eventSigB common.Hash, topicIndex int, fromBlock, toBlock int64, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } -func (d disabled) LogsCreatedAfter(eventSig common.Hash, address common.Address, time time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (d disabled) LogsCreatedAfter(eventSig common.Hash, address common.Address, time time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } -func (d disabled) IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (d disabled) IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return nil, ErrDisabled } -func (d disabled) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { +func (d disabled) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) (int64, error) { return 0, ErrDisabled } diff --git a/core/chains/evm/logpoller/log_poller.go b/core/chains/evm/logpoller/log_poller.go index f4b3a7f4f0d..121f62fb1c5 100644 --- a/core/chains/evm/logpoller/log_poller.go +++ b/core/chains/evm/logpoller/log_poller.go @@ -43,24 +43,26 @@ type LogPoller interface { // General querying Logs(start, end int64, eventSig common.Hash, address common.Address, qopts ...pg.QOpt) ([]Log, error) LogsWithSigs(start, end int64, eventSigs []common.Hash, address common.Address, qopts ...pg.QOpt) ([]Log, error) - LogsCreatedAfter(eventSig common.Hash, address common.Address, time time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) - LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) - LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) ([]Log, error) - LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) + LogsCreatedAfter(eventSig common.Hash, address common.Address, time time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs Confirmations, qopts ...pg.QOpt) (*Log, error) + LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) (int64, error) // Content based querying - IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) IndexedLogsByBlockRange(start, end int64, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) - IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) + IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) IndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, qopts ...pg.QOpt) ([]Log, error) - IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) - IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) - IndexedLogsWithSigsExcluding(address common.Address, eventSigA, eventSigB common.Hash, topicIndex int, fromBlock, toBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) - LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) - LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + IndexedLogsWithSigsExcluding(address common.Address, eventSigA, eventSigB common.Hash, topicIndex int, fromBlock, toBlock int64, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) LogsUntilBlockHashDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) } +type Confirmations int + type LogPollerTest interface { LogPoller PollAndSaveLogs(ctx context.Context, currentBlockNumber int64) @@ -944,12 +946,12 @@ func (lp *logPoller) LogsWithSigs(start, end int64, eventSigs []common.Hash, add return lp.orm.SelectLogsWithSigs(start, end, address, eventSigs, qopts...) } -func (lp *logPoller) LogsCreatedAfter(eventSig common.Hash, address common.Address, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) LogsCreatedAfter(eventSig common.Hash, address common.Address, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectLogsCreatedAfter(address, eventSig, after, confs, qopts...) } // IndexedLogs finds all the logs that have a topic value in topicValues at index topicIndex. -func (lp *logPoller) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectIndexedLogs(address, eventSig, topicIndex, topicValues, confs, qopts...) } @@ -958,7 +960,7 @@ func (lp *logPoller) IndexedLogsByBlockRange(start, end int64, eventSig common.H return lp.orm.SelectIndexedLogsByBlockRange(start, end, address, eventSig, topicIndex, topicValues, qopts...) } -func (lp *logPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectIndexedLogsCreatedAfter(address, eventSig, topicIndex, topicValues, after, confs, qopts...) } @@ -967,18 +969,18 @@ func (lp *logPoller) IndexedLogsByTxHash(eventSig common.Hash, txHash common.Has } // LogsDataWordGreaterThan note index is 0 based. -func (lp *logPoller) LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectLogsDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, confs, qopts...) } // LogsDataWordRange note index is 0 based. -func (lp *logPoller) LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectLogsDataWordRange(address, eventSig, wordIndex, wordValueMin, wordValueMax, confs, qopts...) } // IndexedLogsTopicGreaterThan finds all the logs that have a topic value greater than topicValueMin at index topicIndex. // Only works for integer topics. -func (lp *logPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectIndexedLogsTopicGreaterThan(address, eventSig, topicIndex, topicValueMin, confs, qopts...) } @@ -988,7 +990,7 @@ func (lp *logPoller) LogsUntilBlockHashDataWordGreaterThan(eventSig common.Hash, return lp.orm.SelectLogsUntilBlockHashDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, untilBlockHash, qopts...) } -func (lp *logPoller) IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectIndexedLogsTopicRange(address, eventSig, topicIndex, topicValueMin, topicValueMax, confs, qopts...) } @@ -1008,15 +1010,15 @@ func (lp *logPoller) BlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, } // LatestLogByEventSigWithConfs finds the latest log that has confs number of blocks on top of the log. -func (lp *logPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { +func (lp *logPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs Confirmations, qopts ...pg.QOpt) (*Log, error) { return lp.orm.SelectLatestLogByEventSigWithConfs(eventSig, address, confs, qopts...) } -func (lp *logPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectLatestLogEventSigsAddrsWithConfs(fromBlock, addresses, eventSigs, confs, qopts...) } -func (lp *logPoller) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { +func (lp *logPoller) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) (int64, error) { return lp.orm.SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock, eventSigs, addresses, confs, qopts...) } @@ -1039,8 +1041,8 @@ func (lp *logPoller) GetBlocksRange(ctx context.Context, numbers []uint64, qopts // Retrieve all blocks within this range from the log poller. blocksFound := make(map[uint64]LogPollerBlock) qopts = append(qopts, pg.WithParentCtx(ctx)) - minRequestedBlock := mathutil.Min(numbers[0], numbers[1:]...) - maxRequestedBlock := mathutil.Max(numbers[0], numbers[1:]...) + minRequestedBlock := int64(mathutil.Min(numbers[0], numbers[1:]...)) + maxRequestedBlock := int64(mathutil.Max(numbers[0], numbers[1:]...)) lpBlocks, err := lp.orm.GetBlocksRange(minRequestedBlock, maxRequestedBlock, qopts...) if err != nil { lp.lggr.Warnw("Error while retrieving blocks from log pollers blocks table. Falling back to RPC...", "requestedBlocks", numbers, "err", err) @@ -1150,7 +1152,7 @@ func (lp *logPoller) fillRemainingBlocksFromRPC( // // For example, query to retrieve unfulfilled requests by querying request log events without matching fulfillment log events. // The order of events is not significant. Both logs must be inside the block range and have the minimum number of confirmations -func (lp *logPoller) IndexedLogsWithSigsExcluding(address common.Address, eventSigA, eventSigB common.Hash, topicIndex int, fromBlock, toBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (lp *logPoller) IndexedLogsWithSigsExcluding(address common.Address, eventSigA, eventSigB common.Hash, topicIndex int, fromBlock, toBlock int64, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return lp.orm.SelectIndexedLogsWithSigsExcluding(eventSigA, eventSigB, topicIndex, address, fromBlock, toBlock, confs, qopts...) } diff --git a/core/chains/evm/logpoller/mocks/log_poller.go b/core/chains/evm/logpoller/mocks/log_poller.go index 39d37f31a32..325571e4071 100644 --- a/core/chains/evm/logpoller/mocks/log_poller.go +++ b/core/chains/evm/logpoller/mocks/log_poller.go @@ -99,7 +99,7 @@ func (_m *LogPoller) HealthReport() map[string]error { } // IndexedLogs provides a mock function with given fields: eventSig, address, topicIndex, topicValues, confs, qopts -func (_m *LogPoller) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -111,10 +111,10 @@ func (_m *LogPoller) IndexedLogs(eventSig common.Hash, address common.Address, t var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, []common.Hash, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, []common.Hash, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(eventSig, address, topicIndex, topicValues, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, []common.Hash, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, []common.Hash, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(eventSig, address, topicIndex, topicValues, confs, qopts...) } else { if ret.Get(0) != nil { @@ -122,7 +122,7 @@ func (_m *LogPoller) IndexedLogs(eventSig common.Hash, address common.Address, t } } - if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, []common.Hash, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, []common.Hash, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(eventSig, address, topicIndex, topicValues, confs, qopts...) } else { r1 = ret.Error(1) @@ -198,7 +198,7 @@ func (_m *LogPoller) IndexedLogsByTxHash(eventSig common.Hash, txHash common.Has } // IndexedLogsCreatedAfter provides a mock function with given fields: eventSig, address, topicIndex, topicValues, after, confs, qopts -func (_m *LogPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -210,10 +210,10 @@ func (_m *LogPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address commo var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, []common.Hash, time.Time, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, []common.Hash, time.Time, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(eventSig, address, topicIndex, topicValues, after, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, []common.Hash, time.Time, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, []common.Hash, time.Time, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(eventSig, address, topicIndex, topicValues, after, confs, qopts...) } else { if ret.Get(0) != nil { @@ -221,7 +221,7 @@ func (_m *LogPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address commo } } - if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, []common.Hash, time.Time, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, []common.Hash, time.Time, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(eventSig, address, topicIndex, topicValues, after, confs, qopts...) } else { r1 = ret.Error(1) @@ -231,7 +231,7 @@ func (_m *LogPoller) IndexedLogsCreatedAfter(eventSig common.Hash, address commo } // IndexedLogsTopicGreaterThan provides a mock function with given fields: eventSig, address, topicIndex, topicValueMin, confs, qopts -func (_m *LogPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -243,10 +243,10 @@ func (_m *LogPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address c var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(eventSig, address, topicIndex, topicValueMin, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(eventSig, address, topicIndex, topicValueMin, confs, qopts...) } else { if ret.Get(0) != nil { @@ -254,7 +254,7 @@ func (_m *LogPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address c } } - if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, common.Hash, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, common.Hash, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(eventSig, address, topicIndex, topicValueMin, confs, qopts...) } else { r1 = ret.Error(1) @@ -264,7 +264,7 @@ func (_m *LogPoller) IndexedLogsTopicGreaterThan(eventSig common.Hash, address c } // IndexedLogsTopicRange provides a mock function with given fields: eventSig, address, topicIndex, topicValueMin, topicValueMax, confs, qopts -func (_m *LogPoller) IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -276,10 +276,10 @@ func (_m *LogPoller) IndexedLogsTopicRange(eventSig common.Hash, address common. var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, common.Hash, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, common.Hash, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(eventSig, address, topicIndex, topicValueMin, topicValueMax, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, common.Hash, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, common.Hash, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(eventSig, address, topicIndex, topicValueMin, topicValueMax, confs, qopts...) } else { if ret.Get(0) != nil { @@ -287,7 +287,7 @@ func (_m *LogPoller) IndexedLogsTopicRange(eventSig common.Hash, address common. } } - if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, common.Hash, common.Hash, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, common.Hash, common.Hash, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(eventSig, address, topicIndex, topicValueMin, topicValueMax, confs, qopts...) } else { r1 = ret.Error(1) @@ -297,7 +297,7 @@ func (_m *LogPoller) IndexedLogsTopicRange(eventSig common.Hash, address common. } // IndexedLogsWithSigsExcluding provides a mock function with given fields: address, eventSigA, eventSigB, topicIndex, fromBlock, toBlock, confs, qopts -func (_m *LogPoller) IndexedLogsWithSigsExcluding(address common.Address, eventSigA common.Hash, eventSigB common.Hash, topicIndex int, fromBlock int64, toBlock int64, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) IndexedLogsWithSigsExcluding(address common.Address, eventSigA common.Hash, eventSigB common.Hash, topicIndex int, fromBlock int64, toBlock int64, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -309,10 +309,10 @@ func (_m *LogPoller) IndexedLogsWithSigsExcluding(address common.Address, eventS var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Address, common.Hash, common.Hash, int, int64, int64, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Address, common.Hash, common.Hash, int, int64, int64, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(address, eventSigA, eventSigB, topicIndex, fromBlock, toBlock, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Address, common.Hash, common.Hash, int, int64, int64, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Address, common.Hash, common.Hash, int, int64, int64, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(address, eventSigA, eventSigB, topicIndex, fromBlock, toBlock, confs, qopts...) } else { if ret.Get(0) != nil { @@ -320,7 +320,7 @@ func (_m *LogPoller) IndexedLogsWithSigsExcluding(address common.Address, eventS } } - if rf, ok := ret.Get(1).(func(common.Address, common.Hash, common.Hash, int, int64, int64, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Address, common.Hash, common.Hash, int, int64, int64, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(address, eventSigA, eventSigB, topicIndex, fromBlock, toBlock, confs, qopts...) } else { r1 = ret.Error(1) @@ -360,7 +360,7 @@ func (_m *LogPoller) LatestBlock(qopts ...pg.QOpt) (int64, error) { } // LatestBlockByEventSigsAddrsWithConfs provides a mock function with given fields: fromBlock, eventSigs, addresses, confs, qopts -func (_m *LogPoller) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { +func (_m *LogPoller) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs logpoller.Confirmations, qopts ...pg.QOpt) (int64, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -372,16 +372,16 @@ func (_m *LogPoller) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, event var r0 int64 var r1 error - if rf, ok := ret.Get(0).(func(int64, []common.Hash, []common.Address, int, ...pg.QOpt) (int64, error)); ok { + if rf, ok := ret.Get(0).(func(int64, []common.Hash, []common.Address, logpoller.Confirmations, ...pg.QOpt) (int64, error)); ok { return rf(fromBlock, eventSigs, addresses, confs, qopts...) } - if rf, ok := ret.Get(0).(func(int64, []common.Hash, []common.Address, int, ...pg.QOpt) int64); ok { + if rf, ok := ret.Get(0).(func(int64, []common.Hash, []common.Address, logpoller.Confirmations, ...pg.QOpt) int64); ok { r0 = rf(fromBlock, eventSigs, addresses, confs, qopts...) } else { r0 = ret.Get(0).(int64) } - if rf, ok := ret.Get(1).(func(int64, []common.Hash, []common.Address, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(int64, []common.Hash, []common.Address, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(fromBlock, eventSigs, addresses, confs, qopts...) } else { r1 = ret.Error(1) @@ -391,7 +391,7 @@ func (_m *LogPoller) LatestBlockByEventSigsAddrsWithConfs(fromBlock int64, event } // LatestLogByEventSigWithConfs provides a mock function with given fields: eventSig, address, confs, qopts -func (_m *LogPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*logpoller.Log, error) { +func (_m *LogPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs logpoller.Confirmations, qopts ...pg.QOpt) (*logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -403,10 +403,10 @@ func (_m *LogPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address var r0 *logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, ...pg.QOpt) (*logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, logpoller.Confirmations, ...pg.QOpt) (*logpoller.Log, error)); ok { return rf(eventSig, address, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, ...pg.QOpt) *logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, logpoller.Confirmations, ...pg.QOpt) *logpoller.Log); ok { r0 = rf(eventSig, address, confs, qopts...) } else { if ret.Get(0) != nil { @@ -414,7 +414,7 @@ func (_m *LogPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address } } - if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Hash, common.Address, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(eventSig, address, confs, qopts...) } else { r1 = ret.Error(1) @@ -424,7 +424,7 @@ func (_m *LogPoller) LatestLogByEventSigWithConfs(eventSig common.Hash, address } // LatestLogEventSigsAddrsWithConfs provides a mock function with given fields: fromBlock, eventSigs, addresses, confs, qopts -func (_m *LogPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -436,10 +436,10 @@ func (_m *LogPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(int64, []common.Hash, []common.Address, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(int64, []common.Hash, []common.Address, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(fromBlock, eventSigs, addresses, confs, qopts...) } - if rf, ok := ret.Get(0).(func(int64, []common.Hash, []common.Address, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(int64, []common.Hash, []common.Address, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(fromBlock, eventSigs, addresses, confs, qopts...) } else { if ret.Get(0) != nil { @@ -447,7 +447,7 @@ func (_m *LogPoller) LatestLogEventSigsAddrsWithConfs(fromBlock int64, eventSigs } } - if rf, ok := ret.Get(1).(func(int64, []common.Hash, []common.Address, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(int64, []common.Hash, []common.Address, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(fromBlock, eventSigs, addresses, confs, qopts...) } else { r1 = ret.Error(1) @@ -490,7 +490,7 @@ func (_m *LogPoller) Logs(start int64, end int64, eventSig common.Hash, address } // LogsCreatedAfter provides a mock function with given fields: eventSig, address, _a2, confs, qopts -func (_m *LogPoller) LogsCreatedAfter(eventSig common.Hash, address common.Address, _a2 time.Time, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) LogsCreatedAfter(eventSig common.Hash, address common.Address, _a2 time.Time, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -502,10 +502,10 @@ func (_m *LogPoller) LogsCreatedAfter(eventSig common.Hash, address common.Addre var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, time.Time, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, time.Time, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(eventSig, address, _a2, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, time.Time, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, time.Time, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(eventSig, address, _a2, confs, qopts...) } else { if ret.Get(0) != nil { @@ -513,7 +513,7 @@ func (_m *LogPoller) LogsCreatedAfter(eventSig common.Hash, address common.Addre } } - if rf, ok := ret.Get(1).(func(common.Hash, common.Address, time.Time, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Hash, common.Address, time.Time, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(eventSig, address, _a2, confs, qopts...) } else { r1 = ret.Error(1) @@ -523,7 +523,7 @@ func (_m *LogPoller) LogsCreatedAfter(eventSig common.Hash, address common.Addre } // LogsDataWordGreaterThan provides a mock function with given fields: eventSig, address, wordIndex, wordValueMin, confs, qopts -func (_m *LogPoller) LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -535,10 +535,10 @@ func (_m *LogPoller) LogsDataWordGreaterThan(eventSig common.Hash, address commo var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(eventSig, address, wordIndex, wordValueMin, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(eventSig, address, wordIndex, wordValueMin, confs, qopts...) } else { if ret.Get(0) != nil { @@ -546,7 +546,7 @@ func (_m *LogPoller) LogsDataWordGreaterThan(eventSig common.Hash, address commo } } - if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, common.Hash, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, common.Hash, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(eventSig, address, wordIndex, wordValueMin, confs, qopts...) } else { r1 = ret.Error(1) @@ -556,7 +556,7 @@ func (_m *LogPoller) LogsDataWordGreaterThan(eventSig common.Hash, address commo } // LogsDataWordRange provides a mock function with given fields: eventSig, address, wordIndex, wordValueMin, wordValueMax, confs, qopts -func (_m *LogPoller) LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (_m *LogPoller) LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, wordValueMax common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { _va := make([]interface{}, len(qopts)) for _i := range qopts { _va[_i] = qopts[_i] @@ -568,10 +568,10 @@ func (_m *LogPoller) LogsDataWordRange(eventSig common.Hash, address common.Addr var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, common.Hash, int, ...pg.QOpt) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, common.Hash, logpoller.Confirmations, ...pg.QOpt) ([]logpoller.Log, error)); ok { return rf(eventSig, address, wordIndex, wordValueMin, wordValueMax, confs, qopts...) } - if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, common.Hash, int, ...pg.QOpt) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(common.Hash, common.Address, int, common.Hash, common.Hash, logpoller.Confirmations, ...pg.QOpt) []logpoller.Log); ok { r0 = rf(eventSig, address, wordIndex, wordValueMin, wordValueMax, confs, qopts...) } else { if ret.Get(0) != nil { @@ -579,7 +579,7 @@ func (_m *LogPoller) LogsDataWordRange(eventSig common.Hash, address common.Addr } } - if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, common.Hash, common.Hash, int, ...pg.QOpt) error); ok { + if rf, ok := ret.Get(1).(func(common.Hash, common.Address, int, common.Hash, common.Hash, logpoller.Confirmations, ...pg.QOpt) error); ok { r1 = rf(eventSig, address, wordIndex, wordValueMin, wordValueMax, confs, qopts...) } else { r1 = ret.Error(1) diff --git a/core/chains/evm/logpoller/observability.go b/core/chains/evm/logpoller/observability.go index 4e0ebe74184..5935c25637a 100644 --- a/core/chains/evm/logpoller/observability.go +++ b/core/chains/evm/logpoller/observability.go @@ -138,7 +138,7 @@ func (o *ObservedORM) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, erro }) } -func (o *ObservedORM) SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { +func (o *ObservedORM) SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs Confirmations, qopts ...pg.QOpt) (*Log, error) { return withObservedQuery(o, "SelectLatestLogByEventSigWithConfs", func() (*Log, error) { return o.ORM.SelectLatestLogByEventSigWithConfs(eventSig, address, confs, qopts...) }) @@ -150,13 +150,13 @@ func (o *ObservedORM) SelectLogsWithSigs(start, end int64, address common.Addres }) } -func (o *ObservedORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectLogsCreatedAfter", func() ([]Log, error) { return o.ORM.SelectLogsCreatedAfter(address, eventSig, after, confs, qopts...) }) } -func (o *ObservedORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectIndexedLogs", func() ([]Log, error) { return o.ORM.SelectIndexedLogs(address, eventSig, topicIndex, topicValues, confs, qopts...) }) @@ -168,13 +168,13 @@ func (o *ObservedORM) SelectIndexedLogsByBlockRange(start, end int64, address co }) } -func (o *ObservedORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectIndexedLogsCreatedAfter", func() ([]Log, error) { return o.ORM.SelectIndexedLogsCreatedAfter(address, eventSig, topicIndex, topicValues, after, confs, qopts...) }) } -func (o *ObservedORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectIndexedLogsWithSigsExcluding", func() ([]Log, error) { return o.ORM.SelectIndexedLogsWithSigsExcluding(sigA, sigB, topicIndex, address, startBlock, endBlock, confs, qopts...) }) @@ -192,31 +192,31 @@ func (o *ObservedORM) IndexedLogsByTxHash(eventSig common.Hash, txHash common.Ha }) } -func (o *ObservedORM) GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]LogPollerBlock, error) { +func (o *ObservedORM) GetBlocksRange(start int64, end int64, qopts ...pg.QOpt) ([]LogPollerBlock, error) { return withObservedQueryAndResults(o, "GetBlocksRange", func() ([]LogPollerBlock, error) { return o.ORM.GetBlocksRange(start, end, qopts...) }) } -func (o *ObservedORM) SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectLatestLogEventSigsAddrsWithConfs", func() ([]Log, error) { return o.ORM.SelectLatestLogEventSigsAddrsWithConfs(fromBlock, addresses, eventSigs, confs, qopts...) }) } -func (o *ObservedORM) SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { +func (o *ObservedORM) SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) (int64, error) { return withObservedQuery(o, "SelectLatestBlockByEventSigsAddrsWithConfs", func() (int64, error) { return o.ORM.SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock, eventSigs, addresses, confs, qopts...) }) } -func (o *ObservedORM) SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectLogsDataWordRange", func() ([]Log, error) { return o.ORM.SelectLogsDataWordRange(address, eventSig, wordIndex, wordValueMin, wordValueMax, confs, qopts...) }) } -func (o *ObservedORM) SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectLogsDataWordGreaterThan", func() ([]Log, error) { return o.ORM.SelectLogsDataWordGreaterThan(address, eventSig, wordIndex, wordValueMin, confs, qopts...) }) @@ -228,13 +228,13 @@ func (o *ObservedORM) SelectLogsUntilBlockHashDataWordGreaterThan(address common }) } -func (o *ObservedORM) SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectIndexedLogsTopicGreaterThan", func() ([]Log, error) { return o.ORM.SelectIndexedLogsTopicGreaterThan(address, eventSig, topicIndex, topicValueMin, confs, qopts...) }) } -func (o *ObservedORM) SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { +func (o *ObservedORM) SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { return withObservedQueryAndResults(o, "SelectIndexedLogsTopicRange", func() ([]Log, error) { return o.ORM.SelectIndexedLogsTopicRange(address, eventSig, topicIndex, topicValueMin, topicValueMax, confs, qopts...) }) diff --git a/core/chains/evm/logpoller/observability_test.go b/core/chains/evm/logpoller/observability_test.go index c26b487bbd0..1f0c0abfeaf 100644 --- a/core/chains/evm/logpoller/observability_test.go +++ b/core/chains/evm/logpoller/observability_test.go @@ -35,7 +35,7 @@ func TestMultipleMetricsArePublished(t *testing.T) { _, _ = lp.SelectLogsCreatedAfter(common.Address{}, common.Hash{}, time.Now(), 0, pg.WithParentCtx(ctx)) _, _ = lp.SelectLatestLogByEventSigWithConfs(common.Hash{}, common.Address{}, 0, pg.WithParentCtx(ctx)) _, _ = lp.SelectLatestLogEventSigsAddrsWithConfs(0, []common.Address{{}}, []common.Hash{{}}, 1, pg.WithParentCtx(ctx)) - _, _ = lp.SelectIndexedLogsCreatedAfter(common.Address{}, common.Hash{}, 0, []common.Hash{}, time.Now(), 0, pg.WithParentCtx(ctx)) + _, _ = lp.SelectIndexedLogsCreatedAfter(common.Address{}, common.Hash{}, 1, []common.Hash{}, time.Now(), 0, pg.WithParentCtx(ctx)) _, _ = lp.SelectLogsUntilBlockHashDataWordGreaterThan(common.Address{}, common.Hash{}, 0, common.Hash{}, common.Hash{}, pg.WithParentCtx(ctx)) _ = lp.InsertLogs([]Log{}, pg.WithParentCtx(ctx)) _ = lp.InsertBlock(common.Hash{}, 0, time.Now(), pg.WithParentCtx(ctx)) diff --git a/core/chains/evm/logpoller/orm.go b/core/chains/evm/logpoller/orm.go index 8cb80094c0f..95db7c24255 100644 --- a/core/chains/evm/logpoller/orm.go +++ b/core/chains/evm/logpoller/orm.go @@ -3,11 +3,11 @@ package logpoller import ( "context" "database/sql" + "fmt" "math/big" "time" "github.com/ethereum/go-ethereum/common" - "github.com/lib/pq" "github.com/pkg/errors" "github.com/smartcontractkit/sqlx" @@ -22,7 +22,7 @@ import ( type ORM interface { Q() pg.Q InsertLogs(logs []Log, qopts ...pg.QOpt) error - InsertBlock(h common.Hash, n int64, t time.Time, qopts ...pg.QOpt) error + InsertBlock(blockHash common.Hash, blockNumber int64, blockTimestamp time.Time, qopts ...pg.QOpt) error InsertFilter(filter Filter, qopts ...pg.QOpt) error LoadFilters(qopts ...pg.QOpt) (map[string]Filter, error) @@ -33,26 +33,26 @@ type ORM interface { DeleteLogsAfter(start int64, qopts ...pg.QOpt) error DeleteExpiredLogs(qopts ...pg.QOpt) error - GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]LogPollerBlock, error) - SelectBlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, error) + GetBlocksRange(start int64, end int64, qopts ...pg.QOpt) ([]LogPollerBlock, error) + SelectBlockByNumber(blockNumber int64, qopts ...pg.QOpt) (*LogPollerBlock, error) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error) SelectLogs(start, end int64, address common.Address, eventSig common.Hash, qopts ...pg.QOpt) ([]Log, error) SelectLogsWithSigs(start, end int64, address common.Address, eventSigs []common.Hash, qopts ...pg.QOpt) ([]Log, error) - SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) - SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) - SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) - SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) + SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs Confirmations, qopts ...pg.QOpt) (*Log, error) + SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) (int64, error) - SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) SelectIndexedLogsByBlockRange(start, end int64, address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) - SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) - SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) - SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) - SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) SelectIndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, qopts ...pg.QOpt) ([]Log, error) - SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) - SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) + SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) + SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) SelectLogsUntilBlockHashDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) } @@ -76,11 +76,20 @@ func (o *DbORM) Q() pg.Q { } // InsertBlock is idempotent to support replays. -func (o *DbORM) InsertBlock(h common.Hash, n int64, t time.Time, qopts ...pg.QOpt) error { - q := o.q.WithOpts(qopts...) - err := q.ExecQ(`INSERT INTO evm.log_poller_blocks (evm_chain_id, block_hash, block_number, block_timestamp, created_at) - VALUES ($1, $2, $3, $4, NOW()) ON CONFLICT DO NOTHING`, utils.NewBig(o.chainID), h[:], n, t) - return err +func (o *DbORM) InsertBlock(blockHash common.Hash, blockNumber int64, blockTimestamp time.Time, qopts ...pg.QOpt) error { + args, err := newQueryArgs(o.chainID). + withCustomHashArg("block_hash", blockHash). + withCustomArg("block_number", blockNumber). + withCustomArg("block_timestamp", blockTimestamp). + toArgs() + if err != nil { + return err + } + return o.q.WithOpts(qopts...).ExecQNamed(` + INSERT INTO evm.log_poller_blocks + (evm_chain_id, block_hash, block_number, block_timestamp, created_at) + VALUES (:evm_chain_id, :block_hash, :block_number, :block_timestamp, NOW()) + ON CONFLICT DO NOTHING`, args) } // InsertFilter is idempotent. @@ -88,24 +97,26 @@ func (o *DbORM) InsertBlock(h common.Hash, n int64, t time.Time, qopts ...pg.QOp // Each address/event pair must have a unique job id, so it may be removed when the job is deleted. // If a second job tries to overwrite the same pair, this should fail. func (o *DbORM) InsertFilter(filter Filter, qopts ...pg.QOpt) (err error) { - q := o.q.WithOpts(qopts...) - addresses := make([][]byte, 0) - events := make([][]byte, 0) - - for _, addr := range filter.Addresses { - addresses = append(addresses, addr.Bytes()) - } - for _, ev := range filter.EventSigs { - events = append(events, ev.Bytes()) + args, err := newQueryArgs(o.chainID). + withCustomArg("name", filter.Name). + withCustomArg("retention", filter.Retention). + withAddressArray(filter.Addresses). + withEventSigArray(filter.EventSigs). + toArgs() + if err != nil { + return err } - return q.ExecQ(`INSERT INTO evm.log_poller_filters - (name, evm_chain_id, retention, created_at, address, event) + // '::' has to be escaped in the query string + // https://github.com/jmoiron/sqlx/issues/91, https://github.com/jmoiron/sqlx/issues/428 + return o.q.WithOpts(qopts...).ExecQNamed(` + INSERT INTO evm.log_poller_filters + (name, evm_chain_id, retention, created_at, address, event) SELECT * FROM - (SELECT $1, $2::NUMERIC, $3::BIGINT, NOW()) x, - (SELECT unnest($4::BYTEA[]) addr) a, - (SELECT unnest($5::BYTEA[]) ev) e - ON CONFLICT (name, evm_chain_id, address, event) DO UPDATE SET retention=$3::BIGINT;`, - filter.Name, utils.NewBig(o.chainID), filter.Retention, addresses, events) + (SELECT :name, :evm_chain_id ::::NUMERIC, :retention ::::BIGINT, NOW()) x, + (SELECT unnest(:address_array ::::BYTEA[]) addr) a, + (SELECT unnest(:event_sig_array ::::BYTEA[]) ev) e + ON CONFLICT (name, evm_chain_id, address, event) + DO UPDATE SET retention=:retention ::::BIGINT`, args) } // DeleteFilter removes all events,address pairs associated with the Filter @@ -132,10 +143,10 @@ func (o *DbORM) LoadFilters(qopts ...pg.QOpt) (map[string]Filter, error) { return filters, err } -func (o *DbORM) SelectBlockByHash(h common.Hash, qopts ...pg.QOpt) (*LogPollerBlock, error) { +func (o *DbORM) SelectBlockByHash(hash common.Hash, qopts ...pg.QOpt) (*LogPollerBlock, error) { q := o.q.WithOpts(qopts...) var b LogPollerBlock - if err := q.Get(&b, `SELECT * FROM evm.log_poller_blocks WHERE block_hash = $1 AND evm_chain_id = $2`, h, utils.NewBig(o.chainID)); err != nil { + if err := q.Get(&b, `SELECT * FROM evm.log_poller_blocks WHERE block_hash = $1 AND evm_chain_id = $2`, hash, utils.NewBig(o.chainID)); err != nil { return nil, err } return &b, nil @@ -159,15 +170,22 @@ func (o *DbORM) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error) { return &b, nil } -func (o *DbORM) SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error) { - q := o.q.WithOpts(qopts...) +func (o *DbORM) SelectLatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs Confirmations, qopts ...pg.QOpt) (*Log, error) { + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withConfs(confs). + toArgs() + if err != nil { + return nil, err + } + query := fmt.Sprintf(` + SELECT * FROM evm.logs + WHERE evm_chain_id = :evm_chain_id + AND event_sig = :event_sig + AND address = :address + AND block_number <= %s + ORDER BY (block_number, log_index) DESC LIMIT 1`, nestedBlockNumberQuery()) var l Log - if err := q.Get(&l, `SELECT * FROM evm.logs - WHERE evm_chain_id = $1 - AND event_sig = $2 - AND address = $3 - AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $4 - ORDER BY (block_number, log_index) DESC LIMIT 1`, utils.NewBig(o.chainID), eventSig, address, confs); err != nil { + if err := o.q.WithOpts(qopts...).GetNamed(query, &l, args); err != nil { return nil, err } return &l, nil @@ -229,9 +247,12 @@ func (o *DbORM) InsertLogs(logs []Log, qopts ...pg.QOpt) error { end = len(logs) } - err := q.ExecQNamed(`INSERT INTO evm.logs -(evm_chain_id, log_index, block_hash, block_number, block_timestamp, address, event_sig, topics, tx_hash, data, created_at) VALUES -(:evm_chain_id, :log_index, :block_hash, :block_number, :block_timestamp, :address, :event_sig, :topics, :tx_hash, :data, NOW()) ON CONFLICT DO NOTHING`, logs[start:end]) + err := q.ExecQNamed(` + INSERT INTO evm.logs + (evm_chain_id, log_index, block_hash, block_number, block_timestamp, address, event_sig, topics, tx_hash, data, created_at) + VALUES + (:evm_chain_id, :log_index, :block_hash, :block_number, :block_timestamp, :address, :event_sig, :topics, :tx_hash, :data, NOW()) + ON CONFLICT DO NOTHING`, logs[start:end]) if err != nil { if errors.Is(err, context.DeadlineExceeded) && batchInsertSize > 500 { @@ -243,16 +264,25 @@ func (o *DbORM) InsertLogs(logs []Log, qopts ...pg.QOpt) error { return err } } - return nil } func (o *DbORM) SelectLogsByBlockRange(start, end int64) ([]Log, error) { + args, err := newQueryArgs(o.chainID). + withStartBlock(start). + withEndBlock(end). + toArgs() + if err != nil { + return nil, err + } + var logs []Log - err := o.q.Select(&logs, ` + err = o.q.SelectNamed(&logs, ` SELECT * FROM evm.logs - WHERE block_number >= $1 AND block_number <= $2 AND evm_chain_id = $3 - ORDER BY (block_number, log_index, created_at)`, start, end, utils.NewBig(o.chainID)) + WHERE evm_chain_id = :evm_chain_id + AND block_number >= :start_block + AND block_number <= :end_block + ORDER BY (block_number, log_index, created_at)`, args) if err != nil { return nil, err } @@ -261,13 +291,22 @@ func (o *DbORM) SelectLogsByBlockRange(start, end int64) ([]Log, error) { // SelectLogsByBlockRangeFilter finds the logs in a given block range. func (o *DbORM) SelectLogs(start, end int64, address common.Address, eventSig common.Hash, qopts ...pg.QOpt) ([]Log, error) { + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withStartBlock(start). + withEndBlock(end). + toArgs() + if err != nil { + return nil, err + } var logs []Log - q := o.q.WithOpts(qopts...) - err := q.Select(&logs, ` + err = o.q.WithOpts(qopts...).SelectNamed(&logs, ` SELECT * FROM evm.logs - WHERE evm.logs.block_number >= $1 AND evm.logs.block_number <= $2 AND evm.logs.evm_chain_id = $3 - AND address = $4 AND event_sig = $5 - ORDER BY (evm.logs.block_number, evm.logs.log_index)`, start, end, utils.NewBig(o.chainID), address, eventSig.Bytes()) + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND block_number >= :start_block + AND block_number <= :end_block + ORDER BY (block_number, log_index)`, args) if err != nil { return nil, err } @@ -275,22 +314,27 @@ func (o *DbORM) SelectLogs(start, end int64, address common.Address, eventSig co } // SelectLogsCreatedAfter finds logs created after some timestamp. -func (o *DbORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { - minBlock, maxBlock, err := o.blocksRangeAfterTimestamp(after, confs, qopts...) +func (o *DbORM) SelectLogsCreatedAfter(address common.Address, eventSig common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + startBlock, endBlock, err := o.blocksRangeAfterTimestamp(after, confs, qopts...) + if err != nil { + return nil, err + } + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withStartBlock(startBlock). + withEndBlock(endBlock). + toArgs() if err != nil { return nil, err } - var logs []Log - q := o.q.WithOpts(qopts...) - err = q.Select(&logs, ` + err = o.q.WithOpts(qopts...).SelectNamed(&logs, ` SELECT * FROM evm.logs - WHERE evm_chain_id = $1 - AND address = $2 - AND event_sig = $3 - AND block_number > $4 - AND block_number <= $5 - ORDER BY (block_number, log_index)`, utils.NewBig(o.chainID), address, eventSig, minBlock, maxBlock) + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND block_number > :start_block + AND block_number <= :end_block + ORDER BY (block_number, log_index)`, args) if err != nil { return nil, err } @@ -300,50 +344,45 @@ func (o *DbORM) SelectLogsCreatedAfter(address common.Address, eventSig common.H // SelectLogsWithSigsByBlockRangeFilter finds the logs in the given block range with the given event signatures // emitted from the given address. func (o *DbORM) SelectLogsWithSigs(start, end int64, address common.Address, eventSigs []common.Hash, qopts ...pg.QOpt) (logs []Log, err error) { - q := o.q.WithOpts(qopts...) - sigs := make([][]byte, 0, len(eventSigs)) - for _, sig := range eventSigs { - sigs = append(sigs, sig.Bytes()) - } - a := map[string]any{ - "start": start, - "end": end, - "chainid": utils.NewBig(o.chainID), - "address": address, - "EventSigs": sigs, - } - query, args, err := sqlx.Named( - ` -SELECT - * -FROM evm.logs -WHERE evm.logs.block_number BETWEEN :start AND :end - AND evm.logs.evm_chain_id = :chainid - AND evm.logs.address = :address - AND evm.logs.event_sig IN (:EventSigs) -ORDER BY (evm.logs.block_number, evm.logs.log_index)`, a) - if err != nil { - return nil, errors.Wrap(err, "sqlx Named") - } - query, args, err = sqlx.In(query, args...) + args, err := newQueryArgs(o.chainID). + withAddress(address). + withEventSigArray(eventSigs). + withStartBlock(start). + withEndBlock(end). + toArgs() if err != nil { - return nil, errors.Wrap(err, "sqlx In") + return nil, err } - query = q.Rebind(query) - err = q.Select(&logs, query, args...) + + q := o.q.WithOpts(qopts...) + err = q.SelectNamed(&logs, ` + SELECT * FROM evm.logs + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = ANY(:event_sig_array) + AND block_number BETWEEN :start_block AND :end_block + ORDER BY (block_number, log_index)`, args) if errors.Is(err, sql.ErrNoRows) { return nil, nil } return logs, err } -func (o *DbORM) GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]LogPollerBlock, error) { +func (o *DbORM) GetBlocksRange(start int64, end int64, qopts ...pg.QOpt) ([]LogPollerBlock, error) { + args, err := newQueryArgs(o.chainID). + withStartBlock(start). + withEndBlock(end). + toArgs() + if err != nil { + return nil, err + } var blocks []LogPollerBlock - q := o.q.WithOpts(qopts...) - err := q.Select(&blocks, ` + err = o.q.WithOpts(qopts...).SelectNamed(&blocks, ` SELECT * FROM evm.log_poller_blocks - WHERE block_number >= $1 AND block_number <= $2 AND evm_chain_id = $3 - ORDER BY block_number ASC`, start, end, utils.NewBig(o.chainID)) + WHERE block_number >= :start_block + AND block_number <= :end_block + AND evm_chain_id = :evm_chain_id + ORDER BY block_number ASC`, args) if err != nil { return nil, err } @@ -351,167 +390,177 @@ func (o *DbORM) GetBlocksRange(start uint64, end uint64, qopts ...pg.QOpt) ([]Lo } // SelectLatestLogEventSigsAddrsWithConfs finds the latest log by (address, event) combination that matches a list of Addresses and list of events -func (o *DbORM) SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - var logs []Log - sigs := concatBytes(eventSigs) - addrs := concatBytes(addresses) - - q := o.q.WithOpts(qopts...) - err := q.Select(&logs, ` +func (o *DbORM) SelectLatestLogEventSigsAddrsWithConfs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + args, err := newQueryArgs(o.chainID). + withAddressArray(addresses). + withEventSigArray(eventSigs). + withStartBlock(fromBlock). + withConfs(confs). + toArgs() + if err != nil { + return nil, err + } + query := fmt.Sprintf(` SELECT * FROM evm.logs WHERE (block_number, address, event_sig) IN ( SELECT MAX(block_number), address, event_sig FROM evm.logs - WHERE evm_chain_id = $1 AND - event_sig = ANY($2) AND - address = ANY($3) AND - block_number > $4 AND - block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $5 + WHERE evm_chain_id = :evm_chain_id + AND event_sig = ANY(:event_sig_array) + AND address = ANY(:address_array) + AND block_number > :start_block + AND block_number <= %s GROUP BY event_sig, address ) - ORDER BY block_number ASC - `, o.chainID.Int64(), sigs, addrs, fromBlock, confs) - if err != nil { + ORDER BY block_number ASC`, nestedBlockNumberQuery()) + var logs []Log + if err := o.q.WithOpts(qopts...).SelectNamed(&logs, query, args); err != nil { return nil, errors.Wrap(err, "failed to execute query") } return logs, nil } // SelectLatestBlockNumberEventSigsAddrsWithConfs finds the latest block number that matches a list of Addresses and list of events. It returns 0 if there is no matching block -func (o *DbORM) SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs int, qopts ...pg.QOpt) (int64, error) { - var blockNumber int64 - sigs := concatBytes(eventSigs) - addrs := concatBytes(addresses) - - q := o.q.WithOpts(qopts...) - err := q.Get(&blockNumber, ` - SELECT COALESCE(MAX(block_number), 0) FROM evm.logs - WHERE evm_chain_id = $1 AND - event_sig = ANY($2) AND - address = ANY($3) AND - block_number > $4 AND - block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $5`, - o.chainID.Int64(), sigs, addrs, fromBlock, confs) +func (o *DbORM) SelectLatestBlockByEventSigsAddrsWithConfs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs Confirmations, qopts ...pg.QOpt) (int64, error) { + args, err := newQueryArgs(o.chainID). + withEventSigArray(eventSigs). + withAddressArray(addresses). + withStartBlock(fromBlock). + withConfs(confs). + toArgs() if err != nil { return 0, err } + query := fmt.Sprintf(` + SELECT COALESCE(MAX(block_number), 0) FROM evm.logs + WHERE evm_chain_id = :evm_chain_id + AND event_sig = ANY(:event_sig_array) + AND address = ANY(:address_array) + AND block_number > :start_block + AND block_number <= %s`, nestedBlockNumberQuery()) + var blockNumber int64 + if err := o.q.WithOpts(qopts...).GetNamed(query, &blockNumber, args); err != nil { + return 0, err + } return blockNumber, nil } -func (o *DbORM) SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - var logs []Log - q := o.q.WithOpts(qopts...) - err := q.Select(&logs, - `SELECT * FROM evm.logs - WHERE evm.logs.evm_chain_id = $1 - AND address = $2 AND event_sig = $3 - AND substring(data from 32*$4+1 for 32) >= $5 - AND substring(data from 32*$4+1 for 32) <= $6 - AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $7 - ORDER BY (evm.logs.block_number, evm.logs.log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), wordIndex, wordValueMin.Bytes(), wordValueMax.Bytes(), confs) +func (o *DbORM) SelectLogsDataWordRange(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin, wordValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withWordIndex(wordIndex). + withWordValueMin(wordValueMin). + withWordValueMax(wordValueMax). + withConfs(confs). + toArgs() if err != nil { return nil, err } - return logs, nil -} - -func (o *DbORM) SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { + query := fmt.Sprintf(`SELECT * FROM evm.logs + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND substring(data from 32*:word_index+1 for 32) >= :word_value_min + AND substring(data from 32*:word_index+1 for 32) <= :word_value_max + AND block_number <= %s + ORDER BY (block_number, log_index)`, nestedBlockNumberQuery()) var logs []Log - q := o.q.WithOpts(qopts...) - err := q.Select(&logs, - `SELECT * FROM evm.logs - WHERE evm.logs.evm_chain_id = $1 - AND address = $2 AND event_sig = $3 - AND substring(data from 32*$4+1 for 32) >= $5 - AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $6 - ORDER BY (evm.logs.block_number, evm.logs.log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), wordIndex, wordValueMin.Bytes(), confs) - if err != nil { + if err := o.q.WithOpts(qopts...).SelectNamed(&logs, query, args); err != nil { return nil, err } return logs, nil } -func (o *DbORM) SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - if err := validateTopicIndex(topicIndex); err != nil { +func (o *DbORM) SelectLogsDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withWordIndex(wordIndex). + withWordValueMin(wordValueMin). + withConfs(confs). + toArgs() + if err != nil { return nil, err } - + query := fmt.Sprintf(` + SELECT * FROM evm.logs + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND substring(data from 32*:word_index+1 for 32) >= :word_value_min + AND block_number <= %s + ORDER BY (block_number, log_index)`, nestedBlockNumberQuery()) var logs []Log - q := o.q.WithOpts(qopts...) - err := q.Select(&logs, - `SELECT * FROM evm.logs - WHERE evm.logs.evm_chain_id = $1 - AND address = $2 AND event_sig = $3 - AND topics[$4] >= $5 - AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $6 - ORDER BY (evm.logs.block_number, evm.logs.log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), topicIndex+1, topicValueMin.Bytes(), confs) - if err != nil { + if err = o.q.WithOpts(qopts...).SelectNamed(&logs, query, args); err != nil { return nil, err } return logs, nil } -func (o *DbORM) SelectLogsUntilBlockHashDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { - var logs []Log - q := o.q.WithOpts(qopts...) - err := q.Transaction(func(tx pg.Queryer) error { - // We want to mimic the behaviour of the ETH RPC which errors if blockhash not found. - var block LogPollerBlock - if err := tx.Get(&block, - `SELECT * FROM evm.log_poller_blocks - WHERE evm_chain_id = $1 AND block_hash = $2`, utils.NewBig(o.chainID), untilBlockHash); err != nil { - return err - } - return q.Select(&logs, - `SELECT * FROM evm.logs - WHERE evm_chain_id = $1 - AND address = $2 AND event_sig = $3 - AND substring(data from 32*$4+1 for 32) >= $5 - AND block_number <= $6 - ORDER BY (block_number, log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), wordIndex, wordValueMin.Bytes(), block.BlockNumber) - }) +func (o *DbORM) SelectIndexedLogsTopicGreaterThan(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withTopicIndex(topicIndex). + withTopicValueMin(topicValueMin). + withConfs(confs). + toArgs() if err != nil { return nil, err } + query := fmt.Sprintf(` + SELECT * FROM evm.logs + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND topics[:topic_index] >= :topic_value_min + AND block_number <= %s + ORDER BY (block_number, log_index)`, nestedBlockNumberQuery()) + var logs []Log + if err = o.q.WithOpts(qopts...).SelectNamed(&logs, query, args); err != nil { + return nil, err + } return logs, nil } -func (o *DbORM) SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - if err := validateTopicIndex(topicIndex); err != nil { +func (o *DbORM) SelectIndexedLogsTopicRange(address common.Address, eventSig common.Hash, topicIndex int, topicValueMin, topicValueMax common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withTopicIndex(topicIndex). + withTopicValueMin(topicValueMin). + withTopicValueMax(topicValueMax). + withConfs(confs). + toArgs() + if err != nil { return nil, err } - + query := fmt.Sprintf(` + SELECT * FROM evm.logs + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND topics[:topic_index] >= :topic_value_min + AND topics[:topic_index] <= :topic_value_max + AND block_number <= %s + ORDER BY (evm.logs.block_number, evm.logs.log_index)`, nestedBlockNumberQuery()) var logs []Log - q := o.q.WithOpts(qopts...) - err := q.Select(&logs, - `SELECT * FROM evm.logs - WHERE evm.logs.evm_chain_id = $1 - AND address = $2 AND event_sig = $3 - AND topics[$4] >= $5 - AND topics[$4] <= $6 - AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $7 - ORDER BY (evm.logs.block_number, evm.logs.log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), topicIndex+1, topicValueMin.Bytes(), topicValueMax.Bytes(), confs) - if err != nil { + if err := o.q.WithOpts(qopts...).SelectNamed(&logs, query, args); err != nil { return nil, err } return logs, nil } -func (o *DbORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error) { - if err := validateTopicIndex(topicIndex); err != nil { +func (o *DbORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withTopicIndex(topicIndex). + withTopicValues(topicValues). + withConfs(confs). + toArgs() + if err != nil { return nil, err } - - q := o.q.WithOpts(qopts...) - var logs []Log - topicValuesBytes := concatBytes(topicValues) - // Add 1 since postgresql arrays are 1-indexed. - err := q.Select(&logs, ` + query := fmt.Sprintf(` SELECT * FROM evm.logs - WHERE evm.logs.evm_chain_id = $1 - AND address = $2 AND event_sig = $3 - AND topics[$4] = ANY($5) - AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $6 - ORDER BY (evm.logs.block_number, evm.logs.log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), topicIndex+1, topicValuesBytes, confs) - if err != nil { + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND topics[:topic_index] = ANY(:topic_values) + AND block_number <= %s + ORDER BY (block_number, log_index)`, nestedBlockNumberQuery()) + var logs []Log + if err := o.q.WithOpts(qopts...).SelectNamed(&logs, query, args); err != nil { return nil, err } return logs, nil @@ -519,51 +568,55 @@ func (o *DbORM) SelectIndexedLogs(address common.Address, eventSig common.Hash, // SelectIndexedLogsByBlockRangeFilter finds the indexed logs in a given block range. func (o *DbORM) SelectIndexedLogsByBlockRange(start, end int64, address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, qopts ...pg.QOpt) ([]Log, error) { - if err := validateTopicIndex(topicIndex); err != nil { + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withTopicIndex(topicIndex). + withTopicValues(topicValues). + withStartBlock(start). + withEndBlock(end). + toArgs() + if err != nil { return nil, err } - var logs []Log - topicValuesBytes := concatBytes(topicValues) - q := o.q.WithOpts(qopts...) - err := q.Select(&logs, ` + err = o.q.WithOpts(qopts...).SelectNamed(&logs, ` SELECT * FROM evm.logs - WHERE evm.logs.block_number >= $1 AND evm.logs.block_number <= $2 AND evm.logs.evm_chain_id = $3 - AND address = $4 AND event_sig = $5 - AND topics[$6] = ANY($7) - ORDER BY (evm.logs.block_number, evm.logs.log_index)`, start, end, utils.NewBig(o.chainID), address, eventSig.Bytes(), topicIndex+1, topicValuesBytes) + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND topics[:topic_index] = ANY(:topic_values) + AND block_number >= :start_block + AND block_number <= :end_block + ORDER BY (block_number, log_index)`, args) if err != nil { return nil, err } return logs, nil } -func validateTopicIndex(index int) error { - // Only topicIndex 1 through 3 is valid. 0 is the event sig and only 4 total topics are allowed - if !(index == 1 || index == 2 || index == 3) { - return errors.Errorf("invalid index for topic: %d", index) +func (o *DbORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + startBlock, endBlock, err := o.blocksRangeAfterTimestamp(after, confs, qopts...) + if err != nil { + return nil, err } - return nil -} - -func (o *DbORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig common.Hash, topicIndex int, topicValues []common.Hash, after time.Time, confs int, qopts ...pg.QOpt) ([]Log, error) { - minBlock, maxBlock, err := o.blocksRangeAfterTimestamp(after, confs, qopts...) + args, err := newQueryArgsForEvent(o.chainID, address, eventSig). + withStartBlock(startBlock). + withEndBlock(endBlock). + withTopicIndex(topicIndex). + withTopicValues(topicValues). + toArgs() if err != nil { return nil, err } var logs []Log - q := o.q.WithOpts(qopts...) - topicValuesBytes := concatBytes(topicValues) - // Add 1 since postgresql arrays are 1-indexed. - err = q.Select(&logs, ` + err = o.q.WithOpts(qopts...).SelectNamed(&logs, ` SELECT * FROM evm.logs - WHERE evm.logs.evm_chain_id = $1 - AND address = $2 - AND event_sig = $3 - AND topics[$4] = ANY($5) - AND block_number > $6 - AND block_number <= $7 - ORDER BY (block_number, log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), topicIndex+1, topicValuesBytes, minBlock, maxBlock) + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :event_sig + AND topics[:topic_index] = ANY(:topic_values) + AND block_number > :start_block + AND block_number <= :end_block + ORDER BY (block_number, log_index)`, args) if err != nil { return nil, err } @@ -571,15 +624,20 @@ func (o *DbORM) SelectIndexedLogsCreatedAfter(address common.Address, eventSig c } func (o *DbORM) SelectIndexedLogsByTxHash(eventSig common.Hash, txHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { - q := o.q.WithOpts(qopts...) + args, err := newQueryArgs(o.chainID). + withTxHash(txHash). + withEventSig(eventSig). + toArgs() + if err != nil { + return nil, err + } var logs []Log - err := q.Select(&logs, ` + err = o.q.WithOpts(qopts...).SelectNamed(&logs, ` SELECT * FROM evm.logs - WHERE evm.logs.evm_chain_id = $1 - AND tx_hash = $2 - AND event_sig = $3 - ORDER BY (evm.logs.block_number, evm.logs.log_index)`, - utils.NewBig(o.chainID), txHash.Bytes(), eventSig.Bytes()) + WHERE evm_chain_id = :evm_chain_id + AND tx_hash = :tx_hash + AND event_sig = :event_sig + ORDER BY (block_number, log_index)`, args) if err != nil { return nil, err } @@ -587,73 +645,102 @@ func (o *DbORM) SelectIndexedLogsByTxHash(eventSig common.Hash, txHash common.Ha } // SelectIndexedLogsWithSigsExcluding query's for logs that have signature A and exclude logs that have a corresponding signature B, matching is done based on the topic index both logs should be inside the block range and have the minimum number of confirmations -func (o *DbORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs int, qopts ...pg.QOpt) ([]Log, error) { - if err := validateTopicIndex(topicIndex); err != nil { +func (o *DbORM) SelectIndexedLogsWithSigsExcluding(sigA, sigB common.Hash, topicIndex int, address common.Address, startBlock, endBlock int64, confs Confirmations, qopts ...pg.QOpt) ([]Log, error) { + args, err := newQueryArgs(o.chainID). + withAddress(address). + withTopicIndex(topicIndex). + withStartBlock(startBlock). + withEndBlock(endBlock). + withCustomHashArg("sigA", sigA). + withCustomHashArg("sigB", sigB). + withConfs(confs). + toArgs() + if err != nil { return nil, err } - q := o.q.WithOpts(qopts...) - var logs []Log - - err := q.Select(&logs, ` - SELECT * - FROM evm.logs - WHERE evm_chain_id = $1 - AND address = $2 - AND event_sig = $3 - AND block_number BETWEEN $6 AND $7 - AND block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $8 - + nestedQuery := nestedBlockNumberQuery() + query := fmt.Sprintf(` + SELECT * FROM evm.logs + WHERE evm_chain_id = :evm_chain_id + AND address = :address + AND event_sig = :sigA + AND block_number BETWEEN :start_block AND :end_block + AND block_number <= %s EXCEPT - - SELECT a.* - FROM evm.logs AS a + SELECT a.* FROM evm.logs AS a INNER JOIN evm.logs B ON a.evm_chain_id = b.evm_chain_id AND a.address = b.address - AND a.topics[$5] = b.topics[$5] - AND a.event_sig = $3 - AND b.event_sig = $4 - AND b.block_number BETWEEN $6 AND $7 - AND b.block_number <= (SELECT COALESCE(block_number, 0) FROM evm.log_poller_blocks WHERE evm_chain_id = $1 ORDER BY block_number DESC LIMIT 1) - $8 - - ORDER BY block_number,log_index ASC - `, utils.NewBig(o.chainID), address, sigA.Bytes(), sigB.Bytes(), topicIndex+1, startBlock, endBlock, confs) - if err != nil { + AND a.topics[:topic_index] = b.topics[:topic_index] + AND a.event_sig = :sigA + AND b.event_sig = :sigB + AND b.block_number BETWEEN :start_block AND :end_block + AND b.block_number <= %s + ORDER BY block_number,log_index ASC`, nestedQuery, nestedQuery) + var logs []Log + if err := o.q.WithOpts(qopts...).SelectNamed(&logs, query, args); err != nil { return nil, err } return logs, nil } -func (o *DbORM) blocksRangeAfterTimestamp(after time.Time, confs int, qopts ...pg.QOpt) (int64, int64, error) { - type blockRange struct { - MinBlockNumber int64 `db:"min_block"` - MaxBlockNumber int64 `db:"max_block"` +func (o *DbORM) blocksRangeAfterTimestamp(after time.Time, confs Confirmations, qopts ...pg.QOpt) (int64, int64, error) { + args, err := newQueryArgs(o.chainID). + withBlockTimestampAfter(after). + toArgs() + if err != nil { + return 0, 0, err } - var br blockRange - q := o.q.WithOpts(qopts...) - err := q.Get(&br, ` - SELECT - coalesce(min(block_number), 0) as min_block, - coalesce(max(block_number), 0) as max_block - FROM evm.log_poller_blocks - WHERE evm_chain_id = $1 - AND block_timestamp > $2`, utils.NewBig(o.chainID), after) + var blocks []LogPollerBlock + err = o.q.WithOpts(qopts...).SelectNamed(&blocks, ` + SELECT * FROM evm.log_poller_blocks + WHERE evm_chain_id = :evm_chain_id + AND block_number in ( + SELECT unnest(array[min(block_number), max(block_number)]) FROM evm.log_poller_blocks + WHERE evm_chain_id = :evm_chain_id + AND block_timestamp > :block_timestamp_after) + order by block_number`, args) if err != nil { return 0, 0, err } - return br.MinBlockNumber, br.MaxBlockNumber - int64(confs), nil + if len(blocks) != 2 { + return 0, 0, nil + } + return blocks[0].BlockNumber, blocks[1].BlockNumber - int64(confs), nil } -type bytesProducer interface { - Bytes() []byte +func (o *DbORM) SelectLogsUntilBlockHashDataWordGreaterThan(address common.Address, eventSig common.Hash, wordIndex int, wordValueMin common.Hash, untilBlockHash common.Hash, qopts ...pg.QOpt) ([]Log, error) { + var logs []Log + q := o.q.WithOpts(qopts...) + err := q.Transaction(func(tx pg.Queryer) error { + // We want to mimic the behaviour of the ETH RPC which errors if blockhash not found. + var block LogPollerBlock + if err := tx.Get(&block, + `SELECT * FROM evm.log_poller_blocks + WHERE evm_chain_id = $1 AND block_hash = $2`, utils.NewBig(o.chainID), untilBlockHash); err != nil { + return err + } + return q.Select(&logs, + `SELECT * FROM evm.logs + WHERE evm_chain_id = $1 + AND address = $2 AND event_sig = $3 + AND substring(data from 32*$4+1 for 32) >= $5 + AND block_number <= $6 + ORDER BY (block_number, log_index)`, utils.NewBig(o.chainID), address, eventSig.Bytes(), wordIndex, wordValueMin.Bytes(), block.BlockNumber) + }) + if err != nil { + return nil, err + } + return logs, nil } -func concatBytes[T bytesProducer](byteSlice []T) pq.ByteaArray { - var output [][]byte - for _, b := range byteSlice { - output = append(output, b.Bytes()) - } - return output +func nestedBlockNumberQuery() string { + return ` + (SELECT COALESCE(block_number, 0) + FROM evm.log_poller_blocks + WHERE evm_chain_id = :evm_chain_id + ORDER BY block_number DESC LIMIT 1) - :confs` + } diff --git a/core/chains/evm/logpoller/orm_test.go b/core/chains/evm/logpoller/orm_test.go index 531aec2ff30..e91baec60ec 100644 --- a/core/chains/evm/logpoller/orm_test.go +++ b/core/chains/evm/logpoller/orm_test.go @@ -33,7 +33,7 @@ func GenLog(chainID *big.Int, logIndex int64, blockNum int64, blockHash string, BlockHash: common.HexToHash(blockHash), BlockNumber: blockNum, EventSig: common.BytesToHash(topic1), - Topics: [][]byte{topic1}, + Topics: [][]byte{topic1, topic1}, Address: address, TxHash: common.HexToHash("0x1234"), Data: append([]byte("hello "), byte(blockNum)), @@ -92,9 +92,9 @@ func TestORM_GetBlocks_From_Range(t *testing.T) { require.NoError(t, o1.InsertBlock(b.hash, b.number, time.Unix(b.timestamp, 0).UTC())) } - var blockNumbers []uint64 + var blockNumbers []int64 for _, b := range blocks { - blockNumbers = append(blockNumbers, uint64(b.number)) + blockNumbers = append(blockNumbers, b.number) } lpBlocks, err := o1.GetBlocksRange(blockNumbers[0], blockNumbers[len(blockNumbers)-1]) @@ -124,9 +124,9 @@ func TestORM_GetBlocks_From_Range_Recent_Blocks(t *testing.T) { require.NoError(t, o1.InsertBlock(b.hash, b.number, time.Now())) } - var blockNumbers []uint64 + var blockNumbers []int64 for _, b := range recentBlocks { - blockNumbers = append(blockNumbers, uint64(b.number)) + blockNumbers = append(blockNumbers, b.number) } lpBlocks, err := o1.GetBlocksRange(blockNumbers[0], blockNumbers[len(blockNumbers)-1]) @@ -1102,7 +1102,7 @@ func TestSelectLatestBlockNumberEventSigsAddrsWithConfs(t *testing.T) { name string events []common.Hash addrs []common.Address - confs int + confs logpoller.Confirmations fromBlock int64 expectedBlockNumber int64 }{ @@ -1198,7 +1198,7 @@ func TestSelectLogsCreatedAfter(t *testing.T) { tests := []struct { name string - confs int + confs logpoller.Confirmations after time.Time expectedLogs []expectedLog }{ @@ -1255,7 +1255,7 @@ func TestSelectLogsCreatedAfter(t *testing.T) { }) t.Run("SelectIndexedLogsCreatedAfter"+tt.name, func(t *testing.T) { - logs, err := th.ORM.SelectIndexedLogsCreatedAfter(address, event, 0, []common.Hash{event}, tt.after, tt.confs) + logs, err := th.ORM.SelectIndexedLogsCreatedAfter(address, event, 1, []common.Hash{event}, tt.after, tt.confs) require.NoError(t, err) assert.Len(t, logs, len(tt.expectedLogs)) diff --git a/core/chains/evm/logpoller/query.go b/core/chains/evm/logpoller/query.go new file mode 100644 index 00000000000..2a50dc282e4 --- /dev/null +++ b/core/chains/evm/logpoller/query.go @@ -0,0 +1,143 @@ +package logpoller + +import ( + "errors" + "fmt" + "math/big" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/lib/pq" + + "github.com/smartcontractkit/chainlink/v2/core/utils" +) + +type bytesProducer interface { + Bytes() []byte +} + +func concatBytes[T bytesProducer](byteSlice []T) pq.ByteaArray { + var output [][]byte + for _, b := range byteSlice { + output = append(output, b.Bytes()) + } + return output +} + +// queryArgs is a helper for building the arguments to a postgres query created by DbORM +// Besides the convenience methods, it also keeps track of arguments validation and sanitization. +type queryArgs struct { + args map[string]interface{} + err []error +} + +func newQueryArgs(chainId *big.Int) *queryArgs { + return &queryArgs{ + args: map[string]interface{}{ + "evm_chain_id": utils.NewBig(chainId), + }, + err: []error{}, + } +} + +func newQueryArgsForEvent(chainId *big.Int, address common.Address, eventSig common.Hash) *queryArgs { + return newQueryArgs(chainId). + withAddress(address). + withEventSig(eventSig) +} + +func (q *queryArgs) withEventSig(eventSig common.Hash) *queryArgs { + return q.withCustomHashArg("event_sig", eventSig) +} + +func (q *queryArgs) withEventSigArray(eventSigs []common.Hash) *queryArgs { + q.args["event_sig_array"] = concatBytes(eventSigs) + return q +} + +func (q *queryArgs) withAddress(address common.Address) *queryArgs { + q.args["address"] = address + return q +} + +func (q *queryArgs) withAddressArray(addresses []common.Address) *queryArgs { + q.args["address_array"] = concatBytes(addresses) + return q +} + +func (q *queryArgs) withStartBlock(startBlock int64) *queryArgs { + q.args["start_block"] = startBlock + return q +} + +func (q *queryArgs) withEndBlock(endBlock int64) *queryArgs { + q.args["end_block"] = endBlock + return q +} + +func (q *queryArgs) withWordIndex(wordIndex int) *queryArgs { + q.args["word_index"] = wordIndex + return q +} + +func (q *queryArgs) withWordValueMin(wordValueMin common.Hash) *queryArgs { + return q.withCustomHashArg("word_value_min", wordValueMin) +} + +func (q *queryArgs) withWordValueMax(wordValueMax common.Hash) *queryArgs { + return q.withCustomHashArg("word_value_max", wordValueMax) +} + +func (q *queryArgs) withConfs(confs Confirmations) *queryArgs { + q.args["confs"] = confs + return q +} + +func (q *queryArgs) withTopicIndex(index int) *queryArgs { + // Only topicIndex 1 through 3 is valid. 0 is the event sig and only 4 total topics are allowed + if !(index == 1 || index == 2 || index == 3) { + q.err = append(q.err, fmt.Errorf("invalid index for topic: %d", index)) + } + // Add 1 since postgresql arrays are 1-indexed. + q.args["topic_index"] = index + 1 + return q +} + +func (q *queryArgs) withTopicValueMin(valueMin common.Hash) *queryArgs { + return q.withCustomHashArg("topic_value_min", valueMin) +} + +func (q *queryArgs) withTopicValueMax(valueMax common.Hash) *queryArgs { + return q.withCustomHashArg("topic_value_max", valueMax) +} + +func (q *queryArgs) withTopicValues(values []common.Hash) *queryArgs { + q.args["topic_values"] = concatBytes(values) + return q +} + +func (q *queryArgs) withBlockTimestampAfter(after time.Time) *queryArgs { + q.args["block_timestamp_after"] = after + return q +} + +func (q *queryArgs) withTxHash(hash common.Hash) *queryArgs { + return q.withCustomHashArg("tx_hash", hash) +} + +func (q *queryArgs) withCustomHashArg(name string, arg common.Hash) *queryArgs { + q.args[name] = arg.Bytes() + return q +} + +func (q *queryArgs) withCustomArg(name string, arg any) *queryArgs { + q.args[name] = arg + return q +} + +func (q *queryArgs) toArgs() (map[string]interface{}, error) { + if len(q.err) > 0 { + return nil, errors.Join(q.err...) + } + return q.args, nil +} diff --git a/core/chains/evm/logpoller/query_test.go b/core/chains/evm/logpoller/query_test.go new file mode 100644 index 00000000000..e38aeb05819 --- /dev/null +++ b/core/chains/evm/logpoller/query_test.go @@ -0,0 +1,82 @@ +package logpoller + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/lib/pq" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/utils" +) + +func Test_QueryArgs(t *testing.T) { + tests := []struct { + name string + queryArgs *queryArgs + want map[string]interface{} + wantErr bool + }{ + { + name: "valid arguments", + queryArgs: newQueryArgs(big.NewInt(20)).withAddress(utils.ZeroAddress), + want: map[string]interface{}{ + "evm_chain_id": utils.NewBigI(20), + "address": utils.ZeroAddress, + }, + }, + { + name: "invalid topic index", + queryArgs: newQueryArgs(big.NewInt(20)).withTopicIndex(0), + wantErr: true, + }, + { + name: "custom argument", + queryArgs: newEmptyArgs().withCustomArg("arg", "value"), + want: map[string]interface{}{ + "arg": "value", + }, + }, + { + name: "hash converted to bytes", + queryArgs: newEmptyArgs().withCustomHashArg("hash", common.Hash{}), + want: map[string]interface{}{ + "hash": make([]byte, 32), + }, + }, + { + name: "hash array converted to bytes array", + queryArgs: newEmptyArgs().withEventSigArray([]common.Hash{{}, {}}), + want: map[string]interface{}{ + "event_sig_array": pq.ByteaArray{make([]byte, 32), make([]byte, 32)}, + }, + }, + { + name: "topic index incremented", + queryArgs: newEmptyArgs().withTopicIndex(2), + want: map[string]interface{}{ + "topic_index": 3, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + args, err := tt.queryArgs.toArgs() + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, args) + } + }) + } +} + +func newEmptyArgs() *queryArgs { + return &queryArgs{ + args: map[string]interface{}{}, + err: []error{}, + } +} diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go index 590e5138b3e..ae439cc6321 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go @@ -299,11 +299,11 @@ func (r *EvmRegistry) refreshLogTriggerUpkeepsBatch(logTriggerIDs []*big.Int) er logTriggerHashes = append(logTriggerHashes, common.BigToHash(id)) } - unpausedLogs, err := r.poller.IndexedLogs(iregistry21.IKeeperRegistryMasterUpkeepUnpaused{}.Topic(), r.addr, 1, logTriggerHashes, int(r.finalityDepth), pg.WithParentCtx(r.ctx)) + unpausedLogs, err := r.poller.IndexedLogs(iregistry21.IKeeperRegistryMasterUpkeepUnpaused{}.Topic(), r.addr, 1, logTriggerHashes, logpoller.Confirmations(r.finalityDepth), pg.WithParentCtx(r.ctx)) if err != nil { return err } - configSetLogs, err := r.poller.IndexedLogs(iregistry21.IKeeperRegistryMasterUpkeepTriggerConfigSet{}.Topic(), r.addr, 1, logTriggerHashes, int(r.finalityDepth), pg.WithParentCtx(r.ctx)) + configSetLogs, err := r.poller.IndexedLogs(iregistry21.IKeeperRegistryMasterUpkeepTriggerConfigSet{}.Topic(), r.addr, 1, logTriggerHashes, logpoller.Confirmations(r.finalityDepth), pg.WithParentCtx(r.ctx)) if err != nil { return err } diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/registry_check_pipeline_test.go b/core/services/ocr2/plugins/ocr2keeper/evm21/registry_check_pipeline_test.go index ee213643194..5ea2bdc6670 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/registry_check_pipeline_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/registry_check_pipeline_test.go @@ -204,14 +204,14 @@ func TestRegistry_VerifyCheckBlock(t *testing.T) { type mockLogPoller struct { logpoller.LogPoller GetBlocksRangeFn func(ctx context.Context, numbers []uint64, qopts ...pg.QOpt) ([]logpoller.LogPollerBlock, error) - IndexedLogsFn func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) + IndexedLogsFn func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) } func (p *mockLogPoller) GetBlocksRange(ctx context.Context, numbers []uint64, qopts ...pg.QOpt) ([]logpoller.LogPollerBlock, error) { return p.GetBlocksRangeFn(ctx, numbers, qopts...) } -func (p *mockLogPoller) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { +func (p *mockLogPoller) IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { return p.IndexedLogsFn(eventSig, address, topicIndex, topicValues, confs, qopts...) } diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/registry_test.go b/core/services/ocr2/plugins/ocr2keeper/evm21/registry_test.go index b6b123de485..0cd5ecd2592 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/registry_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/registry_test.go @@ -220,7 +220,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { }, }, poller: &mockLogPoller{ - IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { + IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { if eventSig == (iregistry21.IKeeperRegistryMasterUpkeepUnpaused{}.Topic()) { return nil, errors.New("indexed logs boom") } @@ -245,7 +245,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { }, }, poller: &mockLogPoller{ - IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { + IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { if eventSig == (iregistry21.IKeeperRegistryMasterUpkeepTriggerConfigSet{}.Topic()) { return nil, errors.New("indexed logs boom") } @@ -270,7 +270,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { }, }, poller: &mockLogPoller{ - IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { + IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { return []logpoller.Log{ {}, }, nil @@ -302,7 +302,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { }, }, poller: &mockLogPoller{ - IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { + IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { return []logpoller.Log{ { BlockNumber: 1, @@ -356,7 +356,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { }, }, poller: &mockLogPoller{ - IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { + IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { return []logpoller.Log{ { BlockNumber: 2, @@ -408,7 +408,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { }, }, poller: &mockLogPoller{ - IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { + IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { return []logpoller.Log{ { BlockNumber: 2, @@ -462,7 +462,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { }, }, poller: &mockLogPoller{ - IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]logpoller.Log, error) { + IndexedLogsFn: func(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs logpoller.Confirmations, qopts ...pg.QOpt) ([]logpoller.Log, error) { return []logpoller.Log{ { BlockNumber: 2, diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/scanner.go b/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/scanner.go index 9ce9a10ac73..d70611313af 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/scanner.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/scanner.go @@ -79,7 +79,7 @@ func (s *performedEventsScanner) ScanWorkIDs(ctx context.Context, workID ...stri end = len(ids) } batch := ids[i:end] - batchLogs, err := s.poller.IndexedLogs(iregistry21.IKeeperRegistryMasterDedupKeyAdded{}.Topic(), s.registryAddress, 1, batch, int(s.finalityDepth), pg.WithParentCtx(ctx)) + batchLogs, err := s.poller.IndexedLogs(iregistry21.IKeeperRegistryMasterDedupKeyAdded{}.Topic(), s.registryAddress, 1, batch, logpoller.Confirmations(s.finalityDepth), pg.WithParentCtx(ctx)) if err != nil { return nil, fmt.Errorf("error fetching logs: %w", err) } diff --git a/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator.go b/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator.go index b1d369168fe..e51b68f415d 100644 --- a/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator.go +++ b/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator.go @@ -911,7 +911,7 @@ func (c *coordinator) DKGVRFCommittees(ctx context.Context) (dkgCommittee, vrfCo latestVRF, err := c.lp.LatestLogByEventSigWithConfs( c.configSetTopic, c.beaconAddress, - int(c.finalityDepth), + logpoller.Confirmations(c.finalityDepth), pg.WithParentCtx(ctx), ) if err != nil { @@ -922,7 +922,7 @@ func (c *coordinator) DKGVRFCommittees(ctx context.Context) (dkgCommittee, vrfCo latestDKG, err := c.lp.LatestLogByEventSigWithConfs( c.configSetTopic, c.dkgAddress, - int(c.finalityDepth), + logpoller.Confirmations(c.finalityDepth), pg.WithParentCtx(ctx), ) if err != nil { diff --git a/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator_test.go b/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator_test.go index 1222ab7b2a4..26d0f2996a9 100644 --- a/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator_test.go +++ b/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator_test.go @@ -26,6 +26,7 @@ import ( ocr2vrftypes "github.com/smartcontractkit/ocr2vrf/types" relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + evmclimocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" lp_mocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" @@ -83,11 +84,11 @@ func TestCoordinator_DKGVRFCommittees(t *testing.T) { coordinatorAddress := newAddress(t) beaconAddress := newAddress(t) dkgAddress := newAddress(t) - lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, beaconAddress, 10, mock.Anything). + lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, beaconAddress, logpoller.Confirmations(10), mock.Anything). Return(&logpoller.Log{ Data: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000a6fca200010576e704b4a519484d6239ef17f1f5b4a82e330b0daf827ed4dc2789971b0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000a8cbea12a06869d3ec432ab9682dab6c761d591000000000000000000000000f4f9db7bb1d16b7cdfb18ec68994c26964f5985300000000000000000000000022fb3f90c539457f00d8484438869135e604a65500000000000000000000000033cbcedccb11c9773ad78e214ba342e979255ab30000000000000000000000006ffaa96256fbc1012325cca88c79f725c33eed80000000000000000000000000000000000000000000000000000000000000000500000000000000000000000074103cf8b436465870b26aa9fa2f62ad62b22e3500000000000000000000000038a6cb196f805cc3041f6645a5a6cec27b64430d00000000000000000000000047d7095cfebf8285bdaa421bc8268d0db87d933c000000000000000000000000a8842be973800ff61d80d2d53fa62c3a685380eb0000000000000000000000003750e31321aee8c024751877070e8d5f704ce98700000000000000000000000000000000000000000000000000000000000000206f3b82406688b8ddb944c6f2e6d808f014c8fa8d568d639c25019568c715fbf000000000000000000000000000000000000000000000000000000000000004220880d88ee16f1080c8afa0251880c8afa025208090dfc04a288090dfc04a30033a05010101010142206c5ca6f74b532222ac927dd3de235d46a943e372c0563393a33b01dcfd3f371c4220855114d25c2ef5e85fffe4f20a365672d8f2dba3b2ec82333f494168a2039c0442200266e835634db00977cbc1caa4db10e1676c1a4c0fcbc6ba7f09300f0d1831824220980cd91f7a73f20f4b0d51d00cd4e00373dc2beafbb299ca3c609757ab98c8304220eb6d36e2af8922085ff510bbe1eb8932a0e3295ca9f047fef25d90e69c52948f4a34313244334b6f6f574463364b7232644542684b59326b336e685057694676544565325331703978544532544b74344d7572716f684a34313244334b6f6f574b436e4367724b637743324a3577576a626e355435335068646b6b6f57454e534a39546537544b7836366f4a4a34313244334b6f6f575239616f675948786b357a38636b624c4c56346e426f7a777a747871664a7050586671336d4a7232796452474a34313244334b6f6f5744695444635565675637776b313133473366476a69616259756f54436f3157726f6f53656741343263556f544a34313244334b6f6f574e64687072586b5472665370354d5071736270467a70364167394a53787358694341434442676454424c656652820300050e416c74424e2d3132382047e282810e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b106069c216a812d7616e47f0bd38fa4863f48fbcda6a38af4c58d2233dfa7cf79620947042d09f923e0a2f7a2270391e8b058d8bdb8f79fe082b7b627f025651c7290382fdff97c3181d15d162c146ce87ff752499d2acc2b26011439a12e29571a6f1e1defb1751c3be4258c493984fd9f0f6b4a26c539870b5f15bfed3d8ffac92499eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc2432b127a112970e1adf615f823b2b2180754c2f0ee01f1b389e56df55ca09702cd0401b66ff71779d2dd67222503a85ab921b28c329cc1832800b192d0b0247c0776e1b9653dc00df48daa6364287c84c0382f5165e7269fef06d10bc67c1bba252305d1af0dc7bb0fe92558eb4c5f38c23163dee1cfb34a72020669dbdfe337c16f3307472616e736c61746f722066726f6d20416c74424e2d3132382047e2828120746f20416c74424e2d3132382047e282825880ade2046080c8afa0256880c8afa0257080ade204788094ebdc0382019e010a205034214e0bd4373f38e162cf9fc9133e2f3b71441faa4c3d1ac01c1877f1cd2712200e03e975b996f911abba2b79d2596c2150bc94510963c40a1137a03df6edacdb1a107dee1cdb894163813bb3da604c9c133c1a10bb33302eeafbd55d352e35dcc5d2b3311a10d2c658b6b93d74a02d467849b6fe75251a10fea5308cc1fea69e7246eafe7ca8a3a51a1048efe1ad873b6f025ac0243bdef715f8000000000000000000000000000000000000000000000000000000000000"), }, nil) - lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, dkgAddress, 10, mock.Anything). + lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, dkgAddress, logpoller.Confirmations(10), mock.Anything). Return(&logpoller.Log{ Data: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000a6fca200010576e704b4a519484d6239ef17f1f5b4a82e330b0daf827ed4dc2789971b0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000a8cbea12a06869d3ec432ab9682dab6c761d591000000000000000000000000f4f9db7bb1d16b7cdfb18ec68994c26964f5985300000000000000000000000022fb3f90c539457f00d8484438869135e604a65500000000000000000000000033cbcedccb11c9773ad78e214ba342e979255ab30000000000000000000000006ffaa96256fbc1012325cca88c79f725c33eed80000000000000000000000000000000000000000000000000000000000000000500000000000000000000000074103cf8b436465870b26aa9fa2f62ad62b22e3500000000000000000000000038a6cb196f805cc3041f6645a5a6cec27b64430d00000000000000000000000047d7095cfebf8285bdaa421bc8268d0db87d933c000000000000000000000000a8842be973800ff61d80d2d53fa62c3a685380eb0000000000000000000000003750e31321aee8c024751877070e8d5f704ce98700000000000000000000000000000000000000000000000000000000000000206f3b82406688b8ddb944c6f2e6d808f014c8fa8d568d639c25019568c715fbf000000000000000000000000000000000000000000000000000000000000004220880d88ee16f1080c8afa0251880c8afa025208090dfc04a288090dfc04a30033a05010101010142206c5ca6f74b532222ac927dd3de235d46a943e372c0563393a33b01dcfd3f371c4220855114d25c2ef5e85fffe4f20a365672d8f2dba3b2ec82333f494168a2039c0442200266e835634db00977cbc1caa4db10e1676c1a4c0fcbc6ba7f09300f0d1831824220980cd91f7a73f20f4b0d51d00cd4e00373dc2beafbb299ca3c609757ab98c8304220eb6d36e2af8922085ff510bbe1eb8932a0e3295ca9f047fef25d90e69c52948f4a34313244334b6f6f574463364b7232644542684b59326b336e685057694676544565325331703978544532544b74344d7572716f684a34313244334b6f6f574b436e4367724b637743324a3577576a626e355435335068646b6b6f57454e534a39546537544b7836366f4a4a34313244334b6f6f575239616f675948786b357a38636b624c4c56346e426f7a777a747871664a7050586671336d4a7232796452474a34313244334b6f6f5744695444635565675637776b313133473366476a69616259756f54436f3157726f6f53656741343263556f544a34313244334b6f6f574e64687072586b5472665370354d5071736270467a70364167394a53787358694341434442676454424c656652820300050e416c74424e2d3132382047e282810e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b106069c216a812d7616e47f0bd38fa4863f48fbcda6a38af4c58d2233dfa7cf79620947042d09f923e0a2f7a2270391e8b058d8bdb8f79fe082b7b627f025651c7290382fdff97c3181d15d162c146ce87ff752499d2acc2b26011439a12e29571a6f1e1defb1751c3be4258c493984fd9f0f6b4a26c539870b5f15bfed3d8ffac92499eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc2432b127a112970e1adf615f823b2b2180754c2f0ee01f1b389e56df55ca09702cd0401b66ff71779d2dd67222503a85ab921b28c329cc1832800b192d0b0247c0776e1b9653dc00df48daa6364287c84c0382f5165e7269fef06d10bc67c1bba252305d1af0dc7bb0fe92558eb4c5f38c23163dee1cfb34a72020669dbdfe337c16f3307472616e736c61746f722066726f6d20416c74424e2d3132382047e2828120746f20416c74424e2d3132382047e282825880ade2046080c8afa0256880c8afa0257080ade204788094ebdc0382019e010a205034214e0bd4373f38e162cf9fc9133e2f3b71441faa4c3d1ac01c1877f1cd2712200e03e975b996f911abba2b79d2596c2150bc94510963c40a1137a03df6edacdb1a107dee1cdb894163813bb3da604c9c133c1a10bb33302eeafbd55d352e35dcc5d2b3311a10d2c658b6b93d74a02d467849b6fe75251a10fea5308cc1fea69e7246eafe7ca8a3a51a1048efe1ad873b6f025ac0243bdef715f8000000000000000000000000000000000000000000000000000000000000"), }, nil) @@ -132,7 +133,7 @@ func TestCoordinator_DKGVRFCommittees(t *testing.T) { tp := newTopics() beaconAddress := newAddress(t) - lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, beaconAddress, 10, mock.Anything). + lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, beaconAddress, logpoller.Confirmations(10), mock.Anything). Return(nil, errors.New("rpc error")) c := &coordinator{ @@ -154,11 +155,11 @@ func TestCoordinator_DKGVRFCommittees(t *testing.T) { beaconAddress := newAddress(t) coordinatorAddress := newAddress(t) dkgAddress := newAddress(t) - lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, beaconAddress, 10, mock.Anything). + lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, beaconAddress, logpoller.Confirmations(10), mock.Anything). Return(&logpoller.Log{ Data: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000a6fca200010576e704b4a519484d6239ef17f1f5b4a82e330b0daf827ed4dc2789971b0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000a8cbea12a06869d3ec432ab9682dab6c761d591000000000000000000000000f4f9db7bb1d16b7cdfb18ec68994c26964f5985300000000000000000000000022fb3f90c539457f00d8484438869135e604a65500000000000000000000000033cbcedccb11c9773ad78e214ba342e979255ab30000000000000000000000006ffaa96256fbc1012325cca88c79f725c33eed80000000000000000000000000000000000000000000000000000000000000000500000000000000000000000074103cf8b436465870b26aa9fa2f62ad62b22e3500000000000000000000000038a6cb196f805cc3041f6645a5a6cec27b64430d00000000000000000000000047d7095cfebf8285bdaa421bc8268d0db87d933c000000000000000000000000a8842be973800ff61d80d2d53fa62c3a685380eb0000000000000000000000003750e31321aee8c024751877070e8d5f704ce98700000000000000000000000000000000000000000000000000000000000000206f3b82406688b8ddb944c6f2e6d808f014c8fa8d568d639c25019568c715fbf000000000000000000000000000000000000000000000000000000000000004220880d88ee16f1080c8afa0251880c8afa025208090dfc04a288090dfc04a30033a05010101010142206c5ca6f74b532222ac927dd3de235d46a943e372c0563393a33b01dcfd3f371c4220855114d25c2ef5e85fffe4f20a365672d8f2dba3b2ec82333f494168a2039c0442200266e835634db00977cbc1caa4db10e1676c1a4c0fcbc6ba7f09300f0d1831824220980cd91f7a73f20f4b0d51d00cd4e00373dc2beafbb299ca3c609757ab98c8304220eb6d36e2af8922085ff510bbe1eb8932a0e3295ca9f047fef25d90e69c52948f4a34313244334b6f6f574463364b7232644542684b59326b336e685057694676544565325331703978544532544b74344d7572716f684a34313244334b6f6f574b436e4367724b637743324a3577576a626e355435335068646b6b6f57454e534a39546537544b7836366f4a4a34313244334b6f6f575239616f675948786b357a38636b624c4c56346e426f7a777a747871664a7050586671336d4a7232796452474a34313244334b6f6f5744695444635565675637776b313133473366476a69616259756f54436f3157726f6f53656741343263556f544a34313244334b6f6f574e64687072586b5472665370354d5071736270467a70364167394a53787358694341434442676454424c656652820300050e416c74424e2d3132382047e282810e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b106069c216a812d7616e47f0bd38fa4863f48fbcda6a38af4c58d2233dfa7cf79620947042d09f923e0a2f7a2270391e8b058d8bdb8f79fe082b7b627f025651c7290382fdff97c3181d15d162c146ce87ff752499d2acc2b26011439a12e29571a6f1e1defb1751c3be4258c493984fd9f0f6b4a26c539870b5f15bfed3d8ffac92499eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc2432b127a112970e1adf615f823b2b2180754c2f0ee01f1b389e56df55ca09702cd0401b66ff71779d2dd67222503a85ab921b28c329cc1832800b192d0b0247c0776e1b9653dc00df48daa6364287c84c0382f5165e7269fef06d10bc67c1bba252305d1af0dc7bb0fe92558eb4c5f38c23163dee1cfb34a72020669dbdfe337c16f3307472616e736c61746f722066726f6d20416c74424e2d3132382047e2828120746f20416c74424e2d3132382047e282825880ade2046080c8afa0256880c8afa0257080ade204788094ebdc0382019e010a205034214e0bd4373f38e162cf9fc9133e2f3b71441faa4c3d1ac01c1877f1cd2712200e03e975b996f911abba2b79d2596c2150bc94510963c40a1137a03df6edacdb1a107dee1cdb894163813bb3da604c9c133c1a10bb33302eeafbd55d352e35dcc5d2b3311a10d2c658b6b93d74a02d467849b6fe75251a10fea5308cc1fea69e7246eafe7ca8a3a51a1048efe1ad873b6f025ac0243bdef715f8000000000000000000000000000000000000000000000000000000000000"), }, nil) - lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, dkgAddress, 10, mock.Anything). + lp.On("LatestLogByEventSigWithConfs", tp.configSetTopic, dkgAddress, logpoller.Confirmations(10), mock.Anything). Return(nil, errors.New("rpc error")) c := &coordinator{ @@ -1218,7 +1219,7 @@ func TestCoordinator_ReportIsOnchain(t *testing.T) { log.BlockNumber = 195 lp.On("IndexedLogs", tp.newTransmissionTopic, beaconAddress, 2, []common.Hash{ enrTopic, - }, 1, mock.Anything).Return([]logpoller.Log{log}, nil) + }, logpoller.Confirmations(1), mock.Anything).Return([]logpoller.Log{log}, nil) c := &coordinator{ lp: lp, @@ -1254,7 +1255,7 @@ func TestCoordinator_ReportIsOnchain(t *testing.T) { log.BlockNumber = 195 lp.On("IndexedLogs", tp.newTransmissionTopic, beaconAddress, 2, []common.Hash{ enrTopic, - }, 1, mock.Anything).Return([]logpoller.Log{log}, nil) + }, logpoller.Confirmations(1), mock.Anything).Return([]logpoller.Log{log}, nil) c := &coordinator{ lp: lp, @@ -1281,7 +1282,7 @@ func TestCoordinator_ReportIsOnchain(t *testing.T) { lp := lp_mocks.NewLogPoller(t) lp.On("IndexedLogs", tp.newTransmissionTopic, beaconAddress, 2, []common.Hash{ enrTopic, - }, 1, mock.Anything).Return([]logpoller.Log{}, nil) + }, logpoller.Confirmations(1), mock.Anything).Return([]logpoller.Log{}, nil) c := &coordinator{ lp: lp, diff --git a/core/services/pg/q.go b/core/services/pg/q.go index 41643d42c97..098334bf1e7 100644 --- a/core/services/pg/q.go +++ b/core/services/pg/q.go @@ -237,6 +237,15 @@ func (q Q) Select(dest interface{}, query string, args ...interface{}) error { return ql.withLogError(q.Queryer.SelectContext(ctx, dest, query, args...)) } + +func (q Q) SelectNamed(dest interface{}, query string, arg interface{}) error { + query, args, err := q.BindNamed(query, arg) + if err != nil { + return errors.Wrap(err, "error binding arg") + } + return q.Select(dest, query, args...) +} + func (q Q) Get(dest interface{}, query string, args ...interface{}) error { ctx, cancel := q.Context() defer cancel() From 61ccf8b83d2a232bf0a205d1c848fb4ca1a88f90 Mon Sep 17 00:00:00 2001 From: amit-momin <108959691+amit-momin@users.noreply.github.com> Date: Wed, 4 Oct 2023 02:36:10 -0500 Subject: [PATCH 46/84] Update TxStore to use parent context created at initialization (#10735) * Removed pg.Opts and updated TxStore methods to use both the provided and TxStore contexts * Updated upstream contexts * Updated TxStore to maintain one context in scope at a time * Updated Fluxmonitor context usage * Wired remaining TxStore methods to upstream contexts --------- Co-authored-by: Prashant Yadav <34992934+prashantkumar1982@users.noreply.github.com> --- common/txmgr/broadcaster.go | 18 +- common/txmgr/confirmer.go | 37 +- common/txmgr/mocks/tx_manager.go | 45 +- common/txmgr/reaper.go | 4 +- common/txmgr/resender.go | 4 +- common/txmgr/strategies.go | 12 +- common/txmgr/txmgr.go | 25 +- common/txmgr/types/mocks/tx_store.go | 529 +++++++----------- common/txmgr/types/mocks/tx_strategy.go | 21 +- common/txmgr/types/tx.go | 4 +- common/txmgr/types/tx_store.go | 64 +-- core/chains/evm/txmgr/evm_tx_store.go | 308 +++++++--- core/chains/evm/txmgr/evm_tx_store_test.go | 137 +++-- core/chains/evm/txmgr/mocks/evm_tx_store.go | 529 +++++++----------- core/chains/evm/txmgr/nonce_syncer.go | 2 +- core/chains/evm/txmgr/strategies_test.go | 8 +- core/chains/evm/txmgr/txmgr_test.go | 42 +- core/internal/cltest/factories.go | 4 +- core/services/blockhashstore/batch_bhs.go | 5 +- core/services/blockhashstore/bhs.go | 13 +- core/services/blockhashstore/bhs_test.go | 8 +- .../fluxmonitorv2/contract_submitter.go | 7 +- .../fluxmonitorv2/contract_submitter_test.go | 5 +- core/services/fluxmonitorv2/flux_monitor.go | 15 +- .../fluxmonitorv2/flux_monitor_test.go | 18 +- .../fluxmonitorv2/mocks/contract_submitter.go | 11 +- core/services/fluxmonitorv2/mocks/orm.go | 14 +- core/services/fluxmonitorv2/orm.go | 8 +- core/services/fluxmonitorv2/orm_test.go | 5 +- core/services/keeper/upkeep_executer_test.go | 3 + core/services/ocrcommon/transmitter.go | 7 +- core/services/ocrcommon/transmitter_test.go | 12 +- core/services/pipeline/task.eth_tx.go | 4 +- core/services/pipeline/task.eth_tx_test.go | 20 +- core/services/vrf/delegate_test.go | 1 + core/services/vrf/v1/integration_test.go | 4 +- core/services/vrf/v2/listener_v2.go | 4 +- core/services/vrf/v2/listener_v2_types.go | 4 +- core/web/eth_keys_controller_test.go | 4 +- core/web/evm_transfer_controller.go | 2 +- 40 files changed, 956 insertions(+), 1011 deletions(-) diff --git a/common/txmgr/broadcaster.go b/common/txmgr/broadcaster.go index f00fe6d850c..9eda64f17d6 100644 --- a/common/txmgr/broadcaster.go +++ b/common/txmgr/broadcaster.go @@ -444,12 +444,12 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) proc for { maxInFlightTransactions := eb.txConfig.MaxInFlight() if maxInFlightTransactions > 0 { - nUnconfirmed, err := eb.txStore.CountUnconfirmedTransactions(fromAddress, eb.chainID) + nUnconfirmed, err := eb.txStore.CountUnconfirmedTransactions(ctx, fromAddress, eb.chainID) if err != nil { return true, errors.Wrap(err, "CountUnconfirmedTransactions failed") } if nUnconfirmed >= maxInFlightTransactions { - nUnstarted, err := eb.txStore.CountUnstartedTransactions(fromAddress, eb.chainID) + nUnstarted, err := eb.txStore.CountUnstartedTransactions(ctx, fromAddress, eb.chainID) if err != nil { return true, errors.Wrap(err, "CountUnstartedTransactions failed") } @@ -477,7 +477,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) proc return retryable, errors.Wrap(err, "processUnstartedTxs failed on NewAttempt") } - if err := eb.txStore.UpdateTxUnstartedToInProgress(etx, &a); errors.Is(err, ErrTxRemoved) { + if err := eb.txStore.UpdateTxUnstartedToInProgress(ctx, etx, &a); errors.Is(err, ErrTxRemoved) { eb.logger.Debugw("tx removed", "txID", etx.ID, "subject", etx.Subject) continue } else if err != nil { @@ -493,7 +493,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) proc // handleInProgressTx checks if there is any transaction // in_progress and if so, finishes the job func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) handleAnyInProgressTx(ctx context.Context, fromAddress ADDR) (err error, retryable bool) { - etx, err := eb.txStore.GetTxInProgress(fromAddress) + etx, err := eb.txStore.GetTxInProgress(ctx, fromAddress) if err != nil { return errors.Wrap(err, "handleAnyInProgressTx failed"), true } @@ -668,8 +668,10 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand // Finds next transaction in the queue, assigns a sequence, and moves it to "in_progress" state ready for broadcast. // Returns nil if no transactions are in queue func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) nextUnstartedTransactionWithSequence(fromAddress ADDR) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ctx, cancel := eb.chStop.NewCtx() + defer cancel() etx := &txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{} - if err := eb.txStore.FindNextUnstartedTransactionFromAddress(etx, fromAddress, eb.chainID); err != nil { + if err := eb.txStore.FindNextUnstartedTransactionFromAddress(ctx, etx, fromAddress, eb.chainID); err != nil { if errors.Is(err, sql.ErrNoRows) { // Finish. No more transactions left to process. Hoorah! return nil, nil @@ -722,7 +724,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) tryA } func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) saveTryAgainAttempt(ctx context.Context, lgr logger.Logger, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time, newFee FEE, newFeeLimit uint32) (err error, retyrable bool) { - if err = eb.txStore.SaveReplacementInProgressAttempt(attempt, &replacementAttempt); err != nil { + if err = eb.txStore.SaveReplacementInProgressAttempt(ctx, attempt, &replacementAttempt); err != nil { return errors.Wrap(err, "tryAgainWithNewFee failed"), true } lgr.Debugw("Bumped fee on initial send", "oldFee", attempt.TxFee.String(), "newFee", newFee.String(), "newFeeLimit", newFeeLimit) @@ -730,6 +732,8 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) save } func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) saveFatallyErroredTransaction(lgr logger.Logger, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + ctx, cancel := eb.chStop.NewCtx() + defer cancel() if etx.State != TxInProgress { return errors.Errorf("can only transition to fatal_error from in_progress, transaction is currently %s", etx.State) } @@ -756,7 +760,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) save return errors.Wrap(err, "failed to resume pipeline") } } - return eb.txStore.UpdateTxFatalError(etx) + return eb.txStore.UpdateTxFatalError(ctx, etx) } func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) getNextSequence(address ADDR) (sequence SEQ, err error) { diff --git a/common/txmgr/confirmer.go b/common/txmgr/confirmer.go index dbd67693aa3..7d4a3c0ce7d 100644 --- a/common/txmgr/confirmer.go +++ b/common/txmgr/confirmer.go @@ -21,7 +21,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/label" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -279,7 +278,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) pro ec.lggr.Debugw("processHead start", "headNum", head.BlockNumber(), "id", "confirmer") - if err := ec.txStore.SetBroadcastBeforeBlockNum(head.BlockNumber(), ec.chainID); err != nil { + if err := ec.txStore.SetBroadcastBeforeBlockNum(ctx, head.BlockNumber(), ec.chainID); err != nil { return errors.Wrap(err, "SetBroadcastBeforeBlockNum failed") } if err := ec.CheckConfirmedMissingReceipt(ctx); err != nil { @@ -340,7 +339,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) pro // // This scenario might sound unlikely but has been observed to happen multiple times in the wild on Polygon. func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckConfirmedMissingReceipt(ctx context.Context) (err error) { - attempts, err := ec.txStore.FindTxAttemptsConfirmedMissingReceipt(ec.chainID) + attempts, err := ec.txStore.FindTxAttemptsConfirmedMissingReceipt(ctx, ec.chainID) if err != nil { return err } @@ -351,7 +350,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Che txCodes, txErrs, broadcastTime, txIDs, err := ec.client.BatchSendTransactions(ctx, attempts, int(ec.chainConfig.RPCDefaultBatchSize()), ec.lggr) // update broadcast times before checking additional errors if len(txIDs) > 0 { - if updateErr := ec.txStore.UpdateBroadcastAts(broadcastTime, txIDs); updateErr != nil { + if updateErr := ec.txStore.UpdateBroadcastAts(ctx, broadcastTime, txIDs); updateErr != nil { err = fmt.Errorf("%w: failed to update broadcast time: %w", err, updateErr) } } @@ -369,7 +368,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Che txIDsToUnconfirm = append(txIDsToUnconfirm, attempts[idx].TxID) } - err = ec.txStore.UpdateTxsUnconfirmed(txIDsToUnconfirm) + err = ec.txStore.UpdateTxsUnconfirmed(ctx, txIDsToUnconfirm) if err != nil { return err @@ -379,7 +378,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Che // CheckForReceipts finds attempts that are still pending and checks to see if a receipt is present for the given block number func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckForReceipts(ctx context.Context, blockNum int64) error { - attempts, err := ec.txStore.FindTxAttemptsRequiringReceiptFetch(ec.chainID) + attempts, err := ec.txStore.FindTxAttemptsRequiringReceiptFetch(ctx, ec.chainID) if err != nil { return errors.Wrap(err, "FindTxAttemptsRequiringReceiptFetch failed") } @@ -421,11 +420,11 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Che } } - if err := ec.txStore.MarkAllConfirmedMissingReceipt(ec.chainID); err != nil { + if err := ec.txStore.MarkAllConfirmedMissingReceipt(ctx, ec.chainID); err != nil { return errors.Wrap(err, "unable to mark txes as 'confirmed_missing_receipt'") } - if err := ec.txStore.MarkOldTxesMissingReceiptAsErrored(blockNum, ec.chainConfig.FinalityDepth(), ec.chainID); err != nil { + if err := ec.txStore.MarkOldTxesMissingReceiptAsErrored(ctx, blockNum, ec.chainConfig.FinalityDepth(), ec.chainID); err != nil { return errors.Wrap(err, "unable to confirm buried unconfirmed txes") } return nil @@ -489,7 +488,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) fet if err != nil { return errors.Wrap(err, "batchFetchReceipts failed") } - if err := ec.txStore.SaveFetchedReceipts(receipts, ec.chainID); err != nil { + if err := ec.txStore.SaveFetchedReceipts(ctx, receipts, ec.chainID); err != nil { return errors.Wrap(err, "saveFetchedReceipts failed") } promNumConfirmedTxs.WithLabelValues(ec.chainID.String()).Add(float64(len(receipts))) @@ -511,7 +510,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) get func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) batchFetchReceipts(ctx context.Context, attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], blockNum int64) (receipts []R, err error) { // Metadata is required to determine whether a tx is forwarded or not. if ec.txConfig.ForwardersEnabled() { - err = ec.txStore.PreloadTxes(attempts) + err = ec.txStore.PreloadTxes(ctx, attempts) if err != nil { return nil, errors.Wrap(err, "Confirmer#batchFetchReceipts error loading txs for attempts") } @@ -648,7 +647,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) reb lggr.Debugw("Rebroadcasting transaction", "nPreviousAttempts", len(etx.TxAttempts), "fee", attempt.TxFee) - if err := ec.txStore.SaveInProgressAttempt(&attempt); err != nil { + if err := ec.txStore.SaveInProgressAttempt(ctx, &attempt); err != nil { return errors.Wrap(err, "saveInProgressAttempt failed") } @@ -687,7 +686,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequiringRebroadcast(ctx context.Context, lggr logger.Logger, address ADDR, blockNum, gasBumpThreshold, bumpDepth int64, maxInFlightTransactions uint32, chainID CHAIN_ID) (etxs []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { // NOTE: These two queries could be combined into one using union but it // becomes harder to read and difficult to test in isolation. KISS principle - etxInsufficientFunds, err := ec.txStore.FindTxsRequiringResubmissionDueToInsufficientFunds(address, chainID, pg.WithParentCtx(ctx)) + etxInsufficientFunds, err := ec.txStore.FindTxsRequiringResubmissionDueToInsufficientFunds(ctx, address, chainID) if err != nil { return nil, err } @@ -825,7 +824,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han ec.lggr.Warnw("Got terminally underpriced error for gas bump, this should never happen unless the remote RPC node changed its configuration on the fly, or you are using multiple RPC nodes with different minimum gas price requirements. This is not recommended", "err", sendError, "attempt", attempt) // "Lazily" load attempts here since the overwhelmingly common case is // that we don't need them unless we enter this path - if err := ec.txStore.LoadTxAttempts(&etx, pg.WithParentCtx(ctx)); err != nil { + if err := ec.txStore.LoadTxAttempts(ctx, &etx); err != nil { return errors.Wrap(err, "failed to load TxAttempts while bumping on terminally underpriced error") } if len(etx.TxAttempts) == 0 { @@ -850,7 +849,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han "replacementAttempt", replacementAttempt, ).Errorf("gas price was rejected by the node for being too low. Node returned: '%s'", sendError.Error()) - if err := ec.txStore.SaveReplacementInProgressAttempt(attempt, &replacementAttempt); err != nil { + if err := ec.txStore.SaveReplacementInProgressAttempt(ctx, attempt, &replacementAttempt); err != nil { return errors.Wrap(err, "saveReplacementInProgressAttempt failed") } return ec.handleInProgressAttempt(ctx, lggr, etx, replacementAttempt, blockHeight) @@ -882,11 +881,11 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han return ec.txStore.SaveConfirmedMissingReceiptAttempt(ctx, timeout, &attempt, now) case clienttypes.InsufficientFunds: timeout := ec.dbConfig.DefaultQueryTimeout() - return ec.txStore.SaveInsufficientFundsAttempt(timeout, &attempt, now) + return ec.txStore.SaveInsufficientFundsAttempt(ctx, timeout, &attempt, now) case clienttypes.Successful: lggr.Debugw("Successfully broadcast transaction", "txAttemptID", attempt.ID, "txHash", attempt.Hash.String()) timeout := ec.dbConfig.DefaultQueryTimeout() - return ec.txStore.SaveSentAttempt(timeout, &attempt, now) + return ec.txStore.SaveSentAttempt(ctx, timeout, &attempt, now) case clienttypes.Unknown: // Every error that doesn't fall under one of the above categories will be treated as Unknown. fallthrough @@ -921,7 +920,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Ens } else { ec.nConsecutiveBlocksChainTooShort = 0 } - etxs, err := ec.txStore.FindTransactionsConfirmedInBlockRange(head.BlockNumber(), head.EarliestHeadInChain().BlockNumber(), ec.chainID) + etxs, err := ec.txStore.FindTransactionsConfirmedInBlockRange(ctx, head.BlockNumber(), head.EarliestHeadInChain().BlockNumber(), ec.chainID) if err != nil { return errors.Wrap(err, "findTransactionsConfirmedInBlockRange failed") } @@ -1015,7 +1014,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) mar ec.lggr.Infow(fmt.Sprintf("Re-org detected. Rebroadcasting transaction %s which may have been re-org'd out of the main chain", attempt.Hash.String()), logValues...) // Put it back in progress and delete all receipts (they do not apply to the new chain) - err := ec.txStore.UpdateTxForRebroadcast(etx, attempt) + err := ec.txStore.UpdateTxForRebroadcast(ec.ctx, etx, attempt) return errors.Wrap(err, "markForRebroadcast failed") } @@ -1034,7 +1033,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) For for _, seq := range seqs { - etx, err := ec.txStore.FindTxWithSequence(address, seq) + etx, err := ec.txStore.FindTxWithSequence(context.TODO(), address, seq) if err != nil { return errors.Wrap(err, "ForceRebroadcast failed") } diff --git a/common/txmgr/mocks/tx_manager.go b/common/txmgr/mocks/tx_manager.go index ae878c18a02..fe19023bd5c 100644 --- a/common/txmgr/mocks/tx_manager.go +++ b/common/txmgr/mocks/tx_manager.go @@ -9,8 +9,6 @@ import ( feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" mock "github.com/stretchr/testify/mock" - pg "github.com/smartcontractkit/chainlink/v2/core/services/pg" - txmgr "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" @@ -37,30 +35,23 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close( return r0 } -// CreateTransaction provides a mock function with given fields: txRequest, qopts -func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CreateTransaction(txRequest txmgrtypes.TxRequest[ADDR, TX_HASH], qopts ...pg.QOpt) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, txRequest) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CreateTransaction provides a mock function with given fields: ctx, txRequest +func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, txRequest) var r0 txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(txmgrtypes.TxRequest[ADDR, TX_HASH], ...pg.QOpt) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(txRequest, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.TxRequest[ADDR, TX_HASH]) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, txRequest) } - if rf, ok := ret.Get(0).(func(txmgrtypes.TxRequest[ADDR, TX_HASH], ...pg.QOpt) txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(txRequest, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.TxRequest[ADDR, TX_HASH]) txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, txRequest) } else { r0 = ret.Get(0).(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } - if rf, ok := ret.Get(1).(func(txmgrtypes.TxRequest[ADDR, TX_HASH], ...pg.QOpt) error); ok { - r1 = rf(txRequest, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.TxRequest[ADDR, TX_HASH]) error); ok { + r1 = rf(ctx, txRequest) } else { r1 = ret.Error(1) } @@ -160,23 +151,23 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Reset( return r0 } -// SendNativeToken provides a mock function with given fields: chainID, from, to, value, gasLimit -func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) SendNativeToken(chainID CHAIN_ID, from ADDR, to ADDR, value big.Int, gasLimit uint32) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - ret := _m.Called(chainID, from, to, value, gasLimit) +// SendNativeToken provides a mock function with given fields: ctx, chainID, from, to, value, gasLimit +func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) SendNativeToken(ctx context.Context, chainID CHAIN_ID, from ADDR, to ADDR, value big.Int, gasLimit uint32) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, chainID, from, to, value, gasLimit) var r0 txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(CHAIN_ID, ADDR, ADDR, big.Int, uint32) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(chainID, from, to, value, gasLimit) + if rf, ok := ret.Get(0).(func(context.Context, CHAIN_ID, ADDR, ADDR, big.Int, uint32) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, chainID, from, to, value, gasLimit) } - if rf, ok := ret.Get(0).(func(CHAIN_ID, ADDR, ADDR, big.Int, uint32) txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(chainID, from, to, value, gasLimit) + if rf, ok := ret.Get(0).(func(context.Context, CHAIN_ID, ADDR, ADDR, big.Int, uint32) txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, chainID, from, to, value, gasLimit) } else { r0 = ret.Get(0).(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } - if rf, ok := ret.Get(1).(func(CHAIN_ID, ADDR, ADDR, big.Int, uint32) error); ok { - r1 = rf(chainID, from, to, value, gasLimit) + if rf, ok := ret.Get(1).(func(context.Context, CHAIN_ID, ADDR, ADDR, big.Int, uint32) error); ok { + r1 = rf(ctx, chainID, from, to, value, gasLimit) } else { r1 = ret.Error(1) } diff --git a/common/txmgr/reaper.go b/common/txmgr/reaper.go index 5394266de42..96bc4860d71 100644 --- a/common/txmgr/reaper.go +++ b/common/txmgr/reaper.go @@ -97,6 +97,8 @@ func (r *Reaper[CHAIN_ID]) SetLatestBlockNum(latestBlockNum int64) { // ReapTxes deletes old txes func (r *Reaper[CHAIN_ID]) ReapTxes(headNum int64) error { + ctx, cancel := utils.StopChan(r.chStop).NewCtx() + defer cancel() threshold := r.txConfig.ReaperThreshold() if threshold == 0 { r.log.Debug("Transactions.ReaperThreshold set to 0; skipping ReapTxes") @@ -108,7 +110,7 @@ func (r *Reaper[CHAIN_ID]) ReapTxes(headNum int64) error { r.log.Debugw(fmt.Sprintf("reaping old txes created before %s", timeThreshold.Format(time.RFC3339)), "ageThreshold", threshold, "timeThreshold", timeThreshold, "minBlockNumberToKeep", minBlockNumberToKeep) - if err := r.store.ReapTxHistory(minBlockNumberToKeep, timeThreshold, r.chainID); err != nil { + if err := r.store.ReapTxHistory(ctx, minBlockNumberToKeep, timeThreshold, r.chainID); err != nil { return err } diff --git a/common/txmgr/resender.go b/common/txmgr/resender.go index 20652aaf837..655de0f1135 100644 --- a/common/txmgr/resender.go +++ b/common/txmgr/resender.go @@ -139,7 +139,7 @@ func (er *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) resendUnconfi var allAttempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] for _, k := range enabledAddresses { var attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] - attempts, err = er.txStore.FindTxAttemptsRequiringResend(olderThan, maxInFlightTransactions, er.chainID, k) + attempts, err = er.txStore.FindTxAttemptsRequiringResend(er.ctx, olderThan, maxInFlightTransactions, er.chainID, k) if err != nil { return fmt.Errorf("failed to FindTxAttemptsRequiringResend: %w", err) } @@ -163,7 +163,7 @@ func (er *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) resendUnconfi // update broadcast times before checking additional errors if len(txIDs) > 0 { - if updateErr := er.txStore.UpdateBroadcastAts(broadcastTime, txIDs); updateErr != nil { + if updateErr := er.txStore.UpdateBroadcastAts(er.ctx, broadcastTime, txIDs); updateErr != nil { err = errors.Join(err, fmt.Errorf("failed to update broadcast time: %w", updateErr)) } } diff --git a/common/txmgr/strategies.go b/common/txmgr/strategies.go index 72fc6ba44fe..b986d0d9b80 100644 --- a/common/txmgr/strategies.go +++ b/common/txmgr/strategies.go @@ -8,7 +8,6 @@ import ( "github.com/pkg/errors" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" ) var _ txmgrtypes.TxStrategy = SendEveryStrategy{} @@ -33,7 +32,7 @@ func NewSendEveryStrategy() txmgrtypes.TxStrategy { type SendEveryStrategy struct{} func (SendEveryStrategy) Subject() uuid.NullUUID { return uuid.NullUUID{} } -func (SendEveryStrategy) PruneQueue(pruneService txmgrtypes.UnstartedTxQueuePruner, qopt pg.QOpt) (int64, error) { +func (SendEveryStrategy) PruneQueue(ctx context.Context, pruneService txmgrtypes.UnstartedTxQueuePruner) (int64, error) { return 0, nil } @@ -57,11 +56,12 @@ func (s DropOldestStrategy) Subject() uuid.NullUUID { return uuid.NullUUID{UUID: s.subject, Valid: true} } -func (s DropOldestStrategy) PruneQueue(pruneService txmgrtypes.UnstartedTxQueuePruner, qopt pg.QOpt) (n int64, err error) { - ctx, cancel := context.WithTimeout(context.Background(), s.queryTimeout) - +func (s DropOldestStrategy) PruneQueue(ctx context.Context, pruneService txmgrtypes.UnstartedTxQueuePruner) (n int64, err error) { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, s.queryTimeout) defer cancel() - n, err = pruneService.PruneUnstartedTxQueue(s.queueSize, s.subject, pg.WithParentCtx(ctx), qopt) + + n, err = pruneService.PruneUnstartedTxQueue(ctx, s.queueSize, s.subject) if err != nil { return 0, errors.Wrap(err, "DropOldestStrategy#PruneQueue failed") } diff --git a/common/txmgr/txmgr.go b/common/txmgr/txmgr.go index 0bcf3e482ee..9e59d91dfe6 100644 --- a/common/txmgr/txmgr.go +++ b/common/txmgr/txmgr.go @@ -17,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -43,10 +42,10 @@ type TxManager[ types.HeadTrackable[HEAD, BLOCK_HASH] services.ServiceCtx Trigger(addr ADDR) - CreateTransaction(txRequest txmgrtypes.TxRequest[ADDR, TX_HASH], qopts ...pg.QOpt) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) GetForwarderForEOA(eoa ADDR) (forwarder ADDR, err error) RegisterResumeCallback(fn ResumeCallback) - SendNativeToken(chainID CHAIN_ID, from, to ADDR, value big.Int, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + SendNativeToken(ctx context.Context, chainID CHAIN_ID, from, to ADDR, value big.Int, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) Reset(f func(), addr ADDR, abandon bool) error } @@ -223,7 +222,9 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Reset(call // - marks all pending and inflight transactions fatally errored (note: at this point all transactions are either confirmed or fatally errored) // this must not be run while Broadcaster or Confirmer are running func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) abandon(addr ADDR) (err error) { - err = b.txStore.Abandon(b.chainID, addr) + ctx, cancel := utils.StopChan(b.chStop).NewCtx() + defer cancel() + err = b.txStore.Abandon(ctx, b.chainID, addr) return errors.Wrapf(err, "abandon failed to update txes for key %s", addr.String()) } @@ -435,12 +436,12 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Trigger(ad } // CreateTransaction inserts a new transaction -func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTransaction(txRequest txmgrtypes.TxRequest[ADDR, TX_HASH], qs ...pg.QOpt) (tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { +func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { // Check for existing Tx with IdempotencyKey. If found, return the Tx and do nothing // Skipping CreateTransaction to avoid double send if txRequest.IdempotencyKey != nil { var existingTx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] - existingTx, err = b.txStore.FindTxWithIdempotencyKey(*txRequest.IdempotencyKey, b.chainID) + existingTx, err = b.txStore.FindTxWithIdempotencyKey(ctx, *txRequest.IdempotencyKey, b.chainID) if err != nil && !errors.Is(err, sql.ErrNoRows) { return tx, errors.Wrap(err, "Failed to search for transaction with IdempotencyKey") } @@ -472,12 +473,12 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTran } } - err = b.txStore.CheckTxQueueCapacity(txRequest.FromAddress, b.txConfig.MaxQueued(), b.chainID, qs...) + err = b.txStore.CheckTxQueueCapacity(ctx, txRequest.FromAddress, b.txConfig.MaxQueued(), b.chainID) if err != nil { return tx, errors.Wrap(err, "Txm#CreateTransaction") } - tx, err = b.txStore.CreateTransaction(txRequest, b.chainID, qs...) + tx, err = b.txStore.CreateTransaction(ctx, txRequest, b.chainID) return } @@ -496,7 +497,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) checkEnabl } // SendNativeToken creates a transaction that transfers the given value of native tokens -func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SendNativeToken(chainID CHAIN_ID, from, to ADDR, value big.Int, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { +func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SendNativeToken(ctx context.Context, chainID CHAIN_ID, from, to ADDR, value big.Int, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { if utils.IsZero(to) { return etx, errors.New("cannot send native token to zero address") } @@ -508,7 +509,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SendNative FeeLimit: gasLimit, Strategy: NewSendEveryStrategy(), } - etx, err = b.txStore.CreateTransaction(txRequest, chainID) + etx, err = b.txStore.CreateTransaction(ctx, txRequest, chainID) return etx, errors.Wrap(err, "SendNativeToken failed to insert tx") } @@ -540,7 +541,7 @@ func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Clo func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Trigger(ADDR) { panic(n.ErrMsg) } -func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CreateTransaction(txmgrtypes.TxRequest[ADDR, TX_HASH], ...pg.QOpt) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { +func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { return etx, errors.New(n.ErrMsg) } func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetForwarderForEOA(addr ADDR) (fwdr ADDR, err error) { @@ -551,7 +552,7 @@ func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Res } // SendNativeToken does nothing, null functionality -func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) SendNativeToken(chainID CHAIN_ID, from, to ADDR, value big.Int, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { +func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) SendNativeToken(ctx context.Context, chainID CHAIN_ID, from, to ADDR, value big.Int, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) { return etx, errors.New(n.ErrMsg) } diff --git a/common/txmgr/types/mocks/tx_store.go b/common/txmgr/types/mocks/tx_store.go index 9c812788bf6..dd40a064b9c 100644 --- a/common/txmgr/types/mocks/tx_store.go +++ b/common/txmgr/types/mocks/tx_store.go @@ -24,13 +24,13 @@ type TxStore[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLO mock.Mock } -// Abandon provides a mock function with given fields: id, addr -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Abandon(id CHAIN_ID, addr ADDR) error { - ret := _m.Called(id, addr) +// Abandon provides a mock function with given fields: ctx, id, addr +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Abandon(ctx context.Context, id CHAIN_ID, addr ADDR) error { + ret := _m.Called(ctx, id, addr) var r0 error - if rf, ok := ret.Get(0).(func(CHAIN_ID, ADDR) error); ok { - r0 = rf(id, addr) + if rf, ok := ret.Get(0).(func(context.Context, CHAIN_ID, ADDR) error); ok { + r0 = rf(ctx, id, addr) } else { r0 = ret.Error(0) } @@ -38,20 +38,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Abandon(id return r0 } -// CheckTxQueueCapacity provides a mock function with given fields: fromAddress, maxQueuedTransactions, chainID, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckTxQueueCapacity(fromAddress ADDR, maxQueuedTransactions uint64, chainID CHAIN_ID, qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, fromAddress, maxQueuedTransactions, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CheckTxQueueCapacity provides a mock function with given fields: ctx, fromAddress, maxQueuedTransactions, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckTxQueueCapacity(ctx context.Context, fromAddress ADDR, maxQueuedTransactions uint64, chainID CHAIN_ID) error { + ret := _m.Called(ctx, fromAddress, maxQueuedTransactions, chainID) var r0 error - if rf, ok := ret.Get(0).(func(ADDR, uint64, CHAIN_ID, ...pg.QOpt) error); ok { - r0 = rf(fromAddress, maxQueuedTransactions, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, uint64, CHAIN_ID) error); ok { + r0 = rf(ctx, fromAddress, maxQueuedTransactions, chainID) } else { r0 = ret.Error(0) } @@ -64,30 +57,23 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Close() { _m.Called() } -// CountUnconfirmedTransactions provides a mock function with given fields: fromAddress, chainID, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnconfirmedTransactions(fromAddress ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) (uint32, error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, fromAddress, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CountUnconfirmedTransactions provides a mock function with given fields: ctx, fromAddress, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnconfirmedTransactions(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (uint32, error) { + ret := _m.Called(ctx, fromAddress, chainID) var r0 uint32 var r1 error - if rf, ok := ret.Get(0).(func(ADDR, CHAIN_ID, ...pg.QOpt) (uint32, error)); ok { - return rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) (uint32, error)); ok { + return rf(ctx, fromAddress, chainID) } - if rf, ok := ret.Get(0).(func(ADDR, CHAIN_ID, ...pg.QOpt) uint32); ok { - r0 = rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) uint32); ok { + r0 = rf(ctx, fromAddress, chainID) } else { r0 = ret.Get(0).(uint32) } - if rf, ok := ret.Get(1).(func(ADDR, CHAIN_ID, ...pg.QOpt) error); ok { - r1 = rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, ADDR, CHAIN_ID) error); ok { + r1 = rf(ctx, fromAddress, chainID) } else { r1 = ret.Error(1) } @@ -95,30 +81,23 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnconf return r0, r1 } -// CountUnstartedTransactions provides a mock function with given fields: fromAddress, chainID, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnstartedTransactions(fromAddress ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) (uint32, error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, fromAddress, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CountUnstartedTransactions provides a mock function with given fields: ctx, fromAddress, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnstartedTransactions(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (uint32, error) { + ret := _m.Called(ctx, fromAddress, chainID) var r0 uint32 var r1 error - if rf, ok := ret.Get(0).(func(ADDR, CHAIN_ID, ...pg.QOpt) (uint32, error)); ok { - return rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) (uint32, error)); ok { + return rf(ctx, fromAddress, chainID) } - if rf, ok := ret.Get(0).(func(ADDR, CHAIN_ID, ...pg.QOpt) uint32); ok { - r0 = rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) uint32); ok { + r0 = rf(ctx, fromAddress, chainID) } else { r0 = ret.Get(0).(uint32) } - if rf, ok := ret.Get(1).(func(ADDR, CHAIN_ID, ...pg.QOpt) error); ok { - r1 = rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, ADDR, CHAIN_ID) error); ok { + r1 = rf(ctx, fromAddress, chainID) } else { r1 = ret.Error(1) } @@ -126,30 +105,23 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnstar return r0, r1 } -// CreateTransaction provides a mock function with given fields: txRequest, chainID, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTransaction(txRequest txmgrtypes.TxRequest[ADDR, TX_HASH], chainID CHAIN_ID, qopts ...pg.QOpt) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, txRequest, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CreateTransaction provides a mock function with given fields: ctx, txRequest, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH], chainID CHAIN_ID) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, txRequest, chainID) var r0 txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(txmgrtypes.TxRequest[ADDR, TX_HASH], CHAIN_ID, ...pg.QOpt) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(txRequest, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.TxRequest[ADDR, TX_HASH], CHAIN_ID) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, txRequest, chainID) } - if rf, ok := ret.Get(0).(func(txmgrtypes.TxRequest[ADDR, TX_HASH], CHAIN_ID, ...pg.QOpt) txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(txRequest, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.TxRequest[ADDR, TX_HASH], CHAIN_ID) txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, txRequest, chainID) } else { r0 = ret.Get(0).(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } - if rf, ok := ret.Get(1).(func(txmgrtypes.TxRequest[ADDR, TX_HASH], CHAIN_ID, ...pg.QOpt) error); ok { - r1 = rf(txRequest, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, txmgrtypes.TxRequest[ADDR, TX_HASH], CHAIN_ID) error); ok { + r1 = rf(ctx, txRequest, chainID) } else { r1 = ret.Error(1) } @@ -171,20 +143,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) DeleteInPro return r0 } -// FindNextUnstartedTransactionFromAddress provides a mock function with given fields: etx, fromAddress, chainID, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindNextUnstartedTransactionFromAddress(etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fromAddress ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, etx, fromAddress, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// FindNextUnstartedTransactionFromAddress provides a mock function with given fields: ctx, etx, fromAddress, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindNextUnstartedTransactionFromAddress(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fromAddress ADDR, chainID CHAIN_ID) error { + ret := _m.Called(ctx, etx, fromAddress, chainID) var r0 error - if rf, ok := ret.Get(0).(func(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], ADDR, CHAIN_ID, ...pg.QOpt) error); ok { - r0 = rf(etx, fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], ADDR, CHAIN_ID) error); ok { + r0 = rf(ctx, etx, fromAddress, chainID) } else { r0 = ret.Error(0) } @@ -218,25 +183,25 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindReceipt return r0, r1 } -// FindTransactionsConfirmedInBlockRange provides a mock function with given fields: highBlockNumber, lowBlockNumber, chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTransactionsConfirmedInBlockRange(highBlockNumber int64, lowBlockNumber int64, chainID CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - ret := _m.Called(highBlockNumber, lowBlockNumber, chainID) +// FindTransactionsConfirmedInBlockRange provides a mock function with given fields: ctx, highBlockNumber, lowBlockNumber, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTransactionsConfirmedInBlockRange(ctx context.Context, highBlockNumber int64, lowBlockNumber int64, chainID CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, highBlockNumber, lowBlockNumber, chainID) var r0 []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(int64, int64, CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(highBlockNumber, lowBlockNumber, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, int64, CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, highBlockNumber, lowBlockNumber, chainID) } - if rf, ok := ret.Get(0).(func(int64, int64, CHAIN_ID) []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(highBlockNumber, lowBlockNumber, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, int64, CHAIN_ID) []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, highBlockNumber, lowBlockNumber, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(1).(func(int64, int64, CHAIN_ID) error); ok { - r1 = rf(highBlockNumber, lowBlockNumber, chainID) + if rf, ok := ret.Get(1).(func(context.Context, int64, int64, CHAIN_ID) error); ok { + r1 = rf(ctx, highBlockNumber, lowBlockNumber, chainID) } else { r1 = ret.Error(1) } @@ -244,25 +209,25 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTransac return r0, r1 } -// FindTxAttemptsConfirmedMissingReceipt provides a mock function with given fields: chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsConfirmedMissingReceipt(chainID CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - ret := _m.Called(chainID) +// FindTxAttemptsConfirmedMissingReceipt provides a mock function with given fields: ctx, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsConfirmedMissingReceipt(ctx context.Context, chainID CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, chainID) var r0 []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, chainID) } - if rf, ok := ret.Get(0).(func(CHAIN_ID) []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, CHAIN_ID) []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(1).(func(CHAIN_ID) error); ok { - r1 = rf(chainID) + if rf, ok := ret.Get(1).(func(context.Context, CHAIN_ID) error); ok { + r1 = rf(ctx, chainID) } else { r1 = ret.Error(1) } @@ -270,25 +235,25 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttem return r0, r1 } -// FindTxAttemptsRequiringReceiptFetch provides a mock function with given fields: chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsRequiringReceiptFetch(chainID CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - ret := _m.Called(chainID) +// FindTxAttemptsRequiringReceiptFetch provides a mock function with given fields: ctx, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsRequiringReceiptFetch(ctx context.Context, chainID CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, chainID) var r0 []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, chainID) } - if rf, ok := ret.Get(0).(func(CHAIN_ID) []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, CHAIN_ID) []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(1).(func(CHAIN_ID) error); ok { - r1 = rf(chainID) + if rf, ok := ret.Get(1).(func(context.Context, CHAIN_ID) error); ok { + r1 = rf(ctx, chainID) } else { r1 = ret.Error(1) } @@ -296,25 +261,25 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttem return r0, r1 } -// FindTxAttemptsRequiringResend provides a mock function with given fields: olderThan, maxInFlightTransactions, chainID, address -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsRequiringResend(olderThan time.Time, maxInFlightTransactions uint32, chainID CHAIN_ID, address ADDR) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - ret := _m.Called(olderThan, maxInFlightTransactions, chainID, address) +// FindTxAttemptsRequiringResend provides a mock function with given fields: ctx, olderThan, maxInFlightTransactions, chainID, address +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsRequiringResend(ctx context.Context, olderThan time.Time, maxInFlightTransactions uint32, chainID CHAIN_ID, address ADDR) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, olderThan, maxInFlightTransactions, chainID, address) var r0 []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(time.Time, uint32, CHAIN_ID, ADDR) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(olderThan, maxInFlightTransactions, chainID, address) + if rf, ok := ret.Get(0).(func(context.Context, time.Time, uint32, CHAIN_ID, ADDR) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, olderThan, maxInFlightTransactions, chainID, address) } - if rf, ok := ret.Get(0).(func(time.Time, uint32, CHAIN_ID, ADDR) []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(olderThan, maxInFlightTransactions, chainID, address) + if rf, ok := ret.Get(0).(func(context.Context, time.Time, uint32, CHAIN_ID, ADDR) []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, olderThan, maxInFlightTransactions, chainID, address) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(1).(func(time.Time, uint32, CHAIN_ID, ADDR) error); ok { - r1 = rf(olderThan, maxInFlightTransactions, chainID, address) + if rf, ok := ret.Get(1).(func(context.Context, time.Time, uint32, CHAIN_ID, ADDR) error); ok { + r1 = rf(ctx, olderThan, maxInFlightTransactions, chainID, address) } else { r1 = ret.Error(1) } @@ -322,25 +287,25 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttem return r0, r1 } -// FindTxWithIdempotencyKey provides a mock function with given fields: idempotencyKey, chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithIdempotencyKey(idempotencyKey string, chainID CHAIN_ID) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - ret := _m.Called(idempotencyKey, chainID) +// FindTxWithIdempotencyKey provides a mock function with given fields: ctx, idempotencyKey, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithIdempotencyKey(ctx context.Context, idempotencyKey string, chainID CHAIN_ID) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, idempotencyKey, chainID) var r0 *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(string, CHAIN_ID) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(idempotencyKey, chainID) + if rf, ok := ret.Get(0).(func(context.Context, string, CHAIN_ID) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, idempotencyKey, chainID) } - if rf, ok := ret.Get(0).(func(string, CHAIN_ID) *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(idempotencyKey, chainID) + if rf, ok := ret.Get(0).(func(context.Context, string, CHAIN_ID) *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, idempotencyKey, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(1).(func(string, CHAIN_ID) error); ok { - r1 = rf(idempotencyKey, chainID) + if rf, ok := ret.Get(1).(func(context.Context, string, CHAIN_ID) error); ok { + r1 = rf(ctx, idempotencyKey, chainID) } else { r1 = ret.Error(1) } @@ -348,25 +313,25 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithI return r0, r1 } -// FindTxWithSequence provides a mock function with given fields: fromAddress, seq -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithSequence(fromAddress ADDR, seq SEQ) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - ret := _m.Called(fromAddress, seq) +// FindTxWithSequence provides a mock function with given fields: ctx, fromAddress, seq +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithSequence(ctx context.Context, fromAddress ADDR, seq SEQ) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, fromAddress, seq) var r0 *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(ADDR, SEQ) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(fromAddress, seq) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, SEQ) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, fromAddress, seq) } - if rf, ok := ret.Get(0).(func(ADDR, SEQ) *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(fromAddress, seq) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, SEQ) *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, fromAddress, seq) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(1).(func(ADDR, SEQ) error); ok { - r1 = rf(fromAddress, seq) + if rf, ok := ret.Get(1).(func(context.Context, ADDR, SEQ) error); ok { + r1 = rf(ctx, fromAddress, seq) } else { r1 = ret.Error(1) } @@ -400,32 +365,25 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequ return r0, r1 } -// FindTxsRequiringResubmissionDueToInsufficientFunds provides a mock function with given fields: address, chainID, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequiringResubmissionDueToInsufficientFunds(address ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, address, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// FindTxsRequiringResubmissionDueToInsufficientFunds provides a mock function with given fields: ctx, address, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequiringResubmissionDueToInsufficientFunds(ctx context.Context, address ADDR, chainID CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, address, chainID) var r0 []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(ADDR, CHAIN_ID, ...pg.QOpt) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(address, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, address, chainID) } - if rf, ok := ret.Get(0).(func(ADDR, CHAIN_ID, ...pg.QOpt) []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(address, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, address, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(1).(func(ADDR, CHAIN_ID, ...pg.QOpt) error); ok { - r1 = rf(address, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, ADDR, CHAIN_ID) error); ok { + r1 = rf(ctx, address, chainID) } else { r1 = ret.Error(1) } @@ -459,32 +417,25 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetInProgre return r0, r1 } -// GetTxInProgress provides a mock function with given fields: fromAddress, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxInProgress(fromAddress ADDR, qopts ...pg.QOpt) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, fromAddress) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// GetTxInProgress provides a mock function with given fields: ctx, fromAddress +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxInProgress(ctx context.Context, fromAddress ADDR) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { + ret := _m.Called(ctx, fromAddress) var r0 *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] var r1 error - if rf, ok := ret.Get(0).(func(ADDR, ...pg.QOpt) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { - return rf(fromAddress, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)); ok { + return rf(ctx, fromAddress) } - if rf, ok := ret.Get(0).(func(ADDR, ...pg.QOpt) *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { - r0 = rf(fromAddress, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR) *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]); ok { + r0 = rf(ctx, fromAddress) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) } } - if rf, ok := ret.Get(1).(func(ADDR, ...pg.QOpt) error); ok { - r1 = rf(fromAddress, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, ADDR) error); ok { + r1 = rf(ctx, fromAddress) } else { r1 = ret.Error(1) } @@ -492,30 +443,23 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxInProg return r0, r1 } -// HasInProgressTransaction provides a mock function with given fields: account, chainID, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HasInProgressTransaction(account ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) (bool, error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, account, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// HasInProgressTransaction provides a mock function with given fields: ctx, account, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HasInProgressTransaction(ctx context.Context, account ADDR, chainID CHAIN_ID) (bool, error) { + ret := _m.Called(ctx, account, chainID) var r0 bool var r1 error - if rf, ok := ret.Get(0).(func(ADDR, CHAIN_ID, ...pg.QOpt) (bool, error)); ok { - return rf(account, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) (bool, error)); ok { + return rf(ctx, account, chainID) } - if rf, ok := ret.Get(0).(func(ADDR, CHAIN_ID, ...pg.QOpt) bool); ok { - r0 = rf(account, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, ADDR, CHAIN_ID) bool); ok { + r0 = rf(ctx, account, chainID) } else { r0 = ret.Get(0).(bool) } - if rf, ok := ret.Get(1).(func(ADDR, CHAIN_ID, ...pg.QOpt) error); ok { - r1 = rf(account, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, ADDR, CHAIN_ID) error); ok { + r1 = rf(ctx, account, chainID) } else { r1 = ret.Error(1) } @@ -523,20 +467,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HasInProgre return r0, r1 } -// LoadTxAttempts provides a mock function with given fields: etx, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) LoadTxAttempts(etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, etx) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// LoadTxAttempts provides a mock function with given fields: ctx, etx +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) LoadTxAttempts(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + ret := _m.Called(ctx, etx) var r0 error - if rf, ok := ret.Get(0).(func(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], ...pg.QOpt) error); ok { - r0 = rf(etx, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { + r0 = rf(ctx, etx) } else { r0 = ret.Error(0) } @@ -544,13 +481,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) LoadTxAttem return r0 } -// MarkAllConfirmedMissingReceipt provides a mock function with given fields: chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkAllConfirmedMissingReceipt(chainID CHAIN_ID) error { - ret := _m.Called(chainID) +// MarkAllConfirmedMissingReceipt provides a mock function with given fields: ctx, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkAllConfirmedMissingReceipt(ctx context.Context, chainID CHAIN_ID) error { + ret := _m.Called(ctx, chainID) var r0 error - if rf, ok := ret.Get(0).(func(CHAIN_ID) error); ok { - r0 = rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, CHAIN_ID) error); ok { + r0 = rf(ctx, chainID) } else { r0 = ret.Error(0) } @@ -558,20 +495,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkAllConf return r0 } -// MarkOldTxesMissingReceiptAsErrored provides a mock function with given fields: blockNum, finalityDepth, chainID, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkOldTxesMissingReceiptAsErrored(blockNum int64, finalityDepth uint32, chainID CHAIN_ID, qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, blockNum, finalityDepth, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// MarkOldTxesMissingReceiptAsErrored provides a mock function with given fields: ctx, blockNum, finalityDepth, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, finalityDepth uint32, chainID CHAIN_ID) error { + ret := _m.Called(ctx, blockNum, finalityDepth, chainID) var r0 error - if rf, ok := ret.Get(0).(func(int64, uint32, CHAIN_ID, ...pg.QOpt) error); ok { - r0 = rf(blockNum, finalityDepth, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, int64, uint32, CHAIN_ID) error); ok { + r0 = rf(ctx, blockNum, finalityDepth, chainID) } else { r0 = ret.Error(0) } @@ -579,20 +509,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkOldTxes return r0 } -// PreloadTxes provides a mock function with given fields: attempts, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PreloadTxes(attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, attempts) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// PreloadTxes provides a mock function with given fields: ctx, attempts +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PreloadTxes(ctx context.Context, attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + ret := _m.Called(ctx, attempts) var r0 error - if rf, ok := ret.Get(0).(func([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], ...pg.QOpt) error); ok { - r0 = rf(attempts, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { + r0 = rf(ctx, attempts) } else { r0 = ret.Error(0) } @@ -600,30 +523,23 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PreloadTxes return r0 } -// PruneUnstartedTxQueue provides a mock function with given fields: queueSize, subject, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PruneUnstartedTxQueue(queueSize uint32, subject uuid.UUID, qopts ...pg.QOpt) (int64, error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, queueSize, subject) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// PruneUnstartedTxQueue provides a mock function with given fields: ctx, queueSize, subject +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PruneUnstartedTxQueue(ctx context.Context, queueSize uint32, subject uuid.UUID) (int64, error) { + ret := _m.Called(ctx, queueSize, subject) var r0 int64 var r1 error - if rf, ok := ret.Get(0).(func(uint32, uuid.UUID, ...pg.QOpt) (int64, error)); ok { - return rf(queueSize, subject, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, uint32, uuid.UUID) (int64, error)); ok { + return rf(ctx, queueSize, subject) } - if rf, ok := ret.Get(0).(func(uint32, uuid.UUID, ...pg.QOpt) int64); ok { - r0 = rf(queueSize, subject, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, uint32, uuid.UUID) int64); ok { + r0 = rf(ctx, queueSize, subject) } else { r0 = ret.Get(0).(int64) } - if rf, ok := ret.Get(1).(func(uint32, uuid.UUID, ...pg.QOpt) error); ok { - r1 = rf(queueSize, subject, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, uint32, uuid.UUID) error); ok { + r1 = rf(ctx, queueSize, subject) } else { r1 = ret.Error(1) } @@ -631,13 +547,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PruneUnstar return r0, r1 } -// ReapTxHistory provides a mock function with given fields: minBlockNumberToKeep, timeThreshold, chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ReapTxHistory(minBlockNumberToKeep int64, timeThreshold time.Time, chainID CHAIN_ID) error { - ret := _m.Called(minBlockNumberToKeep, timeThreshold, chainID) +// ReapTxHistory provides a mock function with given fields: ctx, minBlockNumberToKeep, timeThreshold, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ReapTxHistory(ctx context.Context, minBlockNumberToKeep int64, timeThreshold time.Time, chainID CHAIN_ID) error { + ret := _m.Called(ctx, minBlockNumberToKeep, timeThreshold, chainID) var r0 error - if rf, ok := ret.Get(0).(func(int64, time.Time, CHAIN_ID) error); ok { - r0 = rf(minBlockNumberToKeep, timeThreshold, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time, CHAIN_ID) error); ok { + r0 = rf(ctx, minBlockNumberToKeep, timeThreshold, chainID) } else { r0 = ret.Error(0) } @@ -659,13 +575,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveConfirm return r0 } -// SaveFetchedReceipts provides a mock function with given fields: receipts, chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveFetchedReceipts(receipts []R, chainID CHAIN_ID) error { - ret := _m.Called(receipts, chainID) +// SaveFetchedReceipts provides a mock function with given fields: ctx, receipts, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveFetchedReceipts(ctx context.Context, receipts []R, chainID CHAIN_ID) error { + ret := _m.Called(ctx, receipts, chainID) var r0 error - if rf, ok := ret.Get(0).(func([]R, CHAIN_ID) error); ok { - r0 = rf(receipts, chainID) + if rf, ok := ret.Get(0).(func(context.Context, []R, CHAIN_ID) error); ok { + r0 = rf(ctx, receipts, chainID) } else { r0 = ret.Error(0) } @@ -673,13 +589,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveFetched return r0 } -// SaveInProgressAttempt provides a mock function with given fields: attempt -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInProgressAttempt(attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { - ret := _m.Called(attempt) +// SaveInProgressAttempt provides a mock function with given fields: ctx, attempt +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInProgressAttempt(ctx context.Context, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + ret := _m.Called(ctx, attempt) var r0 error - if rf, ok := ret.Get(0).(func(*txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { - r0 = rf(attempt) + if rf, ok := ret.Get(0).(func(context.Context, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { + r0 = rf(ctx, attempt) } else { r0 = ret.Error(0) } @@ -687,13 +603,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInProgr return r0 } -// SaveInsufficientFundsAttempt provides a mock function with given fields: timeout, attempt, broadcastAt -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInsufficientFundsAttempt(timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error { - ret := _m.Called(timeout, attempt, broadcastAt) +// SaveInsufficientFundsAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInsufficientFundsAttempt(ctx context.Context, timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error { + ret := _m.Called(ctx, timeout, attempt, broadcastAt) var r0 error - if rf, ok := ret.Get(0).(func(time.Duration, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], time.Time) error); ok { - r0 = rf(timeout, attempt, broadcastAt) + if rf, ok := ret.Get(0).(func(context.Context, time.Duration, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], time.Time) error); ok { + r0 = rf(ctx, timeout, attempt, broadcastAt) } else { r0 = ret.Error(0) } @@ -701,20 +617,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInsuffi return r0 } -// SaveReplacementInProgressAttempt provides a mock function with given fields: oldAttempt, replacementAttempt, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveReplacementInProgressAttempt(oldAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, oldAttempt, replacementAttempt) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// SaveReplacementInProgressAttempt provides a mock function with given fields: ctx, oldAttempt, replacementAttempt +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveReplacementInProgressAttempt(ctx context.Context, oldAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + ret := _m.Called(ctx, oldAttempt, replacementAttempt) var r0 error - if rf, ok := ret.Get(0).(func(txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], ...pg.QOpt) error); ok { - r0 = rf(oldAttempt, replacementAttempt, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { + r0 = rf(ctx, oldAttempt, replacementAttempt) } else { r0 = ret.Error(0) } @@ -722,13 +631,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveReplace return r0 } -// SaveSentAttempt provides a mock function with given fields: timeout, attempt, broadcastAt -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveSentAttempt(timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error { - ret := _m.Called(timeout, attempt, broadcastAt) +// SaveSentAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveSentAttempt(ctx context.Context, timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error { + ret := _m.Called(ctx, timeout, attempt, broadcastAt) var r0 error - if rf, ok := ret.Get(0).(func(time.Duration, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], time.Time) error); ok { - r0 = rf(timeout, attempt, broadcastAt) + if rf, ok := ret.Get(0).(func(context.Context, time.Duration, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], time.Time) error); ok { + r0 = rf(ctx, timeout, attempt, broadcastAt) } else { r0 = ret.Error(0) } @@ -736,13 +645,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveSentAtt return r0 } -// SetBroadcastBeforeBlockNum provides a mock function with given fields: blockNum, chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SetBroadcastBeforeBlockNum(blockNum int64, chainID CHAIN_ID) error { - ret := _m.Called(blockNum, chainID) +// SetBroadcastBeforeBlockNum provides a mock function with given fields: ctx, blockNum, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SetBroadcastBeforeBlockNum(ctx context.Context, blockNum int64, chainID CHAIN_ID) error { + ret := _m.Called(ctx, blockNum, chainID) var r0 error - if rf, ok := ret.Get(0).(func(int64, CHAIN_ID) error); ok { - r0 = rf(blockNum, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, CHAIN_ID) error); ok { + r0 = rf(ctx, blockNum, chainID) } else { r0 = ret.Error(0) } @@ -750,13 +659,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SetBroadcas return r0 } -// UpdateBroadcastAts provides a mock function with given fields: now, etxIDs -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateBroadcastAts(now time.Time, etxIDs []int64) error { - ret := _m.Called(now, etxIDs) +// UpdateBroadcastAts provides a mock function with given fields: ctx, now, etxIDs +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateBroadcastAts(ctx context.Context, now time.Time, etxIDs []int64) error { + ret := _m.Called(ctx, now, etxIDs) var r0 error - if rf, ok := ret.Get(0).(func(time.Time, []int64) error); ok { - r0 = rf(now, etxIDs) + if rf, ok := ret.Get(0).(func(context.Context, time.Time, []int64) error); ok { + r0 = rf(ctx, now, etxIDs) } else { r0 = ret.Error(0) } @@ -806,20 +715,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxAtt return r0 } -// UpdateTxFatalError provides a mock function with given fields: etx, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFatalError(etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, etx) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// UpdateTxFatalError provides a mock function with given fields: ctx, etx +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFatalError(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + ret := _m.Called(ctx, etx) var r0 error - if rf, ok := ret.Get(0).(func(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], ...pg.QOpt) error); ok { - r0 = rf(etx, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { + r0 = rf(ctx, etx) } else { r0 = ret.Error(0) } @@ -827,13 +729,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFat return r0 } -// UpdateTxForRebroadcast provides a mock function with given fields: etx, etxAttempt -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxForRebroadcast(etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], etxAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { - ret := _m.Called(etx, etxAttempt) +// UpdateTxForRebroadcast provides a mock function with given fields: ctx, etx, etxAttempt +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxForRebroadcast(ctx context.Context, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], etxAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + ret := _m.Called(ctx, etx, etxAttempt) var r0 error - if rf, ok := ret.Get(0).(func(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { - r0 = rf(etx, etxAttempt) + if rf, ok := ret.Get(0).(func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { + r0 = rf(ctx, etx, etxAttempt) } else { r0 = ret.Error(0) } @@ -841,20 +743,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFor return r0 } -// UpdateTxUnstartedToInProgress provides a mock function with given fields: etx, attempt, qopts -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxUnstartedToInProgress(etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, etx, attempt) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// UpdateTxUnstartedToInProgress provides a mock function with given fields: ctx, etx, attempt +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxUnstartedToInProgress(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + ret := _m.Called(ctx, etx, attempt) var r0 error - if rf, ok := ret.Get(0).(func(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], ...pg.QOpt) error); ok { - r0 = rf(etx, attempt, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error); ok { + r0 = rf(ctx, etx, attempt) } else { r0 = ret.Error(0) } @@ -862,13 +757,13 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxUns return r0 } -// UpdateTxsUnconfirmed provides a mock function with given fields: ids -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxsUnconfirmed(ids []int64) error { - ret := _m.Called(ids) +// UpdateTxsUnconfirmed provides a mock function with given fields: ctx, ids +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxsUnconfirmed(ctx context.Context, ids []int64) error { + ret := _m.Called(ctx, ids) var r0 error - if rf, ok := ret.Get(0).(func([]int64) error); ok { - r0 = rf(ids) + if rf, ok := ret.Get(0).(func(context.Context, []int64) error); ok { + r0 = rf(ctx, ids) } else { r0 = ret.Error(0) } diff --git a/common/txmgr/types/mocks/tx_strategy.go b/common/txmgr/types/mocks/tx_strategy.go index 74d3182947e..c6695fd0781 100644 --- a/common/txmgr/types/mocks/tx_strategy.go +++ b/common/txmgr/types/mocks/tx_strategy.go @@ -3,8 +3,9 @@ package mocks import ( + context "context" + types "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" - pg "github.com/smartcontractkit/chainlink/v2/core/services/pg" mock "github.com/stretchr/testify/mock" uuid "github.com/google/uuid" @@ -15,23 +16,23 @@ type TxStrategy struct { mock.Mock } -// PruneQueue provides a mock function with given fields: pruneService, qopt -func (_m *TxStrategy) PruneQueue(pruneService types.UnstartedTxQueuePruner, qopt pg.QOpt) (int64, error) { - ret := _m.Called(pruneService, qopt) +// PruneQueue provides a mock function with given fields: ctx, pruneService +func (_m *TxStrategy) PruneQueue(ctx context.Context, pruneService types.UnstartedTxQueuePruner) (int64, error) { + ret := _m.Called(ctx, pruneService) var r0 int64 var r1 error - if rf, ok := ret.Get(0).(func(types.UnstartedTxQueuePruner, pg.QOpt) (int64, error)); ok { - return rf(pruneService, qopt) + if rf, ok := ret.Get(0).(func(context.Context, types.UnstartedTxQueuePruner) (int64, error)); ok { + return rf(ctx, pruneService) } - if rf, ok := ret.Get(0).(func(types.UnstartedTxQueuePruner, pg.QOpt) int64); ok { - r0 = rf(pruneService, qopt) + if rf, ok := ret.Get(0).(func(context.Context, types.UnstartedTxQueuePruner) int64); ok { + r0 = rf(ctx, pruneService) } else { r0 = ret.Get(0).(int64) } - if rf, ok := ret.Get(1).(func(types.UnstartedTxQueuePruner, pg.QOpt) error); ok { - r1 = rf(pruneService, qopt) + if rf, ok := ret.Get(1).(func(context.Context, types.UnstartedTxQueuePruner) error); ok { + r1 = rf(ctx, pruneService) } else { r1 = ret.Error(1) } diff --git a/common/txmgr/types/tx.go b/common/txmgr/types/tx.go index a0faa81c3aa..37834d92e0f 100644 --- a/common/txmgr/types/tx.go +++ b/common/txmgr/types/tx.go @@ -1,6 +1,7 @@ package types import ( + "context" "encoding/json" "fmt" "math/big" @@ -16,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" clnull "github.com/smartcontractkit/chainlink/v2/core/null" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" "github.com/smartcontractkit/chainlink/v2/core/services/pg/datatypes" ) @@ -29,7 +29,7 @@ type TxStrategy interface { // PruneQueue is called after tx insertion // It accepts the service responsible for deleting // unstarted txs and deletion options - PruneQueue(pruneService UnstartedTxQueuePruner, qopt pg.QOpt) (n int64, err error) + PruneQueue(ctx context.Context, pruneService UnstartedTxQueuePruner) (n int64, err error) } type TxAttemptState int8 diff --git a/common/txmgr/types/tx_store.go b/common/txmgr/types/tx_store.go index 8c56b8a6ed6..a17188be441 100644 --- a/common/txmgr/types/tx_store.go +++ b/common/txmgr/types/tx_store.go @@ -38,12 +38,12 @@ type TxStore[ // methods for saving & retreiving receipts FindReceiptsPendingConfirmation(ctx context.Context, blockNum int64, chainID CHAIN_ID) (receiptsPlus []ReceiptPlus[R], err error) - SaveFetchedReceipts(receipts []R, chainID CHAIN_ID) (err error) + SaveFetchedReceipts(ctx context.Context, receipts []R, chainID CHAIN_ID) (err error) // additional methods for tx store management - CheckTxQueueCapacity(fromAddress ADDR, maxQueuedTransactions uint64, chainID CHAIN_ID, qopts ...pg.QOpt) (err error) + CheckTxQueueCapacity(ctx context.Context, fromAddress ADDR, maxQueuedTransactions uint64, chainID CHAIN_ID) (err error) Close() - Abandon(id CHAIN_ID, addr ADDR) error + Abandon(ctx context.Context, id CHAIN_ID, addr ADDR) error } // TransactionStore contains the persistence layer methods needed to manage Txs and TxAttempts @@ -55,48 +55,48 @@ type TransactionStore[ SEQ types.Sequence, FEE feetypes.Fee, ] interface { - CountUnconfirmedTransactions(fromAddress ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) (count uint32, err error) - CountUnstartedTransactions(fromAddress ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) (count uint32, err error) - CreateTransaction(txRequest TxRequest[ADDR, TX_HASH], chainID CHAIN_ID, qopts ...pg.QOpt) (tx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + CountUnconfirmedTransactions(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (count uint32, err error) + CountUnstartedTransactions(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (count uint32, err error) + CreateTransaction(ctx context.Context, txRequest TxRequest[ADDR, TX_HASH], chainID CHAIN_ID) (tx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) DeleteInProgressAttempt(ctx context.Context, attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error FindTxsRequiringGasBump(ctx context.Context, address ADDR, blockNum, gasBumpThreshold, depth int64, chainID CHAIN_ID) (etxs []*Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) - FindTxsRequiringResubmissionDueToInsufficientFunds(address ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) (etxs []*Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) - FindTxAttemptsConfirmedMissingReceipt(chainID CHAIN_ID) (attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) - FindTxAttemptsRequiringReceiptFetch(chainID CHAIN_ID) (attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) - FindTxAttemptsRequiringResend(olderThan time.Time, maxInFlightTransactions uint32, chainID CHAIN_ID, address ADDR) (attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + FindTxsRequiringResubmissionDueToInsufficientFunds(ctx context.Context, address ADDR, chainID CHAIN_ID) (etxs []*Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + FindTxAttemptsConfirmedMissingReceipt(ctx context.Context, chainID CHAIN_ID) (attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + FindTxAttemptsRequiringReceiptFetch(ctx context.Context, chainID CHAIN_ID) (attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + FindTxAttemptsRequiringResend(ctx context.Context, olderThan time.Time, maxInFlightTransactions uint32, chainID CHAIN_ID, address ADDR) (attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) // Search for Tx using the idempotencyKey and chainID - FindTxWithIdempotencyKey(idempotencyKey string, chainID CHAIN_ID) (tx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + FindTxWithIdempotencyKey(ctx context.Context, idempotencyKey string, chainID CHAIN_ID) (tx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) // Search for Tx using the fromAddress and sequence - FindTxWithSequence(fromAddress ADDR, seq SEQ) (etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) - FindNextUnstartedTransactionFromAddress(etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fromAddress ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) error - FindTransactionsConfirmedInBlockRange(highBlockNumber, lowBlockNumber int64, chainID CHAIN_ID) (etxs []*Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) - GetTxInProgress(fromAddress ADDR, qopts ...pg.QOpt) (etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + FindTxWithSequence(ctx context.Context, fromAddress ADDR, seq SEQ) (etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + FindNextUnstartedTransactionFromAddress(ctx context.Context, etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fromAddress ADDR, chainID CHAIN_ID) error + FindTransactionsConfirmedInBlockRange(ctx context.Context, highBlockNumber, lowBlockNumber int64, chainID CHAIN_ID) (etxs []*Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) + GetTxInProgress(ctx context.Context, fromAddress ADDR) (etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) GetInProgressTxAttempts(ctx context.Context, address ADDR, chainID CHAIN_ID) (attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) - HasInProgressTransaction(account ADDR, chainID CHAIN_ID, qopts ...pg.QOpt) (exists bool, err error) - LoadTxAttempts(etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error - MarkAllConfirmedMissingReceipt(chainID CHAIN_ID) (err error) - MarkOldTxesMissingReceiptAsErrored(blockNum int64, finalityDepth uint32, chainID CHAIN_ID, qopts ...pg.QOpt) error - PreloadTxes(attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error + HasInProgressTransaction(ctx context.Context, account ADDR, chainID CHAIN_ID) (exists bool, err error) + LoadTxAttempts(ctx context.Context, etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error + MarkAllConfirmedMissingReceipt(ctx context.Context, chainID CHAIN_ID) (err error) + MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, finalityDepth uint32, chainID CHAIN_ID) error + PreloadTxes(ctx context.Context, attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error SaveConfirmedMissingReceiptAttempt(ctx context.Context, timeout time.Duration, attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error - SaveInProgressAttempt(attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error - SaveInsufficientFundsAttempt(timeout time.Duration, attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error - SaveReplacementInProgressAttempt(oldAttempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error - SaveSentAttempt(timeout time.Duration, attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error - SetBroadcastBeforeBlockNum(blockNum int64, chainID CHAIN_ID) error - UpdateBroadcastAts(now time.Time, etxIDs []int64) error + SaveInProgressAttempt(ctx context.Context, attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error + SaveInsufficientFundsAttempt(ctx context.Context, timeout time.Duration, attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error + SaveReplacementInProgressAttempt(ctx context.Context, oldAttempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error + SaveSentAttempt(ctx context.Context, timeout time.Duration, attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error + SetBroadcastBeforeBlockNum(ctx context.Context, blockNum int64, chainID CHAIN_ID) error + UpdateBroadcastAts(ctx context.Context, now time.Time, etxIDs []int64) error UpdateTxAttemptInProgressToBroadcast(etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], NewAttemptState TxAttemptState, incrNextSequenceCallback QueryerFunc, qopts ...pg.QOpt) error - UpdateTxsUnconfirmed(ids []int64) error - UpdateTxUnstartedToInProgress(etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error - UpdateTxFatalError(etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], qopts ...pg.QOpt) error - UpdateTxForRebroadcast(etx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], etxAttempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error + UpdateTxsUnconfirmed(ctx context.Context, ids []int64) error + UpdateTxUnstartedToInProgress(ctx context.Context, etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error + UpdateTxFatalError(ctx context.Context, etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error + UpdateTxForRebroadcast(ctx context.Context, etx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], etxAttempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error } type TxHistoryReaper[CHAIN_ID types.ID] interface { - ReapTxHistory(minBlockNumberToKeep int64, timeThreshold time.Time, chainID CHAIN_ID) error + ReapTxHistory(ctx context.Context, minBlockNumberToKeep int64, timeThreshold time.Time, chainID CHAIN_ID) error } type UnstartedTxQueuePruner interface { - PruneUnstartedTxQueue(queueSize uint32, subject uuid.UUID, qopts ...pg.QOpt) (n int64, err error) + PruneUnstartedTxQueue(ctx context.Context, queueSize uint32, subject uuid.UUID) (n int64, err error) } type SequenceStore[ diff --git a/core/chains/evm/txmgr/evm_tx_store.go b/core/chains/evm/txmgr/evm_tx_store.go index 52cd50cba32..539c77dfee5 100644 --- a/core/chains/evm/txmgr/evm_tx_store.go +++ b/core/chains/evm/txmgr/evm_tx_store.go @@ -379,7 +379,15 @@ func (o *evmTxStore) preloadTxAttempts(txs []Tx) error { return nil } -func (o *evmTxStore) PreloadTxes(attempts []TxAttempt, qopts ...pg.QOpt) error { +func (o *evmTxStore) PreloadTxes(ctx context.Context, attempts []TxAttempt) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + return o.preloadTxesAtomic(attempts, pg.WithParentCtx(ctx)) +} + +// Only to be used for atomic transactions internal to the tx store +func (o *evmTxStore) preloadTxesAtomic(attempts []TxAttempt, qopts ...pg.QOpt) error { ethTxM := make(map[int64]Tx) for _, attempt := range attempts { ethTxM[attempt.TxID] = Tx{} @@ -454,7 +462,7 @@ func (o *evmTxStore) TxAttempts(offset, limit int) (txs []TxAttempt, count int, return } txs = dbEthTxAttemptsToEthTxAttempts(dbTxs) - err = o.PreloadTxes(txs) + err = o.preloadTxesAtomic(txs) return } @@ -469,7 +477,7 @@ func (o *evmTxStore) FindTxAttempt(hash common.Hash) (*TxAttempt, error) { var attempt TxAttempt dbTxAttempt.ToTxAttempt(&attempt) attempts := []TxAttempt{attempt} - err := o.PreloadTxes(attempts) + err := o.preloadTxesAtomic(attempts) return &attempts[0], err } @@ -543,7 +551,7 @@ func (o *evmTxStore) FindTxWithAttempts(etxID int64) (etx Tx, err error) { return pkgerrors.Wrapf(err, "failed to find eth_tx with id %d", etxID) } dbEtx.ToTx(&etx) - if err = o.LoadTxAttempts(&etx, pg.WithQueryer(tx)); err != nil { + if err = o.loadTxAttemptsAtomic(&etx, pg.WithQueryer(tx)); err != nil { return pkgerrors.Wrapf(err, "failed to load evm.tx_attempts for eth_tx with id %d", etxID) } if err = loadEthTxAttemptsReceipts(tx, &etx); err != nil { @@ -569,6 +577,7 @@ func (o *evmTxStore) FindTxAttemptConfirmedByTxIDs(ids []int64) ([]TxAttempt, er return txAttempts, pkgerrors.Wrap(err, "FindTxAttemptConfirmedByTxIDs failed") } +// Only used internally for atomic transactions func (o *evmTxStore) LoadTxesAttempts(etxs []*Tx, qopts ...pg.QOpt) error { qq := o.q.WithOpts(qopts...) ethTxIDs := make([]int64, len(etxs)) @@ -591,7 +600,15 @@ func (o *evmTxStore) LoadTxesAttempts(etxs []*Tx, qopts ...pg.QOpt) error { return nil } -func (o *evmTxStore) LoadTxAttempts(etx *Tx, qopts ...pg.QOpt) error { +func (o *evmTxStore) LoadTxAttempts(ctx context.Context, etx *Tx) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + return o.loadTxAttemptsAtomic(etx, pg.WithParentCtx(ctx)) +} + +// Only to be used for atomic transactions internal to the tx store +func (o *evmTxStore) loadTxAttemptsAtomic(etx *Tx, qopts ...pg.QOpt) error { return o.LoadTxesAttempts([]*Tx{etx}, qopts...) } @@ -646,7 +663,11 @@ func loadConfirmedAttemptsReceipts(q pg.Queryer, attempts []TxAttempt) error { // FindTxAttemptsRequiringResend returns the highest priced attempt for each // eth_tx that was last sent before or at the given time (up to limit) -func (o *evmTxStore) FindTxAttemptsRequiringResend(olderThan time.Time, maxInFlightTransactions uint32, chainID *big.Int, address common.Address) (attempts []TxAttempt, err error) { +func (o *evmTxStore) FindTxAttemptsRequiringResend(ctx context.Context, olderThan time.Time, maxInFlightTransactions uint32, chainID *big.Int, address common.Address) (attempts []TxAttempt, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) var limit null.Uint32 if maxInFlightTransactions > 0 { limit = null.Uint32From(maxInFlightTransactions) @@ -654,7 +675,7 @@ func (o *evmTxStore) FindTxAttemptsRequiringResend(olderThan time.Time, maxInFli var dbAttempts []DbEthTxAttempt // this select distinct works because of unique index on evm.txes // (evm_chain_id, from_address, nonce) - err = o.q.Select(&dbAttempts, ` + err = qq.Select(&dbAttempts, ` SELECT DISTINCT ON (evm.txes.nonce) evm.tx_attempts.* FROM evm.tx_attempts JOIN evm.txes ON evm.txes.id = evm.tx_attempts.eth_tx_id AND evm.txes.state IN ('unconfirmed', 'confirmed_missing_receipt') @@ -667,7 +688,11 @@ LIMIT $4 return attempts, pkgerrors.Wrap(err, "FindEthTxAttemptsRequiringResend failed to load evm.tx_attempts") } -func (o *evmTxStore) UpdateBroadcastAts(now time.Time, etxIDs []int64) error { +func (o *evmTxStore) UpdateBroadcastAts(ctx context.Context, now time.Time, etxIDs []int64) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) // Deliberately do nothing on NULL broadcast_at because that indicates the // tx has been moved into a state where broadcast_at is not relevant, e.g. // fatally errored. @@ -675,15 +700,19 @@ func (o *evmTxStore) UpdateBroadcastAts(now time.Time, etxIDs []int64) error { // Since EthConfirmer/EthResender can race (totally OK since highest // priced transaction always wins) we only want to update broadcast_at if // our version is later. - _, err := o.q.Exec(`UPDATE evm.txes SET broadcast_at = $1 WHERE id = ANY($2) AND broadcast_at < $1`, now, pq.Array(etxIDs)) + _, err := qq.Exec(`UPDATE evm.txes SET broadcast_at = $1 WHERE id = ANY($2) AND broadcast_at < $1`, now, pq.Array(etxIDs)) return pkgerrors.Wrap(err, "updateBroadcastAts failed to update evm.txes") } // SetBroadcastBeforeBlockNum updates already broadcast attempts with the // current block number. This is safe no matter how old the head is because if // the attempt is already broadcast it _must_ have been before this head. -func (o *evmTxStore) SetBroadcastBeforeBlockNum(blockNum int64, chainID *big.Int) error { - _, err := o.q.Exec( +func (o *evmTxStore) SetBroadcastBeforeBlockNum(ctx context.Context, blockNum int64, chainID *big.Int) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) + _, err := qq.Exec( `UPDATE evm.tx_attempts SET broadcast_before_block_num = $1 FROM evm.txes @@ -694,9 +723,13 @@ AND evm.txes.id = evm.tx_attempts.eth_tx_id AND evm.txes.evm_chain_id = $2`, return pkgerrors.Wrap(err, "SetBroadcastBeforeBlockNum failed") } -func (o *evmTxStore) FindTxAttemptsConfirmedMissingReceipt(chainID *big.Int) (attempts []TxAttempt, err error) { +func (o *evmTxStore) FindTxAttemptsConfirmedMissingReceipt(ctx context.Context, chainID *big.Int) (attempts []TxAttempt, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) var dbAttempts []DbEthTxAttempt - err = o.q.Select(&dbAttempts, + err = qq.Select(&dbAttempts, `SELECT DISTINCT ON (evm.tx_attempts.eth_tx_id) evm.tx_attempts.* FROM evm.tx_attempts JOIN evm.txes ON evm.txes.id = evm.tx_attempts.eth_tx_id AND evm.txes.state = 'confirmed_missing_receipt' @@ -710,8 +743,12 @@ func (o *evmTxStore) FindTxAttemptsConfirmedMissingReceipt(chainID *big.Int) (at return } -func (o *evmTxStore) UpdateTxsUnconfirmed(ids []int64) error { - _, err := o.q.Exec(`UPDATE evm.txes SET state='unconfirmed' WHERE id = ANY($1)`, pq.Array(ids)) +func (o *evmTxStore) UpdateTxsUnconfirmed(ctx context.Context, ids []int64) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) + _, err := qq.Exec(`UPDATE evm.txes SET state='unconfirmed' WHERE id = ANY($1)`, pq.Array(ids)) if err != nil { return pkgerrors.Wrap(err, "UpdateEthTxsUnconfirmed failed to execute") @@ -719,8 +756,12 @@ func (o *evmTxStore) UpdateTxsUnconfirmed(ids []int64) error { return nil } -func (o *evmTxStore) FindTxAttemptsRequiringReceiptFetch(chainID *big.Int) (attempts []TxAttempt, err error) { - err = o.q.Transaction(func(tx pg.Queryer) error { +func (o *evmTxStore) FindTxAttemptsRequiringReceiptFetch(ctx context.Context, chainID *big.Int) (attempts []TxAttempt, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) + err = qq.Transaction(func(tx pg.Queryer) error { var dbAttempts []DbEthTxAttempt err = tx.Select(&dbAttempts, ` SELECT evm.tx_attempts.* FROM evm.tx_attempts @@ -732,13 +773,17 @@ ORDER BY evm.txes.nonce ASC, evm.tx_attempts.gas_price DESC, evm.tx_attempts.gas return pkgerrors.Wrap(err, "FindEthTxAttemptsRequiringReceiptFetch failed to load evm.tx_attempts") } attempts = dbEthTxAttemptsToEthTxAttempts(dbAttempts) - err = o.PreloadTxes(attempts, pg.WithQueryer(tx)) + err = o.preloadTxesAtomic(attempts, pg.WithParentCtx(ctx), pg.WithQueryer(tx)) return pkgerrors.Wrap(err, "FindEthTxAttemptsRequiringReceiptFetch failed to load evm.txes") }, pg.OptReadOnlyTx()) return } -func (o *evmTxStore) SaveFetchedReceipts(r []*evmtypes.Receipt, chainID *big.Int) (err error) { +func (o *evmTxStore) SaveFetchedReceipts(ctx context.Context, r []*evmtypes.Receipt, chainID *big.Int) (err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) receipts := toOnchainReceipt(r) if len(receipts) == 0 { return nil @@ -815,7 +860,7 @@ func (o *evmTxStore) SaveFetchedReceipts(r []*evmtypes.Receipt, chainID *big.Int stmt = sqlx.Rebind(sqlx.DOLLAR, stmt) - err = o.q.ExecQ(stmt, valueArgs...) + err = qq.ExecQ(stmt, valueArgs...) return pkgerrors.Wrap(err, "SaveFetchedReceipts failed to save receipts") } @@ -839,8 +884,12 @@ func (o *evmTxStore) SaveFetchedReceipts(r []*evmtypes.Receipt, chainID *big.Int // // We will continue to try to fetch a receipt for these attempts until all // attempts are below the finality depth from current head. -func (o *evmTxStore) MarkAllConfirmedMissingReceipt(chainID *big.Int) (err error) { - res, err := o.q.Exec(` +func (o *evmTxStore) MarkAllConfirmedMissingReceipt(ctx context.Context, chainID *big.Int) (err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) + res, err := qq.Exec(` UPDATE evm.txes SET state = 'confirmed_missing_receipt' FROM ( @@ -868,6 +917,9 @@ WHERE state = 'unconfirmed' } func (o *evmTxStore) GetInProgressTxAttempts(ctx context.Context, address common.Address, chainID *big.Int) (attempts []TxAttempt, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() qq := o.q.WithOpts(pg.WithParentCtx(ctx)) err = qq.Transaction(func(tx pg.Queryer) error { var dbAttempts []DbEthTxAttempt @@ -880,7 +932,7 @@ WHERE evm.tx_attempts.state = 'in_progress' AND evm.txes.from_address = $1 AND e return pkgerrors.Wrap(err, "getInProgressEthTxAttempts failed to load evm.tx_attempts") } attempts = dbEthTxAttemptsToEthTxAttempts(dbAttempts) - err = o.PreloadTxes(attempts, pg.WithQueryer(tx)) + err = o.preloadTxesAtomic(attempts, pg.WithParentCtx(ctx), pg.WithQueryer(tx)) return pkgerrors.Wrap(err, "getInProgressEthTxAttempts failed to load evm.txes") }, pg.OptReadOnlyTx()) return attempts, pkgerrors.Wrap(err, "getInProgressEthTxAttempts failed") @@ -889,6 +941,9 @@ WHERE evm.tx_attempts.state = 'in_progress' AND evm.txes.from_address = $1 AND e func (o *evmTxStore) FindReceiptsPendingConfirmation(ctx context.Context, blockNum int64, chainID *big.Int) (receiptsPlus []ReceiptPlus, err error) { var rs []dbReceiptPlus + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() err = o.q.SelectContext(ctx, &rs, ` SELECT pipeline_task_runs.id, evm.receipts.receipt, COALESCE((evm.txes.meta->>'FailOnRevert')::boolean, false) "FailOnRevert" FROM pipeline_task_runs INNER JOIN pipeline_runs ON pipeline_runs.id = pipeline_task_runs.pipeline_run_id @@ -903,9 +958,13 @@ func (o *evmTxStore) FindReceiptsPendingConfirmation(ctx context.Context, blockN } // FindTxWithIdempotencyKey returns any broadcast ethtx with the given idempotencyKey and chainID -func (o *evmTxStore) FindTxWithIdempotencyKey(idempotencyKey string, chainID *big.Int) (etx *Tx, err error) { +func (o *evmTxStore) FindTxWithIdempotencyKey(ctx context.Context, idempotencyKey string, chainID *big.Int) (etx *Tx, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) var dbEtx DbEthTx - err = o.q.Get(&dbEtx, `SELECT * FROM evm.txes WHERE idempotency_key = $1 and evm_chain_id = $2`, idempotencyKey, chainID.String()) + err = qq.Get(&dbEtx, `SELECT * FROM evm.txes WHERE idempotency_key = $1 and evm_chain_id = $2`, idempotencyKey, chainID.String()) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -918,9 +977,13 @@ func (o *evmTxStore) FindTxWithIdempotencyKey(idempotencyKey string, chainID *bi } // FindTxWithSequence returns any broadcast ethtx with the given nonce -func (o *evmTxStore) FindTxWithSequence(fromAddress common.Address, nonce evmtypes.Nonce) (etx *Tx, err error) { +func (o *evmTxStore) FindTxWithSequence(ctx context.Context, fromAddress common.Address, nonce evmtypes.Nonce) (etx *Tx, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) etx = new(Tx) - err = o.q.Transaction(func(tx pg.Queryer) error { + err = qq.Transaction(func(tx pg.Queryer) error { var dbEtx DbEthTx err = tx.Get(&dbEtx, ` SELECT * FROM evm.txes WHERE from_address = $1 AND nonce = $2 AND state IN ('confirmed', 'confirmed_missing_receipt', 'unconfirmed') @@ -929,7 +992,7 @@ SELECT * FROM evm.txes WHERE from_address = $1 AND nonce = $2 AND state IN ('con return pkgerrors.Wrap(err, "FindEthTxWithNonce failed to load evm.txes") } dbEtx.ToTx(etx) - err = o.LoadTxAttempts(etx, pg.WithQueryer(tx)) + err = o.loadTxAttemptsAtomic(etx, pg.WithParentCtx(ctx), pg.WithQueryer(tx)) return pkgerrors.Wrap(err, "FindEthTxWithNonce failed to load evm.tx_attempts") }, pg.OptReadOnlyTx()) if errors.Is(err, sql.ErrNoRows) { @@ -964,8 +1027,12 @@ AND evm.tx_attempts.eth_tx_id = $1 return pkgerrors.Wrap(err, "deleteEthReceipts failed") } -func (o *evmTxStore) UpdateTxForRebroadcast(etx Tx, etxAttempt TxAttempt) error { - return o.q.Transaction(func(tx pg.Queryer) error { +func (o *evmTxStore) UpdateTxForRebroadcast(ctx context.Context, etx Tx, etxAttempt TxAttempt) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) + return qq.Transaction(func(tx pg.Queryer) error { if err := deleteEthReceipts(tx, etx.ID); err != nil { return pkgerrors.Wrapf(err, "deleteEthReceipts failed for etx %v", etx.ID) } @@ -976,8 +1043,12 @@ func (o *evmTxStore) UpdateTxForRebroadcast(etx Tx, etxAttempt TxAttempt) error }) } -func (o *evmTxStore) FindTransactionsConfirmedInBlockRange(highBlockNumber, lowBlockNumber int64, chainID *big.Int) (etxs []*Tx, err error) { - err = o.q.Transaction(func(tx pg.Queryer) error { +func (o *evmTxStore) FindTransactionsConfirmedInBlockRange(ctx context.Context, highBlockNumber, lowBlockNumber int64, chainID *big.Int) (etxs []*Tx, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) + err = qq.Transaction(func(tx pg.Queryer) error { var dbEtxs []DbEthTx err = tx.Select(&dbEtxs, ` SELECT DISTINCT evm.txes.* FROM evm.txes @@ -991,7 +1062,7 @@ ORDER BY nonce ASC } etxs = make([]*Tx, len(dbEtxs)) dbEthTxsToEvmEthTxPtrs(dbEtxs, etxs) - if err = o.LoadTxesAttempts(etxs, pg.WithQueryer(tx)); err != nil { + if err = o.LoadTxesAttempts(etxs, pg.WithParentCtx(ctx), pg.WithQueryer(tx)); err != nil { return pkgerrors.Wrap(err, "FindTransactionsConfirmedInBlockRange failed to load evm.tx_attempts") } err = loadEthTxesAttemptsReceipts(tx, etxs) @@ -1017,12 +1088,16 @@ func saveAttemptWithNewState(q pg.Queryer, timeout time.Duration, logger logger. }) } -func (o *evmTxStore) SaveInsufficientFundsAttempt(timeout time.Duration, attempt *TxAttempt, broadcastAt time.Time) error { +func (o *evmTxStore) SaveInsufficientFundsAttempt(ctx context.Context, timeout time.Duration, attempt *TxAttempt, broadcastAt time.Time) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) if !(attempt.State == txmgrtypes.TxAttemptInProgress || attempt.State == txmgrtypes.TxAttemptInsufficientFunds) { return errors.New("expected state to be either in_progress or insufficient_eth") } attempt.State = txmgrtypes.TxAttemptInsufficientFunds - return pkgerrors.Wrap(saveAttemptWithNewState(o.q, timeout, o.logger, *attempt, broadcastAt), "saveInsufficientEthAttempt failed") + return pkgerrors.Wrap(saveAttemptWithNewState(qq, timeout, o.logger, *attempt, broadcastAt), "saveInsufficientEthAttempt failed") } func saveSentAttempt(q pg.Queryer, timeout time.Duration, logger logger.Logger, attempt *TxAttempt, broadcastAt time.Time) error { @@ -1033,11 +1108,18 @@ func saveSentAttempt(q pg.Queryer, timeout time.Duration, logger logger.Logger, return pkgerrors.Wrap(saveAttemptWithNewState(q, timeout, logger, *attempt, broadcastAt), "saveSentAttempt failed") } -func (o *evmTxStore) SaveSentAttempt(timeout time.Duration, attempt *TxAttempt, broadcastAt time.Time) error { - return saveSentAttempt(o.q, timeout, o.logger, attempt, broadcastAt) +func (o *evmTxStore) SaveSentAttempt(ctx context.Context, timeout time.Duration, attempt *TxAttempt, broadcastAt time.Time) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) + return saveSentAttempt(qq, timeout, o.logger, attempt, broadcastAt) } func (o *evmTxStore) SaveConfirmedMissingReceiptAttempt(ctx context.Context, timeout time.Duration, attempt *TxAttempt, broadcastAt time.Time) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() qq := o.q.WithOpts(pg.WithParentCtx(ctx)) err := qq.Transaction(func(tx pg.Queryer) error { if err := saveSentAttempt(tx, timeout, o.logger, attempt, broadcastAt); err != nil { @@ -1053,8 +1135,10 @@ func (o *evmTxStore) SaveConfirmedMissingReceiptAttempt(ctx context.Context, tim } func (o *evmTxStore) DeleteInProgressAttempt(ctx context.Context, attempt TxAttempt) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() qq := o.q.WithOpts(pg.WithParentCtx(ctx)) - if attempt.State != txmgrtypes.TxAttemptInProgress { return errors.New("DeleteInProgressAttempt: expected attempt state to be in_progress") } @@ -1066,7 +1150,11 @@ func (o *evmTxStore) DeleteInProgressAttempt(ctx context.Context, attempt TxAtte } // SaveInProgressAttempt inserts or updates an attempt -func (o *evmTxStore) SaveInProgressAttempt(attempt *TxAttempt) error { +func (o *evmTxStore) SaveInProgressAttempt(ctx context.Context, attempt *TxAttempt) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) if attempt.State != txmgrtypes.TxAttemptInProgress { return errors.New("SaveInProgressAttempt failed: attempt state must be in_progress") } @@ -1074,16 +1162,16 @@ func (o *evmTxStore) SaveInProgressAttempt(attempt *TxAttempt) error { dbAttempt.FromTxAttempt(attempt) // Insert is the usual mode because the attempt is new if attempt.ID == 0 { - query, args, e := o.q.BindNamed(insertIntoEthTxAttemptsQuery, &dbAttempt) + query, args, e := qq.BindNamed(insertIntoEthTxAttemptsQuery, &dbAttempt) if e != nil { return pkgerrors.Wrap(e, "SaveInProgressAttempt failed to BindNamed") } - e = o.q.Get(&dbAttempt, query, args...) + e = qq.Get(&dbAttempt, query, args...) dbAttempt.ToTxAttempt(attempt) return pkgerrors.Wrap(e, "SaveInProgressAttempt failed to insert into evm.tx_attempts") } // Update only applies to case of insufficient eth and simply changes the state to in_progress - res, err := o.q.Exec(`UPDATE evm.tx_attempts SET state=$1, broadcast_before_block_num=$2 WHERE id=$3`, dbAttempt.State, dbAttempt.BroadcastBeforeBlockNum, dbAttempt.ID) + res, err := qq.Exec(`UPDATE evm.tx_attempts SET state=$1, broadcast_before_block_num=$2 WHERE id=$3`, dbAttempt.State, dbAttempt.BroadcastBeforeBlockNum, dbAttempt.ID) if err != nil { return pkgerrors.Wrap(err, "SaveInProgressAttempt failed to update evm.tx_attempts") } @@ -1106,6 +1194,9 @@ func (o *evmTxStore) FindTxsRequiringGasBump(ctx context.Context, address common if gasBumpThreshold == 0 { return } + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() qq := o.q.WithOpts(pg.WithParentCtx(ctx)) err = qq.Transaction(func(tx pg.Queryer) error { stmt := ` @@ -1121,7 +1212,7 @@ ORDER BY nonce ASC } etxs = make([]*Tx, len(dbEtxs)) dbEthTxsToEvmEthTxPtrs(dbEtxs, etxs) - err = o.LoadTxesAttempts(etxs, pg.WithQueryer(tx)) + err = o.LoadTxesAttempts(etxs, pg.WithParentCtx(ctx), pg.WithQueryer(tx)) return pkgerrors.Wrap(err, "FindEthTxsRequiringGasBump failed to load evm.tx_attempts") }, pg.OptReadOnlyTx()) return @@ -1130,8 +1221,11 @@ ORDER BY nonce ASC // FindTxsRequiringResubmissionDueToInsufficientFunds returns transactions // that need to be re-sent because they hit an out-of-eth error on a previous // block -func (o *evmTxStore) FindTxsRequiringResubmissionDueToInsufficientFunds(address common.Address, chainID *big.Int, qopts ...pg.QOpt) (etxs []*Tx, err error) { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) FindTxsRequiringResubmissionDueToInsufficientFunds(ctx context.Context, address common.Address, chainID *big.Int) (etxs []*Tx, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) err = qq.Transaction(func(tx pg.Queryer) error { var dbEtxs []DbEthTx err = tx.Select(&dbEtxs, ` @@ -1145,7 +1239,7 @@ ORDER BY nonce ASC } etxs = make([]*Tx, len(dbEtxs)) dbEthTxsToEvmEthTxPtrs(dbEtxs, etxs) - err = o.LoadTxesAttempts(etxs, pg.WithQueryer(tx)) + err = o.LoadTxesAttempts(etxs, pg.WithParentCtx(ctx), pg.WithQueryer(tx)) return pkgerrors.Wrap(err, "FindEthTxsRequiringResubmissionDueToInsufficientEth failed to load evm.tx_attempts") }, pg.OptReadOnlyTx()) return @@ -1158,8 +1252,11 @@ ORDER BY nonce ASC // // The job run will also be marked as errored in this case since we never got a // receipt and thus cannot pass on any transaction hash -func (o *evmTxStore) MarkOldTxesMissingReceiptAsErrored(blockNum int64, finalityDepth uint32, chainID *big.Int, qopts ...pg.QOpt) error { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, finalityDepth uint32, chainID *big.Int) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) // cutoffBlockNum is a block height // Any 'confirmed_missing_receipt' eth_tx with all attempts older than this block height will be marked as errored // We will not try to query for receipts for this transaction any more @@ -1249,8 +1346,11 @@ GROUP BY e.id }) } -func (o *evmTxStore) SaveReplacementInProgressAttempt(oldAttempt TxAttempt, replacementAttempt *TxAttempt, qopts ...pg.QOpt) error { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) SaveReplacementInProgressAttempt(ctx context.Context, oldAttempt TxAttempt, replacementAttempt *TxAttempt) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) if oldAttempt.State != txmgrtypes.TxAttemptInProgress || replacementAttempt.State != txmgrtypes.TxAttemptInProgress { return errors.New("expected attempts to be in_progress") } @@ -1274,17 +1374,22 @@ func (o *evmTxStore) SaveReplacementInProgressAttempt(oldAttempt TxAttempt, repl } // Finds earliest saved transaction that has yet to be broadcast from the given address -func (o *evmTxStore) FindNextUnstartedTransactionFromAddress(etx *Tx, fromAddress common.Address, chainID *big.Int, qopts ...pg.QOpt) error { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) FindNextUnstartedTransactionFromAddress(ctx context.Context, etx *Tx, fromAddress common.Address, chainID *big.Int) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) var dbEtx DbEthTx err := qq.Get(&dbEtx, `SELECT * FROM evm.txes WHERE from_address = $1 AND state = 'unstarted' AND evm_chain_id = $2 ORDER BY value ASC, created_at ASC, id ASC`, fromAddress, chainID.String()) dbEtx.ToTx(etx) return pkgerrors.Wrap(err, "failed to FindNextUnstartedTransactionFromAddress") } -func (o *evmTxStore) UpdateTxFatalError(etx *Tx, qopts ...pg.QOpt) error { - qq := o.q.WithOpts(qopts...) - +func (o *evmTxStore) UpdateTxFatalError(ctx context.Context, etx *Tx) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) if etx.State != txmgr.TxInProgress { return pkgerrors.Errorf("can only transition to fatal_error from in_progress, transaction is currently %s", etx.State) } @@ -1350,8 +1455,11 @@ func (o *evmTxStore) UpdateTxAttemptInProgressToBroadcast(etx *Tx, attempt TxAtt } // Updates eth tx from unstarted to in_progress and inserts in_progress eth attempt -func (o *evmTxStore) UpdateTxUnstartedToInProgress(etx *Tx, attempt *TxAttempt, qopts ...pg.QOpt) error { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) UpdateTxUnstartedToInProgress(ctx context.Context, etx *Tx, attempt *TxAttempt) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) if etx.Sequence == nil { return errors.New("in_progress transaction must have nonce") } @@ -1411,8 +1519,11 @@ func (o *evmTxStore) UpdateTxUnstartedToInProgress(etx *Tx, attempt *TxAttempt, // an unfinished state because something went screwy the last time. Most likely // the node crashed in the middle of the ProcessUnstartedEthTxs loop. // It may or may not have been broadcast to an eth node. -func (o *evmTxStore) GetTxInProgress(fromAddress common.Address, qopts ...pg.QOpt) (etx *Tx, err error) { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) GetTxInProgress(ctx context.Context, fromAddress common.Address) (etx *Tx, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) etx = new(Tx) if err != nil { return etx, pkgerrors.Wrap(err, "getInProgressEthTx failed") @@ -1427,7 +1538,7 @@ func (o *evmTxStore) GetTxInProgress(fromAddress common.Address, qopts ...pg.QOp return pkgerrors.Wrap(err, "GetTxInProgress failed while loading eth tx") } dbEtx.ToTx(etx) - if err = o.LoadTxAttempts(etx, pg.WithQueryer(tx)); err != nil { + if err = o.loadTxAttemptsAtomic(etx, pg.WithParentCtx(ctx), pg.WithQueryer(tx)); err != nil { return pkgerrors.Wrap(err, "GetTxInProgress failed while loading EthTxAttempts") } if len(etx.TxAttempts) != 1 || etx.TxAttempts[0].State != txmgrtypes.TxAttemptInProgress { @@ -1440,8 +1551,11 @@ func (o *evmTxStore) GetTxInProgress(fromAddress common.Address, qopts ...pg.QOp return etx, pkgerrors.Wrap(err, "getInProgressEthTx failed") } -func (o *evmTxStore) HasInProgressTransaction(account common.Address, chainID *big.Int, qopts ...pg.QOpt) (exists bool, err error) { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) HasInProgressTransaction(ctx context.Context, account common.Address, chainID *big.Int) (exists bool, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) err = qq.Get(&exists, `SELECT EXISTS(SELECT 1 FROM evm.txes WHERE state = 'in_progress' AND from_address = $1 AND evm_chain_id = $2)`, account, chainID.String()) return exists, pkgerrors.Wrap(err, "hasInProgressTransaction failed") } @@ -1466,25 +1580,31 @@ func (o *evmTxStore) UpdateKeyNextSequence(newNextNonce, currentNextNonce evmtyp }) } -func (o *evmTxStore) countTransactionsWithState(fromAddress common.Address, state txmgrtypes.TxState, chainID *big.Int, qopts ...pg.QOpt) (count uint32, err error) { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) countTransactionsWithState(ctx context.Context, fromAddress common.Address, state txmgrtypes.TxState, chainID *big.Int) (count uint32, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) err = qq.Get(&count, `SELECT count(*) FROM evm.txes WHERE from_address = $1 AND state = $2 AND evm_chain_id = $3`, fromAddress, state, chainID.String()) return count, pkgerrors.Wrap(err, "failed to countTransactionsWithState") } // CountUnconfirmedTransactions returns the number of unconfirmed transactions -func (o *evmTxStore) CountUnconfirmedTransactions(fromAddress common.Address, chainID *big.Int, qopts ...pg.QOpt) (count uint32, err error) { - return o.countTransactionsWithState(fromAddress, txmgr.TxUnconfirmed, chainID, qopts...) +func (o *evmTxStore) CountUnconfirmedTransactions(ctx context.Context, fromAddress common.Address, chainID *big.Int) (count uint32, err error) { + return o.countTransactionsWithState(ctx, fromAddress, txmgr.TxUnconfirmed, chainID) } // CountUnstartedTransactions returns the number of unconfirmed transactions -func (o *evmTxStore) CountUnstartedTransactions(fromAddress common.Address, chainID *big.Int, qopts ...pg.QOpt) (count uint32, err error) { - return o.countTransactionsWithState(fromAddress, txmgr.TxUnstarted, chainID, qopts...) +func (o *evmTxStore) CountUnstartedTransactions(ctx context.Context, fromAddress common.Address, chainID *big.Int) (count uint32, err error) { + return o.countTransactionsWithState(ctx, fromAddress, txmgr.TxUnstarted, chainID) } -func (o *evmTxStore) CheckTxQueueCapacity(fromAddress common.Address, maxQueuedTransactions uint64, chainID *big.Int, qopts ...pg.QOpt) (err error) { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) CheckTxQueueCapacity(ctx context.Context, fromAddress common.Address, maxQueuedTransactions uint64, chainID *big.Int) (err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) if maxQueuedTransactions == 0 { return nil } @@ -1501,9 +1621,12 @@ func (o *evmTxStore) CheckTxQueueCapacity(fromAddress common.Address, maxQueuedT return } -func (o *evmTxStore) CreateTransaction(txRequest TxRequest, chainID *big.Int, qopts ...pg.QOpt) (tx Tx, err error) { +func (o *evmTxStore) CreateTransaction(ctx context.Context, txRequest TxRequest, chainID *big.Int) (tx Tx, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) var dbEtx DbEthTx - qq := o.q.WithOpts(qopts...) err = qq.Transaction(func(tx pg.Queryer) error { if txRequest.PipelineTaskRunID != nil { @@ -1528,7 +1651,7 @@ RETURNING "txes".* return pkgerrors.Wrap(err, "CreateEthTransaction failed to insert evm tx") } var pruned int64 - pruned, err = txRequest.Strategy.PruneQueue(o, pg.WithQueryer(tx)) + pruned, err = txRequest.Strategy.PruneQueue(ctx, o) if err != nil { return pkgerrors.Wrap(err, "CreateEthTransaction failed to prune evm.txes") } @@ -1542,8 +1665,11 @@ RETURNING "txes".* return etx, err } -func (o *evmTxStore) PruneUnstartedTxQueue(queueSize uint32, subject uuid.UUID, qopts ...pg.QOpt) (n int64, err error) { - qq := o.q.WithOpts(qopts...) +func (o *evmTxStore) PruneUnstartedTxQueue(ctx context.Context, queueSize uint32, subject uuid.UUID) (n int64, err error) { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) err = qq.Transaction(func(tx pg.Queryer) error { res, err := qq.Exec(` DELETE FROM evm.txes @@ -1566,12 +1692,16 @@ id < ( return } -func (o *evmTxStore) ReapTxHistory(minBlockNumberToKeep int64, timeThreshold time.Time, chainID *big.Int) error { +func (o *evmTxStore) ReapTxHistory(ctx context.Context, minBlockNumberToKeep int64, timeThreshold time.Time, chainID *big.Int) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) // Delete old confirmed evm.txes // NOTE that this relies on foreign key triggers automatically removing // the evm.tx_attempts and evm.receipts linked to every eth_tx err := pg.Batch(func(_, limit uint) (count uint, err error) { - res, err := o.q.Exec(` + res, err := qq.Exec(` WITH old_enough_receipts AS ( SELECT tx_hash FROM evm.receipts WHERE block_number < $1 @@ -1599,7 +1729,7 @@ AND evm_chain_id = $4`, minBlockNumberToKeep, limit, timeThreshold, chainID.Stri } // Delete old 'fatal_error' evm.txes err = pg.Batch(func(_, limit uint) (count uint, err error) { - res, err := o.q.Exec(` + res, err := qq.Exec(` DELETE FROM evm.txes WHERE created_at < $1 AND state = 'fatal_error' @@ -1620,7 +1750,25 @@ AND evm_chain_id = $2`, timeThreshold, chainID.String()) return nil } -func (o *evmTxStore) Abandon(chainID *big.Int, addr common.Address) error { - _, err := o.q.Exec(`UPDATE evm.txes SET state='fatal_error', nonce = NULL, error = 'abandoned' WHERE state IN ('unconfirmed', 'in_progress', 'unstarted') AND evm_chain_id = $1 AND from_address = $2`, chainID.String(), addr) +func (o *evmTxStore) Abandon(ctx context.Context, chainID *big.Int, addr common.Address) error { + var cancel context.CancelFunc + ctx, cancel = o.mergeContexts(ctx) + defer cancel() + qq := o.q.WithOpts(pg.WithParentCtx(ctx)) + _, err := qq.Exec(`UPDATE evm.txes SET state='fatal_error', nonce = NULL, error = 'abandoned' WHERE state IN ('unconfirmed', 'in_progress', 'unstarted') AND evm_chain_id = $1 AND from_address = $2`, chainID.String(), addr) return err } + +// Returns a context that contains the values of the provided context, +// and which is canceled when either the provided contextg or TxStore parent context is canceled. +func (o *evmTxStore) mergeContexts(ctx context.Context) (context.Context, context.CancelFunc) { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + stop := context.AfterFunc(o.q.ParentCtx, func() { + cancel(context.Cause(o.q.ParentCtx)) + }) + return ctx, func() { + stop() + cancel(context.Canceled) + } +} diff --git a/core/chains/evm/txmgr/evm_tx_store_test.go b/core/chains/evm/txmgr/evm_tx_store_test.go index 913652b7c8b..cc990de1bd4 100644 --- a/core/chains/evm/txmgr/evm_tx_store_test.go +++ b/core/chains/evm/txmgr/evm_tx_store_test.go @@ -1,7 +1,6 @@ package txmgr_test import ( - "context" "database/sql" "fmt" "math/big" @@ -248,7 +247,7 @@ func TestORM_FindTxAttemptsRequiringResend(t *testing.T) { t.Run("returns nothing if there are no transactions", func(t *testing.T) { olderThan := time.Now() - attempts, err := txStore.FindTxAttemptsRequiringResend(olderThan, 10, &cltest.FixtureChainID, fromAddress) + attempts, err := txStore.FindTxAttemptsRequiringResend(testutils.Context(t), olderThan, 10, &cltest.FixtureChainID, fromAddress) require.NoError(t, err) assert.Len(t, attempts, 0) }) @@ -291,14 +290,14 @@ func TestORM_FindTxAttemptsRequiringResend(t *testing.T) { t.Run("returns nothing if there are transactions from a different key", func(t *testing.T) { olderThan := time.Now() - attempts, err := txStore.FindTxAttemptsRequiringResend(olderThan, 10, &cltest.FixtureChainID, utils.RandomAddress()) + attempts, err := txStore.FindTxAttemptsRequiringResend(testutils.Context(t), olderThan, 10, &cltest.FixtureChainID, utils.RandomAddress()) require.NoError(t, err) assert.Len(t, attempts, 0) }) t.Run("returns the highest price attempt for each transaction that was last broadcast before or on the given time", func(t *testing.T) { olderThan := time.Unix(1616509200, 0) - attempts, err := txStore.FindTxAttemptsRequiringResend(olderThan, 0, &cltest.FixtureChainID, fromAddress) + attempts, err := txStore.FindTxAttemptsRequiringResend(testutils.Context(t), olderThan, 0, &cltest.FixtureChainID, fromAddress) require.NoError(t, err) assert.Len(t, attempts, 2) assert.Equal(t, attempt1_2.ID, attempts[0].ID) @@ -307,7 +306,7 @@ func TestORM_FindTxAttemptsRequiringResend(t *testing.T) { t.Run("returns the highest price attempt for EIP-1559 transactions", func(t *testing.T) { olderThan := time.Unix(1616509400, 0) - attempts, err := txStore.FindTxAttemptsRequiringResend(olderThan, 0, &cltest.FixtureChainID, fromAddress) + attempts, err := txStore.FindTxAttemptsRequiringResend(testutils.Context(t), olderThan, 0, &cltest.FixtureChainID, fromAddress) require.NoError(t, err) assert.Len(t, attempts, 4) assert.Equal(t, attempt4_4.ID, attempts[3].ID) @@ -315,7 +314,7 @@ func TestORM_FindTxAttemptsRequiringResend(t *testing.T) { t.Run("applies limit", func(t *testing.T) { olderThan := time.Unix(1616509200, 0) - attempts, err := txStore.FindTxAttemptsRequiringResend(olderThan, 1, &cltest.FixtureChainID, fromAddress) + attempts, err := txStore.FindTxAttemptsRequiringResend(testutils.Context(t), olderThan, 1, &cltest.FixtureChainID, fromAddress) require.NoError(t, err) assert.Len(t, attempts, 1) assert.Equal(t, attempt1_2.ID, attempts[0].ID) @@ -340,7 +339,7 @@ func TestORM_UpdateBroadcastAts(t *testing.T) { assert.Equal(t, nullTime, etx.BroadcastAt) currTime := time.Now() - err := orm.UpdateBroadcastAts(currTime, []int64{etx.ID}) + err := orm.UpdateBroadcastAts(testutils.Context(t), currTime, []int64{etx.ID}) require.NoError(t, err) etx, err = orm.FindTxWithAttempts(etx.ID) @@ -361,7 +360,7 @@ func TestORM_UpdateBroadcastAts(t *testing.T) { require.NoError(t, err) time2 := time.Date(2077, 8, 14, 10, 0, 0, 0, time.UTC) - err = orm.UpdateBroadcastAts(time2, []int64{etx.ID}) + err = orm.UpdateBroadcastAts(testutils.Context(t), time2, []int64{etx.ID}) require.NoError(t, err) etx, err = orm.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -387,7 +386,7 @@ func TestORM_SetBroadcastBeforeBlockNum(t *testing.T) { t.Run("saves block num to unconfirmed evm.tx_attempts without one", func(t *testing.T) { // Do the thing - require.NoError(t, txStore.SetBroadcastBeforeBlockNum(headNum, chainID)) + require.NoError(t, txStore.SetBroadcastBeforeBlockNum(testutils.Context(t), headNum, chainID)) etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -404,7 +403,7 @@ func TestORM_SetBroadcastBeforeBlockNum(t *testing.T) { require.NoError(t, txStore.InsertTxAttempt(&attempt)) // Do the thing - require.NoError(t, txStore.SetBroadcastBeforeBlockNum(headNum, chainID)) + require.NoError(t, txStore.SetBroadcastBeforeBlockNum(testutils.Context(t), headNum, chainID)) etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -420,7 +419,7 @@ func TestORM_SetBroadcastBeforeBlockNum(t *testing.T) { etxThisChain := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 1, fromAddress, cfg.EVM().ChainID()) etxOtherChain := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 0, fromAddress, testutils.SimulatedChainID) - require.NoError(t, txStore.SetBroadcastBeforeBlockNum(headNum, chainID)) + require.NoError(t, txStore.SetBroadcastBeforeBlockNum(testutils.Context(t), headNum, chainID)) etxThisChain, err = txStore.FindTxWithAttempts(etxThisChain.ID) require.NoError(t, err) @@ -452,7 +451,7 @@ func TestORM_FindTxAttemptsConfirmedMissingReceipt(t *testing.T) { etx0 := cltest.MustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt( t, txStore, 0, 1, originalBroadcastAt, fromAddress) - attempts, err := txStore.FindTxAttemptsConfirmedMissingReceipt(ethClient.ConfiguredChainID()) + attempts, err := txStore.FindTxAttemptsConfirmedMissingReceipt(testutils.Context(t), ethClient.ConfiguredChainID()) require.NoError(t, err) @@ -474,7 +473,7 @@ func TestORM_UpdateTxsUnconfirmed(t *testing.T) { etx0 := cltest.MustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt( t, txStore, 0, 1, originalBroadcastAt, fromAddress) assert.Equal(t, etx0.State, txmgrcommon.TxConfirmedMissingReceipt) - require.NoError(t, txStore.UpdateTxsUnconfirmed([]int64{etx0.ID})) + require.NoError(t, txStore.UpdateTxsUnconfirmed(testutils.Context(t), []int64{etx0.ID})) etx0, err := txStore.FindTxWithAttempts(etx0.ID) require.NoError(t, err) @@ -495,7 +494,7 @@ func TestORM_FindTxAttemptsRequiringReceiptFetch(t *testing.T) { etx0 := cltest.MustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt( t, txStore, 0, 1, originalBroadcastAt, fromAddress) - attempts, err := txStore.FindTxAttemptsRequiringReceiptFetch(ethClient.ConfiguredChainID()) + attempts, err := txStore.FindTxAttemptsRequiringReceiptFetch(testutils.Context(t), ethClient.ConfiguredChainID()) require.NoError(t, err) assert.Len(t, attempts, 1) assert.Len(t, etx0.TxAttempts, 1) @@ -525,7 +524,7 @@ func TestORM_SaveFetchedReceipts(t *testing.T) { TransactionIndex: uint(1), } - err := txStore.SaveFetchedReceipts([]*evmtypes.Receipt{&txmReceipt}, ethClient.ConfiguredChainID()) + err := txStore.SaveFetchedReceipts(testutils.Context(t), []*evmtypes.Receipt{&txmReceipt}, ethClient.ConfiguredChainID()) require.NoError(t, err) etx0, err = txStore.FindTxWithAttempts(etx0.ID) @@ -559,7 +558,7 @@ func TestORM_MarkAllConfirmedMissingReceipt(t *testing.T) { assert.Equal(t, etx1.State, txmgrcommon.TxConfirmed) // mark transaction 0 confirmed_missing_receipt - err := txStore.MarkAllConfirmedMissingReceipt(ethClient.ConfiguredChainID()) + err := txStore.MarkAllConfirmedMissingReceipt(testutils.Context(t), ethClient.ConfiguredChainID()) require.NoError(t, err) etx0, err = txStore.FindTxWithAttempts(etx0.ID) require.NoError(t, err) @@ -587,7 +586,7 @@ func TestORM_PreloadTxes(t *testing.T) { attempts := []txmgr.TxAttempt{unloadedAttempt} - err := txStore.PreloadTxes(attempts) + err := txStore.PreloadTxes(testutils.Context(t), attempts) require.NoError(t, err) assert.Equal(t, etx.ID, attempts[0].Tx.ID) @@ -595,7 +594,7 @@ func TestORM_PreloadTxes(t *testing.T) { t.Run("returns nil when attempts slice is empty", func(t *testing.T) { emptyAttempts := []txmgr.TxAttempt{} - err := txStore.PreloadTxes(emptyAttempts) + err := txStore.PreloadTxes(testutils.Context(t), emptyAttempts) require.NoError(t, err) }) } @@ -614,7 +613,7 @@ func TestORM_GetInProgressTxAttempts(t *testing.T) { etx := cltest.MustInsertUnconfirmedEthTxWithAttemptState(t, txStore, int64(7), fromAddress, txmgrtypes.TxAttemptInProgress) // fetch attempt - attempts, err := txStore.GetInProgressTxAttempts(context.Background(), fromAddress, ethClient.ConfiguredChainID()) + attempts, err := txStore.GetInProgressTxAttempts(testutils.Context(t), fromAddress, ethClient.ConfiguredChainID()) require.NoError(t, err) assert.Len(t, attempts, 1) @@ -676,7 +675,7 @@ func Test_FindTxWithIdempotencyKey(t *testing.T) { t.Run("returns nil if no results", func(t *testing.T) { idempotencyKey := "777" - etx, err := txStore.FindTxWithIdempotencyKey(idempotencyKey, big.NewInt(0)) + etx, err := txStore.FindTxWithIdempotencyKey(testutils.Context(t), idempotencyKey, big.NewInt(0)) require.NoError(t, err) assert.Nil(t, etx) }) @@ -688,7 +687,7 @@ func Test_FindTxWithIdempotencyKey(t *testing.T) { cltest.EvmTxRequestWithIdempotencyKey(idempotencyKey)) require.Equal(t, idempotencyKey, *etx.IdempotencyKey) - res, err := txStore.FindTxWithIdempotencyKey(idempotencyKey, big.NewInt(0)) + res, err := txStore.FindTxWithIdempotencyKey(testutils.Context(t), idempotencyKey, big.NewInt(0)) require.NoError(t, err) assert.Equal(t, etx.Sequence, res.Sequence) require.Equal(t, idempotencyKey, *res.IdempotencyKey) @@ -705,7 +704,7 @@ func TestORM_FindTxWithSequence(t *testing.T) { _, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore, 0) t.Run("returns nil if no results", func(t *testing.T) { - etx, err := txStore.FindTxWithSequence(fromAddress, evmtypes.Nonce(777)) + etx, err := txStore.FindTxWithSequence(testutils.Context(t), fromAddress, evmtypes.Nonce(777)) require.NoError(t, err) assert.Nil(t, etx) }) @@ -714,7 +713,7 @@ func TestORM_FindTxWithSequence(t *testing.T) { etx := cltest.MustInsertConfirmedEthTxWithLegacyAttempt(t, txStore, 777, 1, fromAddress) require.Equal(t, evmtypes.Nonce(777), *etx.Sequence) - res, err := txStore.FindTxWithSequence(fromAddress, evmtypes.Nonce(777)) + res, err := txStore.FindTxWithSequence(testutils.Context(t), fromAddress, evmtypes.Nonce(777)) require.NoError(t, err) assert.Equal(t, etx.Sequence, res.Sequence) }) @@ -742,7 +741,7 @@ func TestORM_UpdateTxForRebroadcast(t *testing.T) { assert.Len(t, etx.TxAttempts[0].Receipts, 1) // use exported method - err = txStore.UpdateTxForRebroadcast(etx, attempt) + err = txStore.UpdateTxForRebroadcast(testutils.Context(t), etx, attempt) require.NoError(t, err) resultTx, err := txStore.FindTxWithAttempts(etx.ID) @@ -788,7 +787,7 @@ func TestORM_FindTransactionsConfirmedInBlockRange(t *testing.T) { etx_8 := cltest.MustInsertConfirmedEthTxWithReceipt(t, txStore, fromAddress, 700, 8) etx_9 := cltest.MustInsertConfirmedEthTxWithReceipt(t, txStore, fromAddress, 777, 9) - etxes, err := txStore.FindTransactionsConfirmedInBlockRange(head.Number, 8, ethClient.ConfiguredChainID()) + etxes, err := txStore.FindTransactionsConfirmedInBlockRange(testutils.Context(t), head.Number, 8, ethClient.ConfiguredChainID()) require.NoError(t, err) assert.Len(t, etxes, 2) assert.Equal(t, etxes[0].Sequence, etx_8.Sequence) @@ -811,7 +810,7 @@ func TestORM_SaveInsufficientEthAttempt(t *testing.T) { etx := cltest.MustInsertInProgressEthTxWithAttempt(t, txStore, 1, fromAddress) now := time.Now() - err = txStore.SaveInsufficientFundsAttempt(defaultDuration, &etx.TxAttempts[0], now) + err = txStore.SaveInsufficientFundsAttempt(testutils.Context(t), defaultDuration, &etx.TxAttempts[0], now) require.NoError(t, err) attempt, err := txStore.FindTxAttempt(etx.TxAttempts[0].Hash) @@ -836,7 +835,7 @@ func TestORM_SaveSentAttempt(t *testing.T) { require.Nil(t, etx.BroadcastAt) now := time.Now() - err = txStore.SaveSentAttempt(defaultDuration, &etx.TxAttempts[0], now) + err = txStore.SaveSentAttempt(testutils.Context(t), defaultDuration, &etx.TxAttempts[0], now) require.NoError(t, err) attempt, err := txStore.FindTxAttempt(etx.TxAttempts[0].Hash) @@ -860,7 +859,7 @@ func TestORM_SaveConfirmedMissingReceiptAttempt(t *testing.T) { etx := cltest.MustInsertUnconfirmedEthTxWithAttemptState(t, txStore, 1, fromAddress, txmgrtypes.TxAttemptInProgress) now := time.Now() - err = txStore.SaveConfirmedMissingReceiptAttempt(context.Background(), defaultDuration, &etx.TxAttempts[0], now) + err = txStore.SaveConfirmedMissingReceiptAttempt(testutils.Context(t), defaultDuration, &etx.TxAttempts[0], now) require.NoError(t, err) etx, err := txStore.FindTxWithAttempts(etx.ID) @@ -907,7 +906,7 @@ func TestORM_SaveInProgressAttempt(t *testing.T) { attempt := cltest.NewLegacyEthTxAttempt(t, etx.ID) require.Equal(t, int64(0), attempt.ID) - err := txStore.SaveInProgressAttempt(&attempt) + err := txStore.SaveInProgressAttempt(testutils.Context(t), &attempt) require.NoError(t, err) attemptResult, err := txStore.FindTxAttempt(attempt.Hash) @@ -923,7 +922,7 @@ func TestORM_SaveInProgressAttempt(t *testing.T) { attempt.BroadcastBeforeBlockNum = nil attempt.State = txmgrtypes.TxAttemptInProgress - err := txStore.SaveInProgressAttempt(&attempt) + err := txStore.SaveInProgressAttempt(testutils.Context(t), &attempt) require.NoError(t, err) attemptResult, err := txStore.FindTxAttempt(attempt.Hash) @@ -947,7 +946,7 @@ func TestORM_FindTxsRequiringGasBump(t *testing.T) { t.Run("gets txs requiring gas bump", func(t *testing.T) { etx := cltest.MustInsertUnconfirmedEthTxWithAttemptState(t, txStore, 1, fromAddress, txmgrtypes.TxAttemptBroadcast) - err := txStore.SetBroadcastBeforeBlockNum(currentBlockNum, ethClient.ConfiguredChainID()) + err := txStore.SetBroadcastBeforeBlockNum(testutils.Context(t), currentBlockNum, ethClient.ConfiguredChainID()) require.NoError(t, err) // this tx will require gas bump @@ -960,13 +959,13 @@ func TestORM_FindTxsRequiringGasBump(t *testing.T) { // this tx will not require gas bump cltest.MustInsertUnconfirmedEthTxWithAttemptState(t, txStore, 2, fromAddress, txmgrtypes.TxAttemptBroadcast) - err = txStore.SetBroadcastBeforeBlockNum(currentBlockNum+1, ethClient.ConfiguredChainID()) + err = txStore.SetBroadcastBeforeBlockNum(testutils.Context(t), currentBlockNum+1, ethClient.ConfiguredChainID()) require.NoError(t, err) // any tx broadcast <= 10 will require gas bump newBlock := int64(12) gasBumpThreshold := int64(2) - etxs, err := txStore.FindTxsRequiringGasBump(context.Background(), fromAddress, newBlock, gasBumpThreshold, int64(0), ethClient.ConfiguredChainID()) + etxs, err := txStore.FindTxsRequiringGasBump(testutils.Context(t), fromAddress, newBlock, gasBumpThreshold, int64(0), ethClient.ConfiguredChainID()) require.NoError(t, err) assert.Len(t, etxs, 1) assert.Equal(t, etx.ID, etxs[0].ID) @@ -1000,7 +999,7 @@ func TestEthConfirmer_FindTxsRequiringResubmissionDueToInsufficientEth(t *testin cltest.MustInsertUnconfirmedEthTxWithInsufficientEthAttempt(t, txStore, 0, otherAddress) t.Run("returns all eth_txes with at least one attempt that is in insufficient_eth state", func(t *testing.T) { - etxs, err := txStore.FindTxsRequiringResubmissionDueToInsufficientFunds(fromAddress, &cltest.FixtureChainID) + etxs, err := txStore.FindTxsRequiringResubmissionDueToInsufficientFunds(testutils.Context(t), fromAddress, &cltest.FixtureChainID) require.NoError(t, err) assert.Len(t, etxs, 3) @@ -1014,7 +1013,7 @@ func TestEthConfirmer_FindTxsRequiringResubmissionDueToInsufficientEth(t *testin }) t.Run("does not return eth_txes with different chain ID", func(t *testing.T) { - etxs, err := txStore.FindTxsRequiringResubmissionDueToInsufficientFunds(fromAddress, big.NewInt(42)) + etxs, err := txStore.FindTxsRequiringResubmissionDueToInsufficientFunds(testutils.Context(t), fromAddress, big.NewInt(42)) require.NoError(t, err) assert.Len(t, etxs, 0) @@ -1024,7 +1023,7 @@ func TestEthConfirmer_FindTxsRequiringResubmissionDueToInsufficientEth(t *testin pgtest.MustExec(t, db, `UPDATE evm.txes SET state='confirmed' WHERE id = $1`, etx1.ID) pgtest.MustExec(t, db, `UPDATE evm.txes SET state='fatal_error', nonce=NULL, error='foo', broadcast_at=NULL, initial_broadcast_at=NULL WHERE id = $1`, etx2.ID) - etxs, err := txStore.FindTxsRequiringResubmissionDueToInsufficientFunds(fromAddress, &cltest.FixtureChainID) + etxs, err := txStore.FindTxsRequiringResubmissionDueToInsufficientFunds(testutils.Context(t), fromAddress, &cltest.FixtureChainID) require.NoError(t, err) assert.Len(t, etxs, 1) @@ -1049,7 +1048,7 @@ func TestORM_MarkOldTxesMissingReceiptAsErrored(t *testing.T) { t.Run("successfully mark errored transactions", func(t *testing.T) { etx := cltest.MustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt(t, txStore, 1, 7, time.Now(), fromAddress) - err := txStore.MarkOldTxesMissingReceiptAsErrored(10, 2, ethClient.ConfiguredChainID()) + err := txStore.MarkOldTxesMissingReceiptAsErrored(testutils.Context(t), 10, 2, ethClient.ConfiguredChainID()) require.NoError(t, err) etx, err = txStore.FindTxWithAttempts(etx.ID) @@ -1058,14 +1057,8 @@ func TestORM_MarkOldTxesMissingReceiptAsErrored(t *testing.T) { }) t.Run("successfully mark errored transactions w/ qopt passing in sql.Tx", func(t *testing.T) { - q := pg.NewQ(db, logger.TestLogger(t), cfg.Database()) - etx := cltest.MustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt(t, txStore, 1, 7, time.Now(), fromAddress) - err := q.Transaction(func(q pg.Queryer) error { - err := txStore.MarkOldTxesMissingReceiptAsErrored(10, 2, ethClient.ConfiguredChainID(), pg.WithQueryer(q)) - require.NoError(t, err) - return nil - }) + err := txStore.MarkOldTxesMissingReceiptAsErrored(testutils.Context(t), 10, 2, ethClient.ConfiguredChainID()) require.NoError(t, err) // must run other query outside of postgres transaction so changes are committed @@ -1138,7 +1131,7 @@ func TestORM_SaveReplacementInProgressAttempt(t *testing.T) { oldAttempt := etx.TxAttempts[0] newAttempt := cltest.NewDynamicFeeEthTxAttempt(t, etx.ID) - err := txStore.SaveReplacementInProgressAttempt(oldAttempt, &newAttempt) + err := txStore.SaveReplacementInProgressAttempt(testutils.Context(t), oldAttempt, &newAttempt) require.NoError(t, err) etx, err = txStore.FindTxWithAttempts(etx.ID) @@ -1163,14 +1156,14 @@ func TestORM_FindNextUnstartedTransactionFromAddress(t *testing.T) { cltest.MustInsertInProgressEthTxWithAttempt(t, txStore, 13, fromAddress) resultEtx := new(txmgr.Tx) - err := txStore.FindNextUnstartedTransactionFromAddress(resultEtx, fromAddress, ethClient.ConfiguredChainID()) + err := txStore.FindNextUnstartedTransactionFromAddress(testutils.Context(t), resultEtx, fromAddress, ethClient.ConfiguredChainID()) assert.ErrorIs(t, err, sql.ErrNoRows) }) t.Run("finds unstarted tx", func(t *testing.T) { cltest.MustCreateUnstartedGeneratedTx(t, txStore, fromAddress, &cltest.FixtureChainID) resultEtx := new(txmgr.Tx) - err := txStore.FindNextUnstartedTransactionFromAddress(resultEtx, fromAddress, ethClient.ConfiguredChainID()) + err := txStore.FindNextUnstartedTransactionFromAddress(testutils.Context(t), resultEtx, fromAddress, ethClient.ConfiguredChainID()) require.NoError(t, err) }) } @@ -1190,7 +1183,7 @@ func TestORM_UpdateTxFatalError(t *testing.T) { etxPretendError := null.StringFrom("no more toilet paper") etx.Error = etxPretendError - err := txStore.UpdateTxFatalError(&etx) + err := txStore.UpdateTxFatalError(testutils.Context(t), &etx) require.NoError(t, err) etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -1248,7 +1241,7 @@ func TestORM_UpdateTxUnstartedToInProgress(t *testing.T) { etx.Sequence = &nonce attempt := cltest.NewLegacyEthTxAttempt(t, etx.ID) - err := txStore.UpdateTxUnstartedToInProgress(&etx, &attempt) + err := txStore.UpdateTxUnstartedToInProgress(testutils.Context(t), &etx, &attempt) require.NoError(t, err) etx, err = txStore.FindTxWithAttempts(etx.ID) @@ -1266,7 +1259,7 @@ func TestORM_UpdateTxUnstartedToInProgress(t *testing.T) { err := q.ExecQ("DELETE FROM evm.txes WHERE id = $1", etx.ID) require.NoError(t, err) - err = txStore.UpdateTxUnstartedToInProgress(&etx, &attempt) + err = txStore.UpdateTxUnstartedToInProgress(testutils.Context(t), &etx, &attempt) require.ErrorContains(t, err, "tx removed") }) @@ -1303,7 +1296,7 @@ func TestORM_UpdateTxUnstartedToInProgress(t *testing.T) { // Even though this will initially fail due to idx_eth_tx_attempts_hash constraint, because the conflicting tx has been abandoned // it should succeed after removing the abandoned attempt and retrying the insert - err = txStore.UpdateTxUnstartedToInProgress(&etx2, &attempt2) + err = txStore.UpdateTxUnstartedToInProgress(testutils.Context(t), &etx2, &attempt2) require.NoError(t, err) }) @@ -1317,7 +1310,7 @@ func TestORM_UpdateTxUnstartedToInProgress(t *testing.T) { etx.State = txmgrcommon.TxUnstarted // Should fail due to idx_eth_tx_attempt_hash constraint - err := txStore.UpdateTxUnstartedToInProgress(&etx, &etx.TxAttempts[0]) + err := txStore.UpdateTxUnstartedToInProgress(testutils.Context(t), &etx, &etx.TxAttempts[0]) assert.ErrorContains(t, err, "idx_eth_tx_attempts_hash") txStore = cltest.NewTestTxStore(t, db, cfg.Database()) // current txStore is poisened now, next test will need fresh one }) @@ -1333,7 +1326,7 @@ func TestORM_GetTxInProgress(t *testing.T) { _, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore, 0) t.Run("gets 0 in progress eth transaction", func(t *testing.T) { - etxResult, err := txStore.GetTxInProgress(fromAddress) + etxResult, err := txStore.GetTxInProgress(testutils.Context(t), fromAddress) require.NoError(t, err) require.Nil(t, etxResult) }) @@ -1341,7 +1334,7 @@ func TestORM_GetTxInProgress(t *testing.T) { t.Run("get 1 in progress eth transaction", func(t *testing.T) { etx := cltest.MustInsertInProgressEthTxWithAttempt(t, txStore, 123, fromAddress) - etxResult, err := txStore.GetTxInProgress(fromAddress) + etxResult, err := txStore.GetTxInProgress(testutils.Context(t), fromAddress) require.NoError(t, err) assert.Equal(t, etxResult.ID, etx.ID) }) @@ -1358,7 +1351,7 @@ func TestORM_HasInProgressTransaction(t *testing.T) { _, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore, 0) t.Run("no in progress eth transaction", func(t *testing.T) { - exists, err := txStore.HasInProgressTransaction(fromAddress, ethClient.ConfiguredChainID()) + exists, err := txStore.HasInProgressTransaction(testutils.Context(t), fromAddress, ethClient.ConfiguredChainID()) require.NoError(t, err) require.False(t, exists) }) @@ -1366,7 +1359,7 @@ func TestORM_HasInProgressTransaction(t *testing.T) { t.Run("has in progress eth transaction", func(t *testing.T) { cltest.MustInsertInProgressEthTxWithAttempt(t, txStore, 123, fromAddress) - exists, err := txStore.HasInProgressTransaction(fromAddress, ethClient.ConfiguredChainID()) + exists, err := txStore.HasInProgressTransaction(testutils.Context(t), fromAddress, ethClient.ConfiguredChainID()) require.NoError(t, err) require.True(t, exists) }) @@ -1414,7 +1407,7 @@ func TestORM_CountUnconfirmedTransactions(t *testing.T) { cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 1, fromAddress) cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 2, fromAddress) - count, err := txStore.CountUnconfirmedTransactions(fromAddress, &cltest.FixtureChainID) + count, err := txStore.CountUnconfirmedTransactions(testutils.Context(t), fromAddress, &cltest.FixtureChainID) require.NoError(t, err) assert.Equal(t, int(count), 3) } @@ -1435,7 +1428,7 @@ func TestORM_CountUnstartedTransactions(t *testing.T) { cltest.MustCreateUnstartedGeneratedTx(t, txStore, otherAddress, &cltest.FixtureChainID) cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 2, fromAddress) - count, err := txStore.CountUnstartedTransactions(fromAddress, &cltest.FixtureChainID) + count, err := txStore.CountUnstartedTransactions(testutils.Context(t), fromAddress, &cltest.FixtureChainID) require.NoError(t, err) assert.Equal(t, int(count), 2) } @@ -1458,7 +1451,7 @@ func TestORM_CheckTxQueueCapacity(t *testing.T) { var maxUnconfirmedTransactions uint64 = 2 t.Run("with no eth_txes returns nil", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) require.NoError(t, err) }) @@ -1468,7 +1461,7 @@ func TestORM_CheckTxQueueCapacity(t *testing.T) { } t.Run("with eth_txes from another address returns nil", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) require.NoError(t, err) }) @@ -1477,7 +1470,7 @@ func TestORM_CheckTxQueueCapacity(t *testing.T) { } t.Run("ignores fatally_errored transactions", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) require.NoError(t, err) }) @@ -1488,7 +1481,7 @@ func TestORM_CheckTxQueueCapacity(t *testing.T) { n++ t.Run("unconfirmed and in_progress transactions do not count", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, 1, &cltest.FixtureChainID) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, 1, &cltest.FixtureChainID) require.NoError(t, err) }) @@ -1499,7 +1492,7 @@ func TestORM_CheckTxQueueCapacity(t *testing.T) { } t.Run("with many confirmed eth_txes from the same address returns nil", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) require.NoError(t, err) }) @@ -1508,30 +1501,30 @@ func TestORM_CheckTxQueueCapacity(t *testing.T) { } t.Run("with fewer unstarted eth_txes than limit returns nil", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) require.NoError(t, err) }) cltest.MustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, feeLimit, value, &cltest.FixtureChainID) t.Run("with equal or more unstarted eth_txes than limit returns error", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) require.Error(t, err) require.Contains(t, err.Error(), fmt.Sprintf("cannot create transaction; too many unstarted transactions in the queue (2/%d). WARNING: Hitting EVM.Transactions.MaxQueued", maxUnconfirmedTransactions)) cltest.MustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, feeLimit, value, &cltest.FixtureChainID) - err = txStore.CheckTxQueueCapacity(fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) + err = txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, maxUnconfirmedTransactions, &cltest.FixtureChainID) require.Error(t, err) require.Contains(t, err.Error(), fmt.Sprintf("cannot create transaction; too many unstarted transactions in the queue (3/%d). WARNING: Hitting EVM.Transactions.MaxQueued", maxUnconfirmedTransactions)) }) t.Run("with different chain ID ignores txes", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, maxUnconfirmedTransactions, big.NewInt(42)) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, maxUnconfirmedTransactions, big.NewInt(42)) require.NoError(t, err) }) t.Run("disables check with 0 limit", func(t *testing.T) { - err := txStore.CheckTxQueueCapacity(fromAddress, 0, &cltest.FixtureChainID) + err := txStore.CheckTxQueueCapacity(testutils.Context(t), fromAddress, 0, &cltest.FixtureChainID) require.NoError(t, err) }) } @@ -1555,8 +1548,8 @@ func TestORM_CreateTransaction(t *testing.T) { subject := uuid.New() strategy := newMockTxStrategy(t) strategy.On("Subject").Return(uuid.NullUUID{UUID: subject, Valid: true}) - strategy.On("PruneQueue", mock.AnythingOfType("*txmgr.evmTxStore"), mock.AnythingOfType("pg.QOpt")).Return(int64(0), nil) - etx, err := txStore.CreateTransaction(txmgr.TxRequest{ + strategy.On("PruneQueue", mock.Anything, mock.AnythingOfType("*txmgr.evmTxStore")).Return(int64(0), nil) + etx, err := txStore.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -1599,10 +1592,10 @@ func TestORM_CreateTransaction(t *testing.T) { PipelineTaskRunID: &id, Strategy: txmgrcommon.NewSendEveryStrategy(), } - tx1, err := txStore.CreateTransaction(txRequest, ethClient.ConfiguredChainID()) + tx1, err := txStore.CreateTransaction(testutils.Context(t), txRequest, ethClient.ConfiguredChainID()) assert.NoError(t, err) - tx2, err := txStore.CreateTransaction(txRequest, ethClient.ConfiguredChainID()) + tx2, err := txStore.CreateTransaction(testutils.Context(t), txRequest, ethClient.ConfiguredChainID()) assert.NoError(t, err) assert.Equal(t, tx1.GetID(), tx2.GetID()) diff --git a/core/chains/evm/txmgr/mocks/evm_tx_store.go b/core/chains/evm/txmgr/mocks/evm_tx_store.go index 4a06741a2f3..8c078ba3d15 100644 --- a/core/chains/evm/txmgr/mocks/evm_tx_store.go +++ b/core/chains/evm/txmgr/mocks/evm_tx_store.go @@ -28,13 +28,13 @@ type EvmTxStore struct { mock.Mock } -// Abandon provides a mock function with given fields: id, addr -func (_m *EvmTxStore) Abandon(id *big.Int, addr common.Address) error { - ret := _m.Called(id, addr) +// Abandon provides a mock function with given fields: ctx, id, addr +func (_m *EvmTxStore) Abandon(ctx context.Context, id *big.Int, addr common.Address) error { + ret := _m.Called(ctx, id, addr) var r0 error - if rf, ok := ret.Get(0).(func(*big.Int, common.Address) error); ok { - r0 = rf(id, addr) + if rf, ok := ret.Get(0).(func(context.Context, *big.Int, common.Address) error); ok { + r0 = rf(ctx, id, addr) } else { r0 = ret.Error(0) } @@ -42,20 +42,13 @@ func (_m *EvmTxStore) Abandon(id *big.Int, addr common.Address) error { return r0 } -// CheckTxQueueCapacity provides a mock function with given fields: fromAddress, maxQueuedTransactions, chainID, qopts -func (_m *EvmTxStore) CheckTxQueueCapacity(fromAddress common.Address, maxQueuedTransactions uint64, chainID *big.Int, qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, fromAddress, maxQueuedTransactions, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CheckTxQueueCapacity provides a mock function with given fields: ctx, fromAddress, maxQueuedTransactions, chainID +func (_m *EvmTxStore) CheckTxQueueCapacity(ctx context.Context, fromAddress common.Address, maxQueuedTransactions uint64, chainID *big.Int) error { + ret := _m.Called(ctx, fromAddress, maxQueuedTransactions, chainID) var r0 error - if rf, ok := ret.Get(0).(func(common.Address, uint64, *big.Int, ...pg.QOpt) error); ok { - r0 = rf(fromAddress, maxQueuedTransactions, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, *big.Int) error); ok { + r0 = rf(ctx, fromAddress, maxQueuedTransactions, chainID) } else { r0 = ret.Error(0) } @@ -68,30 +61,23 @@ func (_m *EvmTxStore) Close() { _m.Called() } -// CountUnconfirmedTransactions provides a mock function with given fields: fromAddress, chainID, qopts -func (_m *EvmTxStore) CountUnconfirmedTransactions(fromAddress common.Address, chainID *big.Int, qopts ...pg.QOpt) (uint32, error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, fromAddress, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CountUnconfirmedTransactions provides a mock function with given fields: ctx, fromAddress, chainID +func (_m *EvmTxStore) CountUnconfirmedTransactions(ctx context.Context, fromAddress common.Address, chainID *big.Int) (uint32, error) { + ret := _m.Called(ctx, fromAddress, chainID) var r0 uint32 var r1 error - if rf, ok := ret.Get(0).(func(common.Address, *big.Int, ...pg.QOpt) (uint32, error)); ok { - return rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) (uint32, error)); ok { + return rf(ctx, fromAddress, chainID) } - if rf, ok := ret.Get(0).(func(common.Address, *big.Int, ...pg.QOpt) uint32); ok { - r0 = rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) uint32); ok { + r0 = rf(ctx, fromAddress, chainID) } else { r0 = ret.Get(0).(uint32) } - if rf, ok := ret.Get(1).(func(common.Address, *big.Int, ...pg.QOpt) error); ok { - r1 = rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok { + r1 = rf(ctx, fromAddress, chainID) } else { r1 = ret.Error(1) } @@ -99,30 +85,23 @@ func (_m *EvmTxStore) CountUnconfirmedTransactions(fromAddress common.Address, c return r0, r1 } -// CountUnstartedTransactions provides a mock function with given fields: fromAddress, chainID, qopts -func (_m *EvmTxStore) CountUnstartedTransactions(fromAddress common.Address, chainID *big.Int, qopts ...pg.QOpt) (uint32, error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, fromAddress, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CountUnstartedTransactions provides a mock function with given fields: ctx, fromAddress, chainID +func (_m *EvmTxStore) CountUnstartedTransactions(ctx context.Context, fromAddress common.Address, chainID *big.Int) (uint32, error) { + ret := _m.Called(ctx, fromAddress, chainID) var r0 uint32 var r1 error - if rf, ok := ret.Get(0).(func(common.Address, *big.Int, ...pg.QOpt) (uint32, error)); ok { - return rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) (uint32, error)); ok { + return rf(ctx, fromAddress, chainID) } - if rf, ok := ret.Get(0).(func(common.Address, *big.Int, ...pg.QOpt) uint32); ok { - r0 = rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) uint32); ok { + r0 = rf(ctx, fromAddress, chainID) } else { r0 = ret.Get(0).(uint32) } - if rf, ok := ret.Get(1).(func(common.Address, *big.Int, ...pg.QOpt) error); ok { - r1 = rf(fromAddress, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok { + r1 = rf(ctx, fromAddress, chainID) } else { r1 = ret.Error(1) } @@ -130,30 +109,23 @@ func (_m *EvmTxStore) CountUnstartedTransactions(fromAddress common.Address, cha return r0, r1 } -// CreateTransaction provides a mock function with given fields: txRequest, chainID, qopts -func (_m *EvmTxStore) CreateTransaction(txRequest types.TxRequest[common.Address, common.Hash], chainID *big.Int, qopts ...pg.QOpt) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, txRequest, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// CreateTransaction provides a mock function with given fields: ctx, txRequest, chainID +func (_m *EvmTxStore) CreateTransaction(ctx context.Context, txRequest types.TxRequest[common.Address, common.Hash], chainID *big.Int) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, txRequest, chainID) var r0 types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(types.TxRequest[common.Address, common.Hash], *big.Int, ...pg.QOpt) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(txRequest, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, types.TxRequest[common.Address, common.Hash], *big.Int) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, txRequest, chainID) } - if rf, ok := ret.Get(0).(func(types.TxRequest[common.Address, common.Hash], *big.Int, ...pg.QOpt) types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(txRequest, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, types.TxRequest[common.Address, common.Hash], *big.Int) types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, txRequest, chainID) } else { r0 = ret.Get(0).(types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } - if rf, ok := ret.Get(1).(func(types.TxRequest[common.Address, common.Hash], *big.Int, ...pg.QOpt) error); ok { - r1 = rf(txRequest, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, types.TxRequest[common.Address, common.Hash], *big.Int) error); ok { + r1 = rf(ctx, txRequest, chainID) } else { r1 = ret.Error(1) } @@ -175,20 +147,13 @@ func (_m *EvmTxStore) DeleteInProgressAttempt(ctx context.Context, attempt types return r0 } -// FindNextUnstartedTransactionFromAddress provides a mock function with given fields: etx, fromAddress, chainID, qopts -func (_m *EvmTxStore) FindNextUnstartedTransactionFromAddress(etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], fromAddress common.Address, chainID *big.Int, qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, etx, fromAddress, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// FindNextUnstartedTransactionFromAddress provides a mock function with given fields: ctx, etx, fromAddress, chainID +func (_m *EvmTxStore) FindNextUnstartedTransactionFromAddress(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], fromAddress common.Address, chainID *big.Int) error { + ret := _m.Called(ctx, etx, fromAddress, chainID) var r0 error - if rf, ok := ret.Get(0).(func(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], common.Address, *big.Int, ...pg.QOpt) error); ok { - r0 = rf(etx, fromAddress, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], common.Address, *big.Int) error); ok { + r0 = rf(ctx, etx, fromAddress, chainID) } else { r0 = ret.Error(0) } @@ -222,25 +187,25 @@ func (_m *EvmTxStore) FindReceiptsPendingConfirmation(ctx context.Context, block return r0, r1 } -// FindTransactionsConfirmedInBlockRange provides a mock function with given fields: highBlockNumber, lowBlockNumber, chainID -func (_m *EvmTxStore) FindTransactionsConfirmedInBlockRange(highBlockNumber int64, lowBlockNumber int64, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - ret := _m.Called(highBlockNumber, lowBlockNumber, chainID) +// FindTransactionsConfirmedInBlockRange provides a mock function with given fields: ctx, highBlockNumber, lowBlockNumber, chainID +func (_m *EvmTxStore) FindTransactionsConfirmedInBlockRange(ctx context.Context, highBlockNumber int64, lowBlockNumber int64, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, highBlockNumber, lowBlockNumber, chainID) var r0 []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(int64, int64, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(highBlockNumber, lowBlockNumber, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, highBlockNumber, lowBlockNumber, chainID) } - if rf, ok := ret.Get(0).(func(int64, int64, *big.Int) []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(highBlockNumber, lowBlockNumber, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, highBlockNumber, lowBlockNumber, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } - if rf, ok := ret.Get(1).(func(int64, int64, *big.Int) error); ok { - r1 = rf(highBlockNumber, lowBlockNumber, chainID) + if rf, ok := ret.Get(1).(func(context.Context, int64, int64, *big.Int) error); ok { + r1 = rf(ctx, highBlockNumber, lowBlockNumber, chainID) } else { r1 = ret.Error(1) } @@ -300,25 +265,25 @@ func (_m *EvmTxStore) FindTxAttemptConfirmedByTxIDs(ids []int64) ([]types.TxAtte return r0, r1 } -// FindTxAttemptsConfirmedMissingReceipt provides a mock function with given fields: chainID -func (_m *EvmTxStore) FindTxAttemptsConfirmedMissingReceipt(chainID *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - ret := _m.Called(chainID) +// FindTxAttemptsConfirmedMissingReceipt provides a mock function with given fields: ctx, chainID +func (_m *EvmTxStore) FindTxAttemptsConfirmedMissingReceipt(ctx context.Context, chainID *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, chainID) var r0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(*big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, chainID) } - if rf, ok := ret.Get(0).(func(*big.Int) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } - if rf, ok := ret.Get(1).(func(*big.Int) error); ok { - r1 = rf(chainID) + if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { + r1 = rf(ctx, chainID) } else { r1 = ret.Error(1) } @@ -326,25 +291,25 @@ func (_m *EvmTxStore) FindTxAttemptsConfirmedMissingReceipt(chainID *big.Int) ([ return r0, r1 } -// FindTxAttemptsRequiringReceiptFetch provides a mock function with given fields: chainID -func (_m *EvmTxStore) FindTxAttemptsRequiringReceiptFetch(chainID *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - ret := _m.Called(chainID) +// FindTxAttemptsRequiringReceiptFetch provides a mock function with given fields: ctx, chainID +func (_m *EvmTxStore) FindTxAttemptsRequiringReceiptFetch(ctx context.Context, chainID *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, chainID) var r0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(*big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, chainID) } - if rf, ok := ret.Get(0).(func(*big.Int) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } - if rf, ok := ret.Get(1).(func(*big.Int) error); ok { - r1 = rf(chainID) + if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { + r1 = rf(ctx, chainID) } else { r1 = ret.Error(1) } @@ -352,25 +317,25 @@ func (_m *EvmTxStore) FindTxAttemptsRequiringReceiptFetch(chainID *big.Int) ([]t return r0, r1 } -// FindTxAttemptsRequiringResend provides a mock function with given fields: olderThan, maxInFlightTransactions, chainID, address -func (_m *EvmTxStore) FindTxAttemptsRequiringResend(olderThan time.Time, maxInFlightTransactions uint32, chainID *big.Int, address common.Address) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - ret := _m.Called(olderThan, maxInFlightTransactions, chainID, address) +// FindTxAttemptsRequiringResend provides a mock function with given fields: ctx, olderThan, maxInFlightTransactions, chainID, address +func (_m *EvmTxStore) FindTxAttemptsRequiringResend(ctx context.Context, olderThan time.Time, maxInFlightTransactions uint32, chainID *big.Int, address common.Address) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, olderThan, maxInFlightTransactions, chainID, address) var r0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(time.Time, uint32, *big.Int, common.Address) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(olderThan, maxInFlightTransactions, chainID, address) + if rf, ok := ret.Get(0).(func(context.Context, time.Time, uint32, *big.Int, common.Address) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, olderThan, maxInFlightTransactions, chainID, address) } - if rf, ok := ret.Get(0).(func(time.Time, uint32, *big.Int, common.Address) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(olderThan, maxInFlightTransactions, chainID, address) + if rf, ok := ret.Get(0).(func(context.Context, time.Time, uint32, *big.Int, common.Address) []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, olderThan, maxInFlightTransactions, chainID, address) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } - if rf, ok := ret.Get(1).(func(time.Time, uint32, *big.Int, common.Address) error); ok { - r1 = rf(olderThan, maxInFlightTransactions, chainID, address) + if rf, ok := ret.Get(1).(func(context.Context, time.Time, uint32, *big.Int, common.Address) error); ok { + r1 = rf(ctx, olderThan, maxInFlightTransactions, chainID, address) } else { r1 = ret.Error(1) } @@ -428,25 +393,25 @@ func (_m *EvmTxStore) FindTxWithAttempts(etxID int64) (types.Tx[*big.Int, common return r0, r1 } -// FindTxWithIdempotencyKey provides a mock function with given fields: idempotencyKey, chainID -func (_m *EvmTxStore) FindTxWithIdempotencyKey(idempotencyKey string, chainID *big.Int) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - ret := _m.Called(idempotencyKey, chainID) +// FindTxWithIdempotencyKey provides a mock function with given fields: ctx, idempotencyKey, chainID +func (_m *EvmTxStore) FindTxWithIdempotencyKey(ctx context.Context, idempotencyKey string, chainID *big.Int) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, idempotencyKey, chainID) var r0 *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(string, *big.Int) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(idempotencyKey, chainID) + if rf, ok := ret.Get(0).(func(context.Context, string, *big.Int) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, idempotencyKey, chainID) } - if rf, ok := ret.Get(0).(func(string, *big.Int) *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(idempotencyKey, chainID) + if rf, ok := ret.Get(0).(func(context.Context, string, *big.Int) *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, idempotencyKey, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } - if rf, ok := ret.Get(1).(func(string, *big.Int) error); ok { - r1 = rf(idempotencyKey, chainID) + if rf, ok := ret.Get(1).(func(context.Context, string, *big.Int) error); ok { + r1 = rf(ctx, idempotencyKey, chainID) } else { r1 = ret.Error(1) } @@ -454,25 +419,25 @@ func (_m *EvmTxStore) FindTxWithIdempotencyKey(idempotencyKey string, chainID *b return r0, r1 } -// FindTxWithSequence provides a mock function with given fields: fromAddress, seq -func (_m *EvmTxStore) FindTxWithSequence(fromAddress common.Address, seq evmtypes.Nonce) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - ret := _m.Called(fromAddress, seq) +// FindTxWithSequence provides a mock function with given fields: ctx, fromAddress, seq +func (_m *EvmTxStore) FindTxWithSequence(ctx context.Context, fromAddress common.Address, seq evmtypes.Nonce) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, fromAddress, seq) var r0 *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(common.Address, evmtypes.Nonce) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(fromAddress, seq) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, evmtypes.Nonce) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, fromAddress, seq) } - if rf, ok := ret.Get(0).(func(common.Address, evmtypes.Nonce) *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(fromAddress, seq) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, evmtypes.Nonce) *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, fromAddress, seq) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } - if rf, ok := ret.Get(1).(func(common.Address, evmtypes.Nonce) error); ok { - r1 = rf(fromAddress, seq) + if rf, ok := ret.Get(1).(func(context.Context, common.Address, evmtypes.Nonce) error); ok { + r1 = rf(ctx, fromAddress, seq) } else { r1 = ret.Error(1) } @@ -506,32 +471,25 @@ func (_m *EvmTxStore) FindTxsRequiringGasBump(ctx context.Context, address commo return r0, r1 } -// FindTxsRequiringResubmissionDueToInsufficientFunds provides a mock function with given fields: address, chainID, qopts -func (_m *EvmTxStore) FindTxsRequiringResubmissionDueToInsufficientFunds(address common.Address, chainID *big.Int, qopts ...pg.QOpt) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, address, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// FindTxsRequiringResubmissionDueToInsufficientFunds provides a mock function with given fields: ctx, address, chainID +func (_m *EvmTxStore) FindTxsRequiringResubmissionDueToInsufficientFunds(ctx context.Context, address common.Address, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, address, chainID) var r0 []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(common.Address, *big.Int, ...pg.QOpt) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(address, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, address, chainID) } - if rf, ok := ret.Get(0).(func(common.Address, *big.Int, ...pg.QOpt) []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(address, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, address, chainID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } - if rf, ok := ret.Get(1).(func(common.Address, *big.Int, ...pg.QOpt) error); ok { - r1 = rf(address, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok { + r1 = rf(ctx, address, chainID) } else { r1 = ret.Error(1) } @@ -565,32 +523,25 @@ func (_m *EvmTxStore) GetInProgressTxAttempts(ctx context.Context, address commo return r0, r1 } -// GetTxInProgress provides a mock function with given fields: fromAddress, qopts -func (_m *EvmTxStore) GetTxInProgress(fromAddress common.Address, qopts ...pg.QOpt) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, fromAddress) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// GetTxInProgress provides a mock function with given fields: ctx, fromAddress +func (_m *EvmTxStore) GetTxInProgress(ctx context.Context, fromAddress common.Address) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { + ret := _m.Called(ctx, fromAddress) var r0 *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] var r1 error - if rf, ok := ret.Get(0).(func(common.Address, ...pg.QOpt) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { - return rf(fromAddress, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)); ok { + return rf(ctx, fromAddress) } - if rf, ok := ret.Get(0).(func(common.Address, ...pg.QOpt) *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { - r0 = rf(fromAddress, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address) *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]); ok { + r0 = rf(ctx, fromAddress) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) } } - if rf, ok := ret.Get(1).(func(common.Address, ...pg.QOpt) error); ok { - r1 = rf(fromAddress, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok { + r1 = rf(ctx, fromAddress) } else { r1 = ret.Error(1) } @@ -598,30 +549,23 @@ func (_m *EvmTxStore) GetTxInProgress(fromAddress common.Address, qopts ...pg.QO return r0, r1 } -// HasInProgressTransaction provides a mock function with given fields: account, chainID, qopts -func (_m *EvmTxStore) HasInProgressTransaction(account common.Address, chainID *big.Int, qopts ...pg.QOpt) (bool, error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, account, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// HasInProgressTransaction provides a mock function with given fields: ctx, account, chainID +func (_m *EvmTxStore) HasInProgressTransaction(ctx context.Context, account common.Address, chainID *big.Int) (bool, error) { + ret := _m.Called(ctx, account, chainID) var r0 bool var r1 error - if rf, ok := ret.Get(0).(func(common.Address, *big.Int, ...pg.QOpt) (bool, error)); ok { - return rf(account, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) (bool, error)); ok { + return rf(ctx, account, chainID) } - if rf, ok := ret.Get(0).(func(common.Address, *big.Int, ...pg.QOpt) bool); ok { - r0 = rf(account, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) bool); ok { + r0 = rf(ctx, account, chainID) } else { r0 = ret.Get(0).(bool) } - if rf, ok := ret.Get(1).(func(common.Address, *big.Int, ...pg.QOpt) error); ok { - r1 = rf(account, chainID, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok { + r1 = rf(ctx, account, chainID) } else { r1 = ret.Error(1) } @@ -629,20 +573,13 @@ func (_m *EvmTxStore) HasInProgressTransaction(account common.Address, chainID * return r0, r1 } -// LoadTxAttempts provides a mock function with given fields: etx, qopts -func (_m *EvmTxStore) LoadTxAttempts(etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, etx) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// LoadTxAttempts provides a mock function with given fields: ctx, etx +func (_m *EvmTxStore) LoadTxAttempts(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { + ret := _m.Called(ctx, etx) var r0 error - if rf, ok := ret.Get(0).(func(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], ...pg.QOpt) error); ok { - r0 = rf(etx, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { + r0 = rf(ctx, etx) } else { r0 = ret.Error(0) } @@ -650,13 +587,13 @@ func (_m *EvmTxStore) LoadTxAttempts(etx *types.Tx[*big.Int, common.Address, com return r0 } -// MarkAllConfirmedMissingReceipt provides a mock function with given fields: chainID -func (_m *EvmTxStore) MarkAllConfirmedMissingReceipt(chainID *big.Int) error { - ret := _m.Called(chainID) +// MarkAllConfirmedMissingReceipt provides a mock function with given fields: ctx, chainID +func (_m *EvmTxStore) MarkAllConfirmedMissingReceipt(ctx context.Context, chainID *big.Int) error { + ret := _m.Called(ctx, chainID) var r0 error - if rf, ok := ret.Get(0).(func(*big.Int) error); ok { - r0 = rf(chainID) + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) error); ok { + r0 = rf(ctx, chainID) } else { r0 = ret.Error(0) } @@ -664,20 +601,13 @@ func (_m *EvmTxStore) MarkAllConfirmedMissingReceipt(chainID *big.Int) error { return r0 } -// MarkOldTxesMissingReceiptAsErrored provides a mock function with given fields: blockNum, finalityDepth, chainID, qopts -func (_m *EvmTxStore) MarkOldTxesMissingReceiptAsErrored(blockNum int64, finalityDepth uint32, chainID *big.Int, qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, blockNum, finalityDepth, chainID) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// MarkOldTxesMissingReceiptAsErrored provides a mock function with given fields: ctx, blockNum, finalityDepth, chainID +func (_m *EvmTxStore) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, finalityDepth uint32, chainID *big.Int) error { + ret := _m.Called(ctx, blockNum, finalityDepth, chainID) var r0 error - if rf, ok := ret.Get(0).(func(int64, uint32, *big.Int, ...pg.QOpt) error); ok { - r0 = rf(blockNum, finalityDepth, chainID, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, int64, uint32, *big.Int) error); ok { + r0 = rf(ctx, blockNum, finalityDepth, chainID) } else { r0 = ret.Error(0) } @@ -685,20 +615,13 @@ func (_m *EvmTxStore) MarkOldTxesMissingReceiptAsErrored(blockNum int64, finalit return r0 } -// PreloadTxes provides a mock function with given fields: attempts, qopts -func (_m *EvmTxStore) PreloadTxes(attempts []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, attempts) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// PreloadTxes provides a mock function with given fields: ctx, attempts +func (_m *EvmTxStore) PreloadTxes(ctx context.Context, attempts []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { + ret := _m.Called(ctx, attempts) var r0 error - if rf, ok := ret.Get(0).(func([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], ...pg.QOpt) error); ok { - r0 = rf(attempts, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { + r0 = rf(ctx, attempts) } else { r0 = ret.Error(0) } @@ -706,30 +629,23 @@ func (_m *EvmTxStore) PreloadTxes(attempts []types.TxAttempt[*big.Int, common.Ad return r0 } -// PruneUnstartedTxQueue provides a mock function with given fields: queueSize, subject, qopts -func (_m *EvmTxStore) PruneUnstartedTxQueue(queueSize uint32, subject uuid.UUID, qopts ...pg.QOpt) (int64, error) { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, queueSize, subject) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// PruneUnstartedTxQueue provides a mock function with given fields: ctx, queueSize, subject +func (_m *EvmTxStore) PruneUnstartedTxQueue(ctx context.Context, queueSize uint32, subject uuid.UUID) (int64, error) { + ret := _m.Called(ctx, queueSize, subject) var r0 int64 var r1 error - if rf, ok := ret.Get(0).(func(uint32, uuid.UUID, ...pg.QOpt) (int64, error)); ok { - return rf(queueSize, subject, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, uint32, uuid.UUID) (int64, error)); ok { + return rf(ctx, queueSize, subject) } - if rf, ok := ret.Get(0).(func(uint32, uuid.UUID, ...pg.QOpt) int64); ok { - r0 = rf(queueSize, subject, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, uint32, uuid.UUID) int64); ok { + r0 = rf(ctx, queueSize, subject) } else { r0 = ret.Get(0).(int64) } - if rf, ok := ret.Get(1).(func(uint32, uuid.UUID, ...pg.QOpt) error); ok { - r1 = rf(queueSize, subject, qopts...) + if rf, ok := ret.Get(1).(func(context.Context, uint32, uuid.UUID) error); ok { + r1 = rf(ctx, queueSize, subject) } else { r1 = ret.Error(1) } @@ -737,13 +653,13 @@ func (_m *EvmTxStore) PruneUnstartedTxQueue(queueSize uint32, subject uuid.UUID, return r0, r1 } -// ReapTxHistory provides a mock function with given fields: minBlockNumberToKeep, timeThreshold, chainID -func (_m *EvmTxStore) ReapTxHistory(minBlockNumberToKeep int64, timeThreshold time.Time, chainID *big.Int) error { - ret := _m.Called(minBlockNumberToKeep, timeThreshold, chainID) +// ReapTxHistory provides a mock function with given fields: ctx, minBlockNumberToKeep, timeThreshold, chainID +func (_m *EvmTxStore) ReapTxHistory(ctx context.Context, minBlockNumberToKeep int64, timeThreshold time.Time, chainID *big.Int) error { + ret := _m.Called(ctx, minBlockNumberToKeep, timeThreshold, chainID) var r0 error - if rf, ok := ret.Get(0).(func(int64, time.Time, *big.Int) error); ok { - r0 = rf(minBlockNumberToKeep, timeThreshold, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time, *big.Int) error); ok { + r0 = rf(ctx, minBlockNumberToKeep, timeThreshold, chainID) } else { r0 = ret.Error(0) } @@ -765,13 +681,13 @@ func (_m *EvmTxStore) SaveConfirmedMissingReceiptAttempt(ctx context.Context, ti return r0 } -// SaveFetchedReceipts provides a mock function with given fields: receipts, chainID -func (_m *EvmTxStore) SaveFetchedReceipts(receipts []*evmtypes.Receipt, chainID *big.Int) error { - ret := _m.Called(receipts, chainID) +// SaveFetchedReceipts provides a mock function with given fields: ctx, receipts, chainID +func (_m *EvmTxStore) SaveFetchedReceipts(ctx context.Context, receipts []*evmtypes.Receipt, chainID *big.Int) error { + ret := _m.Called(ctx, receipts, chainID) var r0 error - if rf, ok := ret.Get(0).(func([]*evmtypes.Receipt, *big.Int) error); ok { - r0 = rf(receipts, chainID) + if rf, ok := ret.Get(0).(func(context.Context, []*evmtypes.Receipt, *big.Int) error); ok { + r0 = rf(ctx, receipts, chainID) } else { r0 = ret.Error(0) } @@ -779,13 +695,13 @@ func (_m *EvmTxStore) SaveFetchedReceipts(receipts []*evmtypes.Receipt, chainID return r0 } -// SaveInProgressAttempt provides a mock function with given fields: attempt -func (_m *EvmTxStore) SaveInProgressAttempt(attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { - ret := _m.Called(attempt) +// SaveInProgressAttempt provides a mock function with given fields: ctx, attempt +func (_m *EvmTxStore) SaveInProgressAttempt(ctx context.Context, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { + ret := _m.Called(ctx, attempt) var r0 error - if rf, ok := ret.Get(0).(func(*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { - r0 = rf(attempt) + if rf, ok := ret.Get(0).(func(context.Context, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { + r0 = rf(ctx, attempt) } else { r0 = ret.Error(0) } @@ -793,13 +709,13 @@ func (_m *EvmTxStore) SaveInProgressAttempt(attempt *types.TxAttempt[*big.Int, c return r0 } -// SaveInsufficientFundsAttempt provides a mock function with given fields: timeout, attempt, broadcastAt -func (_m *EvmTxStore) SaveInsufficientFundsAttempt(timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time) error { - ret := _m.Called(timeout, attempt, broadcastAt) +// SaveInsufficientFundsAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt +func (_m *EvmTxStore) SaveInsufficientFundsAttempt(ctx context.Context, timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time) error { + ret := _m.Called(ctx, timeout, attempt, broadcastAt) var r0 error - if rf, ok := ret.Get(0).(func(time.Duration, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], time.Time) error); ok { - r0 = rf(timeout, attempt, broadcastAt) + if rf, ok := ret.Get(0).(func(context.Context, time.Duration, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], time.Time) error); ok { + r0 = rf(ctx, timeout, attempt, broadcastAt) } else { r0 = ret.Error(0) } @@ -807,20 +723,13 @@ func (_m *EvmTxStore) SaveInsufficientFundsAttempt(timeout time.Duration, attemp return r0 } -// SaveReplacementInProgressAttempt provides a mock function with given fields: oldAttempt, replacementAttempt, qopts -func (_m *EvmTxStore) SaveReplacementInProgressAttempt(oldAttempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], replacementAttempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, oldAttempt, replacementAttempt) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// SaveReplacementInProgressAttempt provides a mock function with given fields: ctx, oldAttempt, replacementAttempt +func (_m *EvmTxStore) SaveReplacementInProgressAttempt(ctx context.Context, oldAttempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], replacementAttempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { + ret := _m.Called(ctx, oldAttempt, replacementAttempt) var r0 error - if rf, ok := ret.Get(0).(func(types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], ...pg.QOpt) error); ok { - r0 = rf(oldAttempt, replacementAttempt, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { + r0 = rf(ctx, oldAttempt, replacementAttempt) } else { r0 = ret.Error(0) } @@ -828,13 +737,13 @@ func (_m *EvmTxStore) SaveReplacementInProgressAttempt(oldAttempt types.TxAttemp return r0 } -// SaveSentAttempt provides a mock function with given fields: timeout, attempt, broadcastAt -func (_m *EvmTxStore) SaveSentAttempt(timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time) error { - ret := _m.Called(timeout, attempt, broadcastAt) +// SaveSentAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt +func (_m *EvmTxStore) SaveSentAttempt(ctx context.Context, timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time) error { + ret := _m.Called(ctx, timeout, attempt, broadcastAt) var r0 error - if rf, ok := ret.Get(0).(func(time.Duration, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], time.Time) error); ok { - r0 = rf(timeout, attempt, broadcastAt) + if rf, ok := ret.Get(0).(func(context.Context, time.Duration, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], time.Time) error); ok { + r0 = rf(ctx, timeout, attempt, broadcastAt) } else { r0 = ret.Error(0) } @@ -842,13 +751,13 @@ func (_m *EvmTxStore) SaveSentAttempt(timeout time.Duration, attempt *types.TxAt return r0 } -// SetBroadcastBeforeBlockNum provides a mock function with given fields: blockNum, chainID -func (_m *EvmTxStore) SetBroadcastBeforeBlockNum(blockNum int64, chainID *big.Int) error { - ret := _m.Called(blockNum, chainID) +// SetBroadcastBeforeBlockNum provides a mock function with given fields: ctx, blockNum, chainID +func (_m *EvmTxStore) SetBroadcastBeforeBlockNum(ctx context.Context, blockNum int64, chainID *big.Int) error { + ret := _m.Called(ctx, blockNum, chainID) var r0 error - if rf, ok := ret.Get(0).(func(int64, *big.Int) error); ok { - r0 = rf(blockNum, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, *big.Int) error); ok { + r0 = rf(ctx, blockNum, chainID) } else { r0 = ret.Error(0) } @@ -955,13 +864,13 @@ func (_m *EvmTxStore) TxAttempts(offset int, limit int) ([]types.TxAttempt[*big. return r0, r1, r2 } -// UpdateBroadcastAts provides a mock function with given fields: now, etxIDs -func (_m *EvmTxStore) UpdateBroadcastAts(now time.Time, etxIDs []int64) error { - ret := _m.Called(now, etxIDs) +// UpdateBroadcastAts provides a mock function with given fields: ctx, now, etxIDs +func (_m *EvmTxStore) UpdateBroadcastAts(ctx context.Context, now time.Time, etxIDs []int64) error { + ret := _m.Called(ctx, now, etxIDs) var r0 error - if rf, ok := ret.Get(0).(func(time.Time, []int64) error); ok { - r0 = rf(now, etxIDs) + if rf, ok := ret.Get(0).(func(context.Context, time.Time, []int64) error); ok { + r0 = rf(ctx, now, etxIDs) } else { r0 = ret.Error(0) } @@ -1011,20 +920,13 @@ func (_m *EvmTxStore) UpdateTxAttemptInProgressToBroadcast(etx *types.Tx[*big.In return r0 } -// UpdateTxFatalError provides a mock function with given fields: etx, qopts -func (_m *EvmTxStore) UpdateTxFatalError(etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, etx) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// UpdateTxFatalError provides a mock function with given fields: ctx, etx +func (_m *EvmTxStore) UpdateTxFatalError(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { + ret := _m.Called(ctx, etx) var r0 error - if rf, ok := ret.Get(0).(func(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], ...pg.QOpt) error); ok { - r0 = rf(etx, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { + r0 = rf(ctx, etx) } else { r0 = ret.Error(0) } @@ -1032,13 +934,13 @@ func (_m *EvmTxStore) UpdateTxFatalError(etx *types.Tx[*big.Int, common.Address, return r0 } -// UpdateTxForRebroadcast provides a mock function with given fields: etx, etxAttempt -func (_m *EvmTxStore) UpdateTxForRebroadcast(etx types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], etxAttempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { - ret := _m.Called(etx, etxAttempt) +// UpdateTxForRebroadcast provides a mock function with given fields: ctx, etx, etxAttempt +func (_m *EvmTxStore) UpdateTxForRebroadcast(ctx context.Context, etx types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], etxAttempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { + ret := _m.Called(ctx, etx, etxAttempt) var r0 error - if rf, ok := ret.Get(0).(func(types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { - r0 = rf(etx, etxAttempt) + if rf, ok := ret.Get(0).(func(context.Context, types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { + r0 = rf(ctx, etx, etxAttempt) } else { r0 = ret.Error(0) } @@ -1046,20 +948,13 @@ func (_m *EvmTxStore) UpdateTxForRebroadcast(etx types.Tx[*big.Int, common.Addre return r0 } -// UpdateTxUnstartedToInProgress provides a mock function with given fields: etx, attempt, qopts -func (_m *EvmTxStore) UpdateTxUnstartedToInProgress(etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], qopts ...pg.QOpt) error { - _va := make([]interface{}, len(qopts)) - for _i := range qopts { - _va[_i] = qopts[_i] - } - var _ca []interface{} - _ca = append(_ca, etx, attempt) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) +// UpdateTxUnstartedToInProgress provides a mock function with given fields: ctx, etx, attempt +func (_m *EvmTxStore) UpdateTxUnstartedToInProgress(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { + ret := _m.Called(ctx, etx, attempt) var r0 error - if rf, ok := ret.Get(0).(func(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], ...pg.QOpt) error); ok { - r0 = rf(etx, attempt, qopts...) + if rf, ok := ret.Get(0).(func(context.Context, *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error); ok { + r0 = rf(ctx, etx, attempt) } else { r0 = ret.Error(0) } @@ -1067,13 +962,13 @@ func (_m *EvmTxStore) UpdateTxUnstartedToInProgress(etx *types.Tx[*big.Int, comm return r0 } -// UpdateTxsUnconfirmed provides a mock function with given fields: ids -func (_m *EvmTxStore) UpdateTxsUnconfirmed(ids []int64) error { - ret := _m.Called(ids) +// UpdateTxsUnconfirmed provides a mock function with given fields: ctx, ids +func (_m *EvmTxStore) UpdateTxsUnconfirmed(ctx context.Context, ids []int64) error { + ret := _m.Called(ctx, ids) var r0 error - if rf, ok := ret.Get(0).(func([]int64) error); ok { - r0 = rf(ids) + if rf, ok := ret.Get(0).(func(context.Context, []int64) error); ok { + r0 = rf(ctx, ids) } else { r0 = ret.Error(0) } diff --git a/core/chains/evm/txmgr/nonce_syncer.go b/core/chains/evm/txmgr/nonce_syncer.go index d057ff0e74a..af982e062ac 100644 --- a/core/chains/evm/txmgr/nonce_syncer.go +++ b/core/chains/evm/txmgr/nonce_syncer.go @@ -98,7 +98,7 @@ func (s nonceSyncerImpl) fastForwardNonceIfNecessary(ctx context.Context, addres } localNonce := keyNextNonce - hasInProgressTransaction, err := s.txStore.HasInProgressTransaction(address, s.chainID, pg.WithParentCtx(ctx)) + hasInProgressTransaction, err := s.txStore.HasInProgressTransaction(ctx, address, s.chainID) if err != nil { return errors.Wrapf(err, "failed to query for in_progress transaction for address %s", address.String()) diff --git a/core/chains/evm/txmgr/strategies_test.go b/core/chains/evm/txmgr/strategies_test.go index 085f3248643..3d9fed8fce1 100644 --- a/core/chains/evm/txmgr/strategies_test.go +++ b/core/chains/evm/txmgr/strategies_test.go @@ -10,9 +10,8 @@ import ( txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" configtest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest/v2" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" ) func Test_SendEveryStrategy(t *testing.T) { @@ -40,7 +39,6 @@ func Test_DropOldestStrategy_Subject(t *testing.T) { func Test_DropOldestStrategy_PruneQueue(t *testing.T) { t.Parallel() - db := pgtest.NewSqlxDB(t) cfg := configtest.NewGeneralConfig(t, nil) subject := uuid.New() queueSize := uint32(2) @@ -49,8 +47,8 @@ func Test_DropOldestStrategy_PruneQueue(t *testing.T) { t.Run("calls PrineUnstartedTxQueue for the given subject and queueSize, ignoring fromAddress", func(t *testing.T) { strategy1 := txmgrcommon.NewDropOldestStrategy(subject, queueSize, queryTimeout) - mockTxStore.On("PruneUnstartedTxQueue", queueSize, subject, mock.Anything, mock.Anything).Once().Return(int64(2), nil) - n, err := strategy1.PruneQueue(mockTxStore, pg.WithQueryer(db)) + mockTxStore.On("PruneUnstartedTxQueue", mock.Anything, queueSize, subject, mock.Anything, mock.Anything).Once().Return(int64(2), nil) + n, err := strategy1.PruneQueue(testutils.Context(t), mockTxStore) require.NoError(t, err) assert.Equal(t, int64(2), n) }) diff --git a/core/chains/evm/txmgr/txmgr_test.go b/core/chains/evm/txmgr/txmgr_test.go index 79fcf101d5f..f16e6fecc85 100644 --- a/core/chains/evm/txmgr/txmgr_test.go +++ b/core/chains/evm/txmgr/txmgr_test.go @@ -87,7 +87,7 @@ func TestTxm_SendNativeToken_DoesNotSendToZero(t *testing.T) { txm, err := makeTestEvmTxm(t, db, ethClient, estimator, evmConfig, evmConfig.GasEstimator(), evmConfig.Transactions(), dbConfig, dbConfig.Listener(), keyStore, nil) require.NoError(t, err) - _, err = txm.SendNativeToken(big.NewInt(0), from, to, *value, 21000) + _, err = txm.SendNativeToken(testutils.Context(t), big.NewInt(0), from, to, *value, 21000) require.Error(t, err) require.EqualError(t, err, "cannot send native token to zero address") } @@ -117,9 +117,9 @@ func TestTxm_CreateTransaction(t *testing.T) { subject := uuid.New() strategy := newMockTxStrategy(t) strategy.On("Subject").Return(uuid.NullUUID{UUID: subject, Valid: true}) - strategy.On("PruneQueue", mock.Anything, mock.AnythingOfType("pg.QOpt")).Return(int64(0), nil) + strategy.On("PruneQueue", mock.Anything, mock.Anything).Return(int64(0), nil) evmConfig.maxQueued = uint64(1) - etx, err := txm.CreateTransaction(txmgr.TxRequest{ + etx, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -155,7 +155,7 @@ func TestTxm_CreateTransaction(t *testing.T) { t.Run("with queue at capacity does not insert eth_tx", func(t *testing.T) { evmConfig.maxQueued = uint64(1) - _, err := txm.CreateTransaction(txmgr.TxRequest{ + _, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: testutils.NewAddress(), EncodedPayload: []byte{1, 2, 3}, @@ -170,7 +170,7 @@ func TestTxm_CreateTransaction(t *testing.T) { t.Run("doesn't insert eth_tx if a matching tx already exists for that pipeline_task_run_id", func(t *testing.T) { evmConfig.maxQueued = uint64(3) id := uuid.New() - tx1, err := txm.CreateTransaction(txmgr.TxRequest{ + tx1, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: testutils.NewAddress(), EncodedPayload: []byte{1, 2, 3}, @@ -180,7 +180,7 @@ func TestTxm_CreateTransaction(t *testing.T) { }) assert.NoError(t, err) - tx2, err := txm.CreateTransaction(txmgr.TxRequest{ + tx2, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: testutils.NewAddress(), EncodedPayload: []byte{1, 2, 3}, @@ -195,7 +195,7 @@ func TestTxm_CreateTransaction(t *testing.T) { t.Run("returns error if eth key state is missing or doesn't match chain ID", func(t *testing.T) { rndAddr := testutils.NewAddress() - _, err := txm.CreateTransaction(txmgr.TxRequest{ + _, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: rndAddr, ToAddress: testutils.NewAddress(), EncodedPayload: []byte{1, 2, 3}, @@ -207,7 +207,7 @@ func TestTxm_CreateTransaction(t *testing.T) { _, otherAddress := cltest.MustInsertRandomKey(t, kst.Eth(), *utils.NewBigI(1337)) - _, err = txm.CreateTransaction(txmgr.TxRequest{ + _, err = txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: otherAddress, ToAddress: testutils.NewAddress(), EncodedPayload: []byte{1, 2, 3}, @@ -225,7 +225,7 @@ func TestTxm_CreateTransaction(t *testing.T) { CheckerType: txmgr.TransmitCheckerTypeSimulate, } evmConfig.maxQueued = uint64(1) - etx, err := txm.CreateTransaction(txmgr.TxRequest{ + etx, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -268,7 +268,7 @@ func TestTxm_CreateTransaction(t *testing.T) { CheckerType: txmgr.TransmitCheckerTypeVRFV2, VRFCoordinatorAddress: testutils.NewAddressPtr(), } - etx, err := txm.CreateTransaction(txmgr.TxRequest{ + etx, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -304,7 +304,7 @@ func TestTxm_CreateTransaction(t *testing.T) { require.NoError(t, err) require.Equal(t, fwdr.Address, fwdrAddr) - etx, err := txm.CreateTransaction(txmgr.TxRequest{ + etx, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -328,7 +328,7 @@ func TestTxm_CreateTransaction(t *testing.T) { evmConfig.maxQueued = uint64(3) id := uuid.New() idempotencyKey := "1" - _, err := txm.CreateTransaction(txmgr.TxRequest{ + _, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ IdempotencyKey: &idempotencyKey, FromAddress: fromAddress, ToAddress: testutils.NewAddress(), @@ -344,7 +344,7 @@ func TestTxm_CreateTransaction(t *testing.T) { evmConfig.maxQueued = uint64(3) id := uuid.New() idempotencyKey := "2" - tx1, err := txm.CreateTransaction(txmgr.TxRequest{ + tx1, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ IdempotencyKey: &idempotencyKey, FromAddress: fromAddress, ToAddress: testutils.NewAddress(), @@ -355,7 +355,7 @@ func TestTxm_CreateTransaction(t *testing.T) { }) assert.NoError(t, err) - tx2, err := txm.CreateTransaction(txmgr.TxRequest{ + tx2, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ IdempotencyKey: &idempotencyKey, FromAddress: fromAddress, ToAddress: testutils.NewAddress(), @@ -535,16 +535,16 @@ func TestTxm_CreateTransaction_OutOfEth(t *testing.T) { cltest.MustInsertUnconfirmedEthTxWithInsufficientEthAttempt(t, txStore, 0, otherKey.Address) strategy := newMockTxStrategy(t) strategy.On("Subject").Return(uuid.NullUUID{}) - strategy.On("PruneQueue", mock.Anything, mock.AnythingOfType("pg.QOpt")).Return(int64(0), nil) + strategy.On("PruneQueue", mock.Anything, mock.Anything).Return(int64(0), nil) - etx, err := txm.CreateTransaction(txmgr.TxRequest{ + etx, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: evmFromAddress, ToAddress: toAddress, EncodedPayload: payload, FeeLimit: gasLimit, Meta: nil, Strategy: strategy, - }, pg.WithParentCtx(context.Background())) + }) assert.NoError(t, err) require.Equal(t, payload, etx.EncodedPayload) @@ -559,9 +559,9 @@ func TestTxm_CreateTransaction_OutOfEth(t *testing.T) { cltest.MustInsertUnconfirmedEthTxWithInsufficientEthAttempt(t, txStore, 0, thisKey.Address) strategy := newMockTxStrategy(t) strategy.On("Subject").Return(uuid.NullUUID{}) - strategy.On("PruneQueue", mock.Anything, mock.AnythingOfType("pg.QOpt")).Return(int64(0), nil) + strategy.On("PruneQueue", mock.Anything, mock.Anything).Return(int64(0), nil) - etx, err := txm.CreateTransaction(txmgr.TxRequest{ + etx, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: evmFromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -580,10 +580,10 @@ func TestTxm_CreateTransaction_OutOfEth(t *testing.T) { cltest.MustInsertConfirmedEthTxWithLegacyAttempt(t, txStore, 0, 42, thisKey.Address) strategy := newMockTxStrategy(t) strategy.On("Subject").Return(uuid.NullUUID{}) - strategy.On("PruneQueue", mock.Anything, mock.AnythingOfType("pg.QOpt")).Return(int64(0), nil) + strategy.On("PruneQueue", mock.Anything, mock.Anything).Return(int64(0), nil) evmConfig.maxQueued = uint64(1) - etx, err := txm.CreateTransaction(txmgr.TxRequest{ + etx, err := txm.CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: evmFromAddress, ToAddress: toAddress, EncodedPayload: payload, diff --git a/core/internal/cltest/factories.go b/core/internal/cltest/factories.go index cb0b51743e4..8b77da14380 100644 --- a/core/internal/cltest/factories.go +++ b/core/internal/cltest/factories.go @@ -368,7 +368,7 @@ func MustCreateUnstartedTx(t testing.TB, txStore txmgr.EvmTxStore, fromAddress c } func MustCreateUnstartedTxFromEvmTxRequest(t testing.TB, txStore txmgr.EvmTxStore, txRequest txmgr.TxRequest, chainID *big.Int) (tx txmgr.Tx) { - tx, err := txStore.CreateTransaction(txRequest, chainID) + tx, err := txStore.CreateTransaction(testutils.Context(t), txRequest, chainID) require.NoError(t, err) return tx } @@ -458,7 +458,7 @@ func MustInsertConfirmedEthTxBySaveFetchedReceipts(t *testing.T, txStore txmgr.T BlockNumber: big.NewInt(nonce), TransactionIndex: uint(1), } - err := txStore.SaveFetchedReceipts([]*evmtypes.Receipt{&receipt}, &chainID) + err := txStore.SaveFetchedReceipts(testutils.Context(t), []*evmtypes.Receipt{&receipt}, &chainID) require.NoError(t, err) return etx } diff --git a/core/services/blockhashstore/batch_bhs.go b/core/services/blockhashstore/batch_bhs.go index 96e5784a8cd..d8381ff6231 100644 --- a/core/services/blockhashstore/batch_bhs.go +++ b/core/services/blockhashstore/batch_bhs.go @@ -15,7 +15,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" ) type batchBHSConfig interface { @@ -66,13 +65,13 @@ func (b *BatchBlockhashStore) StoreVerifyHeader(ctx context.Context, blockNumber return errors.Wrap(err, "packing args") } - _, err = b.txm.CreateTransaction(txmgr.TxRequest{ + _, err = b.txm.CreateTransaction(ctx, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: b.batchbhs.Address(), EncodedPayload: payload, FeeLimit: b.config.LimitDefault(), Strategy: txmgrcommon.NewSendEveryStrategy(), - }, pg.WithParentCtx(ctx)) + }) if err != nil { return errors.Wrap(err, "creating transaction") diff --git a/core/services/blockhashstore/bhs.go b/core/services/blockhashstore/bhs.go index 70a9c77669c..3de00f64590 100644 --- a/core/services/blockhashstore/bhs.go +++ b/core/services/blockhashstore/bhs.go @@ -20,7 +20,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/trusted_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" ) var _ BHS = &BulletproofBHS{} @@ -97,7 +96,7 @@ func (c *BulletproofBHS) Store(ctx context.Context, blockNum uint64) error { return errors.Wrap(err, "getting next from address") } - _, err = c.txm.CreateTransaction(txmgr.TxRequest{ + _, err = c.txm.CreateTransaction(ctx, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: c.bhs.Address(), EncodedPayload: payload, @@ -106,7 +105,7 @@ func (c *BulletproofBHS) Store(ctx context.Context, blockNum uint64) error { // Set a queue size of 256. At most we store the blockhash of every block, and only the // latest 256 can possibly be stored. Strategy: txmgrcommon.NewQueueingTxStrategy(c.jobID, 256, c.dbConfig.DefaultQueryTimeout()), - }, pg.WithParentCtx(ctx)) + }) if err != nil { return errors.Wrap(err, "creating transaction") } @@ -137,14 +136,14 @@ func (c *BulletproofBHS) StoreTrusted( if err != nil { return errors.Wrap(err, "getting next from address") } - _, err = c.txm.CreateTransaction(txmgr.TxRequest{ + _, err = c.txm.CreateTransaction(ctx, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: c.trustedBHS.Address(), EncodedPayload: payload, FeeLimit: c.config.LimitDefault(), Strategy: txmgrcommon.NewSendEveryStrategy(), - }, pg.WithParentCtx(ctx)) + }) if err != nil { return errors.Wrap(err, "creating transaction") } @@ -192,13 +191,13 @@ func (c *BulletproofBHS) StoreEarliest(ctx context.Context) error { return errors.Wrap(err, "getting next from address") } - _, err = c.txm.CreateTransaction(txmgr.TxRequest{ + _, err = c.txm.CreateTransaction(ctx, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: c.bhs.Address(), EncodedPayload: payload, FeeLimit: c.config.LimitDefault(), Strategy: txmgrcommon.NewSendEveryStrategy(), - }, pg.WithParentCtx(ctx)) + }) if err != nil { return errors.Wrap(err, "creating transaction") } diff --git a/core/services/blockhashstore/bhs_test.go b/core/services/blockhashstore/bhs_test.go index 79494ea41f6..ed32b3ab49f 100644 --- a/core/services/blockhashstore/bhs_test.go +++ b/core/services/blockhashstore/bhs_test.go @@ -58,13 +58,13 @@ func TestStoreRotatesFromAddresses(t *testing.T) { ) require.NoError(t, err) - txm.On("CreateTransaction", mock.MatchedBy(func(tx txmgr.TxRequest) bool { + txm.On("CreateTransaction", mock.Anything, mock.MatchedBy(func(tx txmgr.TxRequest) bool { return tx.FromAddress.String() == k1.Address.String() - }), mock.Anything).Once().Return(txmgr.Tx{}, nil) + })).Once().Return(txmgr.Tx{}, nil) - txm.On("CreateTransaction", mock.MatchedBy(func(tx txmgr.TxRequest) bool { + txm.On("CreateTransaction", mock.Anything, mock.MatchedBy(func(tx txmgr.TxRequest) bool { return tx.FromAddress.String() == k2.Address.String() - }), mock.Anything).Once().Return(txmgr.Tx{}, nil) + })).Once().Return(txmgr.Tx{}, nil) // store 2 blocks err = bhs.Store(context.Background(), 1) diff --git a/core/services/fluxmonitorv2/contract_submitter.go b/core/services/fluxmonitorv2/contract_submitter.go index d60f5b70e01..8f3f40c309d 100644 --- a/core/services/fluxmonitorv2/contract_submitter.go +++ b/core/services/fluxmonitorv2/contract_submitter.go @@ -1,6 +1,7 @@ package fluxmonitorv2 import ( + "context" "math/big" "github.com/pkg/errors" @@ -16,7 +17,7 @@ var FluxAggregatorABI = evmtypes.MustGetABI(flux_aggregator_wrapper.FluxAggregat // ContractSubmitter defines an interface to submit an eth tx. type ContractSubmitter interface { - Submit(roundID *big.Int, submission *big.Int, idempotencyKey *string) error + Submit(ctx context.Context, roundID *big.Int, submission *big.Int, idempotencyKey *string) error } // FluxAggregatorContractSubmitter submits the polled answer in an eth tx. @@ -50,7 +51,7 @@ func NewFluxAggregatorContractSubmitter( // Submit submits the answer by writing a EthTx for the txmgr to // pick up -func (c *FluxAggregatorContractSubmitter) Submit(roundID *big.Int, submission *big.Int, idempotencyKey *string) error { +func (c *FluxAggregatorContractSubmitter) Submit(ctx context.Context, roundID *big.Int, submission *big.Int, idempotencyKey *string) error { fromAddress, err := c.keyStore.GetRoundRobinAddress(c.chainID) if err != nil { return err @@ -62,7 +63,7 @@ func (c *FluxAggregatorContractSubmitter) Submit(roundID *big.Int, submission *b } return errors.Wrap( - c.orm.CreateEthTransaction(fromAddress, c.Address(), payload, c.gasLimit, idempotencyKey), + c.orm.CreateEthTransaction(ctx, fromAddress, c.Address(), payload, c.gasLimit, idempotencyKey), "failed to send Eth transaction", ) } diff --git a/core/services/fluxmonitorv2/contract_submitter_test.go b/core/services/fluxmonitorv2/contract_submitter_test.go index 7c282e3190c..c3b2ca7e715 100644 --- a/core/services/fluxmonitorv2/contract_submitter_test.go +++ b/core/services/fluxmonitorv2/contract_submitter_test.go @@ -6,6 +6,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/smartcontractkit/chainlink/v2/core/internal/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -35,8 +36,8 @@ func TestFluxAggregatorContractSubmitter_Submit(t *testing.T) { fluxAggregator.On("Address").Return(toAddress) idempotencyKey := uuid.New().String() - orm.On("CreateEthTransaction", fromAddress, toAddress, payload, gasLimit, &idempotencyKey).Return(nil) + orm.On("CreateEthTransaction", mock.Anything, fromAddress, toAddress, payload, gasLimit, &idempotencyKey).Return(nil) - err = submitter.Submit(roundID, submission, &idempotencyKey) + err = submitter.Submit(testutils.Context(t), roundID, submission, &idempotencyKey) assert.NoError(t, err) } diff --git a/core/services/fluxmonitorv2/flux_monitor.go b/core/services/fluxmonitorv2/flux_monitor.go index 0b09655707d..93d3752eb59 100644 --- a/core/services/fluxmonitorv2/flux_monitor.go +++ b/core/services/fluxmonitorv2/flux_monitor.go @@ -587,6 +587,8 @@ func (fm *FluxMonitor) respondToAnswerUpdatedLog(log flux_aggregator_wrapper.Flu // need to poll and submit an answer to the contract regardless of the deviation. func (fm *FluxMonitor) respondToNewRoundLog(log flux_aggregator_wrapper.FluxAggregatorNewRound, lb log.Broadcast) { started := time.Now() + ctx, cancel := utils.StopChan(fm.chStop).NewCtx() + defer cancel() newRoundLogger := fm.logger.With( "round", log.RoundId, @@ -743,7 +745,7 @@ func (fm *FluxMonitor) respondToNewRoundLog(log flux_aggregator_wrapper.FluxAggr }) // Call the v2 pipeline to execute a new job run - run, results, err := fm.runner.ExecuteRun(context.Background(), fm.spec, vars, fm.logger) + run, results, err := fm.runner.ExecuteRun(ctx, fm.spec, vars, fm.logger) if err != nil { newRoundLogger.Errorw(fmt.Sprintf("error executing new run for job ID %v name %v", fm.spec.JobID, fm.spec.JobName), "err", err) return @@ -772,7 +774,7 @@ func (fm *FluxMonitor) respondToNewRoundLog(log flux_aggregator_wrapper.FluxAggr if err2 := fm.runner.InsertFinishedRun(run, false, pg.WithQueryer(tx)); err2 != nil { return err2 } - if err2 := fm.queueTransactionForTxm(tx, run.ID, answer, roundState.RoundId, &log); err2 != nil { + if err2 := fm.queueTransactionForTxm(ctx, tx, run.ID, answer, roundState.RoundId, &log); err2 != nil { return err2 } return fm.logBroadcaster.MarkConsumed(lb, pg.WithQueryer(tx)) @@ -811,6 +813,8 @@ func (fm *FluxMonitor) checkEligibilityAndAggregatorFunding(roundState flux_aggr func (fm *FluxMonitor) pollIfEligible(pollReq PollRequestType, deviationChecker *DeviationChecker, broadcast log.Broadcast) { started := time.Now() + ctx, cancel := utils.StopChan(fm.chStop).NewCtx() + defer cancel() l := fm.logger.With( "threshold", deviationChecker.Thresholds.Rel, @@ -946,7 +950,7 @@ func (fm *FluxMonitor) pollIfEligible(pollReq PollRequestType, deviationChecker }, }) - run, results, err := fm.runner.ExecuteRun(context.Background(), fm.spec, vars, fm.logger) + run, results, err := fm.runner.ExecuteRun(ctx, fm.spec, vars, fm.logger) if err != nil { l.Errorw("can't fetch answer", "err", err) fm.jobORM.TryRecordError(fm.spec.JobID, "Error polling") @@ -996,7 +1000,7 @@ func (fm *FluxMonitor) pollIfEligible(pollReq PollRequestType, deviationChecker if err2 := fm.runner.InsertFinishedRun(run, true, pg.WithQueryer(tx)); err2 != nil { return err2 } - if err2 := fm.queueTransactionForTxm(tx, run.ID, answer, roundState.RoundId, nil); err2 != nil { + if err2 := fm.queueTransactionForTxm(ctx, tx, run.ID, answer, roundState.RoundId, nil); err2 != nil { return err2 } if broadcast != nil { @@ -1072,11 +1076,12 @@ func (fm *FluxMonitor) initialRoundState() flux_aggregator_wrapper.OracleRoundSt return latestRoundState } -func (fm *FluxMonitor) queueTransactionForTxm(tx pg.Queryer, runID int64, answer decimal.Decimal, roundID uint32, log *flux_aggregator_wrapper.FluxAggregatorNewRound) error { +func (fm *FluxMonitor) queueTransactionForTxm(ctx context.Context, tx pg.Queryer, runID int64, answer decimal.Decimal, roundID uint32, log *flux_aggregator_wrapper.FluxAggregatorNewRound) error { // Use pipeline run ID to generate globally unique key that can correlate this run to a Tx idempotencyKey := fmt.Sprintf("fluxmonitor-%d", runID) // Submit the Eth Tx err := fm.contractSubmitter.Submit( + ctx, new(big.Int).SetInt64(int64(roundID)), answer.BigInt(), &idempotencyKey, diff --git a/core/services/fluxmonitorv2/flux_monitor_test.go b/core/services/fluxmonitorv2/flux_monitor_test.go index 27d40cd69c7..f2e97b66b35 100644 --- a/core/services/fluxmonitorv2/flux_monitor_test.go +++ b/core/services/fluxmonitorv2/flux_monitor_test.go @@ -474,7 +474,7 @@ func TestFluxMonitor_PollIfEligible(t *testing.T) { }). Once() tm.contractSubmitter. - On("Submit", big.NewInt(reportableRoundID), big.NewInt(answers.polledAnswer), buildIdempotencyKey(run.ID)). + On("Submit", mock.Anything, big.NewInt(reportableRoundID), big.NewInt(answers.polledAnswer), buildIdempotencyKey(run.ID)). Return(nil). Once() @@ -609,7 +609,7 @@ func TestPollingDeviationChecker_BuffersLogs(t *testing.T) { args.Get(0).(*pipeline.Run).ID = 1 }).Once() tm.contractSubmitter. - On("Submit", big.NewInt(1), big.NewInt(fetchedValue), buildIdempotencyKey(run.ID)). + On("Submit", mock.Anything, big.NewInt(1), big.NewInt(fetchedValue), buildIdempotencyKey(run.ID)). Return(nil). Once() @@ -649,7 +649,7 @@ func TestPollingDeviationChecker_BuffersLogs(t *testing.T) { args.Get(0).(*pipeline.Run).ID = 2 }).Once() tm.contractSubmitter. - On("Submit", big.NewInt(3), big.NewInt(fetchedValue), buildIdempotencyKey(run.ID)). + On("Submit", mock.Anything, big.NewInt(3), big.NewInt(fetchedValue), buildIdempotencyKey(run.ID)). Return(nil). Once() tm.orm. @@ -688,7 +688,7 @@ func TestPollingDeviationChecker_BuffersLogs(t *testing.T) { args.Get(0).(*pipeline.Run).ID = 3 }).Once() tm.contractSubmitter. - On("Submit", big.NewInt(4), big.NewInt(fetchedValue), buildIdempotencyKey(run.ID)). + On("Submit", mock.Anything, big.NewInt(4), big.NewInt(fetchedValue), buildIdempotencyKey(run.ID)). Return(nil). Once() tm.orm. @@ -1515,7 +1515,7 @@ func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { args.Get(0).(*pipeline.Run).ID = 1 }) tm.logBroadcaster.On("MarkConsumed", mock.Anything, mock.Anything).Return(nil).Once() - tm.contractSubmitter.On("Submit", big.NewInt(roundID), big.NewInt(answer), buildIdempotencyKey(run.ID)).Return(nil).Once() + tm.contractSubmitter.On("Submit", mock.Anything, big.NewInt(roundID), big.NewInt(answer), buildIdempotencyKey(run.ID)).Return(nil).Once() tm.orm. On("UpdateFluxMonitorRoundStats", contractAddress, @@ -1642,7 +1642,7 @@ func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { Run(func(args mock.Arguments) { args.Get(0).(*pipeline.Run).ID = 1 }) - tm.contractSubmitter.On("Submit", big.NewInt(roundID), big.NewInt(answer), buildIdempotencyKey(run.ID)).Return(nil).Once() + tm.contractSubmitter.On("Submit", mock.Anything, big.NewInt(roundID), big.NewInt(answer), buildIdempotencyKey(run.ID)).Return(nil).Once() tm.orm. On("UpdateFluxMonitorRoundStats", contractAddress, @@ -1738,7 +1738,7 @@ func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { Run(func(args mock.Arguments) { args.Get(0).(*pipeline.Run).ID = 1 }) - tm.contractSubmitter.On("Submit", big.NewInt(roundID), big.NewInt(answer), buildIdempotencyKey(run.ID)).Return(nil).Once() + tm.contractSubmitter.On("Submit", mock.Anything, big.NewInt(roundID), big.NewInt(answer), buildIdempotencyKey(run.ID)).Return(nil).Once() tm.orm. On("UpdateFluxMonitorRoundStats", contractAddress, @@ -1811,7 +1811,7 @@ func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { Once() // and that should result in a new submission - tm.contractSubmitter.On("Submit", big.NewInt(olderRoundID), big.NewInt(answer), buildIdempotencyKey(run.ID)).Return(nil).Once() + tm.contractSubmitter.On("Submit", mock.Anything, big.NewInt(olderRoundID), big.NewInt(answer), buildIdempotencyKey(run.ID)).Return(nil).Once() tm.orm. On("UpdateFluxMonitorRoundStats", @@ -1919,7 +1919,7 @@ func TestFluxMonitor_DrumbeatTicker(t *testing.T) { }). Once() tm.contractSubmitter. - On("Submit", big.NewInt(int64(roundID)), answerBigInt, buildIdempotencyKey(runID)). + On("Submit", mock.Anything, big.NewInt(int64(roundID)), answerBigInt, buildIdempotencyKey(runID)). Return(nil). Once() diff --git a/core/services/fluxmonitorv2/mocks/contract_submitter.go b/core/services/fluxmonitorv2/mocks/contract_submitter.go index 6214255ff66..c2927af1527 100644 --- a/core/services/fluxmonitorv2/mocks/contract_submitter.go +++ b/core/services/fluxmonitorv2/mocks/contract_submitter.go @@ -3,6 +3,7 @@ package mocks import ( + context "context" big "math/big" mock "github.com/stretchr/testify/mock" @@ -13,13 +14,13 @@ type ContractSubmitter struct { mock.Mock } -// Submit provides a mock function with given fields: roundID, submission, idempotencyKey -func (_m *ContractSubmitter) Submit(roundID *big.Int, submission *big.Int, idempotencyKey *string) error { - ret := _m.Called(roundID, submission, idempotencyKey) +// Submit provides a mock function with given fields: ctx, roundID, submission, idempotencyKey +func (_m *ContractSubmitter) Submit(ctx context.Context, roundID *big.Int, submission *big.Int, idempotencyKey *string) error { + ret := _m.Called(ctx, roundID, submission, idempotencyKey) var r0 error - if rf, ok := ret.Get(0).(func(*big.Int, *big.Int, *string) error); ok { - r0 = rf(roundID, submission, idempotencyKey) + if rf, ok := ret.Get(0).(func(context.Context, *big.Int, *big.Int, *string) error); ok { + r0 = rf(ctx, roundID, submission, idempotencyKey) } else { r0 = ret.Error(0) } diff --git a/core/services/fluxmonitorv2/mocks/orm.go b/core/services/fluxmonitorv2/mocks/orm.go index 1f2303fbf1a..141ac515546 100644 --- a/core/services/fluxmonitorv2/mocks/orm.go +++ b/core/services/fluxmonitorv2/mocks/orm.go @@ -3,8 +3,12 @@ package mocks import ( + context "context" + common "github.com/ethereum/go-ethereum/common" + fluxmonitorv2 "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" + mock "github.com/stretchr/testify/mock" pg "github.com/smartcontractkit/chainlink/v2/core/services/pg" @@ -39,13 +43,13 @@ func (_m *ORM) CountFluxMonitorRoundStats() (int, error) { return r0, r1 } -// CreateEthTransaction provides a mock function with given fields: fromAddress, toAddress, payload, gasLimit, idempotencyKey -func (_m *ORM) CreateEthTransaction(fromAddress common.Address, toAddress common.Address, payload []byte, gasLimit uint32, idempotencyKey *string) error { - ret := _m.Called(fromAddress, toAddress, payload, gasLimit, idempotencyKey) +// CreateEthTransaction provides a mock function with given fields: ctx, fromAddress, toAddress, payload, gasLimit, idempotencyKey +func (_m *ORM) CreateEthTransaction(ctx context.Context, fromAddress common.Address, toAddress common.Address, payload []byte, gasLimit uint32, idempotencyKey *string) error { + ret := _m.Called(ctx, fromAddress, toAddress, payload, gasLimit, idempotencyKey) var r0 error - if rf, ok := ret.Get(0).(func(common.Address, common.Address, []byte, uint32, *string) error); ok { - r0 = rf(fromAddress, toAddress, payload, gasLimit, idempotencyKey) + if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Address, []byte, uint32, *string) error); ok { + r0 = rf(ctx, fromAddress, toAddress, payload, gasLimit, idempotencyKey) } else { r0 = ret.Error(0) } diff --git a/core/services/fluxmonitorv2/orm.go b/core/services/fluxmonitorv2/orm.go index 70ebd2e7020..61395e8708a 100644 --- a/core/services/fluxmonitorv2/orm.go +++ b/core/services/fluxmonitorv2/orm.go @@ -1,6 +1,7 @@ package fluxmonitorv2 import ( + "context" "database/sql" "github.com/ethereum/go-ethereum/common" @@ -15,7 +16,7 @@ import ( ) type transmitter interface { - CreateTransaction(txRequest txmgr.TxRequest, qopts ...pg.QOpt) (tx txmgr.Tx, err error) + CreateTransaction(ctx context.Context, txRequest txmgr.TxRequest) (tx txmgr.Tx, err error) } //go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore @@ -26,7 +27,7 @@ type ORM interface { DeleteFluxMonitorRoundsBackThrough(aggregator common.Address, roundID uint32) error FindOrCreateFluxMonitorRoundStats(aggregator common.Address, roundID uint32, newRoundLogs uint) (FluxMonitorRoundStatsV2, error) UpdateFluxMonitorRoundStats(aggregator common.Address, roundID uint32, runID int64, newRoundLogsAddition uint, qopts ...pg.QOpt) error - CreateEthTransaction(fromAddress, toAddress common.Address, payload []byte, gasLimit uint32, idempotencyKey *string) error + CreateEthTransaction(ctx context.Context, fromAddress, toAddress common.Address, payload []byte, gasLimit uint32, idempotencyKey *string) error CountFluxMonitorRoundStats() (count int, err error) } @@ -114,6 +115,7 @@ func (o *orm) CountFluxMonitorRoundStats() (count int, err error) { // CreateEthTransaction creates an ethereum transaction for the Txm to pick up func (o *orm) CreateEthTransaction( + ctx context.Context, fromAddress common.Address, toAddress common.Address, payload []byte, @@ -121,7 +123,7 @@ func (o *orm) CreateEthTransaction( idempotencyKey *string, ) (err error) { - _, err = o.txm.CreateTransaction(txmgr.TxRequest{ + _, err = o.txm.CreateTransaction(ctx, txmgr.TxRequest{ IdempotencyKey: idempotencyKey, FromAddress: fromAddress, ToAddress: toAddress, diff --git a/core/services/fluxmonitorv2/orm_test.go b/core/services/fluxmonitorv2/orm_test.go index a24f516c7f0..960618c43bb 100644 --- a/core/services/fluxmonitorv2/orm_test.go +++ b/core/services/fluxmonitorv2/orm_test.go @@ -7,6 +7,7 @@ import ( "github.com/google/uuid" "gopkg.in/guregu/null.v4" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" commontxmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/types/mocks" @@ -186,7 +187,7 @@ func TestORM_CreateEthTransaction(t *testing.T) { gasLimit = uint32(21000) ) idempotencyKey := uuid.New().String() - txm.On("CreateTransaction", txmgr.TxRequest{ + txm.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ IdempotencyKey: &idempotencyKey, FromAddress: from, ToAddress: to, @@ -196,5 +197,5 @@ func TestORM_CreateEthTransaction(t *testing.T) { Strategy: strategy, }).Return(txmgr.Tx{}, nil).Once() - require.NoError(t, orm.CreateEthTransaction(from, to, payload, gasLimit, &idempotencyKey)) + require.NoError(t, orm.CreateEthTransaction(testutils.Context(t), from, to, payload, gasLimit, &idempotencyKey)) } diff --git a/core/services/keeper/upkeep_executer_test.go b/core/services/keeper/upkeep_executer_test.go index 702633e1d08..39f85aedcd9 100644 --- a/core/services/keeper/upkeep_executer_test.go +++ b/core/services/keeper/upkeep_executer_test.go @@ -134,6 +134,7 @@ func Test_UpkeepExecuter_PerformsUpkeep_Happy(t *testing.T) { ethTxCreated := cltest.NewAwaiter() txm.On("CreateTransaction", + mock.Anything, mock.MatchedBy(func(txRequest txmgr.TxRequest) bool { return txRequest.FeeLimit == gasLimit }), ). Once(). @@ -178,6 +179,7 @@ func Test_UpkeepExecuter_PerformsUpkeep_Happy(t *testing.T) { ethTxCreated := cltest.NewAwaiter() txm.On("CreateTransaction", + mock.Anything, mock.MatchedBy(func(txRequest txmgr.TxRequest) bool { return txRequest.FeeLimit == gasLimit }), ). Once(). @@ -284,6 +286,7 @@ func Test_UpkeepExecuter_PerformsUpkeep_Happy(t *testing.T) { } gasLimit := 5_000_000 + config.Keeper().Registry().PerformGasOverhead() txm.On("CreateTransaction", + mock.Anything, mock.MatchedBy(func(txRequest txmgr.TxRequest) bool { return txRequest.FeeLimit == gasLimit }), ). Once(). diff --git a/core/services/ocrcommon/transmitter.go b/core/services/ocrcommon/transmitter.go index 24e985048f0..9cdf6a0c5a9 100644 --- a/core/services/ocrcommon/transmitter.go +++ b/core/services/ocrcommon/transmitter.go @@ -9,7 +9,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" ) type roundRobinKeystore interface { @@ -17,7 +16,7 @@ type roundRobinKeystore interface { } type txManager interface { - CreateTransaction(txRequest txmgr.TxRequest, qopts ...pg.QOpt) (tx txmgr.Tx, err error) + CreateTransaction(ctx context.Context, txRequest txmgr.TxRequest) (tx txmgr.Tx, err error) } type Transmitter interface { @@ -72,7 +71,7 @@ func (t *transmitter) CreateEthTransaction(ctx context.Context, toAddress common return errors.Wrap(err, "skipped OCR transmission, error getting round-robin address") } - _, err = t.txm.CreateTransaction(txmgr.TxRequest{ + _, err = t.txm.CreateTransaction(ctx, txmgr.TxRequest{ FromAddress: roundRobinFromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -81,7 +80,7 @@ func (t *transmitter) CreateEthTransaction(ctx context.Context, toAddress common Strategy: t.strategy, Checker: t.checker, Meta: txMeta, - }, pg.WithParentCtx(ctx)) + }) return errors.Wrap(err, "skipped OCR transmission") } diff --git a/core/services/ocrcommon/transmitter_test.go b/core/services/ocrcommon/transmitter_test.go index 65a5f382830..0790f2331c8 100644 --- a/core/services/ocrcommon/transmitter_test.go +++ b/core/services/ocrcommon/transmitter_test.go @@ -51,7 +51,7 @@ func Test_DefaultTransmitter_CreateEthTransaction(t *testing.T) { ) require.NoError(t, err) - txm.On("CreateTransaction", txmgr.TxRequest{ + txm.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -59,7 +59,7 @@ func Test_DefaultTransmitter_CreateEthTransaction(t *testing.T) { ForwarderAddress: common.Address{}, Meta: nil, Strategy: strategy, - }, mock.Anything).Return(txmgr.Tx{}, nil).Once() + }).Return(txmgr.Tx{}, nil).Once() require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil)) } @@ -93,7 +93,7 @@ func Test_DefaultTransmitter_Forwarding_Enabled_CreateEthTransaction(t *testing. ) require.NoError(t, err) - txm.On("CreateTransaction", txmgr.TxRequest{ + txm.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: toAddress, EncodedPayload: payload, @@ -101,8 +101,8 @@ func Test_DefaultTransmitter_Forwarding_Enabled_CreateEthTransaction(t *testing. ForwarderAddress: common.Address{}, Meta: nil, Strategy: strategy, - }, mock.Anything).Return(txmgr.Tx{}, nil).Once() - txm.On("CreateTransaction", txmgr.TxRequest{ + }).Return(txmgr.Tx{}, nil).Once() + txm.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: fromAddress2, ToAddress: toAddress, EncodedPayload: payload, @@ -110,7 +110,7 @@ func Test_DefaultTransmitter_Forwarding_Enabled_CreateEthTransaction(t *testing. ForwarderAddress: common.Address{}, Meta: nil, Strategy: strategy, - }, mock.Anything).Return(txmgr.Tx{}, nil).Once() + }).Return(txmgr.Tx{}, nil).Once() require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil)) require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil)) } diff --git a/core/services/pipeline/task.eth_tx.go b/core/services/pipeline/task.eth_tx.go index d5d29240652..57f1c0a7ed8 100644 --- a/core/services/pipeline/task.eth_tx.go +++ b/core/services/pipeline/task.eth_tx.go @@ -63,7 +63,7 @@ func (t *ETHTxTask) getEvmChainID() string { return t.EVMChainID } -func (t *ETHTxTask) Run(_ context.Context, lggr logger.Logger, vars Vars, inputs []Result) (result Result, runInfo RunInfo) { +func (t *ETHTxTask) Run(ctx context.Context, lggr logger.Logger, vars Vars, inputs []Result) (result Result, runInfo RunInfo) { var chainID StringParam err := errors.Wrap(ResolveParam(&chainID, From(VarExpr(t.getEvmChainID(), vars), NonemptyString(t.getEvmChainID()), "")), "evmChainID") if err != nil { @@ -163,7 +163,7 @@ func (t *ETHTxTask) Run(_ context.Context, lggr logger.Logger, vars Vars, inputs txRequest.MinConfirmations = clnull.Uint32From(uint32(minOutgoingConfirmations)) } - _, err = txManager.CreateTransaction(txRequest) + _, err = txManager.CreateTransaction(ctx, txRequest) if err != nil { return Result{Error: errors.Wrapf(ErrTaskRunFailed, "while creating transaction: %v", err)}, retryableRunInfo() } diff --git a/core/services/pipeline/task.eth_tx_test.go b/core/services/pipeline/task.eth_tx_test.go index a280e6f2720..b1915c851b9 100644 --- a/core/services/pipeline/task.eth_tx_test.go +++ b/core/services/pipeline/task.eth_tx_test.go @@ -84,7 +84,7 @@ func TestETHTxTask(t *testing.T) { FailOnRevert: null.BoolFrom(false), } keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", txmgr.TxRequest{ + txManager.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: from, ToAddress: to, EncodedPayload: data, @@ -131,7 +131,7 @@ func TestETHTxTask(t *testing.T) { FailOnRevert: null.BoolFrom(false), } keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", txmgr.TxRequest{ + txManager.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: from, ToAddress: to, EncodedPayload: data, @@ -168,7 +168,7 @@ func TestETHTxTask(t *testing.T) { func(keyStore *keystoremocks.Eth, txManager *txmmocks.MockEvmTxManager) { from := common.HexToAddress("0x882969652440ccf14a5dbb9bd53eb21cb1e11e5c") keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", mock.MatchedBy(func(tx txmgr.TxRequest) bool { + txManager.On("CreateTransaction", mock.Anything, mock.MatchedBy(func(tx txmgr.TxRequest) bool { return tx.MinConfirmations == clnull.Uint32From(2) })).Return(txmgr.Tx{}, nil) }, @@ -208,7 +208,7 @@ func TestETHTxTask(t *testing.T) { FailOnRevert: null.BoolFrom(false), } keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", txmgr.TxRequest{ + txManager.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: from, ToAddress: to, EncodedPayload: data, @@ -253,7 +253,7 @@ func TestETHTxTask(t *testing.T) { FailOnRevert: null.BoolFrom(false), } keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID).Return(from, nil) - txManager.On("CreateTransaction", txmgr.TxRequest{ + txManager.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: from, ToAddress: to, EncodedPayload: data, @@ -283,7 +283,7 @@ func TestETHTxTask(t *testing.T) { gasLimit := uint32(12345) txMeta := &txmgr.TxMeta{FailOnRevert: null.BoolFrom(false)} keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", txmgr.TxRequest{ + txManager.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: from, ToAddress: to, EncodedPayload: data, @@ -317,7 +317,7 @@ func TestETHTxTask(t *testing.T) { FailOnRevert: null.BoolFrom(false), } keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", txmgr.TxRequest{ + txManager.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: from, ToAddress: to, EncodedPayload: data, @@ -351,7 +351,7 @@ func TestETHTxTask(t *testing.T) { FailOnRevert: null.BoolFrom(false), } keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", txmgr.TxRequest{ + txManager.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: from, ToAddress: to, EncodedPayload: data, @@ -416,7 +416,7 @@ func TestETHTxTask(t *testing.T) { FailOnRevert: null.BoolFrom(false), } keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", txmgr.TxRequest{ + txManager.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ FromAddress: from, ToAddress: to, EncodedPayload: data, @@ -512,7 +512,7 @@ func TestETHTxTask(t *testing.T) { func(keyStore *keystoremocks.Eth, txManager *txmmocks.MockEvmTxManager) { from := common.HexToAddress("0x882969652440ccf14a5dbb9bd53eb21cb1e11e5c") keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID, from).Return(from, nil) - txManager.On("CreateTransaction", mock.MatchedBy(func(tx txmgr.TxRequest) bool { + txManager.On("CreateTransaction", mock.Anything, mock.MatchedBy(func(tx txmgr.TxRequest) bool { return tx.MinConfirmations == clnull.Uint32From(3) && tx.PipelineTaskRunID != nil })).Return(txmgr.Tx{}, nil) }, diff --git a/core/services/vrf/delegate_test.go b/core/services/vrf/delegate_test.go index ae0accc329e..fc96f008d40 100644 --- a/core/services/vrf/delegate_test.go +++ b/core/services/vrf/delegate_test.go @@ -305,6 +305,7 @@ func TestDelegate_ValidLog(t *testing.T) { // Ensure we queue up a valid eth transaction // Linked to requestID vuni.txm.On("CreateTransaction", + mock.Anything, mock.MatchedBy(func(txRequest txmgr.TxRequest) bool { meta := txRequest.Meta return txRequest.FromAddress == vuni.submitter && diff --git a/core/services/vrf/v1/integration_test.go b/core/services/vrf/v1/integration_test.go index 8626b43dd23..14550912376 100644 --- a/core/services/vrf/v1/integration_test.go +++ b/core/services/vrf/v1/integration_test.go @@ -98,7 +98,7 @@ func TestIntegration_VRF_JPV2(t *testing.T) { // Ensure the eth transaction gets confirmed on chain. gomega.NewWithT(t).Eventually(func() bool { orm := txmgr.NewTxStore(app.GetSqlxDB(), app.GetLogger(), app.GetConfig().Database()) - uc, err2 := orm.CountUnconfirmedTransactions(key1.Address, testutils.SimulatedChainID) + uc, err2 := orm.CountUnconfirmedTransactions(testutils.Context(t), key1.Address, testutils.SimulatedChainID) require.NoError(t, err2) return uc == 0 }, testutils.WaitTimeout(t), 100*time.Millisecond).Should(gomega.BeTrue()) @@ -215,7 +215,7 @@ func TestIntegration_VRF_WithBHS(t *testing.T) { // Ensure the eth transaction gets confirmed on chain. gomega.NewWithT(t).Eventually(func() bool { orm := txmgr.NewTxStore(app.GetSqlxDB(), app.GetLogger(), app.GetConfig().Database()) - uc, err2 := orm.CountUnconfirmedTransactions(key.Address, testutils.SimulatedChainID) + uc, err2 := orm.CountUnconfirmedTransactions(testutils.Context(t), key.Address, testutils.SimulatedChainID) require.NoError(t, err2) return uc == 0 }, 5*time.Second, 100*time.Millisecond).Should(gomega.BeTrue()) diff --git a/core/services/vrf/v2/listener_v2.go b/core/services/vrf/v2/listener_v2.go index 6a1ad3e8b2e..7998de557a6 100644 --- a/core/services/vrf/v2/listener_v2.go +++ b/core/services/vrf/v2/listener_v2.go @@ -917,7 +917,7 @@ func (lsn *listenerV2) enqueueForceFulfillment( requestID := common.BytesToHash(p.req.req.RequestID().Bytes()) subID := p.req.req.SubID() requestTxHash := p.req.req.Raw().TxHash - etx, err = lsn.txm.CreateTransaction(txmgr.TxRequest{ + etx, err = lsn.txm.CreateTransaction(ctx, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: lsn.vrfOwner.Address(), EncodedPayload: txData, @@ -1124,7 +1124,7 @@ func (lsn *listenerV2) processRequestsPerSubHelper( requestID := common.BytesToHash(p.req.req.RequestID().Bytes()) coordinatorAddress := lsn.coordinator.Address() requestTxHash := p.req.req.Raw().TxHash - transaction, err = lsn.txm.CreateTransaction(txmgr.TxRequest{ + transaction, err = lsn.txm.CreateTransaction(ctx, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: lsn.coordinator.Address(), EncodedPayload: hexutil.MustDecode(p.payload), diff --git a/core/services/vrf/v2/listener_v2_types.go b/core/services/vrf/v2/listener_v2_types.go index e8c3a8ccb13..e0596abcd1a 100644 --- a/core/services/vrf/v2/listener_v2_types.go +++ b/core/services/vrf/v2/listener_v2_types.go @@ -113,6 +113,8 @@ func (lsn *listenerV2) processBatch( fromAddress common.Address, ) (processedRequestIDs []string) { start := time.Now() + ctx, cancel := lsn.chStop.NewCtx() + defer cancel() // Enqueue a single batch tx for requests that we're able to fulfill based on whether // they passed simulation or not. @@ -179,7 +181,7 @@ func (lsn *listenerV2) processBatch( for _, reqID := range batch.reqIDs { reqIDHashes = append(reqIDHashes, common.BytesToHash(reqID.Bytes())) } - ethTX, err = lsn.txm.CreateTransaction(txmgr.TxRequest{ + ethTX, err = lsn.txm.CreateTransaction(ctx, txmgr.TxRequest{ FromAddress: fromAddress, ToAddress: lsn.batchCoordinator.Address(), EncodedPayload: payload, diff --git a/core/web/eth_keys_controller_test.go b/core/web/eth_keys_controller_test.go index c36ca0aeb5a..f0b5b4bfd7c 100644 --- a/core/web/eth_keys_controller_test.go +++ b/core/web/eth_keys_controller_test.go @@ -402,8 +402,8 @@ func TestETHKeysController_ChainSuccess_ResetWithAbandon(t *testing.T) { subject := uuid.New() strategy := commontxmmocks.NewTxStrategy(t) strategy.On("Subject").Return(uuid.NullUUID{UUID: subject, Valid: true}) - strategy.On("PruneQueue", mock.AnythingOfType("*txmgr.evmTxStore"), mock.AnythingOfType("pg.QOpt")).Return(int64(0), nil) - _, err := chain.TxManager().CreateTransaction(txmgr.TxRequest{ + strategy.On("PruneQueue", mock.Anything, mock.AnythingOfType("*txmgr.evmTxStore")).Return(int64(0), nil) + _, err := chain.TxManager().CreateTransaction(testutils.Context(t), txmgr.TxRequest{ FromAddress: addr, ToAddress: testutils.NewAddress(), EncodedPayload: []byte{1, 2, 3}, diff --git a/core/web/evm_transfer_controller.go b/core/web/evm_transfer_controller.go index 69d55b54bba..c62dcf73b65 100644 --- a/core/web/evm_transfer_controller.go +++ b/core/web/evm_transfer_controller.go @@ -63,7 +63,7 @@ func (tc *EVMTransfersController) Create(c *gin.Context) { } } - etx, err := chain.TxManager().SendNativeToken(chain.ID(), tr.FromAddress, tr.DestinationAddress, *tr.Amount.ToInt(), chain.Config().EVM().GasEstimator().LimitTransfer()) + etx, err := chain.TxManager().SendNativeToken(c, chain.ID(), tr.FromAddress, tr.DestinationAddress, *tr.Amount.ToInt(), chain.Config().EVM().GasEstimator().LimitTransfer()) if err != nil { jsonAPIError(c, http.StatusBadRequest, errors.Errorf("transaction failed: %v", err)) return From c97bb570dab7d6fb445492f2c3017ff80c16837f Mon Sep 17 00:00:00 2001 From: Makram Date: Wed, 4 Oct 2023 11:17:12 +0300 Subject: [PATCH 47/84] chore: fix wrapper config in v2plus scripts (#10845) --- core/scripts/vrfv2plus/testnet/main.go | 12 +++++- .../vrfv2plus/testnet/super_scripts.go | 37 +++++++++++++++---- core/scripts/vrfv2plus/testnet/util.go | 12 +++++- 3 files changed, 51 insertions(+), 10 deletions(-) diff --git a/core/scripts/vrfv2plus/testnet/main.go b/core/scripts/vrfv2plus/testnet/main.go index 7bc64108669..00737fd8272 100644 --- a/core/scripts/vrfv2plus/testnet/main.go +++ b/core/scripts/vrfv2plus/testnet/main.go @@ -1112,7 +1112,11 @@ func main() { wrapperPremiumPercentage := cmd.Uint("wrapper-premium-percentage", 25, "gas premium charged by wrapper") keyHash := cmd.String("key-hash", "", "the keyhash that wrapper requests should use") maxNumWords := cmd.Uint("max-num-words", 10, "the keyhash that wrapper requests should use") - helpers.ParseArgs(cmd, os.Args[2:], "wrapper-address", "key-hash") + fallbackWeiPerUnitLink := cmd.String("fallback-wei-per-unit-link", "", "the fallback wei per unit link") + stalenessSeconds := cmd.Uint("staleness-seconds", 86400, "the number of seconds of staleness to allow") + fulfillmentFlatFeeLinkPPM := cmd.Uint("fulfillment-flat-fee-link-ppm", 500, "the link flat fee in ppm to charge for fulfillment") + fulfillmentFlatFeeNativePPM := cmd.Uint("fulfillment-flat-fee-native-ppm", 500, "the native flat fee in ppm to charge for fulfillment") + helpers.ParseArgs(cmd, os.Args[2:], "wrapper-address", "key-hash", "fallback-wei-per-unit-link") wrapperConfigure(e, common.HexToAddress(*wrapperAddress), @@ -1120,7 +1124,11 @@ func main() { *coordinatorGasOverhead, *wrapperPremiumPercentage, *keyHash, - *maxNumWords) + *maxNumWords, + decimal.RequireFromString(*fallbackWeiPerUnitLink).BigInt(), + uint32(*stalenessSeconds), + uint32(*fulfillmentFlatFeeLinkPPM), + uint32(*fulfillmentFlatFeeNativePPM)) case "wrapper-get-fulfillment-tx-size": cmd := flag.NewFlagSet("wrapper-get-fulfillment-tx-size", flag.ExitOnError) wrapperAddress := cmd.String("wrapper-address", "", "address of the VRFV2Wrapper contract") diff --git a/core/scripts/vrfv2plus/testnet/super_scripts.go b/core/scripts/vrfv2plus/testnet/super_scripts.go index f9efde8f148..3f18e18db9a 100644 --- a/core/scripts/vrfv2plus/testnet/super_scripts.go +++ b/core/scripts/vrfv2plus/testnet/super_scripts.go @@ -492,6 +492,8 @@ func deployUniverse(e helpers.Environment) { // required flags linkAddress := deployCmd.String("link-address", "", "address of link token") linkEthAddress := deployCmd.String("link-eth-feed", "", "address of link eth feed") + bhsAddress := deployCmd.String("bhs-address", "", "address of blockhash store") + batchBHSAddress := deployCmd.String("batch-bhs-address", "", "address of batch blockhash store") subscriptionBalanceString := deployCmd.String("subscription-balance", "1e19", "amount to fund subscription") // optional flags @@ -548,11 +550,21 @@ func deployUniverse(e helpers.Environment) { linkEthAddress = &address } - fmt.Println("\nDeploying BHS...") - bhsContractAddress := deployBHS(e) + var bhsContractAddress common.Address + if len(*bhsAddress) == 0 { + fmt.Println("\nDeploying BHS...") + bhsContractAddress = deployBHS(e) + } else { + bhsContractAddress = common.HexToAddress(*bhsAddress) + } - fmt.Println("\nDeploying Batch BHS...") - batchBHSAddress := deployBatchBHS(e, bhsContractAddress) + var batchBHSContractAddress common.Address + if len(*batchBHSAddress) == 0 { + fmt.Println("\nDeploying Batch BHS...") + batchBHSContractAddress = deployBatchBHS(e, bhsContractAddress) + } else { + batchBHSContractAddress = common.HexToAddress(*batchBHSAddress) + } var coordinatorAddress common.Address fmt.Println("\nDeploying Coordinator...") @@ -637,11 +649,12 @@ func deployUniverse(e helpers.Environment) { ) fmt.Println( + "\n----------------------------", "\nDeployment complete.", "\nLINK Token contract address:", *linkAddress, "\nLINK/ETH Feed contract address:", *linkEthAddress, "\nBlockhash Store contract address:", bhsContractAddress, - "\nBatch Blockhash Store contract address:", batchBHSAddress, + "\nBatch Blockhash Store contract address:", batchBHSContractAddress, "\nVRF Coordinator Address:", coordinatorAddress, "\nBatch VRF Coordinator Address:", batchCoordinatorAddress, "\nVRF Consumer Address:", consumerAddress, @@ -651,6 +664,7 @@ func deployUniverse(e helpers.Environment) { fmt.Sprintf("go run . eoa-request --consumer-address %s --sub-id %d --key-hash %s", consumerAddress, subID, keyHash), "\nA node can now be configured to run a VRF job with the below job spec :\n", formattedJobSpec, + "\n----------------------------", ) } @@ -666,7 +680,11 @@ func deployWrapperUniverse(e helpers.Environment) { maxNumWords := cmd.Uint("max-num-words", 10, "the keyhash that wrapper requests should use") subFunding := cmd.String("sub-funding", "10000000000000000000", "amount to fund the subscription with") consumerFunding := cmd.String("consumer-funding", "10000000000000000000", "amount to fund the consumer with") - helpers.ParseArgs(cmd, os.Args[2:], "link-address", "link-eth-feed", "coordinator-address", "key-hash") + fallbackWeiPerUnitLink := cmd.String("fallback-wei-per-unit-link", "", "the fallback wei per unit link") + stalenessSeconds := cmd.Uint("staleness-seconds", 86400, "the number of seconds of staleness to allow") + fulfillmentFlatFeeLinkPPM := cmd.Uint("fulfillment-flat-fee-link-ppm", 500, "the link flat fee in ppm to charge for fulfillment") + fulfillmentFlatFeeNativePPM := cmd.Uint("fulfillment-flat-fee-native-ppm", 500, "the native flat fee in ppm to charge for fulfillment") + helpers.ParseArgs(cmd, os.Args[2:], "link-address", "link-eth-feed", "coordinator-address", "key-hash", "fallback-wei-per-unit-link") amount, s := big.NewInt(0).SetString(*subFunding, 10) if !s { @@ -684,7 +702,12 @@ func deployWrapperUniverse(e helpers.Environment) { *coordinatorGasOverhead, *wrapperPremiumPercentage, *keyHash, - *maxNumWords) + *maxNumWords, + decimal.RequireFromString(*fallbackWeiPerUnitLink).BigInt(), + uint32(*stalenessSeconds), + uint32(*fulfillmentFlatFeeLinkPPM), + uint32(*fulfillmentFlatFeeNativePPM), + ) consumer := wrapperConsumerDeploy(e, common.HexToAddress(*linkAddress), diff --git a/core/scripts/vrfv2plus/testnet/util.go b/core/scripts/vrfv2plus/testnet/util.go index 904a3f6ba4f..2aeb71bd598 100644 --- a/core/scripts/vrfv2plus/testnet/util.go +++ b/core/scripts/vrfv2plus/testnet/util.go @@ -205,6 +205,10 @@ func wrapperConfigure( wrapperGasOverhead, coordinatorGasOverhead, premiumPercentage uint, keyHash string, maxNumWords uint, + fallbackWeiPerUnitLink *big.Int, + stalenessSeconds uint32, + fulfillmentFlatFeeLinkPPM uint32, + fulfillmentFlatFeeNativePPM uint32, ) { wrapper, err := vrfv2plus_wrapper.NewVRFV2PlusWrapper(wrapperAddress, e.Ec) helpers.PanicErr(err) @@ -215,7 +219,13 @@ func wrapperConfigure( uint32(coordinatorGasOverhead), uint8(premiumPercentage), common.HexToHash(keyHash), - uint8(maxNumWords)) + uint8(maxNumWords), + stalenessSeconds, + fallbackWeiPerUnitLink, + fulfillmentFlatFeeLinkPPM, + fulfillmentFlatFeeNativePPM, + ) + helpers.PanicErr(err) helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID) } From dd3a699128d66d5e6c48649bea6a02ebedc33d54 Mon Sep 17 00:00:00 2001 From: Sri Kidambi <1702865+kidambisrinivas@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:47:02 +0300 Subject: [PATCH 48/84] Rename VRFV2PlusWrapperInterface to IVRFV2PlusWrapper to be consistent with rest of interfaces (#10857) Co-authored-by: Sri Kidambi --- ...{VRFV2PlusWrapperInterface.sol => IVRFV2PlusWrapper.sol} | 2 +- contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol | 4 ++-- contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol | 6 +++--- .../vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol | 2 +- .../vrfv2plus_wrapper_load_test_consumer.go | 2 +- .../generated-wrapper-dependency-versions-do-not-edit.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename contracts/src/v0.8/dev/interfaces/{VRFV2PlusWrapperInterface.sol => IVRFV2PlusWrapper.sol} (98%) diff --git a/contracts/src/v0.8/dev/interfaces/VRFV2PlusWrapperInterface.sol b/contracts/src/v0.8/dev/interfaces/IVRFV2PlusWrapper.sol similarity index 98% rename from contracts/src/v0.8/dev/interfaces/VRFV2PlusWrapperInterface.sol rename to contracts/src/v0.8/dev/interfaces/IVRFV2PlusWrapper.sol index 72f1af5d2fb..aa3de0b6770 100644 --- a/contracts/src/v0.8/dev/interfaces/VRFV2PlusWrapperInterface.sol +++ b/contracts/src/v0.8/dev/interfaces/IVRFV2PlusWrapper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -interface VRFV2PlusWrapperInterface { +interface IVRFV2PlusWrapper { /** * @return the request ID of the most recent VRF V2 request made by this wrapper. This should only * be relied option within the same transaction that the request was made. diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol index 51487a692ff..fb6d9ee0243 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol @@ -7,7 +7,7 @@ import "./VRFConsumerBaseV2Plus.sol"; import "../../shared/interfaces/LinkTokenInterface.sol"; import "../../interfaces/AggregatorV3Interface.sol"; import "../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../interfaces/VRFV2PlusWrapperInterface.sol"; +import "../interfaces/IVRFV2PlusWrapper.sol"; import "./VRFV2PlusWrapperConsumerBase.sol"; import "../../ChainSpecificUtil.sol"; @@ -15,7 +15,7 @@ import "../../ChainSpecificUtil.sol"; * @notice A wrapper for VRFCoordinatorV2 that provides an interface better suited to one-off * @notice requests for randomness. */ -contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBaseV2Plus, VRFV2PlusWrapperInterface { +contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBaseV2Plus, IVRFV2PlusWrapper { event WrapperFulfillmentFailed(uint256 indexed requestId, address indexed consumer); error LinkAlreadySet(); diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol index 098f0558660..c96623d28ef 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../interfaces/VRFV2PlusWrapperInterface.sol"; +import "../interfaces/IVRFV2PlusWrapper.sol"; /** * @@ -32,7 +32,7 @@ abstract contract VRFV2PlusWrapperConsumerBase { error LINKAlreadySet(); LinkTokenInterface internal LINK; - VRFV2PlusWrapperInterface internal VRF_V2_PLUS_WRAPPER; + IVRFV2PlusWrapper internal VRF_V2_PLUS_WRAPPER; /** * @param _link is the address of LinkToken @@ -43,7 +43,7 @@ abstract contract VRFV2PlusWrapperConsumerBase { LINK = LinkTokenInterface(_link); } - VRF_V2_PLUS_WRAPPER = VRFV2PlusWrapperInterface(_vrfV2PlusWrapper); + VRF_V2_PLUS_WRAPPER = IVRFV2PlusWrapper(_vrfV2PlusWrapper); } /** diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol index 6c7849b2581..0656f621799 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol @@ -166,7 +166,7 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi require(success, "withdrawNative failed"); } - function getWrapper() external view returns (VRFV2PlusWrapperInterface) { + function getWrapper() external view returns (IVRFV2PlusWrapper) { return VRF_V2_PLUS_WRAPPER; } diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go b/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go index 98ab26fc295..0bb0e31d6be 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer/vrfv2plus_wrapper_load_test_consumer.go @@ -31,7 +31,7 @@ var ( ) var VRFV2PlusWrapperLoadTestConsumerMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vrfV2PlusWrapper\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"LINKAlreadySet\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"WrappedRequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"}],\"name\":\"WrapperRequestMade\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWrapper\",\"outputs\":[{\"internalType\":\"contractVRFV2PlusWrapperInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"makeRequests\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"makeRequestsNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"}],\"name\":\"setLinkToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLink\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vrfV2PlusWrapper\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"LINKAlreadySet\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"WrappedRequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"}],\"name\":\"WrapperRequestMade\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"}],\"name\":\"getRequestStatus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWrapper\",\"outputs\":[{\"internalType\":\"contractIVRFV2PlusWrapper\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"makeRequests\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestCount\",\"type\":\"uint16\"}],\"name\":\"makeRequestsNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_averageFulfillmentInMillions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fastestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_requestCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requests\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"requestTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fulfilmentBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_responseCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_slowestFulfillment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"}],\"name\":\"setLinkToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLink\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", Bin: "0x6080604052600060065560006007556103e76008553480156200002157600080fd5b5060405162001f0a38038062001f0a8339810160408190526200004491620001f2565b3380600084846001600160a01b038216156200007657600080546001600160a01b0319166001600160a01b0384161790555b600180546001600160a01b0319166001600160a01b03928316179055831615159050620000ea5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b03848116919091179091558116156200011d576200011d8162000128565b50505050506200022a565b6001600160a01b038116331415620001835760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620000e1565b600380546001600160a01b0319166001600160a01b03838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b80516001600160a01b0381168114620001ed57600080fd5b919050565b600080604083850312156200020657600080fd5b6200021183620001d5565b91506200022160208401620001d5565b90509250929050565b611cd0806200023a6000396000f3fe6080604052600436106101635760003560e01c80638f6b7070116100c0578063d826f88f11610074578063dc1670db11610059578063dc1670db14610421578063f176596214610437578063f2fde38b1461045757600080fd5b8063d826f88f146103c2578063d8a4676f146103ee57600080fd5b8063a168fa89116100a5578063a168fa89146102f7578063afacbf9c1461038c578063b1e21749146103ac57600080fd5b80638f6b7070146102ac5780639c24ea40146102d757600080fd5b806374dba124116101175780637a8042bd116100fc5780637a8042bd1461022057806384276d81146102405780638da5cb5b1461026057600080fd5b806374dba124146101f557806379ba50971461020b57600080fd5b80631fe543e3116101485780631fe543e3146101a7578063557d2e92146101c9578063737144bc146101df57600080fd5b806312065fe01461016f5780631757f11c1461019157600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b50475b6040519081526020015b60405180910390f35b34801561019d57600080fd5b5061017e60075481565b3480156101b357600080fd5b506101c76101c23660046118a2565b610477565b005b3480156101d557600080fd5b5061017e60055481565b3480156101eb57600080fd5b5061017e60065481565b34801561020157600080fd5b5061017e60085481565b34801561021757600080fd5b506101c7610530565b34801561022c57600080fd5b506101c761023b366004611870565b610631565b34801561024c57600080fd5b506101c761025b366004611870565b61071b565b34801561026c57600080fd5b5060025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610188565b3480156102b857600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff16610287565b3480156102e357600080fd5b506101c76102f2366004611811565b61080b565b34801561030357600080fd5b50610355610312366004611870565b600b602052600090815260409020805460018201546003830154600484015460058501546006860154600790960154949560ff9485169593949293919290911687565b604080519788529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e001610188565b34801561039857600080fd5b506101c76103a7366004611991565b6108a2565b3480156103b857600080fd5b5061017e60095481565b3480156103ce57600080fd5b506101c76000600681905560078190556103e76008556005819055600455565b3480156103fa57600080fd5b5061040e610409366004611870565b610b32565b6040516101889796959493929190611ae9565b34801561042d57600080fd5b5061017e60045481565b34801561044357600080fd5b506101c7610452366004611991565b610cb5565b34801561046357600080fd5b506101c7610472366004611811565b610f3d565b60015473ffffffffffffffffffffffffffffffffffffffff163314610522576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f6e6c792056524620563220506c757320777261707065722063616e2066756c60448201527f66696c6c0000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61052c8282610f51565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146105b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610519565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560038054909116905560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b610639611130565b60005473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61067660025473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101849052604401602060405180830381600087803b1580156106e357600080fd5b505af11580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052c919061184e565b610723611130565b600061074460025473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461079b576040519150601f19603f3d011682016040523d82523d6000602084013e6107a0565b606091505b505090508061052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f77697468647261774e6174697665206661696c656400000000000000000000006044820152606401610519565b60005473ffffffffffffffffffffffffffffffffffffffff161561085b576040517f64f778ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6108aa611130565b60005b8161ffff168161ffff161015610b2b5760006108d96040518060200160405280600015158152506111b3565b905060006108e98787878561126f565b6009819055905060006108fa611464565b6001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8b16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634306d3549060240160206040518083038186803b15801561096f57600080fd5b505afa158015610983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a79190611889565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c0850184905260e08501849052898452600b8352949092208351815591516001830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790559251805194955091939092610a4f926002850192910190611786565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610ac283611c2c565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610b0c9084815260200190565b60405180910390a2505050508080610b2390611c0a565b9150506108ad565b5050505050565b6000818152600b602052604081205481906060908290819081908190610bb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000888152600b6020908152604080832081516101008101835281548152600182015460ff16151581850152600282018054845181870281018701865281815292959394860193830182828015610c2a57602002820191906000526020600020905b815481526020019060010190808311610c16575b50505050508152602001600382015481526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff1615151515815250509050806000015181602001518260400151836060015184608001518560a001518660c00151975097509750975097509750975050919395979092949650565b610cbd611130565b60005b8161ffff168161ffff161015610b2b576000610cec6040518060200160405280600115158152506111b3565b90506000610cfc87878785611501565b600981905590506000610d0d611464565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff8b16600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b158015610d8257600080fd5b505afa158015610d96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dba9190611889565b604080516101008101825282815260006020808301828152845183815280830186528486019081524260608601526080850184905260a0850189905260c08501849052600160e086018190528a8552600b84529590932084518155905194810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001695151595909517909455905180519495509193610e619260028501920190611786565b50606082015160038201556080820151600482015560a082015160058083019190915560c0830151600683015560e090920151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790558054906000610ed483611c2c565b90915550506000838152600a6020526040908190208390555183907f5f56b4c20db9f5b294cbf6f681368de4a992a27e2de2ee702dcf2cbbfa791ec490610f1e9084815260200190565b60405180910390a2505050508080610f3590611c0a565b915050610cc0565b610f45611130565b610f4e81611668565b50565b6000828152600b6020526040902054610fc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610519565b6000610fd0611464565b6000848152600a602052604081205491925090610fed9083611bf3565b90506000610ffe82620f4240611bb6565b90506007548211156110105760078290555b600854821061102157600854611023565b815b6008556004546110335780611066565b600454611041906001611b63565b816004546006546110529190611bb6565b61105c9190611b63565b6110669190611b7b565b6006556004805490600061107983611c2c565b90915550506000858152600b60209081526040909120600181810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909117905585516110d192600290920191870190611786565b506000858152600b602052604090819020426004820155600681018590555490517f6c84e12b4c188e61f1b4727024a5cf05c025fa58467e5eedf763c0744c89da7b916111219188918891611ac0565b60405180910390a15050505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146111b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610519565b565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa826040516024016111ec91511515815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b600080546001546040517f4306d35400000000000000000000000000000000000000000000000000000000815263ffffffff8816600482015273ffffffffffffffffffffffffffffffffffffffff92831692634000aea09216908190634306d3549060240160206040518083038186803b1580156112ec57600080fd5b505afa158015611300573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113249190611889565b8888888860405160200161133b9493929190611b30565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161136893929190611a8b565b602060405180830381600087803b15801561138257600080fd5b505af1158015611396573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ba919061184e565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc2a88c36040518163ffffffff1660e01b815260040160206040518083038186803b15801561142357600080fd5b505afa158015611437573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145b9190611889565b95945050505050565b6000466114708161175f565b156114fa57606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156114bc57600080fd5b505afa1580156114d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f49190611889565b91505090565b4391505090565b6001546040517f4b16093500000000000000000000000000000000000000000000000000000000815263ffffffff86166004820152600091829173ffffffffffffffffffffffffffffffffffffffff90911690634b1609359060240160206040518083038186803b15801561157557600080fd5b505afa158015611589573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ad9190611889565b6001546040517f9cfc058e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639cfc058e90839061160c908a908a908a908a90600401611b30565b6020604051808303818588803b15801561162557600080fd5b505af1158015611639573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061165e9190611889565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff81163314156116e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610519565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b600061a4b1821480611773575062066eed82145b80611780575062066eee82145b92915050565b8280548282559060005260206000209081019282156117c1579160200282015b828111156117c15782518255916020019190600101906117a6565b506117cd9291506117d1565b5090565b5b808211156117cd57600081556001016117d2565b803561ffff811681146117f857600080fd5b919050565b803563ffffffff811681146117f857600080fd5b60006020828403121561182357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461184757600080fd5b9392505050565b60006020828403121561186057600080fd5b8151801515811461184757600080fd5b60006020828403121561188257600080fd5b5035919050565b60006020828403121561189b57600080fd5b5051919050565b600080604083850312156118b557600080fd5b8235915060208084013567ffffffffffffffff808211156118d557600080fd5b818601915086601f8301126118e957600080fd5b8135818111156118fb576118fb611c94565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561193e5761193e611c94565b604052828152858101935084860182860187018b101561195d57600080fd5b600095505b83861015611980578035855260019590950194938601938601611962565b508096505050505050509250929050565b600080600080608085870312156119a757600080fd5b6119b0856117fd565b93506119be602086016117e6565b92506119cc604086016117fd565b91506119da606086016117e6565b905092959194509250565b600081518084526020808501945080840160005b83811015611a15578151875295820195908201906001016119f9565b509495945050505050565b6000815180845260005b81811015611a4657602081850181015186830182015201611a2a565b81811115611a58576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8416815282602082015260606040820152600061145b6060830184611a20565b838152606060208201526000611ad960608301856119e5565b9050826040830152949350505050565b878152861515602082015260e060408201526000611b0a60e08301886119e5565b90508560608301528460808301528360a08301528260c083015298975050505050505050565b600063ffffffff808716835261ffff861660208401528085166040840152506080606083015261165e6080830184611a20565b60008219821115611b7657611b76611c65565b500190565b600082611bb1577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611bee57611bee611c65565b500290565b600082821015611c0557611c05611c65565b500390565b600061ffff80831681811415611c2257611c22611c65565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611c5e57611c5e611c65565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", } diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index e1c577e8d01..5de3f9b1df2 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -103,4 +103,4 @@ vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigr vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin abbc47c56be3aef960abb9682f71c7a2e46ee7aab9fbe7d47030f01330329de4 vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin 4b3da45ff177e09b1e731b5b0cf4e050033a600ef8b0d32e79eec97db5c72408 -vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin b1ba4c41b6fafe94fdf2f9ad273b4f95ff1c07129ced2883be75fad230836b09 +vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 4886b08ff9cf013033b7c08e0317f23130ba8e2be445625fdbe1424eb7c38989 From 346c942ea1fe412c0ec7fc0da9189f2c857f8fe1 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 4 Oct 2023 08:53:06 -0500 Subject: [PATCH 49/84] remove -tags test in favor of testing.Testing() (#10853) --- .github/workflows/ci-core.yml | 4 ++-- GNUmakefile | 6 +++--- README.md | 2 +- core/build/build.go | 11 ++++++++--- core/build/default.go | 5 ----- core/build/init.go | 13 +++++++++++++ core/build/{dev.go => init_dev.go} | 2 +- core/build/test.go | 5 ----- core/config/toml/types.go | 16 ++++++++++++---- core/config/toml/types_test.go | 14 +++++++------- tools/bin/go_core_race_tests | 2 +- tools/bin/go_core_tests | 2 +- 12 files changed, 49 insertions(+), 33 deletions(-) delete mode 100644 core/build/default.go create mode 100644 core/build/init.go rename core/build/{dev.go => init_dev.go} (53%) delete mode 100644 core/build/test.go diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 245b282f2da..bba65b443df 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -85,7 +85,7 @@ jobs: - name: Download Go vendor packages run: go mod download - name: Build binary - run: go build -tags test -o chainlink.test . + run: go build -o chainlink.test . - name: Setup DB run: ./chainlink.test local db preparetest - name: Increase Race Timeout @@ -163,7 +163,7 @@ jobs: - name: Download Go vendor packages run: go mod download - name: Build binary - run: go build -tags test -o chainlink.test . + run: go build -o chainlink.test . - name: Setup DB run: ./chainlink.test local db preparetest - name: Load test outputs diff --git a/GNUmakefile b/GNUmakefile index 71279f43651..14595d222e9 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -51,7 +51,7 @@ chainlink-dev: operator-ui ## Build a dev build of chainlink binary. go build -tags dev $(GOFLAGS) . chainlink-test: operator-ui ## Build a test build of chainlink binary. - go build -tags test $(GOFLAGS) . + go build $(GOFLAGS) . .PHONY: chainlink-local-start chainlink-local-start: @@ -105,11 +105,11 @@ testscripts-update: ## Update testdata/scripts/* files via testscript. .PHONY: testdb testdb: ## Prepares the test database. - go run -tags test . local db preparetest + go run . local db preparetest .PHONY: testdb testdb-user-only: ## Prepares the test database with user only. - go run -tags test . local db preparetest --user-only + go run . local db preparetest --user-only # Format for CI .PHONY: presubmit diff --git a/README.md b/README.md index f8dd24ffcc2..eff798d46b8 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ If you do end up modifying the migrations for the database, you will need to rer 7. Run tests: ```bash -go test -tags test ./... +go test ./... ``` #### Notes diff --git a/core/build/build.go b/core/build/build.go index 027da4738f6..e7d1f7cbdca 100644 --- a/core/build/build.go +++ b/core/build/build.go @@ -1,14 +1,19 @@ +// Package build utilizes build tags and package testing API to determine the environment that this binary was built to target. +// - Prod is the default +// - Test is automatically set in test binaries, e.g. when using `go test` +// - Dev can be set with the 'dev' build tag, for standard builds or test binaries package build -// The build module utilizes build tags to determine the environment that this binary was built to target -// the currently supported build modes are dev, test. Setting both tags is not allowed and will result to compilation errors. - const ( Prod = "prod" Dev = "dev" Test = "test" ) +var mode string + +func Mode() string { return mode } + func IsDev() bool { return mode == Dev } diff --git a/core/build/default.go b/core/build/default.go deleted file mode 100644 index 81aa6b5ae3e..00000000000 --- a/core/build/default.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build !dev && !test - -package build - -const mode = Prod diff --git a/core/build/init.go b/core/build/init.go new file mode 100644 index 00000000000..a32dc4a87e2 --- /dev/null +++ b/core/build/init.go @@ -0,0 +1,13 @@ +//go:build !dev + +package build + +import "testing" + +func init() { + if testing.Testing() { + mode = Test + } else { + mode = Prod + } +} diff --git a/core/build/dev.go b/core/build/init_dev.go similarity index 53% rename from core/build/dev.go rename to core/build/init_dev.go index aadfc32fc60..a8773ef3d89 100644 --- a/core/build/dev.go +++ b/core/build/init_dev.go @@ -2,4 +2,4 @@ package build -const mode = Dev +func init() { mode = Dev } diff --git a/core/build/test.go b/core/build/test.go deleted file mode 100644 index f7758c14135..00000000000 --- a/core/build/test.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build test - -package build - -const mode = Test diff --git a/core/config/toml/types.go b/core/config/toml/types.go index 5fba0c7ea5e..f1ea6590c4b 100644 --- a/core/config/toml/types.go +++ b/core/config/toml/types.go @@ -141,9 +141,13 @@ func validateDBURL(dbURI url.URL) error { } func (d *DatabaseSecrets) ValidateConfig() (err error) { + return d.validateConfig(build.Mode()) +} + +func (d *DatabaseSecrets) validateConfig(buildMode string) (err error) { if d.URL == nil || (*url.URL)(d.URL).String() == "" { err = multierr.Append(err, configutils.ErrEmpty{Name: "URL", Msg: "must be provided and non-empty"}) - } else if *d.AllowSimplePasswords && build.IsProd() { + } else if *d.AllowSimplePasswords && buildMode == build.Prod { err = multierr.Append(err, configutils.ErrInvalid{Name: "AllowSimplePasswords", Value: true, Msg: "insecure configs are not allowed on secure builds"}) } else if !*d.AllowSimplePasswords { if verr := validateDBURL((url.URL)(*d.URL)); verr != nil { @@ -1142,14 +1146,18 @@ type Insecure struct { } func (ins *Insecure) ValidateConfig() (err error) { - if build.IsDev() { + return ins.validateConfig(build.Mode()) +} + +func (ins *Insecure) validateConfig(buildMode string) (err error) { + if buildMode == build.Dev { return } if ins.DevWebServer != nil && *ins.DevWebServer { err = multierr.Append(err, configutils.ErrInvalid{Name: "DevWebServer", Value: *ins.DevWebServer, Msg: "insecure configs are not allowed on secure builds"}) } - // OCRDevelopmentMode is allowed on test builds. - if ins.OCRDevelopmentMode != nil && *ins.OCRDevelopmentMode && !build.IsTest() { + // OCRDevelopmentMode is allowed on dev/test builds. + if ins.OCRDevelopmentMode != nil && *ins.OCRDevelopmentMode && buildMode == build.Prod { err = multierr.Append(err, configutils.ErrInvalid{Name: "OCRDevelopmentMode", Value: *ins.OCRDevelopmentMode, Msg: "insecure configs are not allowed on secure builds"}) } if ins.InfiniteDepthQueries != nil && *ins.InfiniteDepthQueries { diff --git a/core/config/toml/types_test.go b/core/config/toml/types_test.go index 2ab3f0fb86b..1430f8ab2c5 100644 --- a/core/config/toml/types_test.go +++ b/core/config/toml/types_test.go @@ -107,7 +107,7 @@ func Test_validateDBURL(t *testing.T) { } } -func TestValidateConfig(t *testing.T) { +func TestDatabaseSecrets_ValidateConfig(t *testing.T) { validUrl := models.URL(url.URL{Scheme: "https", Host: "localhost"}) validSecretURL := *models.NewSecretURL(&validUrl) @@ -120,7 +120,7 @@ func TestValidateConfig(t *testing.T) { tests := []struct { name string input *DatabaseSecrets - skip bool + buildMode string expectedErrContains []string }{ { @@ -143,7 +143,7 @@ func TestValidateConfig(t *testing.T) { URL: &validSecretURL, AllowSimplePasswords: &[]bool{true}[0], }, - skip: !build.IsProd(), + buildMode: build.Prod, expectedErrContains: []string{"insecure configs are not allowed on secure builds"}, }, { @@ -159,11 +159,11 @@ func TestValidateConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - // needed while -tags test is supported - if tt.skip { - t.SkipNow() + buildMode := build.Mode() + if tt.buildMode != "" { + buildMode = tt.buildMode } - err := tt.input.ValidateConfig() + err := tt.input.validateConfig(buildMode) if err == nil && len(tt.expectedErrContains) > 0 { t.Errorf("expected errors but got none") return diff --git a/tools/bin/go_core_race_tests b/tools/bin/go_core_race_tests index 81571bfbbe3..aa6510c1127 100755 --- a/tools/bin/go_core_race_tests +++ b/tools/bin/go_core_race_tests @@ -12,7 +12,7 @@ use_tee() { cat > "$@" fi } -GORACE="log_path=$PWD/race" go test -json -tags test -race -ldflags "$GO_LDFLAGS" -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | use_tee "$OUTPUT_FILE" +GORACE="log_path=$PWD/race" go test -json -race -ldflags "$GO_LDFLAGS" -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | use_tee "$OUTPUT_FILE" EXITCODE=${PIPESTATUS[0]} # Fail if any race logs are present. if ls race.* &>/dev/null diff --git a/tools/bin/go_core_tests b/tools/bin/go_core_tests index 79f7a480cfb..694a51d1f82 100755 --- a/tools/bin/go_core_tests +++ b/tools/bin/go_core_tests @@ -16,7 +16,7 @@ use_tee() { cat > "$@" fi } -go test -json -ldflags "$GO_LDFLAGS" -tags test,integration $TEST_FLAGS -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $1 | use_tee $OUTPUT_FILE +go test -json -ldflags "$GO_LDFLAGS" -tags integration $TEST_FLAGS -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $1 | use_tee $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output From 936ec09758d42a6c375624e5483a73d7c7148f5d Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 4 Oct 2023 09:43:21 -0500 Subject: [PATCH 50/84] core/services: flag duplicate service names (#10843) --- common/headtracker/head_tracker.go | 4 +- common/txmgr/txmgr.go | 9 ++-- core/chains/evm/chain.go | 11 ++-- core/chains/evm/gas/models.go | 6 +-- .../evm/headtracker/head_tracker_test.go | 17 +++--- core/chains/evm/monitor/balance.go | 2 +- core/chains/solana/chain.go | 3 +- core/chains/starknet/chain.go | 5 +- core/services/chainlink/relayer_factory.go | 54 ++++++++++--------- core/services/checkable.go | 24 +++++++++ core/services/directrequest/delegate.go | 4 +- core/services/gateway/connectionmanager.go | 4 +- core/services/gateway/connector/connector.go | 4 +- core/services/health.go | 6 +++ core/services/ocr2/delegate.go | 4 +- .../ocr2/plugins/mercury/helpers_test.go | 2 - .../ocr2/plugins/mercury/integration_test.go | 22 +++----- core/services/ocr2/plugins/mercury/plugin.go | 10 +--- .../plugins/ocr2keeper/evm20/log_provider.go | 2 +- .../ocr2/plugins/ocr2keeper/evm20/registry.go | 2 +- .../ocr2/plugins/ocr2keeper/evm21/registry.go | 2 +- .../evm21/upkeepstate/store_test.go | 9 ++-- core/services/relay/evm/evm.go | 38 +++++++------ .../services/relay/evm/mercury/transmitter.go | 7 +-- core/services/relay/evm/mercury_provider.go | 6 +-- core/services/relay/relay.go | 5 +- core/services/vrf/delegate.go | 4 +- plugins/plugin.go | 4 +- 28 files changed, 140 insertions(+), 130 deletions(-) diff --git a/common/headtracker/head_tracker.go b/common/headtracker/head_tracker.go index 91813d89a2d..94f6db6f116 100644 --- a/common/headtracker/head_tracker.go +++ b/common/headtracker/head_tracker.go @@ -9,12 +9,12 @@ import ( "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "golang.org/x/exp/maps" htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -157,7 +157,7 @@ func (ht *HeadTracker[HTH, S, ID, BLOCK_HASH]) HealthReport() map[string]error { report := map[string]error{ ht.Name(): ht.StartStopOnce.Healthy(), } - maps.Copy(report, ht.headListener.HealthReport()) + services.CopyHealth(report, ht.headListener.HealthReport()) return report } diff --git a/common/txmgr/txmgr.go b/common/txmgr/txmgr.go index 9e59d91dfe6..dbe9e508359 100644 --- a/common/txmgr/txmgr.go +++ b/common/txmgr/txmgr.go @@ -10,7 +10,6 @@ import ( "github.com/google/uuid" "github.com/pkg/errors" - "golang.org/x/exp/maps" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" @@ -263,13 +262,13 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HealthRepo // only query if txm started properly b.IfStarted(func() { - maps.Copy(report, b.broadcaster.HealthReport()) - maps.Copy(report, b.confirmer.HealthReport()) - maps.Copy(report, b.txAttemptBuilder.HealthReport()) + services.CopyHealth(report, b.broadcaster.HealthReport()) + services.CopyHealth(report, b.confirmer.HealthReport()) + services.CopyHealth(report, b.txAttemptBuilder.HealthReport()) }) if b.txConfig.ForwardersEnabled() { - maps.Copy(report, b.fwdMgr.HealthReport()) + services.CopyHealth(report, b.fwdMgr.HealthReport()) } return report } diff --git a/core/chains/evm/chain.go b/core/chains/evm/chain.go index 2b6ee55474a..dfa67978ddf 100644 --- a/core/chains/evm/chain.go +++ b/core/chains/evm/chain.go @@ -9,7 +9,6 @@ import ( "time" "go.uber.org/multierr" - "golang.org/x/exp/maps" "github.com/smartcontractkit/sqlx" @@ -380,13 +379,13 @@ func (c *chain) HealthReport() map[string]error { report := map[string]error{ c.Name(): c.StartStopOnce.Healthy(), } - maps.Copy(report, c.txm.HealthReport()) - maps.Copy(report, c.headBroadcaster.HealthReport()) - maps.Copy(report, c.headTracker.HealthReport()) - maps.Copy(report, c.logBroadcaster.HealthReport()) + services.CopyHealth(report, c.txm.HealthReport()) + services.CopyHealth(report, c.headBroadcaster.HealthReport()) + services.CopyHealth(report, c.headTracker.HealthReport()) + services.CopyHealth(report, c.logBroadcaster.HealthReport()) if c.balanceMonitor != nil { - maps.Copy(report, c.balanceMonitor.HealthReport()) + services.CopyHealth(report, c.balanceMonitor.HealthReport()) } return report diff --git a/core/chains/evm/gas/models.go b/core/chains/evm/gas/models.go index c6f8edbf04b..e3a1154c5b5 100644 --- a/core/chains/evm/gas/models.go +++ b/core/chains/evm/gas/models.go @@ -8,8 +8,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" - "golang.org/x/exp/maps" - commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" commontypes "github.com/smartcontractkit/chainlink/v2/common/types" @@ -215,9 +213,9 @@ func (e *WrappedEvmEstimator) Ready() error { func (e *WrappedEvmEstimator) HealthReport() map[string]error { report := map[string]error{e.Name(): e.StartStopOnce.Healthy()} - maps.Copy(report, e.EvmEstimator.HealthReport()) + services.CopyHealth(report, e.EvmEstimator.HealthReport()) if e.l1Oracle != nil { - maps.Copy(report, e.l1Oracle.HealthReport()) + services.CopyHealth(report, e.l1Oracle.HealthReport()) } return report diff --git a/core/chains/evm/headtracker/head_tracker_test.go b/core/chains/evm/headtracker/head_tracker_test.go index 330142b9dc0..cb438e4c263 100644 --- a/core/chains/evm/headtracker/head_tracker_test.go +++ b/core/chains/evm/headtracker/head_tracker_test.go @@ -8,14 +8,6 @@ import ( "testing" "time" - "golang.org/x/exp/maps" - "golang.org/x/exp/slices" - - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - configtest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest/v2" - "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/store/models" - "github.com/ethereum/go-ethereum" gethCommon "github.com/ethereum/go-ethereum/common" gethTypes "github.com/ethereum/go-ethereum/core/types" @@ -24,6 +16,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "golang.org/x/exp/maps" + "golang.org/x/exp/slices" commonmocks "github.com/smartcontractkit/chainlink/v2/common/types/mocks" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" @@ -31,9 +25,14 @@ import ( httypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + configtest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest/v2" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -402,7 +401,7 @@ func TestHeadTracker_Start_LoadsLatestChain(t *testing.T) { gomega.NewWithT(t).Eventually(func() bool { report := ht.headTracker.HealthReport() - maps.Copy(report, ht.headBroadcaster.HealthReport()) + services.CopyHealth(report, ht.headBroadcaster.HealthReport()) return !slices.ContainsFunc(maps.Values(report), func(e error) bool { return e != nil }) }, 5*time.Second, testutils.TestInterval).Should(gomega.Equal(true)) diff --git a/core/chains/evm/monitor/balance.go b/core/chains/evm/monitor/balance.go index 28682f2509a..2f0509efd75 100644 --- a/core/chains/evm/monitor/balance.go +++ b/core/chains/evm/monitor/balance.go @@ -54,7 +54,7 @@ func NewBalanceMonitor(ethClient evmclient.Client, ethKeyStore keystore.Eth, log chainId := ethClient.ConfiguredChainID() bm := &balanceMonitor{ utils.StartStopOnce{}, - logger, + logger.Named("BalanceMonitor"), ethClient, chainId, chainId.String(), diff --git a/core/chains/solana/chain.go b/core/chains/solana/chain.go index 682fb23f9f2..e8e05f05b8e 100644 --- a/core/chains/solana/chain.go +++ b/core/chains/solana/chain.go @@ -14,7 +14,6 @@ import ( "github.com/gagliardetto/solana-go/rpc" "github.com/pkg/errors" "go.uber.org/multierr" - "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-relay/pkg/logger" "github.com/smartcontractkit/chainlink-relay/pkg/loop" @@ -387,7 +386,7 @@ func (c *chain) Ready() error { func (c *chain) HealthReport() map[string]error { report := map[string]error{c.Name(): c.StartStopOnce.Healthy()} - maps.Copy(report, c.txm.HealthReport()) + services.CopyHealth(report, c.txm.HealthReport()) return report } diff --git a/core/chains/starknet/chain.go b/core/chains/starknet/chain.go index fead94cda60..765b54fe78e 100644 --- a/core/chains/starknet/chain.go +++ b/core/chains/starknet/chain.go @@ -8,12 +8,10 @@ import ( "github.com/pkg/errors" "go.uber.org/multierr" - "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-relay/pkg/logger" "github.com/smartcontractkit/chainlink-relay/pkg/loop" relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" - starkChain "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/chain" starkchain "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/chain" "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config" @@ -23,6 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains" "github.com/smartcontractkit/chainlink/v2/core/chains/internal" + "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -164,7 +163,7 @@ func (c *chain) Ready() error { func (c *chain) HealthReport() map[string]error { report := map[string]error{c.Name(): c.StartStopOnce.Healthy()} - maps.Copy(report, c.txm.HealthReport()) + services.CopyHealth(report, c.txm.HealthReport()) return report } diff --git a/core/services/chainlink/relayer_factory.go b/core/services/chainlink/relayer_factory.go index c0541f4384d..cf5d1516523 100644 --- a/core/services/chainlink/relayer_factory.go +++ b/core/services/chainlink/relayer_factory.go @@ -56,7 +56,7 @@ func (r *RelayerFactory) NewEVM(ctx context.Context, config EVMFactoryConfig) (m } legacyChains := evmrelay.NewLegacyChainsFromRelayerExtenders(evmRelayExtenders) for _, ext := range evmRelayExtenders.Slice() { - relayID := relay.ID{Network: relay.EVM, ChainID: relay.ChainID(ext.Chain().ID().String())} + relayID := relay.ID{Network: relay.EVM, ChainID: ext.Chain().ID().String()} chain, err2 := legacyChains.Get(relayID.ChainID) if err2 != nil { return nil, err2 @@ -68,7 +68,7 @@ func (r *RelayerFactory) NewEVM(ctx context.Context, config EVMFactoryConfig) (m CSAETHKeystore: config.CSAETHKeystore, EventBroadcaster: ccOpts.EventBroadcaster, } - relayer, err2 := evmrelay.NewRelayer(ccOpts.Logger, chain, relayerOpts) + relayer, err2 := evmrelay.NewRelayer(ccOpts.Logger.Named(relayID.ChainID), chain, relayerOpts) if err2 != nil { err = errors.Join(err, err2) continue @@ -97,12 +97,12 @@ func (r *RelayerFactory) NewSolana(ks keystore.Solana, chainCfgs solana.SolanaCo // create one relayer per chain id for _, chainCfg := range chainCfgs { - relayId := relay.ID{Network: relay.Solana, ChainID: relay.ChainID(*chainCfg.ChainID)} - _, alreadyExists := unique[relayId.Name()] + relayID := relay.ID{Network: relay.Solana, ChainID: *chainCfg.ChainID} + _, alreadyExists := unique[relayID.Name()] if alreadyExists { - return nil, fmt.Errorf("duplicate chain definitions for %s", relayId.Name()) + return nil, fmt.Errorf("duplicate chain definitions for %s", relayID.Name()) } - unique[relayId.Name()] = struct{}{} + unique[relayID.Name()] = struct{}{} // skip disabled chains from further processing if !chainCfg.IsEnabled() { @@ -110,6 +110,8 @@ func (r *RelayerFactory) NewSolana(ks keystore.Solana, chainCfgs solana.SolanaCo continue } + lggr := solLggr.Named(relayID.ChainID) + if cmdName := env.SolanaPluginCmd.Get(); cmdName != "" { // setup the solana relayer to be a LOOP @@ -122,19 +124,19 @@ func (r *RelayerFactory) NewSolana(ks keystore.Solana, chainCfgs solana.SolanaCo } solCmdFn, err := plugins.NewCmdFactory(r.Register, plugins.CmdConfig{ - ID: relayId.Name(), + ID: relayID.Name(), Cmd: cmdName, }) if err != nil { return nil, fmt.Errorf("failed to create Solana LOOP command: %w", err) } - solanaRelayers[relayId] = loop.NewRelayerService(solLggr, r.GRPCOpts, solCmdFn, string(cfgTOML), signer) + solanaRelayers[relayID] = loop.NewRelayerService(lggr, r.GRPCOpts, solCmdFn, string(cfgTOML), signer) } else { // fallback to embedded chain opts := solana.ChainOpts{ - Logger: solLggr, + Logger: lggr, KeyStore: signer, } @@ -142,7 +144,7 @@ func (r *RelayerFactory) NewSolana(ks keystore.Solana, chainCfgs solana.SolanaCo if err != nil { return nil, err } - solanaRelayers[relayId] = relay.NewRelayerServerAdapter(pkgsolana.NewRelayer(solLggr, chain), chain) + solanaRelayers[relayID] = relay.NewRelayerServerAdapter(pkgsolana.NewRelayer(lggr, chain), chain) } } return solanaRelayers, nil @@ -166,12 +168,12 @@ func (r *RelayerFactory) NewStarkNet(ks keystore.StarkNet, chainCfgs starknet.St unique := make(map[string]struct{}) // create one relayer per chain id for _, chainCfg := range chainCfgs { - relayId := relay.ID{Network: relay.StarkNet, ChainID: relay.ChainID(*chainCfg.ChainID)} - _, alreadyExists := unique[relayId.Name()] + relayID := relay.ID{Network: relay.StarkNet, ChainID: *chainCfg.ChainID} + _, alreadyExists := unique[relayID.Name()] if alreadyExists { - return nil, fmt.Errorf("duplicate chain definitions for %s", relayId.Name()) + return nil, fmt.Errorf("duplicate chain definitions for %s", relayID.Name()) } - unique[relayId.Name()] = struct{}{} + unique[relayID.Name()] = struct{}{} // skip disabled chains from further processing if !chainCfg.IsEnabled() { @@ -179,6 +181,8 @@ func (r *RelayerFactory) NewStarkNet(ks keystore.StarkNet, chainCfgs starknet.St continue } + lggr := starkLggr.Named(relayID.ChainID) + if cmdName := env.StarknetPluginCmd.Get(); cmdName != "" { // setup the starknet relayer to be a LOOP cfgTOML, err := toml.Marshal(struct { @@ -189,7 +193,7 @@ func (r *RelayerFactory) NewStarkNet(ks keystore.StarkNet, chainCfgs starknet.St } starknetCmdFn, err := plugins.NewCmdFactory(r.Register, plugins.CmdConfig{ - ID: relayId.Name(), + ID: relayID.Name(), Cmd: cmdName, }) if err != nil { @@ -197,11 +201,11 @@ func (r *RelayerFactory) NewStarkNet(ks keystore.StarkNet, chainCfgs starknet.St } // the starknet relayer service has a delicate keystore dependency. the value that is passed to NewRelayerService must // be compatible with instantiating a starknet transaction manager KeystoreAdapter within the LOOPp executable. - starknetRelayers[relayId] = loop.NewRelayerService(starkLggr, r.GRPCOpts, starknetCmdFn, string(cfgTOML), loopKs) + starknetRelayers[relayID] = loop.NewRelayerService(lggr, r.GRPCOpts, starknetCmdFn, string(cfgTOML), loopKs) } else { // fallback to embedded chain opts := starknet.ChainOpts{ - Logger: starkLggr, + Logger: lggr, KeyStore: loopKs, } @@ -210,7 +214,7 @@ func (r *RelayerFactory) NewStarkNet(ks keystore.StarkNet, chainCfgs starknet.St return nil, err } - starknetRelayers[relayId] = relay.NewRelayerServerAdapter(pkgstarknet.NewRelayer(starkLggr, chain), chain) + starknetRelayers[relayID] = relay.NewRelayerServerAdapter(pkgstarknet.NewRelayer(lggr, chain), chain) } } return starknetRelayers, nil @@ -257,17 +261,19 @@ func (r *RelayerFactory) NewCosmos(ctx context.Context, config CosmosFactoryConf relayers := make(map[relay.ID]cosmos.LoopRelayerChainer) var ( - lggr = r.Logger.Named("Cosmos") - loopKs = &keystore.CosmosLoopKeystore{Cosmos: config.Keystore} + cosmosLggr = r.Logger.Named("Cosmos") + loopKs = &keystore.CosmosLoopKeystore{Cosmos: config.Keystore} ) // create one relayer per chain id for _, chainCfg := range config.CosmosConfigs { - relayId := relay.ID{Network: relay.Cosmos, ChainID: relay.ChainID(*chainCfg.ChainID)} + relayID := relay.ID{Network: relay.Cosmos, ChainID: *chainCfg.ChainID} + + lggr := cosmosLggr.Named(relayID.ChainID) opts := cosmos.ChainOpts{ QueryConfig: config.QConfig, - Logger: lggr.Named(relayId.ChainID), + Logger: lggr, DB: config.DB, KeyStore: loopKs, EventBroadcaster: config.EventBroadcaster, @@ -275,10 +281,10 @@ func (r *RelayerFactory) NewCosmos(ctx context.Context, config CosmosFactoryConf chain, err := cosmos.NewChain(chainCfg, opts) if err != nil { - return nil, fmt.Errorf("failed to load Cosmos chain %q: %w", relayId, err) + return nil, fmt.Errorf("failed to load Cosmos chain %q: %w", relayID, err) } - relayers[relayId] = cosmos.NewLoopRelayerChain(pkgcosmos.NewRelayer(lggr, chain), chain) + relayers[relayID] = cosmos.NewLoopRelayerChain(pkgcosmos.NewRelayer(lggr, chain), chain) } return relayers, nil diff --git a/core/services/checkable.go b/core/services/checkable.go index a702f9f979d..e3e4c50386b 100644 --- a/core/services/checkable.go +++ b/core/services/checkable.go @@ -1,5 +1,10 @@ package services +import ( + "errors" + "testing" +) + // Checkable should be implemented by any type requiring health checks. // From the k8s docs: // > ready means it’s initialized and healthy means that it can accept traffic in kubernetes @@ -9,7 +14,26 @@ type Checkable interface { Ready() error // HealthReport returns a full health report of the callee including it's dependencies. // key is the dep name, value is nil if healthy, or error message otherwise. + // See CopyHealth. HealthReport() map[string]error // Name returns the fully qualified name of the component. Usually the logger name. Name() string } + +// CopyHealth copies health statuses from src to dest. +// If duplicate names are encountered, the errors are joined, unless testing in which case a panic is thrown. +func CopyHealth(dest, src map[string]error) { + for name, err := range src { + errOrig, ok := dest[name] + if ok { + if testing.Testing() { + panic("service names must be unique: duplicate name: " + name) + } + if errOrig != nil { + dest[name] = errors.Join(errOrig, err) + continue + } + } + dest[name] = err + } +} diff --git a/core/services/directrequest/delegate.go b/core/services/directrequest/delegate.go index 4ccaf55b645..75cebb7a74a 100644 --- a/core/services/directrequest/delegate.go +++ b/core/services/directrequest/delegate.go @@ -83,7 +83,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { return nil, errors.Wrapf(err, "DirectRequest: failed to create an operator wrapper for address: %v", concreteSpec.ContractAddress.Address().String()) } - svcLogger := d.logger. + svcLogger := d.logger.Named(jb.ExternalJobID.String()). With( "contract", concreteSpec.ContractAddress.Address().String(), "jobName", jb.PipelineSpec.JobName, @@ -92,7 +92,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { ) logListener := &listener{ - logger: svcLogger.Named("DirectRequest"), + logger: svcLogger.Named("Listener"), config: chain.Config().EVM(), logBroadcaster: chain.LogBroadcaster(), oracle: oracle, diff --git a/core/services/gateway/connectionmanager.go b/core/services/gateway/connectionmanager.go index f225b66fe18..8a029f772cb 100644 --- a/core/services/gateway/connectionmanager.go +++ b/core/services/gateway/connectionmanager.go @@ -14,9 +14,9 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "go.uber.org/multierr" - "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/common" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/config" @@ -57,7 +57,7 @@ func (m *connectionManager) HealthReport() map[string]error { hr := map[string]error{m.Name(): m.Healthy()} for _, d := range m.dons { for _, n := range d.nodes { - maps.Copy(hr, n.conn.HealthReport()) + services.CopyHealth(hr, n.conn.HealthReport()) } } return hr diff --git a/core/services/gateway/connector/connector.go b/core/services/gateway/connector/connector.go index 4cc84d37490..5eaa4b4ff9b 100644 --- a/core/services/gateway/connector/connector.go +++ b/core/services/gateway/connector/connector.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "golang.org/x/exp/maps" + "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/gorilla/websocket" @@ -64,7 +64,7 @@ type gatewayConnector struct { func (c *gatewayConnector) HealthReport() map[string]error { m := map[string]error{c.Name(): c.Healthy()} for _, g := range c.gateways { - maps.Copy(m, g.conn.HealthReport()) + services.CopyHealth(m, g.conn.HealthReport()) } return m } diff --git a/core/services/health.go b/core/services/health.go index 1912a49b75e..823c4421db1 100644 --- a/core/services/health.go +++ b/core/services/health.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "sync" + "testing" "time" "github.com/pkg/errors" @@ -184,6 +185,11 @@ func (c *checker) Register(service Checkable) error { c.srvMutex.Lock() defer c.srvMutex.Unlock() + if testing.Testing() { + if orig, ok := c.services[name]; ok { + panic(fmt.Errorf("duplicate name %q: service names must be unique: types %T & %T", name, service, orig)) + } + } c.services[name] = service return nil } diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index 9ce04ac407f..e2dc9eaa2f2 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -213,7 +213,7 @@ func NewDelegate( monitoringEndpointGen: monitoringEndpointGen, legacyChains: legacyChains, cfg: cfg, - lggr: lggr, + lggr: lggr.Named("OCR2"), ks: ks, dkgSignKs: dkgSignKs, dkgEncryptKs: dkgEncryptKs, @@ -335,7 +335,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { lggrCtx.FeedID = *spec.FeedID spec.RelayConfig["feedID"] = spec.FeedID } - lggr := logger.Sugared(d.lggr.Named("OCR2").With(lggrCtx.Args()...)) + lggr := logger.Sugared(d.lggr.Named(jb.ExternalJobID.String()).With(lggrCtx.Args()...)) rid, err := spec.RelayID() if err != nil { diff --git a/core/services/ocr2/plugins/mercury/helpers_test.go b/core/services/ocr2/plugins/mercury/helpers_test.go index ddb521ff9ca..97b86cfc561 100644 --- a/core/services/ocr2/plugins/mercury/helpers_test.go +++ b/core/services/ocr2/plugins/mercury/helpers_test.go @@ -21,7 +21,6 @@ import ( "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" - "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -153,7 +152,6 @@ func setupNode( t *testing.T, port int64, dbName string, - p2pV2Bootstrappers []commontypes.BootstrapperLocator, backend *backends.SimulatedBackend, csaKey csakey.KeyV2, ) (app chainlink.Application, peerID string, clientPubKey credentials.StaticSizedPublicKey, ocr2kb ocr2key.KeyBundle, observedLogs *observer.ObservedLogs) { diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index aab1cadc5a5..fa3aef0451a 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -23,7 +23,6 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/shopspring/decimal" - "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -174,7 +173,7 @@ func TestIntegration_MercuryV1(t *testing.T) { // Setup bootstrap + oracle nodes bootstrapNodePort := int64(19700) - appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", nil, backend, clientCSAKeys[n]) + appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", backend, clientCSAKeys[n]) bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) @@ -184,10 +183,7 @@ func TestIntegration_MercuryV1(t *testing.T) { nodes []Node ) for i := int64(0); i < int64(n); i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), []commontypes.BootstrapperLocator{ - // Supply the bootstrap IP and port as a V2 peer address - {PeerID: bootstrapPeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, - }, backend, clientCSAKeys[i]) + app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) nodes = append(nodes, Node{ app, transmitter, kb, @@ -525,7 +521,7 @@ func TestIntegration_MercuryV2(t *testing.T) { // Setup bootstrap + oracle nodes bootstrapNodePort := int64(20700) - appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", nil, backend, clientCSAKeys[n]) + appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", backend, clientCSAKeys[n]) bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) @@ -535,10 +531,7 @@ func TestIntegration_MercuryV2(t *testing.T) { nodes []Node ) for i := int64(0); i < int64(n); i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), []commontypes.BootstrapperLocator{ - // Supply the bootstrap IP and port as a V2 peer address - {PeerID: bootstrapPeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, - }, backend, clientCSAKeys[i]) + app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) nodes = append(nodes, Node{ app, transmitter, kb, @@ -803,7 +796,7 @@ func TestIntegration_MercuryV3(t *testing.T) { // Setup bootstrap + oracle nodes bootstrapNodePort := int64(21700) - appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", nil, backend, clientCSAKeys[n]) + appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", backend, clientCSAKeys[n]) bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) @@ -813,10 +806,7 @@ func TestIntegration_MercuryV3(t *testing.T) { nodes []Node ) for i := int64(0); i < int64(n); i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), []commontypes.BootstrapperLocator{ - // Supply the bootstrap IP and port as a V2 peer address - {PeerID: bootstrapPeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, - }, backend, clientCSAKeys[i]) + app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) nodes = append(nodes, Node{ app, transmitter, kb, diff --git a/core/services/ocr2/plugins/mercury/plugin.go b/core/services/ocr2/plugins/mercury/plugin.go index 31fb8ab8c4b..69a3b53c284 100644 --- a/core/services/ocr2/plugins/mercury/plugin.go +++ b/core/services/ocr2/plugins/mercury/plugin.go @@ -125,12 +125,6 @@ func NewServices( if err != nil { return nil, errors.WithStack(err) } - return []job.ServiceCtx{ocr2Provider, ocrcommon.NewResultRunSaver( - runResults, - pipelineRunner, - make(chan struct{}), - lggr, - cfg.MaxSuccessfulRuns(), - ), - job.NewServiceAdapter(oracle)}, nil + saver := ocrcommon.NewResultRunSaver(runResults, pipelineRunner, make(chan struct{}), lggr, cfg.MaxSuccessfulRuns()) + return []job.ServiceCtx{ocr2Provider, saver, job.NewServiceAdapter(oracle)}, nil } diff --git a/core/services/ocr2/plugins/ocr2keeper/evm20/log_provider.go b/core/services/ocr2/plugins/ocr2keeper/evm20/log_provider.go index 69533e95869..e32c4a0662e 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm20/log_provider.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm20/log_provider.go @@ -82,7 +82,7 @@ func NewLogProvider( } return &LogProvider{ - logger: logger, + logger: logger.Named("AutomationLogProvider"), logPoller: logPoller, registryAddress: registryAddress, lookbackBlocks: lookbackBlocks, diff --git a/core/services/ocr2/plugins/ocr2keeper/evm20/registry.go b/core/services/ocr2/plugins/ocr2keeper/evm20/registry.go index 3f574158e31..7d1de17a5b0 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm20/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm20/registry.go @@ -87,7 +87,7 @@ func NewEVMRegistryService(addr common.Address, client evm.Chain, lggr logger.Lo hb: client.HeadBroadcaster(), chHead: make(chan ocr2keepers.BlockKey, 1), }, - lggr: lggr, + lggr: lggr.Named("AutomationRegistry"), poller: client.LogPoller(), addr: addr, client: client.Client(), diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go index ae439cc6321..b47b6187baf 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go @@ -87,7 +87,7 @@ func NewEvmRegistry( return &EvmRegistry{ ctx: context.Background(), threadCtrl: utils.NewThreadControl(), - lggr: lggr.Named("EvmRegistry"), + lggr: lggr.Named(RegistryServiceName), poller: client.LogPoller(), addr: addr, client: client.Client(), diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/store_test.go b/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/store_test.go index 49851b584e8..8e2e77f7fb4 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/store_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/store_test.go @@ -8,11 +8,12 @@ import ( "testing" "time" - ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" + ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -561,11 +562,11 @@ func (_m *mockORM) setErr(err error) { _m.err = err } -func (_m *mockORM) BatchInsertRecords(state []persistedStateRecord, _ ...pg.QOpt) error { +func (_m *mockORM) BatchInsertRecords(state []persistedStateRecord, opts ...pg.QOpt) error { return nil } -func (_m *mockORM) SelectStatesByWorkIDs(workIDs []string, _ ...pg.QOpt) ([]persistedStateRecord, error) { +func (_m *mockORM) SelectStatesByWorkIDs(workIDs []string, opts ...pg.QOpt) ([]persistedStateRecord, error) { _m.lock.Lock() defer _m.lock.Unlock() @@ -575,7 +576,7 @@ func (_m *mockORM) SelectStatesByWorkIDs(workIDs []string, _ ...pg.QOpt) ([]pers return res, _m.err } -func (_m *mockORM) DeleteExpired(tm time.Time, _ ...pg.QOpt) error { +func (_m *mockORM) DeleteExpired(tm time.Time, opts ...pg.QOpt) error { _m.lock.Lock() defer _m.lock.Unlock() diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index 6ae2052c408..a837350c04c 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -11,14 +11,14 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" pkgerrors "github.com/pkg/errors" + "go.uber.org/multierr" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median/evmreportcodec" "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/sqlx" - "go.uber.org/multierr" - "golang.org/x/exp/maps" relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" @@ -127,11 +127,12 @@ func (r *Relayer) Ready() error { func (r *Relayer) HealthReport() (report map[string]error) { report = make(map[string]error) - maps.Copy(report, r.mercuryPool.HealthReport()) + services.CopyHealth(report, r.mercuryPool.HealthReport()) return } func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MercuryProvider, error) { + lggr := r.lggr.Named("MercuryProvider").Named(rargs.ExternalJobID.String()) relayOpts := types.NewRelayOpts(rargs) relayConfig, err := relayOpts.RelayConfig() if err != nil { @@ -151,7 +152,7 @@ func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytype if relayConfig.ChainID.String() != r.chain.ID().String() { return nil, fmt.Errorf("internal error: chain id in spec does not match this relayer's chain: have %s expected %s", relayConfig.ChainID.String(), r.chain.ID().String()) } - configWatcher, err := newConfigProvider(r.lggr, r.chain, relayOpts, r.eventBroadcaster) + configWatcher, err := newConfigProvider(lggr, r.chain, relayOpts, r.eventBroadcaster) if err != nil { return nil, pkgerrors.WithStack(err) } @@ -172,9 +173,9 @@ func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytype // FIXME: We actually know the version here since it's in the feed ID, can // we use generics to avoid passing three of this? // https://smartcontract-it.atlassian.net/browse/MERC-1414 - reportCodecV1 := reportcodecv1.NewReportCodec(*relayConfig.FeedID, r.lggr.Named("ReportCodecV1")) - reportCodecV2 := reportcodecv2.NewReportCodec(*relayConfig.FeedID, r.lggr.Named("ReportCodecV2")) - reportCodecV3 := reportcodecv3.NewReportCodec(*relayConfig.FeedID, r.lggr.Named("ReportCodecV3")) + reportCodecV1 := reportcodecv1.NewReportCodec(*relayConfig.FeedID, lggr.Named("ReportCodecV1")) + reportCodecV2 := reportcodecv2.NewReportCodec(*relayConfig.FeedID, lggr.Named("ReportCodecV2")) + reportCodecV3 := reportcodecv3.NewReportCodec(*relayConfig.FeedID, lggr.Named("ReportCodecV3")) var transmitterCodec mercury.TransmitterReportDecoder switch feedID.Version() { @@ -187,17 +188,19 @@ func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytype default: return nil, fmt.Errorf("invalid feed version %d", feedID.Version()) } - transmitter := mercury.NewTransmitter(r.lggr, configWatcher.ContractConfigTracker(), client, privKey.PublicKey, rargs.JobID, *relayConfig.FeedID, r.db, r.pgCfg, transmitterCodec) + transmitter := mercury.NewTransmitter(lggr, configWatcher.ContractConfigTracker(), client, privKey.PublicKey, rargs.JobID, *relayConfig.FeedID, r.db, r.pgCfg, transmitterCodec) - return NewMercuryProvider(configWatcher, transmitter, reportCodecV1, reportCodecV2, reportCodecV3, r.lggr), nil + return NewMercuryProvider(configWatcher, transmitter, reportCodecV1, reportCodecV2, reportCodecV3, lggr), nil } func (r *Relayer) NewFunctionsProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.FunctionsProvider, error) { + lggr := r.lggr.Named("FunctionsProvider").Named(rargs.ExternalJobID.String()) // TODO(FUN-668): Not ready yet (doesn't implement FunctionsEvents() properly) - return NewFunctionsProvider(r.chain, rargs, pargs, r.lggr, r.ks.Eth(), functions.FunctionsPlugin) + return NewFunctionsProvider(r.chain, rargs, pargs, lggr, r.ks.Eth(), functions.FunctionsPlugin) } func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error) { + lggr := r.lggr.Named("ConfigProvider").Named(args.ExternalJobID.String()) relayOpts := types.NewRelayOpts(args) relayConfig, err := relayOpts.RelayConfig() if err != nil { @@ -208,7 +211,7 @@ func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.Confi return nil, fmt.Errorf("internal error: chain id in spec does not match this relayer's chain: have %s expected %s", relayConfig.ChainID.String(), r.chain.ID().String()) } - configProvider, err := newConfigProvider(r.lggr, r.chain, relayOpts, r.eventBroadcaster) + configProvider, err := newConfigProvider(lggr, r.chain, relayOpts, r.eventBroadcaster) if err != nil { // Never return (*configProvider)(nil) return nil, err @@ -261,7 +264,7 @@ func newConfigWatcher(lggr logger.Logger, replayCtx, replayCancel := context.WithCancel(context.Background()) return &configWatcher{ StartStopOnce: utils.StartStopOnce{}, - lggr: lggr, + lggr: lggr.Named("ConfigWatcher").Named(contractAddress.String()), contractAddress: contractAddress, contractABI: contractABI, offchainDigester: offchainDigester, @@ -338,7 +341,7 @@ func newConfigProvider(lggr logger.Logger, chain evm.Chain, opts *types.RelayOpt } if relayConfig.FeedID != nil { cp, err = mercury.NewConfigPoller( - lggr, + lggr.Named(relayConfig.FeedID.String()), chain.LogPoller(), aggregatorAddress, *relayConfig.FeedID, @@ -491,6 +494,7 @@ func newPipelineContractTransmitter(lggr logger.Logger, rargs relaytypes.RelayAr } func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) { + lggr := r.lggr.Named("MedianProvider").Named(rargs.ExternalJobID.String()) relayOpts := types.NewRelayOpts(rargs) relayConfig, err := relayOpts.RelayConfig() if err != nil { @@ -501,18 +505,18 @@ func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes return nil, fmt.Errorf("internal error: chain id in spec does not match this relayer's chain: have %s expected %s", relayConfig.ChainID.String(), r.chain.ID().String()) } - configWatcher, err := newConfigProvider(r.lggr, r.chain, relayOpts, r.eventBroadcaster) + configWatcher, err := newConfigProvider(lggr, r.chain, relayOpts, r.eventBroadcaster) if err != nil { return nil, err } reportCodec := evmreportcodec.ReportCodec{} - contractTransmitter, err := newContractTransmitter(r.lggr, rargs, pargs.TransmitterID, configWatcher, r.ks.Eth()) + contractTransmitter, err := newContractTransmitter(lggr, rargs, pargs.TransmitterID, configWatcher, r.ks.Eth()) if err != nil { return nil, err } - medianContract, err := newMedianContract(configWatcher.ContractConfigTracker(), configWatcher.contractAddress, configWatcher.chain, rargs.JobID, r.db, r.lggr) + medianContract, err := newMedianContract(configWatcher.ContractConfigTracker(), configWatcher.contractAddress, configWatcher.chain, rargs.JobID, r.db, lggr) if err != nil { return nil, err } @@ -553,7 +557,7 @@ func (p *medianProvider) Ready() error { func (p *medianProvider) HealthReport() map[string]error { report := p.configWatcher.HealthReport() - maps.Copy(report, p.contractTransmitter.HealthReport()) + services.CopyHealth(report, p.contractTransmitter.HealthReport()) return report } diff --git a/core/services/relay/evm/mercury/transmitter.go b/core/services/relay/evm/mercury/transmitter.go index 199dbfcdf88..508c4a7b481 100644 --- a/core/services/relay/evm/mercury/transmitter.go +++ b/core/services/relay/evm/mercury/transmitter.go @@ -15,12 +15,13 @@ import ( pkgerrors "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/sqlx" - "golang.org/x/exp/maps" relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink/v2/core/services/pg" @@ -188,8 +189,8 @@ func (mt *mercuryTransmitter) Name() string { return mt.lggr.Name() } func (mt *mercuryTransmitter) HealthReport() map[string]error { report := map[string]error{mt.Name(): mt.StartStopOnce.Healthy()} - maps.Copy(report, mt.rpcClient.HealthReport()) - maps.Copy(report, mt.queue.HealthReport()) + services.CopyHealth(report, mt.rpcClient.HealthReport()) + services.CopyHealth(report, mt.queue.HealthReport()) return report } diff --git a/core/services/relay/evm/mercury_provider.go b/core/services/relay/evm/mercury_provider.go index 74072167061..bd00db6f3f9 100644 --- a/core/services/relay/evm/mercury_provider.go +++ b/core/services/relay/evm/mercury_provider.go @@ -4,8 +4,6 @@ import ( "context" "errors" - "golang.org/x/exp/maps" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" @@ -69,8 +67,8 @@ func (p *mercuryProvider) Name() string { func (p *mercuryProvider) HealthReport() map[string]error { report := map[string]error{} - maps.Copy(report, p.configWatcher.HealthReport()) - maps.Copy(report, p.transmitter.HealthReport()) + services.CopyHealth(report, p.configWatcher.HealthReport()) + services.CopyHealth(report, p.transmitter.HealthReport()) return report } diff --git a/core/services/relay/relay.go b/core/services/relay/relay.go index 75ced101b3f..022e7b794e5 100644 --- a/core/services/relay/relay.go +++ b/core/services/relay/relay.go @@ -6,8 +6,6 @@ import ( "fmt" "regexp" - "golang.org/x/exp/maps" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" "github.com/smartcontractkit/chainlink-relay/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/services" @@ -133,8 +131,7 @@ func (r *relayerAdapter) Ready() (err error) { func (r *relayerAdapter) HealthReport() map[string]error { hr := make(map[string]error) - maps.Copy(hr, r.Relayer.HealthReport()) - maps.Copy(hr, r.RelayerExt.HealthReport()) + services.CopyHealth(hr, r.Relayer.HealthReport()) return hr } diff --git a/core/services/vrf/delegate.go b/core/services/vrf/delegate.go index b2e630b020e..95d51275d47 100644 --- a/core/services/vrf/delegate.go +++ b/core/services/vrf/delegate.go @@ -58,7 +58,7 @@ func NewDelegate( pr: pr, porm: porm, legacyChains: legacyChains, - lggr: lggr, + lggr: lggr.Named("VRF"), mailMon: mailMon, } } @@ -119,7 +119,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { } } - l := d.lggr.With( + l := d.lggr.Named(jb.ExternalJobID.String()).With( "jobID", jb.ID, "externalJobID", jb.ExternalJobID, "coordinatorAddress", jb.VRFSpec.CoordinatorAddress, diff --git a/plugins/plugin.go b/plugins/plugin.go index 0b93ef26f5c..6cb3c606b94 100644 --- a/plugins/plugin.go +++ b/plugins/plugin.go @@ -3,8 +3,6 @@ package plugins import ( "sync" - "golang.org/x/exp/maps" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" "github.com/smartcontractkit/chainlink-relay/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/services" @@ -32,7 +30,7 @@ func (p *Base) HealthReport() map[string]error { p.mu.RLock() defer p.mu.RUnlock() for _, s := range p.srvs { - maps.Copy(hr, s.HealthReport()) + services.CopyHealth(hr, s.HealthReport()) } return hr } From fea8410bf1fba510e34c5d03739de3e00c7856cb Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:05:36 -0400 Subject: [PATCH 51/84] Retroactively update the @chainlink/contracts v0.7.1 changelog (#10748) --- contracts/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/CHANGELOG.md b/contracts/CHANGELOG.md index e3ea1a31a9c..782e39f583b 100644 --- a/contracts/CHANGELOG.md +++ b/contracts/CHANGELOG.md @@ -17,6 +17,7 @@ - Functions library uses solidty-cborutils CBOR v2.0.0 and ENS Buffer v0.1.0(#8485) - Gas optimization to AuthorizedOriginReceiverUpgradable by using EnumberableSet .values() - Remove support for inline secrets in Functions requests (#8847) +- Moved versioned directories to use v prefix ## 0.6.1 - 2023-02-06 From 76cb6421372e8cad33c856e81ccc3a37923fc454 Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:11:50 -0400 Subject: [PATCH 52/84] @chainlink.contracts release v0.8.0 (#10798) * Update CHANGELOG and package version for contracts * Update CHANGELOG (#10800) * chore: update changelog (#10801) * add automation comment on contracts changelog (#10802) * (chore): Update CHANGELOG (#10825) * Finalize date on changelog for @chainlink/contracts * Finalize version for @chainlink/contracts --------- Co-authored-by: Austin Born Co-authored-by: Makram Co-authored-by: Ryan Hall Co-authored-by: Justin Kaseman --- contracts/CHANGELOG.md | 21 +++++++++++++++++++++ contracts/package.json | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/contracts/CHANGELOG.md b/contracts/CHANGELOG.md index 782e39f583b..1cb2e0e905b 100644 --- a/contracts/CHANGELOG.md +++ b/contracts/CHANGELOG.md @@ -4,6 +4,27 @@ ... +## 0.8.0 - 2023-10-04 + +### Changed + + +- Add a re-entrancy guard to VRFCoordinatorV2Mock to mimic VRFCoordinatorV2's behavior (#10585) +- Enhanced support for destination configs in Data Streams verifiers (#10472) +- Update Data Streams proxy and billing interfaces for better UX (#10603) +- Allow new reward recipients to be added to pools in Data Streams reward management (#10658) +- Reorganize Data Streams contracts (llo-feeds/) (#10727) +- Release automation 2.1 contracts (#10587) + - Note: consumers should only use IKeeperRegistryMaster when interacting with the registry contract +- Fix Functions v1 OracleWithdrawAll to correctly use transmitters (#10392) +- Clean up unused Functions v1 code: FunctionsBilling.sol maxCallbackGasLimit & FunctionsRequest.sol requestSignature (#10509) +- Fix Functions v1 FunctionsBilling.sol gas price naming to reflect that it is in wei, not gwei (#10509) +- Use Natspec comment lines in Functions v1 contracts (#10567) +- Functions v1 Subscriptions now require a minimum number of requests to release a deposit amount (#10513) +- Fix Functions v1 Subscriptions add consumer checks for when maximum consumers changes in contract configuration (#10511) +- Functions v1 Router no longer reverts during fulfillment on an invalid client (#10511) +- Functions v1 Coordinator oracleWithdrawAll checks for 0 balances (#10511) + ## 0.7.1 - 2023-09-20 ### Changed diff --git a/contracts/package.json b/contracts/package.json index 750eaca181a..dbe47be5221 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,6 +1,6 @@ { "name": "@chainlink/contracts", - "version": "0.7.1", + "version": "0.8.0", "description": "Chainlink smart contracts", "author": "Chainlink devs", "license": "MIT", @@ -17,7 +17,7 @@ "coverage": "hardhat coverage", "prepublishOnly": "pnpm compile && ./scripts/prepublish_generate_abi_folder", "publish-beta": "pnpm publish --tag beta", - "publish-prod": "npm dist-tag add @chainlink/contracts@0.7.1 latest" + "publish-prod": "npm dist-tag add @chainlink/contracts@0.8.0 latest" }, "files": [ "src/", From 30dfa217079f26311010578a1643dfb80e15ef8b Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Wed, 4 Oct 2023 13:06:47 -0400 Subject: [PATCH 53/84] write keeper debugging script (#10808) --- .../generate-automation-master-interface.ts | 8 + .../interfaces/v2_1/IKeeperRegistryMaster.sol | 11 +- contracts/src/v0.8/automation/v2_1/README.md | 4 - .../i_keeper_registry_master_wrapper_2_1.go | 234 ++++++-- ...rapper-dependency-versions-do-not-edit.txt | 2 +- core/scripts/chaincli/README.md | 7 +- core/scripts/chaincli/command/keeper/debug.go | 20 + core/scripts/chaincli/command/keeper/root.go | 1 + core/scripts/chaincli/config/config.go | 14 +- core/scripts/chaincli/handler/debug.go | 462 +++++++++++++++ core/scripts/chaincli/handler/handler.go | 38 +- .../handler/mercury_lookup_handler.go | 536 ++++++++++++++++++ core/scripts/common/helpers.go | 51 ++ core/scripts/go.mod | 3 +- core/scripts/go.sum | 2 + .../ocr2/plugins/ocr2keeper/evm21/core/abi.go | 12 + .../ocr2keeper/evm21/encoding/encoder_test.go | 10 +- .../ocr2keeper/evm21/encoding/interface.go | 1 + .../ocr2keeper/evm21/encoding/packer.go | 55 +- .../ocr2keeper/evm21/encoding/packer_test.go | 70 ++- .../ocr2keeper/evm21/logprovider/factory.go | 5 +- .../evm21/logprovider/integration_test.go | 41 +- .../evm21/logprovider/log_packer.go | 9 +- .../ocr2keeper/evm21/mocks/registry.go | 14 +- .../ocr2/plugins/ocr2keeper/evm21/registry.go | 7 +- .../ocr2/plugins/ocr2keeper/evm21/services.go | 24 +- .../ocr2keeper/evm21/streams_lookup.go | 110 ++-- .../ocr2keeper/evm21/streams_lookup_test.go | 333 +++++------ 28 files changed, 1649 insertions(+), 435 deletions(-) create mode 100644 core/scripts/chaincli/command/keeper/debug.go create mode 100644 core/scripts/chaincli/handler/debug.go create mode 100644 core/scripts/chaincli/handler/mercury_lookup_handler.go create mode 100644 core/services/ocr2/plugins/ocr2keeper/evm21/core/abi.go diff --git a/contracts/scripts/generate-automation-master-interface.ts b/contracts/scripts/generate-automation-master-interface.ts index 5b71c99bc75..de71c56806b 100644 --- a/contracts/scripts/generate-automation-master-interface.ts +++ b/contracts/scripts/generate-automation-master-interface.ts @@ -26,6 +26,14 @@ for (const abi of abis) { const id = utils.id(JSON.stringify(entry)) if (!abiSet.has(id)) { abiSet.add(id) + if ( + entry.type === 'function' && + (entry.name === 'checkUpkeep' || + entry.name === 'checkCallback' || + entry.name === 'simulatePerformUpkeep') + ) { + entry.stateMutability = 'view' // override stateMutability for check / callback / simulate functions + } combinedABI.push(entry) } } diff --git a/contracts/src/v0.8/automation/interfaces/v2_1/IKeeperRegistryMaster.sol b/contracts/src/v0.8/automation/interfaces/v2_1/IKeeperRegistryMaster.sol index cab4d61c5b9..a20fe3127a6 100644 --- a/contracts/src/v0.8/automation/interfaces/v2_1/IKeeperRegistryMaster.sol +++ b/contracts/src/v0.8/automation/interfaces/v2_1/IKeeperRegistryMaster.sol @@ -139,7 +139,10 @@ interface IKeeperRegistryMaster { bytes memory offchainConfig ) external; - function simulatePerformUpkeep(uint256 id, bytes memory performData) external returns (bool success, uint256 gasUsed); + function simulatePerformUpkeep( + uint256 id, + bytes memory performData + ) external view returns (bool success, uint256 gasUsed); function transferOwnership(address to) external; @@ -161,13 +164,14 @@ interface IKeeperRegistryMaster { uint256 id, bytes[] memory values, bytes memory extraData - ) external returns (bool upkeepNeeded, bytes memory performData, uint8 upkeepFailureReason, uint256 gasUsed); + ) external view returns (bool upkeepNeeded, bytes memory performData, uint8 upkeepFailureReason, uint256 gasUsed); function checkUpkeep( uint256 id, bytes memory triggerData ) external + view returns ( bool upkeepNeeded, bytes memory performData, @@ -182,6 +186,7 @@ interface IKeeperRegistryMaster { uint256 id ) external + view returns ( bool upkeepNeeded, bytes memory performData, @@ -375,5 +380,5 @@ interface KeeperRegistryBase2_1 { // THIS FILE WAS AUTOGENERATED FROM THE FOLLOWING ABI JSON: /* -[{"inputs":[{"internalType":"contract KeeperRegistryLogicB2_1","name":"logicA","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayHasNoEntries","type":"error"},{"inputs":[],"name":"CannotCancel","type":"error"},{"inputs":[],"name":"CheckDataExceedsLimit","type":"error"},{"inputs":[],"name":"ConfigDigestMismatch","type":"error"},{"inputs":[],"name":"DuplicateEntry","type":"error"},{"inputs":[],"name":"DuplicateSigners","type":"error"},{"inputs":[],"name":"GasLimitCanOnlyIncrease","type":"error"},{"inputs":[],"name":"GasLimitOutsideRange","type":"error"},{"inputs":[],"name":"IncorrectNumberOfFaultyOracles","type":"error"},{"inputs":[],"name":"IncorrectNumberOfSignatures","type":"error"},{"inputs":[],"name":"IncorrectNumberOfSigners","type":"error"},{"inputs":[],"name":"IndexOutOfRange","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidDataLength","type":"error"},{"inputs":[],"name":"InvalidPayee","type":"error"},{"inputs":[],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidReport","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"InvalidTransmitter","type":"error"},{"inputs":[],"name":"InvalidTrigger","type":"error"},{"inputs":[],"name":"InvalidTriggerType","type":"error"},{"inputs":[],"name":"MaxCheckDataSizeCanOnlyIncrease","type":"error"},{"inputs":[],"name":"MaxPerformDataSizeCanOnlyIncrease","type":"error"},{"inputs":[],"name":"MigrationNotPermitted","type":"error"},{"inputs":[],"name":"NotAContract","type":"error"},{"inputs":[],"name":"OnlyActiveSigners","type":"error"},{"inputs":[],"name":"OnlyActiveTransmitters","type":"error"},{"inputs":[],"name":"OnlyCallableByAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByLINKToken","type":"error"},{"inputs":[],"name":"OnlyCallableByOwnerOrAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByOwnerOrRegistrar","type":"error"},{"inputs":[],"name":"OnlyCallableByPayee","type":"error"},{"inputs":[],"name":"OnlyCallableByProposedAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByProposedPayee","type":"error"},{"inputs":[],"name":"OnlyCallableByUpkeepPrivilegeManager","type":"error"},{"inputs":[],"name":"OnlyPausedUpkeep","type":"error"},{"inputs":[],"name":"OnlySimulatedBackend","type":"error"},{"inputs":[],"name":"OnlyUnpausedUpkeep","type":"error"},{"inputs":[],"name":"ParameterLengthError","type":"error"},{"inputs":[],"name":"PaymentGreaterThanAllLINK","type":"error"},{"inputs":[],"name":"ReentrantCall","type":"error"},{"inputs":[],"name":"RegistryPaused","type":"error"},{"inputs":[],"name":"RepeatedSigner","type":"error"},{"inputs":[],"name":"RepeatedTransmitter","type":"error"},{"inputs":[{"internalType":"bytes","name":"reason","type":"bytes"}],"name":"TargetCheckReverted","type":"error"},{"inputs":[],"name":"TooManyOracles","type":"error"},{"inputs":[],"name":"TranscoderNotSet","type":"error"},{"inputs":[],"name":"UpkeepAlreadyExists","type":"error"},{"inputs":[],"name":"UpkeepCancelled","type":"error"},{"inputs":[],"name":"UpkeepNotCanceled","type":"error"},{"inputs":[],"name":"UpkeepNotNeeded","type":"error"},{"inputs":[],"name":"ValueNotChanged","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"bytes","name":"privilegeConfig","type":"bytes"}],"name":"AdminPrivilegeConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"CancelledUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"previousConfigBlockNumber","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"configCount","type":"uint64"},{"indexed":false,"internalType":"address[]","name":"signers","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"transmitters","type":"address[]"},{"indexed":false,"internalType":"uint8","name":"f","type":"uint8"},{"indexed":false,"internalType":"bytes","name":"onchainConfig","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"ConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"dedupKey","type":"bytes32"}],"name":"DedupKeyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint96","name":"amount","type":"uint96"}],"name":"FundsAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"FundsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"InsufficientFundsUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint96","name":"amount","type":"uint96"}],"name":"OwnerFundsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"transmitters","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"payees","type":"address[]"}],"name":"PayeesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"PayeeshipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"PayeeshipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"payee","type":"address"}],"name":"PaymentWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"ReorgedUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"StaleUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"epoch","type":"uint32"}],"name":"Transmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"UpkeepAdminTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"UpkeepAdminTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"atBlockHeight","type":"uint64"}],"name":"UpkeepCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"newCheckData","type":"bytes"}],"name":"UpkeepCheckDataSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"gasLimit","type":"uint96"}],"name":"UpkeepGasLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"remainingBalance","type":"uint256"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"UpkeepMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"UpkeepOffchainConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"UpkeepPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"uint96","name":"totalPayment","type":"uint96"},{"indexed":false,"internalType":"uint256","name":"gasUsed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"gasOverhead","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"UpkeepPerformed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"privilegeConfig","type":"bytes"}],"name":"UpkeepPrivilegeConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startingBalance","type":"uint256"},{"indexed":false,"internalType":"address","name":"importedFrom","type":"address"}],"name":"UpkeepReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"performGas","type":"uint32"},{"indexed":false,"internalType":"address","name":"admin","type":"address"}],"name":"UpkeepRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"triggerConfig","type":"bytes"}],"name":"UpkeepTriggerConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"UpkeepUnpaused","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fallbackTo","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestConfigDetails","outputs":[{"internalType":"uint32","name":"configCount","type":"uint32"},{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"bytes32","name":"configDigest","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestConfigDigestAndEpoch","outputs":[{"internalType":"bool","name":"scanLogs","type":"bool"},{"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"internalType":"uint32","name":"epoch","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onTokenTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"},{"internalType":"bytes","name":"onchainConfigBytes","type":"bytes"},{"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"},{"components":[{"internalType":"uint32","name":"paymentPremiumPPB","type":"uint32"},{"internalType":"uint32","name":"flatFeeMicroLink","type":"uint32"},{"internalType":"uint32","name":"checkGasLimit","type":"uint32"},{"internalType":"uint24","name":"stalenessSeconds","type":"uint24"},{"internalType":"uint16","name":"gasCeilingMultiplier","type":"uint16"},{"internalType":"uint96","name":"minUpkeepSpend","type":"uint96"},{"internalType":"uint32","name":"maxPerformGas","type":"uint32"},{"internalType":"uint32","name":"maxCheckDataSize","type":"uint32"},{"internalType":"uint32","name":"maxPerformDataSize","type":"uint32"},{"internalType":"uint32","name":"maxRevertDataSize","type":"uint32"},{"internalType":"uint256","name":"fallbackGasPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackLinkPrice","type":"uint256"},{"internalType":"address","name":"transcoder","type":"address"},{"internalType":"address[]","name":"registrars","type":"address[]"},{"internalType":"address","name":"upkeepPrivilegeManager","type":"address"}],"internalType":"struct KeeperRegistryBase2_1.OnchainConfig","name":"onchainConfig","type":"tuple"},{"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"setConfigTypeSafe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"performData","type":"bytes"}],"name":"simulatePerformUpkeep","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[3]","name":"reportContext","type":"bytes32[3]"},{"internalType":"bytes","name":"rawReport","type":"bytes"},{"internalType":"bytes32[]","name":"rs","type":"bytes32[]"},{"internalType":"bytes32[]","name":"ss","type":"bytes32[]"},{"internalType":"bytes32","name":"rawVs","type":"bytes32"}],"name":"transmit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"typeAndVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract KeeperRegistryLogicB2_1","name":"logicB","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint96","name":"amount","type":"uint96"}],"name":"addFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"cancelUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes[]","name":"values","type":"bytes[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"name":"checkCallback","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum KeeperRegistryBase2_1.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"triggerData","type":"bytes"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum KeeperRegistryBase2_1.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"fastGasWei","type":"uint256"},{"internalType":"uint256","name":"linkNative","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum KeeperRegistryBase2_1.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"fastGasWei","type":"uint256"},{"internalType":"uint256","name":"linkNative","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"executeCallback","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum KeeperRegistryBase2_1.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"address","name":"destination","type":"address"}],"name":"migrateUpkeeps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"encodedUpkeeps","type":"bytes"}],"name":"receiveUpkeeps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint32","name":"gasLimit","type":"uint32"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"enum KeeperRegistryBase2_1.Trigger","name":"triggerType","type":"uint8"},{"internalType":"bytes","name":"checkData","type":"bytes"},{"internalType":"bytes","name":"triggerConfig","type":"bytes"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"registerUpkeep","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint32","name":"gasLimit","type":"uint32"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"bytes","name":"checkData","type":"bytes"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"registerUpkeep","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"triggerConfig","type":"bytes"}],"name":"setUpkeepTriggerConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum KeeperRegistryBase2_1.Mode","name":"mode","type":"uint8"},{"internalType":"address","name":"link","type":"address"},{"internalType":"address","name":"linkNativeFeed","type":"address"},{"internalType":"address","name":"fastGasFeed","type":"address"},{"internalType":"address","name":"automationForwarderLogic","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"transmitter","type":"address"}],"name":"acceptPayeeship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"acceptUpkeepAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startIndex","type":"uint256"},{"internalType":"uint256","name":"maxCount","type":"uint256"}],"name":"getActiveUpkeepIDs","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"getAdminPrivilegeConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAutomationForwarderLogic","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getBalance","outputs":[{"internalType":"uint96","name":"balance","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCancellationDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getConditionalGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getFastGasFeedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepID","type":"uint256"}],"name":"getForwarder","outputs":[{"internalType":"contract IAutomationForwarder","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLinkAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLinkNativeFeedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLogGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"enum KeeperRegistryBase2_1.Trigger","name":"triggerType","type":"uint8"},{"internalType":"uint32","name":"gasLimit","type":"uint32"}],"name":"getMaxPaymentForGas","outputs":[{"internalType":"uint96","name":"maxPayment","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getMinBalance","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getMinBalanceForUpkeep","outputs":[{"internalType":"uint96","name":"minBalance","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMode","outputs":[{"internalType":"enum KeeperRegistryBase2_1.Mode","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"peer","type":"address"}],"name":"getPeerRegistryMigrationPermission","outputs":[{"internalType":"enum KeeperRegistryBase2_1.MigrationPermission","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPerPerformByteGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getPerSignerGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"query","type":"address"}],"name":"getSignerInfo","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint8","name":"index","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getState","outputs":[{"components":[{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"uint96","name":"ownerLinkBalance","type":"uint96"},{"internalType":"uint256","name":"expectedLinkBalance","type":"uint256"},{"internalType":"uint96","name":"totalPremium","type":"uint96"},{"internalType":"uint256","name":"numUpkeeps","type":"uint256"},{"internalType":"uint32","name":"configCount","type":"uint32"},{"internalType":"uint32","name":"latestConfigBlockNumber","type":"uint32"},{"internalType":"bytes32","name":"latestConfigDigest","type":"bytes32"},{"internalType":"uint32","name":"latestEpoch","type":"uint32"},{"internalType":"bool","name":"paused","type":"bool"}],"internalType":"struct KeeperRegistryBase2_1.State","name":"state","type":"tuple"},{"components":[{"internalType":"uint32","name":"paymentPremiumPPB","type":"uint32"},{"internalType":"uint32","name":"flatFeeMicroLink","type":"uint32"},{"internalType":"uint32","name":"checkGasLimit","type":"uint32"},{"internalType":"uint24","name":"stalenessSeconds","type":"uint24"},{"internalType":"uint16","name":"gasCeilingMultiplier","type":"uint16"},{"internalType":"uint96","name":"minUpkeepSpend","type":"uint96"},{"internalType":"uint32","name":"maxPerformGas","type":"uint32"},{"internalType":"uint32","name":"maxCheckDataSize","type":"uint32"},{"internalType":"uint32","name":"maxPerformDataSize","type":"uint32"},{"internalType":"uint32","name":"maxRevertDataSize","type":"uint32"},{"internalType":"uint256","name":"fallbackGasPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackLinkPrice","type":"uint256"},{"internalType":"address","name":"transcoder","type":"address"},{"internalType":"address[]","name":"registrars","type":"address[]"},{"internalType":"address","name":"upkeepPrivilegeManager","type":"address"}],"internalType":"struct KeeperRegistryBase2_1.OnchainConfig","name":"config","type":"tuple"},{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"query","type":"address"}],"name":"getTransmitterInfo","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint8","name":"index","type":"uint8"},{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"uint96","name":"lastCollected","type":"uint96"},{"internalType":"address","name":"payee","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getTriggerType","outputs":[{"internalType":"enum KeeperRegistryBase2_1.Trigger","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getUpkeep","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint32","name":"performGas","type":"uint32"},{"internalType":"bytes","name":"checkData","type":"bytes"},{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"uint64","name":"maxValidBlocknumber","type":"uint64"},{"internalType":"uint32","name":"lastPerformedBlockNumber","type":"uint32"},{"internalType":"uint96","name":"amountSpent","type":"uint96"},{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"internalType":"struct KeeperRegistryBase2_1.UpkeepInfo","name":"upkeepInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getUpkeepPrivilegeConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getUpkeepTriggerConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dedupKey","type":"bytes32"}],"name":"hasDedupKey","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"pauseUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"recoverFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"bytes","name":"newPrivilegeConfig","type":"bytes"}],"name":"setAdminPrivilegeConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"payees","type":"address[]"}],"name":"setPayees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"peer","type":"address"},{"internalType":"enum KeeperRegistryBase2_1.MigrationPermission","name":"permission","type":"uint8"}],"name":"setPeerRegistryMigrationPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"newCheckData","type":"bytes"}],"name":"setUpkeepCheckData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint32","name":"gasLimit","type":"uint32"}],"name":"setUpkeepGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"config","type":"bytes"}],"name":"setUpkeepOffchainConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"},{"internalType":"bytes","name":"newPrivilegeConfig","type":"bytes"}],"name":"setUpkeepPrivilegeConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transmitter","type":"address"},{"internalType":"address","name":"proposed","type":"address"}],"name":"transferPayeeship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"proposed","type":"address"}],"name":"transferUpkeepAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"unpauseUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upkeepTranscoderVersion","outputs":[{"internalType":"enum UpkeepFormat","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"upkeepVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawOwnerFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawPayment","outputs":[],"stateMutability":"nonpayable","type":"function"}] +[{"inputs":[{"internalType":"contract KeeperRegistryLogicB2_1","name":"logicA","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayHasNoEntries","type":"error"},{"inputs":[],"name":"CannotCancel","type":"error"},{"inputs":[],"name":"CheckDataExceedsLimit","type":"error"},{"inputs":[],"name":"ConfigDigestMismatch","type":"error"},{"inputs":[],"name":"DuplicateEntry","type":"error"},{"inputs":[],"name":"DuplicateSigners","type":"error"},{"inputs":[],"name":"GasLimitCanOnlyIncrease","type":"error"},{"inputs":[],"name":"GasLimitOutsideRange","type":"error"},{"inputs":[],"name":"IncorrectNumberOfFaultyOracles","type":"error"},{"inputs":[],"name":"IncorrectNumberOfSignatures","type":"error"},{"inputs":[],"name":"IncorrectNumberOfSigners","type":"error"},{"inputs":[],"name":"IndexOutOfRange","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidDataLength","type":"error"},{"inputs":[],"name":"InvalidPayee","type":"error"},{"inputs":[],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidReport","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"InvalidTransmitter","type":"error"},{"inputs":[],"name":"InvalidTrigger","type":"error"},{"inputs":[],"name":"InvalidTriggerType","type":"error"},{"inputs":[],"name":"MaxCheckDataSizeCanOnlyIncrease","type":"error"},{"inputs":[],"name":"MaxPerformDataSizeCanOnlyIncrease","type":"error"},{"inputs":[],"name":"MigrationNotPermitted","type":"error"},{"inputs":[],"name":"NotAContract","type":"error"},{"inputs":[],"name":"OnlyActiveSigners","type":"error"},{"inputs":[],"name":"OnlyActiveTransmitters","type":"error"},{"inputs":[],"name":"OnlyCallableByAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByLINKToken","type":"error"},{"inputs":[],"name":"OnlyCallableByOwnerOrAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByOwnerOrRegistrar","type":"error"},{"inputs":[],"name":"OnlyCallableByPayee","type":"error"},{"inputs":[],"name":"OnlyCallableByProposedAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByProposedPayee","type":"error"},{"inputs":[],"name":"OnlyCallableByUpkeepPrivilegeManager","type":"error"},{"inputs":[],"name":"OnlyPausedUpkeep","type":"error"},{"inputs":[],"name":"OnlySimulatedBackend","type":"error"},{"inputs":[],"name":"OnlyUnpausedUpkeep","type":"error"},{"inputs":[],"name":"ParameterLengthError","type":"error"},{"inputs":[],"name":"PaymentGreaterThanAllLINK","type":"error"},{"inputs":[],"name":"ReentrantCall","type":"error"},{"inputs":[],"name":"RegistryPaused","type":"error"},{"inputs":[],"name":"RepeatedSigner","type":"error"},{"inputs":[],"name":"RepeatedTransmitter","type":"error"},{"inputs":[{"internalType":"bytes","name":"reason","type":"bytes"}],"name":"TargetCheckReverted","type":"error"},{"inputs":[],"name":"TooManyOracles","type":"error"},{"inputs":[],"name":"TranscoderNotSet","type":"error"},{"inputs":[],"name":"UpkeepAlreadyExists","type":"error"},{"inputs":[],"name":"UpkeepCancelled","type":"error"},{"inputs":[],"name":"UpkeepNotCanceled","type":"error"},{"inputs":[],"name":"UpkeepNotNeeded","type":"error"},{"inputs":[],"name":"ValueNotChanged","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"bytes","name":"privilegeConfig","type":"bytes"}],"name":"AdminPrivilegeConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"CancelledUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"previousConfigBlockNumber","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"configCount","type":"uint64"},{"indexed":false,"internalType":"address[]","name":"signers","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"transmitters","type":"address[]"},{"indexed":false,"internalType":"uint8","name":"f","type":"uint8"},{"indexed":false,"internalType":"bytes","name":"onchainConfig","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"ConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"dedupKey","type":"bytes32"}],"name":"DedupKeyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint96","name":"amount","type":"uint96"}],"name":"FundsAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"FundsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"InsufficientFundsUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint96","name":"amount","type":"uint96"}],"name":"OwnerFundsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"transmitters","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"payees","type":"address[]"}],"name":"PayeesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"PayeeshipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"PayeeshipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"payee","type":"address"}],"name":"PaymentWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"ReorgedUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"StaleUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"epoch","type":"uint32"}],"name":"Transmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"UpkeepAdminTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"UpkeepAdminTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"atBlockHeight","type":"uint64"}],"name":"UpkeepCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"newCheckData","type":"bytes"}],"name":"UpkeepCheckDataSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"gasLimit","type":"uint96"}],"name":"UpkeepGasLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"remainingBalance","type":"uint256"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"UpkeepMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"UpkeepOffchainConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"UpkeepPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"uint96","name":"totalPayment","type":"uint96"},{"indexed":false,"internalType":"uint256","name":"gasUsed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"gasOverhead","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"UpkeepPerformed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"privilegeConfig","type":"bytes"}],"name":"UpkeepPrivilegeConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startingBalance","type":"uint256"},{"indexed":false,"internalType":"address","name":"importedFrom","type":"address"}],"name":"UpkeepReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"performGas","type":"uint32"},{"indexed":false,"internalType":"address","name":"admin","type":"address"}],"name":"UpkeepRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"triggerConfig","type":"bytes"}],"name":"UpkeepTriggerConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"UpkeepUnpaused","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fallbackTo","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestConfigDetails","outputs":[{"internalType":"uint32","name":"configCount","type":"uint32"},{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"bytes32","name":"configDigest","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestConfigDigestAndEpoch","outputs":[{"internalType":"bool","name":"scanLogs","type":"bool"},{"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"internalType":"uint32","name":"epoch","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onTokenTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"},{"internalType":"bytes","name":"onchainConfigBytes","type":"bytes"},{"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"},{"components":[{"internalType":"uint32","name":"paymentPremiumPPB","type":"uint32"},{"internalType":"uint32","name":"flatFeeMicroLink","type":"uint32"},{"internalType":"uint32","name":"checkGasLimit","type":"uint32"},{"internalType":"uint24","name":"stalenessSeconds","type":"uint24"},{"internalType":"uint16","name":"gasCeilingMultiplier","type":"uint16"},{"internalType":"uint96","name":"minUpkeepSpend","type":"uint96"},{"internalType":"uint32","name":"maxPerformGas","type":"uint32"},{"internalType":"uint32","name":"maxCheckDataSize","type":"uint32"},{"internalType":"uint32","name":"maxPerformDataSize","type":"uint32"},{"internalType":"uint32","name":"maxRevertDataSize","type":"uint32"},{"internalType":"uint256","name":"fallbackGasPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackLinkPrice","type":"uint256"},{"internalType":"address","name":"transcoder","type":"address"},{"internalType":"address[]","name":"registrars","type":"address[]"},{"internalType":"address","name":"upkeepPrivilegeManager","type":"address"}],"internalType":"struct KeeperRegistryBase2_1.OnchainConfig","name":"onchainConfig","type":"tuple"},{"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"setConfigTypeSafe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"performData","type":"bytes"}],"name":"simulatePerformUpkeep","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[3]","name":"reportContext","type":"bytes32[3]"},{"internalType":"bytes","name":"rawReport","type":"bytes"},{"internalType":"bytes32[]","name":"rs","type":"bytes32[]"},{"internalType":"bytes32[]","name":"ss","type":"bytes32[]"},{"internalType":"bytes32","name":"rawVs","type":"bytes32"}],"name":"transmit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"typeAndVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract KeeperRegistryLogicB2_1","name":"logicB","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint96","name":"amount","type":"uint96"}],"name":"addFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"cancelUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes[]","name":"values","type":"bytes[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"name":"checkCallback","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum KeeperRegistryBase2_1.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"triggerData","type":"bytes"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum KeeperRegistryBase2_1.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"fastGasWei","type":"uint256"},{"internalType":"uint256","name":"linkNative","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum KeeperRegistryBase2_1.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"fastGasWei","type":"uint256"},{"internalType":"uint256","name":"linkNative","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"executeCallback","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum KeeperRegistryBase2_1.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"address","name":"destination","type":"address"}],"name":"migrateUpkeeps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"encodedUpkeeps","type":"bytes"}],"name":"receiveUpkeeps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint32","name":"gasLimit","type":"uint32"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"enum KeeperRegistryBase2_1.Trigger","name":"triggerType","type":"uint8"},{"internalType":"bytes","name":"checkData","type":"bytes"},{"internalType":"bytes","name":"triggerConfig","type":"bytes"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"registerUpkeep","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint32","name":"gasLimit","type":"uint32"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"bytes","name":"checkData","type":"bytes"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"registerUpkeep","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"triggerConfig","type":"bytes"}],"name":"setUpkeepTriggerConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum KeeperRegistryBase2_1.Mode","name":"mode","type":"uint8"},{"internalType":"address","name":"link","type":"address"},{"internalType":"address","name":"linkNativeFeed","type":"address"},{"internalType":"address","name":"fastGasFeed","type":"address"},{"internalType":"address","name":"automationForwarderLogic","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"transmitter","type":"address"}],"name":"acceptPayeeship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"acceptUpkeepAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startIndex","type":"uint256"},{"internalType":"uint256","name":"maxCount","type":"uint256"}],"name":"getActiveUpkeepIDs","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"getAdminPrivilegeConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAutomationForwarderLogic","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getBalance","outputs":[{"internalType":"uint96","name":"balance","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCancellationDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getConditionalGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getFastGasFeedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepID","type":"uint256"}],"name":"getForwarder","outputs":[{"internalType":"contract IAutomationForwarder","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLinkAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLinkNativeFeedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLogGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"enum KeeperRegistryBase2_1.Trigger","name":"triggerType","type":"uint8"},{"internalType":"uint32","name":"gasLimit","type":"uint32"}],"name":"getMaxPaymentForGas","outputs":[{"internalType":"uint96","name":"maxPayment","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getMinBalance","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getMinBalanceForUpkeep","outputs":[{"internalType":"uint96","name":"minBalance","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMode","outputs":[{"internalType":"enum KeeperRegistryBase2_1.Mode","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"peer","type":"address"}],"name":"getPeerRegistryMigrationPermission","outputs":[{"internalType":"enum KeeperRegistryBase2_1.MigrationPermission","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPerPerformByteGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getPerSignerGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"query","type":"address"}],"name":"getSignerInfo","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint8","name":"index","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getState","outputs":[{"components":[{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"uint96","name":"ownerLinkBalance","type":"uint96"},{"internalType":"uint256","name":"expectedLinkBalance","type":"uint256"},{"internalType":"uint96","name":"totalPremium","type":"uint96"},{"internalType":"uint256","name":"numUpkeeps","type":"uint256"},{"internalType":"uint32","name":"configCount","type":"uint32"},{"internalType":"uint32","name":"latestConfigBlockNumber","type":"uint32"},{"internalType":"bytes32","name":"latestConfigDigest","type":"bytes32"},{"internalType":"uint32","name":"latestEpoch","type":"uint32"},{"internalType":"bool","name":"paused","type":"bool"}],"internalType":"struct KeeperRegistryBase2_1.State","name":"state","type":"tuple"},{"components":[{"internalType":"uint32","name":"paymentPremiumPPB","type":"uint32"},{"internalType":"uint32","name":"flatFeeMicroLink","type":"uint32"},{"internalType":"uint32","name":"checkGasLimit","type":"uint32"},{"internalType":"uint24","name":"stalenessSeconds","type":"uint24"},{"internalType":"uint16","name":"gasCeilingMultiplier","type":"uint16"},{"internalType":"uint96","name":"minUpkeepSpend","type":"uint96"},{"internalType":"uint32","name":"maxPerformGas","type":"uint32"},{"internalType":"uint32","name":"maxCheckDataSize","type":"uint32"},{"internalType":"uint32","name":"maxPerformDataSize","type":"uint32"},{"internalType":"uint32","name":"maxRevertDataSize","type":"uint32"},{"internalType":"uint256","name":"fallbackGasPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackLinkPrice","type":"uint256"},{"internalType":"address","name":"transcoder","type":"address"},{"internalType":"address[]","name":"registrars","type":"address[]"},{"internalType":"address","name":"upkeepPrivilegeManager","type":"address"}],"internalType":"struct KeeperRegistryBase2_1.OnchainConfig","name":"config","type":"tuple"},{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"query","type":"address"}],"name":"getTransmitterInfo","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint8","name":"index","type":"uint8"},{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"uint96","name":"lastCollected","type":"uint96"},{"internalType":"address","name":"payee","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getTriggerType","outputs":[{"internalType":"enum KeeperRegistryBase2_1.Trigger","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getUpkeep","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint32","name":"performGas","type":"uint32"},{"internalType":"bytes","name":"checkData","type":"bytes"},{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"uint64","name":"maxValidBlocknumber","type":"uint64"},{"internalType":"uint32","name":"lastPerformedBlockNumber","type":"uint32"},{"internalType":"uint96","name":"amountSpent","type":"uint96"},{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"internalType":"struct KeeperRegistryBase2_1.UpkeepInfo","name":"upkeepInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getUpkeepPrivilegeConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getUpkeepTriggerConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dedupKey","type":"bytes32"}],"name":"hasDedupKey","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"pauseUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"recoverFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"bytes","name":"newPrivilegeConfig","type":"bytes"}],"name":"setAdminPrivilegeConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"payees","type":"address[]"}],"name":"setPayees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"peer","type":"address"},{"internalType":"enum KeeperRegistryBase2_1.MigrationPermission","name":"permission","type":"uint8"}],"name":"setPeerRegistryMigrationPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"newCheckData","type":"bytes"}],"name":"setUpkeepCheckData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint32","name":"gasLimit","type":"uint32"}],"name":"setUpkeepGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"config","type":"bytes"}],"name":"setUpkeepOffchainConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"},{"internalType":"bytes","name":"newPrivilegeConfig","type":"bytes"}],"name":"setUpkeepPrivilegeConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transmitter","type":"address"},{"internalType":"address","name":"proposed","type":"address"}],"name":"transferPayeeship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"proposed","type":"address"}],"name":"transferUpkeepAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"unpauseUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upkeepTranscoderVersion","outputs":[{"internalType":"enum UpkeepFormat","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"upkeepVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawOwnerFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawPayment","outputs":[],"stateMutability":"nonpayable","type":"function"}] */ diff --git a/contracts/src/v0.8/automation/v2_1/README.md b/contracts/src/v0.8/automation/v2_1/README.md index 865f2d74e01..43c71daae76 100644 --- a/contracts/src/v0.8/automation/v2_1/README.md +++ b/contracts/src/v0.8/automation/v2_1/README.md @@ -34,10 +34,6 @@ graph LR The Master Interface is a deduped combination of all the interfaces from all contracts in the chain. We generate this interface programatically using the script `generate-automation-master-interface.ts`. This process is not a hardened one. Users of this script should take great care to ensure it's efficacy. -### Future Improvements - -- We could use this script to change `checkUpkeep` from an executable function to a "view" function in the master interface - this would make interacting with the contract simpler in tests and (maybe) also from the core node. - [size-limit-eip]: https://eips.ethereum.org/EIPS/eip-170 [fallback]: https://docs.soliditylang.org/en/v0.8.12/contracts.html#fallback-function [delegatecall]: https://docs.soliditylang.org/en/v0.8.12/introduction-to-smart-contracts.html?highlight=delegatecall#delegatecall-callcode-and-libraries diff --git a/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1/i_keeper_registry_master_wrapper_2_1.go b/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1/i_keeper_registry_master_wrapper_2_1.go index c43f32103de..640e871c084 100644 --- a/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1/i_keeper_registry_master_wrapper_2_1.go +++ b/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1/i_keeper_registry_master_wrapper_2_1.go @@ -75,7 +75,7 @@ type KeeperRegistryBase21UpkeepInfo struct { } var IKeeperRegistryMasterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"ArrayHasNoEntries\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotCancel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CheckDataExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateEntry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitOutsideRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfFaultyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRecipient\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTrigger\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTriggerType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxCheckDataSizeCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxPerformDataSizeCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MigrationNotPermitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByLINKToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrRegistrar\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpkeepPrivilegeManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySimulatedBackend\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyUnpausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ParameterLengthError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentGreaterThanAllLINK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"TargetCheckReverted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TranscoderNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotCanceled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotNeeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValueNotChanged\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"AdminPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"CancelledUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"DedupKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"FundsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"FundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"InsufficientFundsUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"OwnerFundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"PayeesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"PaymentWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"ReorgedUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"StaleUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"atBlockHeight\",\"type\":\"uint64\"}],\"name\":\"UpkeepCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"UpkeepCheckDataSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"gasLimit\",\"type\":\"uint96\"}],\"name\":\"UpkeepGasLimitSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"UpkeepMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepOffchainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"totalPayment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasOverhead\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"UpkeepPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"importedFrom\",\"type\":\"address\"}],\"name\":\"UpkeepReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"UpkeepRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepTriggerConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepUnpaused\",\"type\":\"event\"},{\"stateMutability\":\"nonpayable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"acceptPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"acceptUpkeepAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"addFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"cancelUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"values\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"checkCallback\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"triggerData\",\"type\":\"bytes\"}],\"name\":\"checkUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fastGasWei\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"linkNative\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"checkUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fastGasWei\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"linkNative\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"executeCallback\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fallbackTo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveUpkeepIDs\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"getAdminPrivilegeConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAutomationForwarderLogic\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCancellationDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConditionalGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFastGasFeedAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepID\",\"type\":\"uint256\"}],\"name\":\"getForwarder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLinkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLinkNativeFeedAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLogGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"triggerType\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"name\":\"getMaxPaymentForGas\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"maxPayment\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getMinBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getMinBalanceForUpkeep\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"minBalance\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMode\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"peer\",\"type\":\"address\"}],\"name\":\"getPeerRegistryMigrationPermission\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPerPerformByteGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPerSignerGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"query\",\"type\":\"address\"}],\"name\":\"getSignerInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"ownerLinkBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"expectedLinkBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"totalPremium\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"numUpkeeps\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"latestConfigBlockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"latestConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"latestEpoch\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"}],\"internalType\":\"structKeeperRegistryBase2_1.State\",\"name\":\"state\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"paymentPremiumPPB\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"flatFeeMicroLink\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"uint96\",\"name\":\"minUpkeepSpend\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"}],\"internalType\":\"structKeeperRegistryBase2_1.OnchainConfig\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"query\",\"type\":\"address\"}],\"name\":\"getTransmitterInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"lastCollected\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getTriggerType\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getUpkeep\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"checkData\",\"type\":\"bytes\"},{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"maxValidBlocknumber\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"lastPerformedBlockNumber\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"amountSpent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structKeeperRegistryBase2_1.UpkeepInfo\",\"name\":\"upkeepInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getUpkeepPrivilegeConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getUpkeepTriggerConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"hasDedupKey\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"migrateUpkeeps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"pauseUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedUpkeeps\",\"type\":\"bytes\"}],\"name\":\"receiveUpkeeps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"triggerType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"checkData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"registerUpkeep\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"checkData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"registerUpkeep\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"newPrivilegeConfig\",\"type\":\"bytes\"}],\"name\":\"setAdminPrivilegeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfigBytes\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"paymentPremiumPPB\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"flatFeeMicroLink\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"uint96\",\"name\":\"minUpkeepSpend\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"}],\"internalType\":\"structKeeperRegistryBase2_1.OnchainConfig\",\"name\":\"onchainConfig\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfigTypeSafe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"setPayees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"peer\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"permission\",\"type\":\"uint8\"}],\"name\":\"setPeerRegistryMigrationPermission\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"setUpkeepCheckData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"name\":\"setUpkeepGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"name\":\"setUpkeepOffchainConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"newPrivilegeConfig\",\"type\":\"bytes\"}],\"name\":\"setUpkeepPrivilegeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"setUpkeepTriggerConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"}],\"name\":\"simulatePerformUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"transferPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"transferUpkeepAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"unpauseUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upkeepTranscoderVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upkeepVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawOwnerFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawPayment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"name\":\"ArrayHasNoEntries\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotCancel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CheckDataExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateEntry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitOutsideRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfFaultyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRecipient\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTrigger\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTriggerType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxCheckDataSizeCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxPerformDataSizeCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MigrationNotPermitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByLINKToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrRegistrar\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpkeepPrivilegeManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySimulatedBackend\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyUnpausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ParameterLengthError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentGreaterThanAllLINK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"TargetCheckReverted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TranscoderNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotCanceled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotNeeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValueNotChanged\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"AdminPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"CancelledUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"DedupKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"FundsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"FundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"InsufficientFundsUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"OwnerFundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"PayeesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"PaymentWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"ReorgedUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"StaleUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"atBlockHeight\",\"type\":\"uint64\"}],\"name\":\"UpkeepCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"UpkeepCheckDataSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"gasLimit\",\"type\":\"uint96\"}],\"name\":\"UpkeepGasLimitSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"UpkeepMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepOffchainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"totalPayment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasOverhead\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"UpkeepPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"importedFrom\",\"type\":\"address\"}],\"name\":\"UpkeepReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"UpkeepRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepTriggerConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepUnpaused\",\"type\":\"event\"},{\"stateMutability\":\"nonpayable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"acceptPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"acceptUpkeepAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"addFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"cancelUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"values\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"checkCallback\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"triggerData\",\"type\":\"bytes\"}],\"name\":\"checkUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fastGasWei\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"linkNative\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"checkUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fastGasWei\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"linkNative\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"executeCallback\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fallbackTo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveUpkeepIDs\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"getAdminPrivilegeConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAutomationForwarderLogic\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCancellationDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConditionalGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFastGasFeedAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepID\",\"type\":\"uint256\"}],\"name\":\"getForwarder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLinkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLinkNativeFeedAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLogGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"triggerType\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"name\":\"getMaxPaymentForGas\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"maxPayment\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getMinBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getMinBalanceForUpkeep\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"minBalance\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMode\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"peer\",\"type\":\"address\"}],\"name\":\"getPeerRegistryMigrationPermission\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPerPerformByteGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPerSignerGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"query\",\"type\":\"address\"}],\"name\":\"getSignerInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"ownerLinkBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"expectedLinkBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"totalPremium\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"numUpkeeps\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"latestConfigBlockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"latestConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"latestEpoch\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"}],\"internalType\":\"structKeeperRegistryBase2_1.State\",\"name\":\"state\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"paymentPremiumPPB\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"flatFeeMicroLink\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"uint96\",\"name\":\"minUpkeepSpend\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"}],\"internalType\":\"structKeeperRegistryBase2_1.OnchainConfig\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"query\",\"type\":\"address\"}],\"name\":\"getTransmitterInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"lastCollected\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getTriggerType\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getUpkeep\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"checkData\",\"type\":\"bytes\"},{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"maxValidBlocknumber\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"lastPerformedBlockNumber\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"amountSpent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structKeeperRegistryBase2_1.UpkeepInfo\",\"name\":\"upkeepInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getUpkeepPrivilegeConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getUpkeepTriggerConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"hasDedupKey\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"migrateUpkeeps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"pauseUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedUpkeeps\",\"type\":\"bytes\"}],\"name\":\"receiveUpkeeps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"triggerType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"checkData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"registerUpkeep\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"checkData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"registerUpkeep\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"newPrivilegeConfig\",\"type\":\"bytes\"}],\"name\":\"setAdminPrivilegeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfigBytes\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"paymentPremiumPPB\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"flatFeeMicroLink\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"uint96\",\"name\":\"minUpkeepSpend\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"}],\"internalType\":\"structKeeperRegistryBase2_1.OnchainConfig\",\"name\":\"onchainConfig\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfigTypeSafe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"setPayees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"peer\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"permission\",\"type\":\"uint8\"}],\"name\":\"setPeerRegistryMigrationPermission\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"setUpkeepCheckData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"name\":\"setUpkeepGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"name\":\"setUpkeepOffchainConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"newPrivilegeConfig\",\"type\":\"bytes\"}],\"name\":\"setUpkeepPrivilegeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"setUpkeepTriggerConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"}],\"name\":\"simulatePerformUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"transferPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"transferUpkeepAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"unpauseUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upkeepTranscoderVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upkeepVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawOwnerFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawPayment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } var IKeeperRegistryMasterABI = IKeeperRegistryMasterMetaData.ABI @@ -196,6 +196,108 @@ func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactorRaw) Transact(opts return _IKeeperRegistryMaster.Contract.contract.Transact(opts, method, params...) } +func (_IKeeperRegistryMaster *IKeeperRegistryMasterCaller) CheckCallback(opts *bind.CallOpts, id *big.Int, values [][]byte, extraData []byte) (CheckCallback, + + error) { + var out []interface{} + err := _IKeeperRegistryMaster.contract.Call(opts, &out, "checkCallback", id, values, extraData) + + outstruct := new(CheckCallback) + if err != nil { + return *outstruct, err + } + + outstruct.UpkeepNeeded = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.PerformData = *abi.ConvertType(out[1], new([]byte)).(*[]byte) + outstruct.UpkeepFailureReason = *abi.ConvertType(out[2], new(uint8)).(*uint8) + outstruct.GasUsed = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterSession) CheckCallback(id *big.Int, values [][]byte, extraData []byte) (CheckCallback, + + error) { + return _IKeeperRegistryMaster.Contract.CheckCallback(&_IKeeperRegistryMaster.CallOpts, id, values, extraData) +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterCallerSession) CheckCallback(id *big.Int, values [][]byte, extraData []byte) (CheckCallback, + + error) { + return _IKeeperRegistryMaster.Contract.CheckCallback(&_IKeeperRegistryMaster.CallOpts, id, values, extraData) +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterCaller) CheckUpkeep(opts *bind.CallOpts, id *big.Int, triggerData []byte) (CheckUpkeep, + + error) { + var out []interface{} + err := _IKeeperRegistryMaster.contract.Call(opts, &out, "checkUpkeep", id, triggerData) + + outstruct := new(CheckUpkeep) + if err != nil { + return *outstruct, err + } + + outstruct.UpkeepNeeded = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.PerformData = *abi.ConvertType(out[1], new([]byte)).(*[]byte) + outstruct.UpkeepFailureReason = *abi.ConvertType(out[2], new(uint8)).(*uint8) + outstruct.GasUsed = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.GasLimit = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.FastGasWei = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + outstruct.LinkNative = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterSession) CheckUpkeep(id *big.Int, triggerData []byte) (CheckUpkeep, + + error) { + return _IKeeperRegistryMaster.Contract.CheckUpkeep(&_IKeeperRegistryMaster.CallOpts, id, triggerData) +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterCallerSession) CheckUpkeep(id *big.Int, triggerData []byte) (CheckUpkeep, + + error) { + return _IKeeperRegistryMaster.Contract.CheckUpkeep(&_IKeeperRegistryMaster.CallOpts, id, triggerData) +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterCaller) CheckUpkeep0(opts *bind.CallOpts, id *big.Int) (CheckUpkeep0, + + error) { + var out []interface{} + err := _IKeeperRegistryMaster.contract.Call(opts, &out, "checkUpkeep0", id) + + outstruct := new(CheckUpkeep0) + if err != nil { + return *outstruct, err + } + + outstruct.UpkeepNeeded = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.PerformData = *abi.ConvertType(out[1], new([]byte)).(*[]byte) + outstruct.UpkeepFailureReason = *abi.ConvertType(out[2], new(uint8)).(*uint8) + outstruct.GasUsed = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.GasLimit = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.FastGasWei = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + outstruct.LinkNative = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterSession) CheckUpkeep0(id *big.Int) (CheckUpkeep0, + + error) { + return _IKeeperRegistryMaster.Contract.CheckUpkeep0(&_IKeeperRegistryMaster.CallOpts, id) +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterCallerSession) CheckUpkeep0(id *big.Int) (CheckUpkeep0, + + error) { + return _IKeeperRegistryMaster.Contract.CheckUpkeep0(&_IKeeperRegistryMaster.CallOpts, id) +} + func (_IKeeperRegistryMaster *IKeeperRegistryMasterCaller) FallbackTo(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _IKeeperRegistryMaster.contract.Call(opts, &out, "fallbackTo") @@ -904,6 +1006,36 @@ func (_IKeeperRegistryMaster *IKeeperRegistryMasterCallerSession) Owner() (commo return _IKeeperRegistryMaster.Contract.Owner(&_IKeeperRegistryMaster.CallOpts) } +func (_IKeeperRegistryMaster *IKeeperRegistryMasterCaller) SimulatePerformUpkeep(opts *bind.CallOpts, id *big.Int, performData []byte) (SimulatePerformUpkeep, + + error) { + var out []interface{} + err := _IKeeperRegistryMaster.contract.Call(opts, &out, "simulatePerformUpkeep", id, performData) + + outstruct := new(SimulatePerformUpkeep) + if err != nil { + return *outstruct, err + } + + outstruct.Success = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.GasUsed = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterSession) SimulatePerformUpkeep(id *big.Int, performData []byte) (SimulatePerformUpkeep, + + error) { + return _IKeeperRegistryMaster.Contract.SimulatePerformUpkeep(&_IKeeperRegistryMaster.CallOpts, id, performData) +} + +func (_IKeeperRegistryMaster *IKeeperRegistryMasterCallerSession) SimulatePerformUpkeep(id *big.Int, performData []byte) (SimulatePerformUpkeep, + + error) { + return _IKeeperRegistryMaster.Contract.SimulatePerformUpkeep(&_IKeeperRegistryMaster.CallOpts, id, performData) +} + func (_IKeeperRegistryMaster *IKeeperRegistryMasterCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { var out []interface{} err := _IKeeperRegistryMaster.contract.Call(opts, &out, "typeAndVersion") @@ -1030,42 +1162,6 @@ func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactorSession) CancelUpke return _IKeeperRegistryMaster.Contract.CancelUpkeep(&_IKeeperRegistryMaster.TransactOpts, id) } -func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactor) CheckCallback(opts *bind.TransactOpts, id *big.Int, values [][]byte, extraData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.contract.Transact(opts, "checkCallback", id, values, extraData) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterSession) CheckCallback(id *big.Int, values [][]byte, extraData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.Contract.CheckCallback(&_IKeeperRegistryMaster.TransactOpts, id, values, extraData) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactorSession) CheckCallback(id *big.Int, values [][]byte, extraData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.Contract.CheckCallback(&_IKeeperRegistryMaster.TransactOpts, id, values, extraData) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactor) CheckUpkeep(opts *bind.TransactOpts, id *big.Int, triggerData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.contract.Transact(opts, "checkUpkeep", id, triggerData) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterSession) CheckUpkeep(id *big.Int, triggerData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.Contract.CheckUpkeep(&_IKeeperRegistryMaster.TransactOpts, id, triggerData) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactorSession) CheckUpkeep(id *big.Int, triggerData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.Contract.CheckUpkeep(&_IKeeperRegistryMaster.TransactOpts, id, triggerData) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactor) CheckUpkeep0(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error) { - return _IKeeperRegistryMaster.contract.Transact(opts, "checkUpkeep0", id) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterSession) CheckUpkeep0(id *big.Int) (*types.Transaction, error) { - return _IKeeperRegistryMaster.Contract.CheckUpkeep0(&_IKeeperRegistryMaster.TransactOpts, id) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactorSession) CheckUpkeep0(id *big.Int) (*types.Transaction, error) { - return _IKeeperRegistryMaster.Contract.CheckUpkeep0(&_IKeeperRegistryMaster.TransactOpts, id) -} - func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactor) ExecuteCallback(opts *bind.TransactOpts, id *big.Int, payload []byte) (*types.Transaction, error) { return _IKeeperRegistryMaster.contract.Transact(opts, "executeCallback", id, payload) } @@ -1294,18 +1390,6 @@ func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactorSession) SetUpkeepT return _IKeeperRegistryMaster.Contract.SetUpkeepTriggerConfig(&_IKeeperRegistryMaster.TransactOpts, id, triggerConfig) } -func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactor) SimulatePerformUpkeep(opts *bind.TransactOpts, id *big.Int, performData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.contract.Transact(opts, "simulatePerformUpkeep", id, performData) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterSession) SimulatePerformUpkeep(id *big.Int, performData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.Contract.SimulatePerformUpkeep(&_IKeeperRegistryMaster.TransactOpts, id, performData) -} - -func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactorSession) SimulatePerformUpkeep(id *big.Int, performData []byte) (*types.Transaction, error) { - return _IKeeperRegistryMaster.Contract.SimulatePerformUpkeep(&_IKeeperRegistryMaster.TransactOpts, id, performData) -} - func (_IKeeperRegistryMaster *IKeeperRegistryMasterTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { return _IKeeperRegistryMaster.contract.Transact(opts, "transferOwnership", to) } @@ -5726,6 +5810,30 @@ func (_IKeeperRegistryMaster *IKeeperRegistryMasterFilterer) ParseUpkeepUnpaused return event, nil } +type CheckCallback struct { + UpkeepNeeded bool + PerformData []byte + UpkeepFailureReason uint8 + GasUsed *big.Int +} +type CheckUpkeep struct { + UpkeepNeeded bool + PerformData []byte + UpkeepFailureReason uint8 + GasUsed *big.Int + GasLimit *big.Int + FastGasWei *big.Int + LinkNative *big.Int +} +type CheckUpkeep0 struct { + UpkeepNeeded bool + PerformData []byte + UpkeepFailureReason uint8 + GasUsed *big.Int + GasLimit *big.Int + FastGasWei *big.Int + LinkNative *big.Int +} type GetSignerInfo struct { Active bool Index uint8 @@ -5754,6 +5862,10 @@ type LatestConfigDigestAndEpoch struct { ConfigDigest [32]byte Epoch uint32 } +type SimulatePerformUpkeep struct { + Success bool + GasUsed *big.Int +} func (_IKeeperRegistryMaster *IKeeperRegistryMaster) ParseLog(log types.Log) (generated.AbigenLog, error) { switch log.Topics[0] { @@ -5966,6 +6078,18 @@ func (_IKeeperRegistryMaster *IKeeperRegistryMaster) Address() common.Address { } type IKeeperRegistryMasterInterface interface { + CheckCallback(opts *bind.CallOpts, id *big.Int, values [][]byte, extraData []byte) (CheckCallback, + + error) + + CheckUpkeep(opts *bind.CallOpts, id *big.Int, triggerData []byte) (CheckUpkeep, + + error) + + CheckUpkeep0(opts *bind.CallOpts, id *big.Int) (CheckUpkeep0, + + error) + FallbackTo(opts *bind.CallOpts) (common.Address, error) GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) @@ -6036,6 +6160,10 @@ type IKeeperRegistryMasterInterface interface { Owner(opts *bind.CallOpts) (common.Address, error) + SimulatePerformUpkeep(opts *bind.CallOpts, id *big.Int, performData []byte) (SimulatePerformUpkeep, + + error) + TypeAndVersion(opts *bind.CallOpts) (string, error) UpkeepTranscoderVersion(opts *bind.CallOpts) (uint8, error) @@ -6052,12 +6180,6 @@ type IKeeperRegistryMasterInterface interface { CancelUpkeep(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error) - CheckCallback(opts *bind.TransactOpts, id *big.Int, values [][]byte, extraData []byte) (*types.Transaction, error) - - CheckUpkeep(opts *bind.TransactOpts, id *big.Int, triggerData []byte) (*types.Transaction, error) - - CheckUpkeep0(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error) - ExecuteCallback(opts *bind.TransactOpts, id *big.Int, payload []byte) (*types.Transaction, error) MigrateUpkeeps(opts *bind.TransactOpts, ids []*big.Int, destination common.Address) (*types.Transaction, error) @@ -6096,8 +6218,6 @@ type IKeeperRegistryMasterInterface interface { SetUpkeepTriggerConfig(opts *bind.TransactOpts, id *big.Int, triggerConfig []byte) (*types.Transaction, error) - SimulatePerformUpkeep(opts *bind.TransactOpts, id *big.Int, performData []byte) (*types.Transaction, error) - TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) TransferPayeeship(opts *bind.TransactOpts, transmitter common.Address, proposed common.Address) (*types.Transaction, error) diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 5de3f9b1df2..9a27aba379e 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -22,7 +22,7 @@ functions_billing_registry_events_mock: ../../contracts/solc/v0.8.6/FunctionsBil functions_oracle_events_mock: ../../contracts/solc/v0.8.6/FunctionsOracleEventsMock.abi ../../contracts/solc/v0.8.6/FunctionsOracleEventsMock.bin 3ca70f966f8fe751987f0ccb50bebb6aa5be77e4a9f835d1ae99e0e9bfb7d52c gas_wrapper: ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2.abi ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2.bin 4a5dcdac486d18fcd58e3488c15c1710ae76b977556a3f3191bd269a4bc75723 gas_wrapper_mock: ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.abi ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.bin a9b08f18da59125c6fc305855710241f3d35161b8b9f3e3f635a7b1d5c6da9c8 -i_keeper_registry_master_wrapper_2_1: ../../contracts/solc/v0.8.16/IKeeperRegistryMaster.abi ../../contracts/solc/v0.8.16/IKeeperRegistryMaster.bin 4426a320baaef8a66692699ec008e371eb7f841b1f9f02ff817c0eee0c63c7b5 +i_keeper_registry_master_wrapper_2_1: ../../contracts/solc/v0.8.16/IKeeperRegistryMaster.abi ../../contracts/solc/v0.8.16/IKeeperRegistryMaster.bin 6501bb9bcf5048bab2737b00685c6984a24867e234ddf5b60a65904eee9a4ebc i_log_automation: ../../contracts/solc/v0.8.16/ILogAutomation.abi ../../contracts/solc/v0.8.16/ILogAutomation.bin 296beccb6af655d6fc3a6e676b244831cce2da6688d3afc4f21f8738ae59e03e keeper_registrar_wrapper1_2: ../../contracts/solc/v0.8.6/KeeperRegistrar.abi ../../contracts/solc/v0.8.6/KeeperRegistrar.bin e49b2f8b23da17af1ed2209b8ae0968cc04350554d636711e6c24a3ad3118692 keeper_registrar_wrapper1_2_mock: ../../contracts/solc/v0.8.6/KeeperRegistrar1_2Mock.abi ../../contracts/solc/v0.8.6/KeeperRegistrar1_2Mock.bin 5b155a7cb3def309fd7525de1d7cd364ebf8491bdc3060eac08ea0ff55ab29bc diff --git a/core/scripts/chaincli/README.md b/core/scripts/chaincli/README.md index c4c48c899da..692287ee024 100644 --- a/core/scripts/chaincli/README.md +++ b/core/scripts/chaincli/README.md @@ -2,7 +2,7 @@ Before starting, you will need: 1. A working [Go](https://go.dev/doc/install) installation -2. EVM chain endpoint URLs +2. EVM chain endpoint URLs - The endpoint can be a local node, or an externally hosted node, e.g. [alchemy](alchemy.com) or [infura](infura.io) - Both the HTTPS and WSS URLs of your endpoint are needed 3. The chain ID corresponding to your chain, you can find the chain ID for your chosen chain [here](https://chainlist.org/) @@ -10,8 +10,9 @@ Before starting, you will need: - Steps for exporting your private key from Metamask can be found [here](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key) 5. The LINK address, LINK-ETH feed address, fast gas feed address for your chain 6. Install [docker](https://docs.docker.com/get-docker/) for CLI and GUI (optional) +7. \[Optional\] get a [tenderly API key](https://docs.tenderly.co/other/platform-access/how-to-generate-api-access-tokens) and find your [username / project name](https://docs.tenderly.co/other/platform-access/how-to-find-the-project-slug-username-and-organization-name). -The example .env in this repo is for the Polygon Mumbai testnet. You can use [this faucet](https://faucets.chain.link/mumbai) to send testnet LINK +The example .env in this repo is for the Polygon Mumbai testnet. You can use [this faucet](https://faucets.chain.link/mumbai) to send testnet LINK to your wallet ahead of executing the next steps >Note: Be careful with your key. When using testnets, it's best to use a separate @@ -121,4 +122,4 @@ You can use the `grep` and `grepv` flags to filter log lines, e.g. to only show ```shell ./chaincli keeper logs --grep keepers-plugin -``` \ No newline at end of file +``` diff --git a/core/scripts/chaincli/command/keeper/debug.go b/core/scripts/chaincli/command/keeper/debug.go new file mode 100644 index 00000000000..455c04efe6d --- /dev/null +++ b/core/scripts/chaincli/command/keeper/debug.go @@ -0,0 +1,20 @@ +package keeper + +import ( + "github.com/spf13/cobra" + + "github.com/smartcontractkit/chainlink/core/scripts/chaincli/config" + "github.com/smartcontractkit/chainlink/core/scripts/chaincli/handler" +) + +// jobCmd represents the command to run the service +var debugCmd = &cobra.Command{ + Use: "debug", + Short: "Debug an upkeep", + Long: `This command debugs an upkeep on the povided registry to figure out why it is not performing`, + Run: func(cmd *cobra.Command, args []string) { + cfg := config.New() + hdlr := handler.NewKeeper(cfg) + hdlr.Debug(cmd.Context(), args) + }, +} diff --git a/core/scripts/chaincli/command/keeper/root.go b/core/scripts/chaincli/command/keeper/root.go index 47cb2fc4300..e00052e3ebb 100644 --- a/core/scripts/chaincli/command/keeper/root.go +++ b/core/scripts/chaincli/command/keeper/root.go @@ -13,6 +13,7 @@ var RootCmd = &cobra.Command{ func init() { RootCmd.AddCommand(deployCmd) + RootCmd.AddCommand(debugCmd) RootCmd.AddCommand(jobCmd) RootCmd.AddCommand(logsCmd) RootCmd.AddCommand(registryCmd) diff --git a/core/scripts/chaincli/config/config.go b/core/scripts/chaincli/config/config.go index 3f4809bf772..d227aa2e298 100644 --- a/core/scripts/chaincli/config/config.go +++ b/core/scripts/chaincli/config/config.go @@ -91,10 +91,16 @@ type Config struct { FeedDecimals uint8 `mapstructure:"FEED_DECIMALS"` // Mercury Config - MercuryURL string `mapstructure:"MERCURY_URL"` - MercuryID string `mapstructure:"MERCURY_ID"` - MercuryKey string `mapstructure:"MERCURY_KEY"` - MercuryCredName string `mapstructure:"MERCURY_CRED_NAME"` + MercuryURL string `mapstructure:"MERCURY_URL"` + MercuryLegacyURL string `mapstructure:"MERCURY_LEGACY_URL"` + MercuryID string `mapstructure:"MERCURY_ID"` + MercuryKey string `mapstructure:"MERCURY_KEY"` + MercuryCredName string `mapstructure:"MERCURY_CRED_NAME"` + + // Tenderly + TenderlyKey string `mapstructure:"TENDERLY_KEY"` + TenderlyAccountName string `mapstructure:"TENDERLY_ACCOUNT_NAME"` + TenderlyProjectName string `mapstructure:"TENDERLY_PROJECT_NAME"` } // New creates a new config diff --git a/core/scripts/chaincli/handler/debug.go b/core/scripts/chaincli/handler/debug.go new file mode 100644 index 00000000000..e4beefbf14b --- /dev/null +++ b/core/scripts/chaincli/handler/debug.go @@ -0,0 +1,462 @@ +package handler + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "log" + "math" + "math/big" + "net/http" + "os" + "strconv" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/chainlink/core/scripts/chaincli/config" + "github.com/smartcontractkit/chainlink/core/scripts/common" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" + iregistry21 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" + evm "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21/core" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21/encoding" + "github.com/smartcontractkit/chainlink/v2/core/utils" + bigmath "github.com/smartcontractkit/chainlink/v2/core/utils/big_math" + ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" +) + +const ( + ConditionTrigger uint8 = iota + LogTrigger + + blockNumber = "blockNumber" + expectedTypeAndVersion = "KeeperRegistry 2.1.0" + feedIdHex = "feedIdHex" + feedIDs = "feedIDs" + timestamp = "timestamp" +) + +var packer = encoding.NewAbiPacker() + +var links []string + +func (k *Keeper) Debug(ctx context.Context, args []string) { + if len(args) < 1 { + failCheckArgs("no upkeepID supplied", nil) + } + // test that we are connected to an archive node + _, err := k.client.BalanceAt(ctx, gethcommon.Address{}, big.NewInt(1)) + if err != nil { + failCheckConfig("you are not connected to an archive node; try using infura or alchemy", err) + } + chainIDBig, err := k.client.ChainID(ctx) + if err != nil { + failUnknown("unable to retrieve chainID from rpc client", err) + } + chainID := chainIDBig.Int64() + // connect to registry contract + latestCallOpts := &bind.CallOpts{Context: ctx} // always use latest block + triggerCallOpts := &bind.CallOpts{Context: ctx} // use latest block for conditionals, but use block from tx for log triggers + registryAddress := gethcommon.HexToAddress(k.cfg.RegistryAddress) + keeperRegistry21, err := iregistry21.NewIKeeperRegistryMaster(registryAddress, k.client) + if err != nil { + failUnknown("failed to connect to registry contract", err) + } + // verify contract is correct + typeAndVersion, err := keeperRegistry21.TypeAndVersion(latestCallOpts) + if err != nil { + failCheckConfig("failed to get typeAndVersion: are you sure you have the correct contract address?", err) + } + if typeAndVersion != expectedTypeAndVersion { + failCheckConfig(fmt.Sprintf("invalid registry contract: this command can only debug %s, got: %s", expectedTypeAndVersion, typeAndVersion), nil) + } + // get upkeepID from command args + upkeepID := big.NewInt(0) + upkeepIDNoPrefix := utils.RemoveHexPrefix(args[0]) + _, wasBase10 := upkeepID.SetString(upkeepIDNoPrefix, 10) + if !wasBase10 { + _, wasBase16 := upkeepID.SetString(upkeepIDNoPrefix, 16) + if !wasBase16 { + failCheckArgs("invalid upkeep ID", nil) + } + } + // get upkeep info + triggerType, err := keeperRegistry21.GetTriggerType(latestCallOpts, upkeepID) + if err != nil { + failUnknown("failed to get trigger type: ", err) + } + upkeepInfo, err := keeperRegistry21.GetUpkeep(latestCallOpts, upkeepID) + if err != nil { + failUnknown("failed to get trigger type: ", err) + } + minBalance, err := keeperRegistry21.GetMinBalance(latestCallOpts, upkeepID) + if err != nil { + failUnknown("failed to get min balance: ", err) + } + // do basic sanity checks + if (upkeepInfo.Target == gethcommon.Address{}) { + failCheckArgs("this upkeep does not exist on this registry", nil) + } + addLink("upkeep", common.UpkeepLink(chainID, upkeepID)) + addLink("target", common.ContractExplorerLink(chainID, upkeepInfo.Target)) + if upkeepInfo.Paused { + resolveIneligible("upkeep is paused") + } + if upkeepInfo.MaxValidBlocknumber != math.MaxUint32 { + resolveIneligible("upkeep is cancelled") + } + message("upkeep is active (not paused or cancelled)") + if upkeepInfo.Balance.Cmp(minBalance) == -1 { + resolveIneligible("minBalance is < upkeep balance") + } + message("upkeep is funded above the min balance") + if bigmath.Div(bigmath.Mul(bigmath.Sub(upkeepInfo.Balance, minBalance), big.NewInt(100)), minBalance).Cmp(big.NewInt(5)) == -1 { + warning("upkeep balance is < 5% larger than minBalance") + } + // local state for pipeline results + var checkResult iregistry21.CheckUpkeep + var blockNum uint64 + var performData []byte + upkeepNeeded := false + // check upkeep + if triggerType == ConditionTrigger { + message("upkeep identified as conditional trigger") + tmpCheckResult, err := keeperRegistry21.CheckUpkeep0(latestCallOpts, upkeepID) + if err != nil { + failUnknown("failed to check upkeep: ", err) + } + checkResult = iregistry21.CheckUpkeep(tmpCheckResult) + // do tenderly simulation + rawCall, err := core.RegistryABI.Pack("checkUpkeep", upkeepID, []byte{}) + if err != nil { + failUnknown("failed to pack raw checkUpkeep call", err) + } + addLink("checkUpkeep simulation", tenderlySimLink(k.cfg, chainID, 0, rawCall, registryAddress)) + } else if triggerType == LogTrigger { + // validate inputs + message("upkeep identified as log trigger") + if len(args) != 3 { + failCheckArgs("txHash and log index must be supplied to command in order to debug log triggered upkeeps", nil) + } + txHash := gethcommon.HexToHash(args[1]) + logIndex, err := strconv.ParseInt(args[2], 10, 64) + if err != nil { + failCheckArgs("unable to parse log index", err) + } + // find transaciton receipt + _, isPending, err := k.client.TransactionByHash(ctx, txHash) + if err != nil { + log.Fatal("failed to fetch tx receipt", err) + } + if isPending { + resolveIneligible(fmt.Sprintf("tx %s is still pending confirmation", txHash)) + } + receipt, err := k.client.TransactionReceipt(ctx, txHash) + if err != nil { + failCheckArgs("failed to fetch tx receipt", err) + } + addLink("trigger", common.ExplorerLink(chainID, txHash)) + blockNum = receipt.BlockNumber.Uint64() + if len(receipt.Logs) <= int(logIndex) { + failCheckArgs(fmt.Sprintf("the provided transaction has %d logs but index %d was requested", len(receipt.Logs), logIndex), err) + } + triggeringEvent := receipt.Logs[logIndex] + message(fmt.Sprintf("log #%d found in transaction", logIndex)) + // check that tx for this upkeep / tx was not already performed + workID := mustUpkeepWorkID(upkeepID, blockNum, receipt.BlockHash, txHash, logIndex) + message(fmt.Sprintf("workID computed: %s", hex.EncodeToString(workID[:]))) + hasKey, err := keeperRegistry21.HasDedupKey(latestCallOpts, workID) + if err != nil { + failUnknown("failed to check if upkeep was already performed: ", err) + } + if hasKey { + resolveIneligible("upkeep was already performed") + } + triggerCallOpts = &bind.CallOpts{Context: ctx, BlockNumber: big.NewInt(receipt.BlockNumber.Int64())} + rawTriggerConfig, err := keeperRegistry21.GetUpkeepTriggerConfig(triggerCallOpts, upkeepID) + if err != nil { + failUnknown("failed to fetch trigger config for upkeep", err) + } + triggerConfig, err := packer.UnpackLogTriggerConfig(rawTriggerConfig) + if err != nil { + failUnknown("failed to unpack trigger config", err) + } + if triggerConfig.FilterSelector > 7 { + resolveIneligible(fmt.Sprintf("invalid filter selector %d", triggerConfig.FilterSelector)) + } + if !logMatchesTriggerConfig(triggeringEvent, triggerConfig) { + resolveIneligible("log does not match trigger config") + } + header, err := k.client.HeaderByHash(ctx, receipt.BlockHash) + if err != nil { + failUnknown("failed to find block", err) + } + triggerData, err := packTriggerData(triggeringEvent, header.Time) + if err != nil { + failUnknown("failed to pack trigger data", err) + } + checkResult, err = keeperRegistry21.CheckUpkeep(triggerCallOpts, upkeepID, triggerData) + if err != nil { + failUnknown("failed to check upkeep", err) + } + // do tenderly simulation + rawCall, err := core.RegistryABI.Pack("checkUpkeep", upkeepID, triggerData) + if err != nil { + failUnknown("failed to pack raw checkUpkeep call", err) + } + addLink("checkUpkeep simulation", tenderlySimLink(k.cfg, chainID, blockNum, rawCall, registryAddress)) + } else { + resolveIneligible(fmt.Sprintf("invalid trigger type: %d", triggerType)) + } + upkeepNeeded, performData = checkResult.UpkeepNeeded, checkResult.PerformData + // handle streams lookup + if checkResult.UpkeepFailureReason != 0 { + message(fmt.Sprintf("checkUpkeep failed with UpkeepFailureReason %d", checkResult.UpkeepFailureReason)) + } + if checkResult.UpkeepFailureReason == uint8(encoding.UpkeepFailureReasonTargetCheckReverted) { + streamsLookupErr, err := packer.DecodeStreamsLookupRequest(checkResult.PerformData) + if err == nil { + message("upkeep reverted with StreamsLookup") + if streamsLookupErr.FeedParamKey == feedIdHex && streamsLookupErr.TimeParamKey == blockNumber { + message("using mercury lookup v0.2") + // handle v0.2 + cfg, err := keeperRegistry21.GetUpkeepPrivilegeConfig(triggerCallOpts, upkeepID) + if err != nil { + failUnknown("failed to get upkeep privilege config ", err) + } + allowed := false + if len(cfg) > 0 { + var privilegeConfig evm.UpkeepPrivilegeConfig + if err := json.Unmarshal(cfg, &privilegeConfig); err != nil { + failUnknown("failed to unmarshal privilege config ", err) + } + allowed = privilegeConfig.MercuryEnabled + } + if !allowed { + resolveIneligible("upkeep reverted with StreamsLookup but is not allowed to access streams") + } + } else if streamsLookupErr.FeedParamKey != feedIDs || streamsLookupErr.TimeParamKey != timestamp { + // handle v0.3 + resolveIneligible("upkeep reverted with StreamsLookup but the configuration is invalid") + } else { + message("using mercury lookup v0.3") + } + streamsLookup := &StreamsLookup{streamsLookupErr.FeedParamKey, streamsLookupErr.Feeds, streamsLookupErr.TimeParamKey, streamsLookupErr.Time, streamsLookupErr.ExtraData, upkeepID, blockNum} + handler := NewMercuryLookupHandler(&MercuryCredentials{k.cfg.MercuryLegacyURL, k.cfg.MercuryURL, k.cfg.MercuryID, k.cfg.MercuryKey}, k.rpcClient) + state, failureReason, values, _, err := handler.doMercuryRequest(ctx, streamsLookup) + if failureReason == UpkeepFailureReasonInvalidRevertDataInput { + resolveIneligible("upkeep used invalid revert data") + } + if state == InvalidMercuryRequest { + resolveIneligible("the mercury request data is invalid") + } + if err != nil { + failCheckConfig("failed to do mercury request ", err) + } + callbackResult, err := keeperRegistry21.CheckCallback(triggerCallOpts, upkeepID, values, streamsLookup.extraData) + if err != nil { + failUnknown("failed to execute mercury callback ", err) + } + upkeepNeeded, performData = callbackResult.UpkeepNeeded, callbackResult.PerformData + // do tenderly simulation + rawCall, err := core.RegistryABI.Pack("checkCallback", upkeepID, values, streamsLookup.extraData) + if err != nil { + failUnknown("failed to pack raw checkUpkeep call", err) + } + addLink("checkCallback simulation", tenderlySimLink(k.cfg, chainID, blockNum, rawCall, registryAddress)) + } + } + if !upkeepNeeded { + resolveIneligible("upkeep is not needed") + } + // simulate perform ukeep + simulateResult, err := keeperRegistry21.SimulatePerformUpkeep(latestCallOpts, upkeepID, performData) + if err != nil { + failUnknown("failed to simulate perform upkeep: ", err) + } + if simulateResult.Success { + resolveEligible() + } +} + +func logMatchesTriggerConfig(log *types.Log, config automation_utils_2_1.LogTriggerConfig) bool { + if log.Topics[0] != config.Topic0 { + return false + } + if config.FilterSelector&1 > 0 && (len(log.Topics) < 1 || log.Topics[1] != config.Topic1) { + return false + } + if config.FilterSelector&2 > 0 && (len(log.Topics) < 2 || log.Topics[2] != config.Topic2) { + return false + } + if config.FilterSelector&4 > 0 && (len(log.Topics) < 3 || log.Topics[3] != config.Topic3) { + return false + } + return true +} + +func packTriggerData(log *types.Log, blockTime uint64) ([]byte, error) { + var topics [][32]byte + for _, topic := range log.Topics { + topics = append(topics, topic) + } + b, err := core.UtilsABI.Methods["_log"].Inputs.Pack(&automation_utils_2_1.Log{ + Index: big.NewInt(int64(log.Index)), + Timestamp: big.NewInt(int64(blockTime)), + TxHash: log.TxHash, + BlockNumber: big.NewInt(int64(log.BlockNumber)), + BlockHash: log.BlockHash, + Source: log.Address, + Topics: topics, + Data: log.Data, + }) + if err != nil { + return nil, err + } + return b, nil +} + +func mustUpkeepWorkID(upkeepID *big.Int, blockNum uint64, blockHash [32]byte, txHash [32]byte, logIndex int64) [32]byte { + // TODO - this is a copy of the code in core.UpkeepWorkID + // We should refactor that code to be more easily exported ex not rely on Trigger structs + trigger := ocr2keepers.Trigger{ + LogTriggerExtension: &ocr2keepers.LogTriggerExtension{ + TxHash: txHash, + Index: uint32(logIndex), + BlockNumber: ocr2keepers.BlockNumber(blockNum), + BlockHash: blockHash, + }, + } + upkeepIdentifier := &ocr2keepers.UpkeepIdentifier{} + upkeepIdentifier.FromBigInt(upkeepID) + workID := core.UpkeepWorkID(*upkeepIdentifier, trigger) + workIDBytes, err := hex.DecodeString(workID) + if err != nil { + failUnknown("failed to decode workID", err) + } + var result [32]byte + copy(result[:], workIDBytes[:]) + return result +} + +func message(msg string) { + log.Printf("☑️ %s", msg) +} + +func warning(msg string) { + log.Printf("⚠️ %s", msg) +} + +func resolveIneligible(msg string) { + exit(fmt.Sprintf("✅ %s: this upkeep is not currently elligible", msg), nil, 0) +} + +func resolveEligible() { + exit("❌ this upkeep is currently elligible", nil, 0) +} + +func rerun(msg string, err error) { + exit(fmt.Sprintf("🔁 %s: rerun this command", msg), err, 1) +} + +func failUnknown(msg string, err error) { + exit(fmt.Sprintf("🤷 %s: this should not happen - this script may be broken or your RPC may be experiencing issues", msg), err, 1) +} + +func failCheckConfig(msg string, err error) { + rerun(fmt.Sprintf("%s: check your config", msg), err) +} + +func failCheckArgs(msg string, err error) { + rerun(fmt.Sprintf("%s: check your command arguments", msg), err) +} + +func addLink(identifier string, link string) { + links = append(links, fmt.Sprintf("🔗 %s: %s", identifier, link)) +} + +func printLinks() { + for i := 0; i < len(links); i++ { + log.Println(links[i]) + } +} + +func exit(msg string, err error, code int) { + if err != nil { + log.Printf("⚠️ %v", err) + } + log.Println(msg) + printLinks() + os.Exit(code) +} + +type TenderlyAPIResponse struct { + Simulation struct { + Id string + } +} + +func tenderlySimLink(cfg *config.Config, chainID int64, blockNumber uint64, input []byte, contractAddress gethcommon.Address) string { + errResult := "" + if cfg.TenderlyAccountName == "" || cfg.TenderlyKey == "" || cfg.TenderlyProjectName == "" { + warning("tenderly credentials not properly configured - this is optional but helpful") + return errResult + } + values := map[string]interface{}{ + "network_id": fmt.Sprintf("%d", chainID), + "from": "0x0000000000000000000000000000000000000000", + "input": hexutil.Encode(input), + "to": contractAddress.Hex(), + "gas": 50_000_000, + "save": true, + } + if blockNumber > 0 { + values["block_number"] = blockNumber + } + jsonData, err := json.Marshal(values) + if err != nil { + warning(fmt.Sprintf("unable to marshal tenderly request data: %v", err)) + return errResult + } + request, err := http.NewRequest( + "POST", + fmt.Sprintf("https://api.tenderly.co/api/v1/account/%s/project/%s/simulate", cfg.TenderlyAccountName, cfg.TenderlyProjectName), + bytes.NewBuffer(jsonData), + ) + if err != nil { + warning(fmt.Sprintf("unable to create tenderly request: %v", err)) + return errResult + } + request.Header.Set("X-Access-Key", cfg.TenderlyKey) + request.Header.Set("Content-Type", "application/json") + client := &http.Client{} + response, err := client.Do(request) + if err != nil { + warning(fmt.Sprintf("could not run tenderly simulation: %v", err)) + return errResult + } + defer response.Body.Close() + body, err := io.ReadAll(response.Body) + if err != nil { + warning(fmt.Sprintf("unable to read response body from tenderly response: %v", err)) + return errResult + } + var responseJSON = &TenderlyAPIResponse{} + err = json.Unmarshal(body, responseJSON) + if err != nil { + warning(fmt.Sprintf("unable to unmarshal tenderly response: %v", err)) + return errResult + } + if responseJSON.Simulation.Id == "" { + warning("unable to simulate tenderly tx") + return errResult + } + return common.TenderlySimLink(responseJSON.Simulation.Id) +} + +// TODO - link to performUpkeep tx if exists diff --git a/core/scripts/chaincli/handler/handler.go b/core/scripts/chaincli/handler/handler.go index b33748c00fa..c51792f9adc 100644 --- a/core/scripts/chaincli/handler/handler.go +++ b/core/scripts/chaincli/handler/handler.go @@ -106,24 +106,30 @@ func NewBaseHandler(cfg *config.Config) *baseHandler { nodeClient := ethclient.NewClient(rpcClient) // Parse private key - d := new(big.Int).SetBytes(common.FromHex(cfg.PrivateKey)) - pkX, pkY := crypto.S256().ScalarBaseMult(d.Bytes()) - privateKey := &ecdsa.PrivateKey{ - PublicKey: ecdsa.PublicKey{ - Curve: crypto.S256(), - X: pkX, - Y: pkY, - }, - D: d, - } + var fromAddr common.Address + var privateKey *ecdsa.PrivateKey + if cfg.PrivateKey != "" { + d := new(big.Int).SetBytes(common.FromHex(cfg.PrivateKey)) + pkX, pkY := crypto.S256().ScalarBaseMult(d.Bytes()) + privateKey = &ecdsa.PrivateKey{ + PublicKey: ecdsa.PublicKey{ + Curve: crypto.S256(), + X: pkX, + Y: pkY, + }, + D: d, + } - // Init from address - publicKey := privateKey.Public() - publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) - if !ok { - log.Fatal("error casting public key to ECDSA") + // Init from address + publicKey := privateKey.Public() + publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) + if !ok { + log.Fatal("error casting public key to ECDSA") + } + fromAddr = crypto.PubkeyToAddress(*publicKeyECDSA) + } else { + log.Println("WARNING: no PRIVATE_KEY set: cannot use commands that deploy contracts or send transactions") } - fromAddr := crypto.PubkeyToAddress(*publicKeyECDSA) // Create link token wrapper linkToken, err := link.NewLinkToken(common.HexToAddress(cfg.LinkTokenAddr), nodeClient) diff --git a/core/scripts/chaincli/handler/mercury_lookup_handler.go b/core/scripts/chaincli/handler/mercury_lookup_handler.go new file mode 100644 index 00000000000..0db142df9f9 --- /dev/null +++ b/core/scripts/chaincli/handler/mercury_lookup_handler.go @@ -0,0 +1,536 @@ +package handler + +import ( + "context" + "crypto/hmac" + "encoding/hex" + "fmt" + "io" + "math/big" + "net/http" + "net/url" + "strconv" + "strings" + "time" + + "crypto/sha256" + + "encoding/json" + + "github.com/avast/retry-go" + ethabi "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + "github.com/pkg/errors" +) + +// MercuryLookupHandler is responsible for initiating the calls to the Mercury server +// to determine whether the upkeeps are eligible +type MercuryLookupHandler struct { + credentials *MercuryCredentials + httpClient HttpClient + rpcClient *rpc.Client +} + +func NewMercuryLookupHandler( + credentials *MercuryCredentials, + rpcClient *rpc.Client, +) *MercuryLookupHandler { + return &MercuryLookupHandler{ + credentials: credentials, + httpClient: http.DefaultClient, + rpcClient: rpcClient, + } +} + +type MercuryVersion string + +type StreamsLookup struct { + feedParamKey string + feeds []string + timeParamKey string + time *big.Int + extraData []byte + upkeepId *big.Int + block uint64 +} + +//go:generate mockery --quiet --name HttpClient --output ./mocks/ --case=underscore +type HttpClient interface { + Do(req *http.Request) (*http.Response, error) +} + +type MercuryCredentials struct { + LegacyURL string + URL string + ClientID string + ClientKey string +} + +func (mc *MercuryCredentials) Validate() bool { + return mc.URL != "" && mc.ClientID != "" && mc.ClientKey != "" +} + +type MercuryData struct { + Index int + Error error + Retryable bool + Bytes [][]byte + State PipelineExecutionState +} + +// MercuryV02Response represents a JSON structure used by Mercury v0.2 +type MercuryV02Response struct { + ChainlinkBlob string `json:"chainlinkBlob"` +} + +// MercuryV03Response represents a JSON structure used by Mercury v0.3 +type MercuryV03Response struct { + Reports []MercuryV03Report `json:"reports"` +} + +type MercuryV03Report struct { + FeedID string `json:"feedID"` // feed id in hex encoded + ValidFromTimestamp uint32 `json:"validFromTimestamp"` + ObservationsTimestamp uint32 `json:"observationsTimestamp"` + FullReport string `json:"fullReport"` // the actual hex encoded mercury report of this feed, can be sent to verifier +} + +const ( + // DefaultAllowListExpiration decides how long an upkeep's allow list info will be valid for. + DefaultAllowListExpiration = 20 * time.Minute + // CleanupInterval decides when the expired items in cache will be deleted. + CleanupInterval = 25 * time.Minute +) + +const ( + ApplicationJson = "application/json" + BlockNumber = "blockNumber" // valid for v0.2 + FeedIDs = "feedIDs" // valid for v0.3 + FeedIdHex = "feedIdHex" // valid for v0.2 + HeaderAuthorization = "Authorization" + HeaderContentType = "Content-Type" + HeaderTimestamp = "X-Authorization-Timestamp" + HeaderSignature = "X-Authorization-Signature-SHA256" + HeaderUpkeepId = "X-Authorization-Upkeep-Id" + MercuryPathV2 = "/client?" // only used to access mercury v0.2 server + MercuryBatchPathV3 = "/api/v1/reports/bulk?" // only used to access mercury v0.3 server + RetryDelay = 500 * time.Millisecond + Timestamp = "timestamp" // valid for v0.3 + TotalAttempt = 3 + UserId = "userId" +) + +type UpkeepFailureReason uint8 +type PipelineExecutionState uint8 + +const ( + // upkeep failure onchain reasons + UpkeepFailureReasonNone UpkeepFailureReason = 0 + UpkeepFailureReasonUpkeepCancelled UpkeepFailureReason = 1 + UpkeepFailureReasonUpkeepPaused UpkeepFailureReason = 2 + UpkeepFailureReasonTargetCheckReverted UpkeepFailureReason = 3 + UpkeepFailureReasonUpkeepNotNeeded UpkeepFailureReason = 4 + UpkeepFailureReasonPerformDataExceedsLimit UpkeepFailureReason = 5 + UpkeepFailureReasonInsufficientBalance UpkeepFailureReason = 6 + UpkeepFailureReasonMercuryCallbackReverted UpkeepFailureReason = 7 + UpkeepFailureReasonRevertDataExceedsLimit UpkeepFailureReason = 8 + UpkeepFailureReasonRegistryPaused UpkeepFailureReason = 9 + // leaving a gap here for more onchain failure reasons in the future + // upkeep failure offchain reasons + UpkeepFailureReasonMercuryAccessNotAllowed UpkeepFailureReason = 32 + UpkeepFailureReasonTxHashNoLongerExists UpkeepFailureReason = 33 + UpkeepFailureReasonInvalidRevertDataInput UpkeepFailureReason = 34 + UpkeepFailureReasonSimulationFailed UpkeepFailureReason = 35 + UpkeepFailureReasonTxHashReorged UpkeepFailureReason = 36 + + // pipeline execution error + NoPipelineError PipelineExecutionState = 0 + CheckBlockTooOld PipelineExecutionState = 1 + CheckBlockInvalid PipelineExecutionState = 2 + RpcFlakyFailure PipelineExecutionState = 3 + MercuryFlakyFailure PipelineExecutionState = 4 + PackUnpackDecodeFailed PipelineExecutionState = 5 + MercuryUnmarshalError PipelineExecutionState = 6 + InvalidMercuryRequest PipelineExecutionState = 7 + InvalidMercuryResponse PipelineExecutionState = 8 // this will only happen if Mercury server sends bad responses + UpkeepNotAuthorized PipelineExecutionState = 9 +) + +// UpkeepPrivilegeConfig represents the administrative offchain config for each upkeep. It can be set by s_upkeepPrivilegeManager +// role on the registry. Upkeeps allowed to use Mercury server will have this set to true. +type UpkeepPrivilegeConfig struct { + MercuryEnabled bool `json:"mercuryEnabled"` +} + +// generateHMAC calculates a user HMAC for Mercury server authentication. +func (mlh *MercuryLookupHandler) generateHMAC(method string, path string, body []byte, clientId string, secret string, ts int64) string { + bodyHash := sha256.New() + bodyHash.Write(body) + hashString := fmt.Sprintf("%s %s %s %s %d", + method, + path, + hex.EncodeToString(bodyHash.Sum(nil)), + clientId, + ts) + signedMessage := hmac.New(sha256.New, []byte(secret)) + signedMessage.Write([]byte(hashString)) + userHmac := hex.EncodeToString(signedMessage.Sum(nil)) + return userHmac +} + +// singleFeedRequest sends a v0.2 Mercury request for a single feed report. +func (mlh *MercuryLookupHandler) singleFeedRequest(ctx context.Context, ch chan<- MercuryData, index int, ml *StreamsLookup) { + q := url.Values{ + ml.feedParamKey: {ml.feeds[index]}, + ml.timeParamKey: {ml.time.String()}, + } + mercuryURL := mlh.credentials.LegacyURL + reqUrl := fmt.Sprintf("%s%s%s", mercuryURL, MercuryPathV2, q.Encode()) + // mlh.logger.Debugf("request URL for upkeep %s feed %s: %s", ml.upkeepId.String(), ml.feeds[index], reqUrl) + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqUrl, nil) + if err != nil { + ch <- MercuryData{Index: index, Error: err, Retryable: false, State: InvalidMercuryRequest} + return + } + + ts := time.Now().UTC().UnixMilli() + signature := mlh.generateHMAC(http.MethodGet, MercuryPathV2+q.Encode(), []byte{}, mlh.credentials.ClientID, mlh.credentials.ClientKey, ts) + req.Header.Set(HeaderContentType, ApplicationJson) + req.Header.Set(HeaderAuthorization, mlh.credentials.ClientID) + req.Header.Set(HeaderTimestamp, strconv.FormatInt(ts, 10)) + req.Header.Set(HeaderSignature, signature) + + // in the case of multiple retries here, use the last attempt's data + state := NoPipelineError + retryable := false + sent := false + retryErr := retry.Do( + func() error { + retryable = false + resp, err1 := mlh.httpClient.Do(req) + if err1 != nil { + // mlh.logger.Errorw("StreamsLookup GET request failed", "upkeepID", ml.upkeepId.String(), "time", ml.time.String(), "feed", ml.feeds[index], "error", err1) + retryable = true + state = MercuryFlakyFailure + return err1 + } + defer func(Body io.ReadCloser) { + err := Body.Close() + if err != nil { + // mlh.logger.Errorf("Encountered error when closing the body of the response in single feed: %s", err) + } + }(resp.Body) + + body, err1 := io.ReadAll(resp.Body) + if err1 != nil { + retryable = false + state = InvalidMercuryResponse + return err1 + } + + if resp.StatusCode == http.StatusNotFound || resp.StatusCode == http.StatusInternalServerError { + // mlh.logger.Errorw("StreamsLookup received retryable status code", "upkeepID", ml.upkeepId.String(), "time", ml.time.String(), "statusCode", resp.StatusCode, "feed", ml.feeds[index]) + retryable = true + state = MercuryFlakyFailure + return errors.New(strconv.FormatInt(int64(resp.StatusCode), 10)) + } else if resp.StatusCode != http.StatusOK { + retryable = false + state = InvalidMercuryRequest + return fmt.Errorf("StreamsLookup upkeep %s block %s received status code %d for feed %s", ml.upkeepId.String(), ml.time.String(), resp.StatusCode, ml.feeds[index]) + } + + // mlh.logger.Debugf("at block %s upkeep %s received status code %d from mercury v0.2 with BODY=%s", ml.time.String(), ml.upkeepId.String(), resp.StatusCode, hexutil.Encode(body)) + + var m MercuryV02Response + err1 = json.Unmarshal(body, &m) + if err1 != nil { + // mlh.logger.Errorw("StreamsLookup failed to unmarshal body to MercuryResponse", "upkeepID", ml.upkeepId.String(), "time", ml.time.String(), "feed", ml.feeds[index], "error", err1) + retryable = false + state = MercuryUnmarshalError + return err1 + } + blobBytes, err1 := hexutil.Decode(m.ChainlinkBlob) + if err1 != nil { + // mlh.logger.Errorw("StreamsLookup failed to decode chainlinkBlob for feed", "upkeepID", ml.upkeepId.String(), "time", ml.time.String(), "blob", m.ChainlinkBlob, "feed", ml.feeds[index], "error", err1) + retryable = false + state = InvalidMercuryResponse + return err1 + } + ch <- MercuryData{ + Index: index, + Bytes: [][]byte{blobBytes}, + Retryable: false, + State: NoPipelineError, + } + sent = true + return nil + }, + // only retry when the error is 404 Not Found or 500 Internal Server Error + retry.RetryIf(func(err error) bool { + return err.Error() == fmt.Sprintf("%d", http.StatusNotFound) || err.Error() == fmt.Sprintf("%d", http.StatusInternalServerError) + }), + retry.Context(ctx), + retry.Delay(RetryDelay), + retry.Attempts(TotalAttempt)) + + if !sent { + md := MercuryData{ + Index: index, + Bytes: [][]byte{}, + Retryable: retryable, + Error: fmt.Errorf("failed to request feed for %s: %w", ml.feeds[index], retryErr), + State: state, + } + ch <- md + } +} + +// multiFeedsRequest sends a Mercury v0.3 request for a multi-feed report +func (mlh *MercuryLookupHandler) multiFeedsRequest(ctx context.Context, ch chan<- MercuryData, ml *StreamsLookup) { + params := fmt.Sprintf("%s=%s&%s=%s", FeedIDs, strings.Join(ml.feeds, ","), Timestamp, ml.time.String()) + reqUrl := fmt.Sprintf("%s%s%s", mlh.credentials.URL, MercuryBatchPathV3, params) + // mlh.logger.Debugf("request URL for upkeep %s userId %s: %s", ml.upkeepId.String(), mlh.credentials.ClientID, reqUrl) + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqUrl, nil) + if err != nil { + ch <- MercuryData{Index: 0, Error: err, Retryable: false, State: InvalidMercuryRequest} + return + } + + ts := time.Now().UTC().UnixMilli() + signature := mlh.generateHMAC(http.MethodGet, MercuryBatchPathV3+params, []byte{}, mlh.credentials.ClientID, mlh.credentials.ClientKey, ts) + req.Header.Set(HeaderContentType, ApplicationJson) + // username here is often referred to as user id + req.Header.Set(HeaderAuthorization, mlh.credentials.ClientID) + req.Header.Set(HeaderTimestamp, strconv.FormatInt(ts, 10)) + req.Header.Set(HeaderSignature, signature) + // mercury will inspect authorization headers above to make sure this user (in automation's context, this node) is eligible to access mercury + // and if it has an automation role. it will then look at this upkeep id to check if it has access to all the requested feeds. + req.Header.Set(HeaderUpkeepId, ml.upkeepId.String()) + + // in the case of multiple retries here, use the last attempt's data + state := NoPipelineError + retryable := false + sent := false + retryErr := retry.Do( + func() error { + retryable = false + resp, err1 := mlh.httpClient.Do(req) + if err1 != nil { + // mlh.logger.Errorw("StreamsLookup GET request fails for multi feed", "upkeepID", ml.upkeepId.String(), "time", ml.time.String(), "error", err1) + retryable = true + state = MercuryFlakyFailure + return err1 + } + defer func(Body io.ReadCloser) { + err := Body.Close() + if err != nil { + // mlh.logger.Errorf("Encountered error when closing the body of the response in the multi feed: %s", err) + } + }(resp.Body) + body, err1 := io.ReadAll(resp.Body) + if err1 != nil { + retryable = false + state = InvalidMercuryResponse + return err1 + } + + // mlh.logger.Infof("at timestamp %s upkeep %s received status code %d from mercury v0.3", ml.time.String(), ml.upkeepId.String(), resp.StatusCode) + if resp.StatusCode == http.StatusUnauthorized { + retryable = false + state = UpkeepNotAuthorized + return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by unauthorized upkeep", ml.time.String(), ml.upkeepId.String(), resp.StatusCode) + } else if resp.StatusCode == http.StatusBadRequest { + retryable = false + state = InvalidMercuryRequest + return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by invalid format of timestamp", ml.time.String(), ml.upkeepId.String(), resp.StatusCode) + } else if resp.StatusCode == http.StatusInternalServerError { + retryable = true + state = MercuryFlakyFailure + return fmt.Errorf("%d", http.StatusInternalServerError) + } else if resp.StatusCode == 420 { + // in 0.3, this will happen when missing/malformed query args, missing or bad required headers, non-existent feeds, or no permissions for feeds + retryable = false + state = InvalidMercuryRequest + return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by missing/malformed query args, missing or bad required headers, non-existent feeds, or no permissions for feeds", ml.time.String(), ml.upkeepId.String(), resp.StatusCode) + } else if resp.StatusCode != http.StatusOK { + retryable = false + state = InvalidMercuryRequest + return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3", ml.time.String(), ml.upkeepId.String(), resp.StatusCode) + } + + var response MercuryV03Response + err1 = json.Unmarshal(body, &response) + if err1 != nil { + // mlh.logger.Errorw("StreamsLookup failed to unmarshal body to MercuryResponse for multi feed", "upkeepID", ml.upkeepId.String(), "time", ml.time.String(), "error", err1) + retryable = false + state = MercuryUnmarshalError + return err1 + } + // in v0.3, if some feeds are not available, the server will only return available feeds, but we need to make sure ALL feeds are retrieved before calling user contract + // hence, retry in this case. retry will help when we send a very new timestamp and reports are not yet generated + if len(response.Reports) != len(ml.feeds) { + // TODO: AUTO-5044: calculate what reports are missing and log a warning + retryable = true + state = MercuryFlakyFailure + return fmt.Errorf("%d", http.StatusNotFound) + } + var reportBytes [][]byte + for _, rsp := range response.Reports { + b, err := hexutil.Decode(rsp.FullReport) + if err != nil { + retryable = false + state = InvalidMercuryResponse + return err + } + reportBytes = append(reportBytes, b) + } + ch <- MercuryData{ + Index: 0, + Bytes: reportBytes, + Retryable: false, + State: NoPipelineError, + } + sent = true + return nil + }, + // only retry when the error is 404 Not Found or 500 Internal Server Error + retry.RetryIf(func(err error) bool { + return err.Error() == fmt.Sprintf("%d", http.StatusNotFound) || err.Error() == fmt.Sprintf("%d", http.StatusInternalServerError) + }), + retry.Context(ctx), + retry.Delay(RetryDelay), + retry.Attempts(TotalAttempt)) + + if !sent { + md := MercuryData{ + Index: 0, + Bytes: [][]byte{}, + Retryable: retryable, + Error: retryErr, + State: state, + } + ch <- md + } +} + +// doMercuryRequest sends requests to Mercury API to retrieve ChainlinkBlob. +func (mlh *MercuryLookupHandler) doMercuryRequest(ctx context.Context, ml *StreamsLookup) (PipelineExecutionState, UpkeepFailureReason, [][]byte, bool, error) { + var isMercuryV03 bool + resultLen := len(ml.feeds) + ch := make(chan MercuryData, resultLen) + if len(ml.feeds) == 0 { + return NoPipelineError, UpkeepFailureReasonInvalidRevertDataInput, nil, false, fmt.Errorf("invalid revert data input: feed param key %s, time param key %s, feeds %s", ml.feedParamKey, ml.timeParamKey, ml.feeds) + } + if ml.feedParamKey == FeedIdHex && ml.timeParamKey == BlockNumber { + // only v0.2 + for i := range ml.feeds { + go mlh.singleFeedRequest(ctx, ch, i, ml) + } + } else if ml.feedParamKey == FeedIDs && ml.timeParamKey == Timestamp { + // only v0.3 + resultLen = 1 + isMercuryV03 = true + ch = make(chan MercuryData, resultLen) + go mlh.multiFeedsRequest(ctx, ch, ml) + } else { + return NoPipelineError, UpkeepFailureReasonInvalidRevertDataInput, nil, false, fmt.Errorf("invalid revert data input: feed param key %s, time param key %s, feeds %s", ml.feedParamKey, ml.timeParamKey, ml.feeds) + } + + var reqErr error + results := make([][]byte, len(ml.feeds)) + retryable := true + allSuccess := true + // in v0.2, use the last execution error as the state, if no execution errors, state will be no error + state := NoPipelineError + for i := 0; i < resultLen; i++ { + m := <-ch + if m.Error != nil { + if reqErr == nil { + reqErr = errors.New(m.Error.Error()) + } else { + reqErr = errors.New(reqErr.Error() + m.Error.Error()) + } + retryable = retryable && m.Retryable + allSuccess = false + if m.State != NoPipelineError { + state = m.State + } + continue + } + if isMercuryV03 { + results = m.Bytes + } else { + results[m.Index] = m.Bytes[0] + } + } + // only retry when not all successful AND none are not retryable + return state, UpkeepFailureReasonNone, results, retryable && !allSuccess, reqErr +} + +// decodeStreamsLookup decodes the revert error StreamsLookup(string feedParamKey, string[] feeds, string timeParamKey, uint256 time, byte[] extraData) +// func (mlh *MercuryLookupHandler) decodeStreamsLookup(data []byte) (*StreamsLookup, error) { +// e := mlh.mercuryConfig.Abi.Errors["StreamsLookup"] +// unpack, err := e.Unpack(data) +// if err != nil { +// return nil, fmt.Errorf("unpack error: %w", err) +// } +// errorParameters := unpack.([]interface{}) + +// return &StreamsLookup{ +// feedParamKey: *abi.ConvertType(errorParameters[0], new(string)).(*string), +// feeds: *abi.ConvertType(errorParameters[1], new([]string)).(*[]string), +// timeParamKey: *abi.ConvertType(errorParameters[2], new(string)).(*string), +// time: *abi.ConvertType(errorParameters[3], new(*big.Int)).(**big.Int), +// extraData: *abi.ConvertType(errorParameters[4], new([]byte)).(*[]byte), +// }, nil +// } + +// allowedToUseMercury retrieves upkeep's administrative offchain config and decode a mercuryEnabled bool to indicate if +// this upkeep is allowed to use Mercury service. +// func (mlh *MercuryLookupHandler) allowedToUseMercury(upkeep models.Upkeep) (bool, error) { +// allowed, ok := mlh.mercuryConfig.AllowListCache.Get(upkeep.Admin.Hex()) +// if ok { +// return allowed.(bool), nil +// } + +// if upkeep.UpkeepPrivilegeConfig == nil { +// return false, fmt.Errorf("the upkeep privilege config was not retrieved for upkeep with ID %s", upkeep.UpkeepID) +// } + +// if len(upkeep.UpkeepPrivilegeConfig) == 0 { +// return false, fmt.Errorf("the upkeep privilege config is empty") +// } + +// var a UpkeepPrivilegeConfig +// err := json.Unmarshal(upkeep.UpkeepPrivilegeConfig, &a) +// if err != nil { +// return false, fmt.Errorf("failed to unmarshal privilege config for upkeep ID %s: %v", upkeep.UpkeepID, err) +// } + +// mlh.mercuryConfig.AllowListCache.Set(upkeep.Admin.Hex(), a.MercuryEnabled, cache.DefaultExpiration) +// return a.MercuryEnabled, nil +// } + +func (mlh *MercuryLookupHandler) CheckCallback(ctx context.Context, values [][]byte, lookup *StreamsLookup, registryABI ethabi.ABI, registryAddress common.Address) (hexutil.Bytes, error) { + payload, err := registryABI.Pack("checkCallback", lookup.upkeepId, values, lookup.extraData) + if err != nil { + return nil, err + } + + var theBytes hexutil.Bytes + args := map[string]interface{}{ + "to": registryAddress.Hex(), + "data": hexutil.Bytes(payload), + } + + // call checkCallback function at the block which OCR3 has agreed upon + err = mlh.rpcClient.CallContext(ctx, &theBytes, "eth_call", args, hexutil.EncodeUint64(lookup.block)) + if err != nil { + return nil, err + } + return theBytes, nil +} diff --git a/core/scripts/common/helpers.go b/core/scripts/common/helpers.go index ed8155d1779..d03dcec097f 100644 --- a/core/scripts/common/helpers.go +++ b/core/scripts/common/helpers.go @@ -225,6 +225,49 @@ func explorerLinkPrefix(chainID int64) (prefix string) { return } +func automationExplorerNetworkName(chainID int64) (prefix string) { + switch chainID { + case 1: // ETH mainnet + prefix = "mainnet" + case 5: // Goerli + prefix = "goerli" + case 11155111: // Sepolia + prefix = "sepolia" + + case 420: // Optimism Goerli + prefix = "optimism-goerli" + + case ArbitrumGoerliChainID: // Arbitrum Goerli + prefix = "arbitrum-goerli" + case ArbitrumOneChainID: // Arbitrum mainnet + prefix = "arbitrum" + + case 56: // BSC mainnet + prefix = "bsc" + case 97: // BSC testnet + prefix = "bnb-chain-testnet" + + case 137: // Polygon mainnet + prefix = "polygon" + case 80001: // Polygon Mumbai testnet + prefix = "mumbai" + + case 250: // Fantom mainnet + prefix = "fantom" + case 4002: // Fantom testnet + prefix = "fantom-testnet" + + case 43114: // Avalanche mainnet + prefix = "avalanche" + case 43113: // Avalanche testnet + prefix = "fuji" + + default: // Unknown chain, return prefix as-is + prefix = "" + } + return +} + // ExplorerLink creates a block explorer link for the given transaction hash. If the chain ID is // unrecognized, the hash is returned as-is. func ExplorerLink(chainID int64, txHash common.Hash) string { @@ -245,6 +288,10 @@ func ContractExplorerLink(chainID int64, contractAddress common.Address) string return contractAddress.Hex() } +func TenderlySimLink(simID string) string { + return fmt.Sprintf("https://dashboard.tenderly.co/simulator/%s", simID) +} + // ConfirmTXMined confirms that the given transaction is mined and prints useful execution information. func ConfirmTXMined(context context.Context, client *ethclient.Client, transaction *types.Transaction, chainID int64, txInfo ...string) (receipt *types.Receipt) { fmt.Println("Executing TX", ExplorerLink(chainID, transaction.Hash()), txInfo) @@ -535,3 +582,7 @@ func IsAvaxNetwork(chainID int64) bool { chainID == 335 || // DFK testnet chainID == 53935 // DFK mainnet } + +func UpkeepLink(chainID int64, upkeepID *big.Int) string { + return fmt.Sprintf("https://automation.chain.link/%s/%s", automationExplorerNetworkName(chainID), upkeepID.String()) +} diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 00ab2f871d0..00ea273fbfa 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -7,6 +7,7 @@ replace github.com/smartcontractkit/chainlink/v2 => ../../ require ( github.com/ava-labs/coreth v0.12.1 + github.com/avast/retry-go v3.0.0+incompatible github.com/docker/docker v24.0.4+incompatible github.com/docker/go-connections v0.4.0 github.com/ethereum/go-ethereum v1.12.0 @@ -17,6 +18,7 @@ require ( github.com/montanaflynn/stats v0.7.1 github.com/olekukonko/tablewriter v0.0.5 github.com/pelletier/go-toml/v2 v2.1.0 + github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 @@ -278,7 +280,6 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/pressly/goose/v3 v3.15.0 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index f4c6d6acfbb..640e5dd1982 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -142,6 +142,8 @@ github.com/ava-labs/avalanchego v1.10.1 h1:lBeamJ1iNq+p2oKg2nAs+A65m8vhSDjkiTDbw github.com/ava-labs/avalanchego v1.10.1/go.mod h1:ZvSXWlbkUKlbk3BsWx29a+8eVHe/WBsOxh55BSGoeRk= github.com/ava-labs/coreth v0.12.1 h1:EWSkFGHGVUxmu1pnSK/2pdcxaAVHbGspHqO3Ag+i7sA= github.com/ava-labs/coreth v0.12.1/go.mod h1:/5x54QlIKjlPebkdzTA5ic9wXdejbWOnQosztkv9jxo= +github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= +github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/avast/retry-go/v4 v4.5.0 h1:QoRAZZ90cj5oni2Lsgl2GW8mNTnUCnmpx/iKpwVisHg= github.com/avast/retry-go/v4 v4.5.0/go.mod h1:7hLEXp0oku2Nir2xBAsg0PTphp9z71bN5Aq1fboC3+I= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/core/abi.go b/core/services/ocr2/plugins/ocr2keeper/evm21/core/abi.go new file mode 100644 index 00000000000..7913838dcbc --- /dev/null +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/core/abi.go @@ -0,0 +1,12 @@ +package core + +import ( + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" + iregistry21 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/streams_lookup_compatible_interface" +) + +var UtilsABI = types.MustGetABI(automation_utils_2_1.AutomationUtilsABI) +var RegistryABI = types.MustGetABI(iregistry21.IKeeperRegistryMasterABI) +var StreamsCompatibleABI = types.MustGetABI(streams_lookup_compatible_interface.StreamsLookupCompatibleInterfaceABI) diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/encoder_test.go b/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/encoder_test.go index 36435a93bab..578153e07a4 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/encoder_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/encoder_test.go @@ -2,26 +2,18 @@ package encoding import ( "math/big" - "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" "github.com/stretchr/testify/assert" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" - iregistry21 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21/core" ) func TestReportEncoder_EncodeExtract(t *testing.T) { - keepersABI, err := abi.JSON(strings.NewReader(iregistry21.IKeeperRegistryMasterABI)) - assert.Nil(t, err) - utilsABI, err := abi.JSON(strings.NewReader(automation_utils_2_1.AutomationUtilsABI)) - assert.Nil(t, err) encoder := reportEncoder{ - packer: NewAbiPacker(keepersABI, utilsABI), + packer: NewAbiPacker(), } tests := []struct { diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/interface.go b/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/interface.go index 1f36cadb4d7..217f0dcb571 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/interface.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/interface.go @@ -56,4 +56,5 @@ type Packer interface { UnpackReport(raw []byte) (automation_utils_2_1.KeeperRegistryBase21Report, error) PackGetUpkeepPrivilegeConfig(upkeepId *big.Int) ([]byte, error) UnpackGetUpkeepPrivilegeConfig(resp []byte) ([]byte, error) + DecodeStreamsLookupRequest(data []byte) (*StreamsLookupError, error) } diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/packer.go b/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/packer.go index 824a98172bd..9e070b2838c 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/packer.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/packer.go @@ -8,25 +8,24 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21/core" ) -var utilsABI = types.MustGetABI(automation_utils_2_1.AutomationUtilsABI) - // triggerWrapper is a wrapper for the different trigger types (log and condition triggers). // NOTE: we use log trigger because it extends condition trigger, type triggerWrapper = automation_utils_2_1.KeeperRegistryBase21LogTrigger type abiPacker struct { - abi abi.ABI - utilsAbi abi.ABI + registryABI abi.ABI + utilsABI abi.ABI + streamsABI abi.ABI } var _ Packer = (*abiPacker)(nil) -func NewAbiPacker(abi abi.ABI, utilsAbi abi.ABI) *abiPacker { - return &abiPacker{abi: abi, utilsAbi: utilsAbi} +func NewAbiPacker() *abiPacker { + return &abiPacker{registryABI: core.RegistryABI, utilsABI: core.UtilsABI, streamsABI: core.StreamsCompatibleABI} } func (p *abiPacker) UnpackCheckResult(payload ocr2keepers.UpkeepPayload, raw string) (ocr2keepers.CheckResult, error) { @@ -37,7 +36,7 @@ func (p *abiPacker) UnpackCheckResult(payload ocr2keepers.UpkeepPayload, raw str fmt.Errorf("upkeepId %s failed to decode checkUpkeep result %s: %s", payload.UpkeepID.String(), raw, err) } - out, err := p.abi.Methods["checkUpkeep"].Outputs.UnpackValues(b) + out, err := p.registryABI.Methods["checkUpkeep"].Outputs.UnpackValues(b) if err != nil { // unpack failed, not retryable return GetIneligibleCheckResultWithoutPerformData(payload, UpkeepFailureReasonNone, PackUnpackDecodeFailed, false), @@ -67,11 +66,11 @@ func (p *abiPacker) UnpackCheckResult(payload ocr2keepers.UpkeepPayload, raw str } func (p *abiPacker) PackGetUpkeepPrivilegeConfig(upkeepId *big.Int) ([]byte, error) { - return p.abi.Pack("getUpkeepPrivilegeConfig", upkeepId) + return p.registryABI.Pack("getUpkeepPrivilegeConfig", upkeepId) } func (p *abiPacker) UnpackGetUpkeepPrivilegeConfig(resp []byte) ([]byte, error) { - out, err := p.abi.Methods["getUpkeepPrivilegeConfig"].Outputs.UnpackValues(resp) + out, err := p.registryABI.Methods["getUpkeepPrivilegeConfig"].Outputs.UnpackValues(resp) if err != nil { return nil, fmt.Errorf("%w: unpack getUpkeepPrivilegeConfig return", err) } @@ -82,7 +81,7 @@ func (p *abiPacker) UnpackGetUpkeepPrivilegeConfig(resp []byte) ([]byte, error) } func (p *abiPacker) UnpackCheckCallbackResult(callbackResp []byte) (PipelineExecutionState, bool, []byte, uint8, *big.Int, error) { - out, err := p.abi.Methods["checkCallback"].Outputs.UnpackValues(callbackResp) + out, err := p.registryABI.Methods["checkCallback"].Outputs.UnpackValues(callbackResp) if err != nil { return PackUnpackDecodeFailed, false, nil, 0, nil, fmt.Errorf("%w: unpack checkUpkeep return: %s", err, hexutil.Encode(callbackResp)) } @@ -101,7 +100,7 @@ func (p *abiPacker) UnpackPerformResult(raw string) (PipelineExecutionState, boo return PackUnpackDecodeFailed, false, err } - out, err := p.abi.Methods["simulatePerformUpkeep"].Outputs.UnpackValues(b) + out, err := p.registryABI.Methods["simulatePerformUpkeep"].Outputs.UnpackValues(b) if err != nil { return PackUnpackDecodeFailed, false, err } @@ -113,7 +112,7 @@ func (p *abiPacker) UnpackPerformResult(raw string) (PipelineExecutionState, boo func (p *abiPacker) UnpackLogTriggerConfig(raw []byte) (automation_utils_2_1.LogTriggerConfig, error) { var cfg automation_utils_2_1.LogTriggerConfig - out, err := utilsABI.Methods["_logTriggerConfig"].Inputs.UnpackValues(raw) + out, err := core.UtilsABI.Methods["_logTriggerConfig"].Inputs.UnpackValues(raw) if err != nil { return cfg, fmt.Errorf("%w: unpack _logTriggerConfig return: %s", err, raw) } @@ -127,7 +126,7 @@ func (p *abiPacker) UnpackLogTriggerConfig(raw []byte) (automation_utils_2_1.Log // PackReport packs the report with abi definitions from the contract. func (p *abiPacker) PackReport(report automation_utils_2_1.KeeperRegistryBase21Report) ([]byte, error) { - bts, err := p.utilsAbi.Methods["_report"].Inputs.Pack(&report) + bts, err := p.utilsABI.Methods["_report"].Inputs.Pack(&report) if err != nil { return nil, fmt.Errorf("%w: failed to pack report", err) } @@ -136,7 +135,7 @@ func (p *abiPacker) PackReport(report automation_utils_2_1.KeeperRegistryBase21R // UnpackReport unpacks the report from the given raw data. func (p *abiPacker) UnpackReport(raw []byte) (automation_utils_2_1.KeeperRegistryBase21Report, error) { - unpacked, err := p.utilsAbi.Methods["_report"].Inputs.Unpack(raw) + unpacked, err := p.utilsABI.Methods["_report"].Inputs.Unpack(raw) if err != nil { return automation_utils_2_1.KeeperRegistryBase21Report{}, fmt.Errorf("%w: failed to unpack report", err) } @@ -162,6 +161,32 @@ func (p *abiPacker) UnpackReport(raw []byte) (automation_utils_2_1.KeeperRegistr return report, nil } +type StreamsLookupError struct { + FeedParamKey string + Feeds []string + TimeParamKey string + Time *big.Int + ExtraData []byte +} + +// DecodeStreamsLookupRequest decodes the revert error StreamsLookup(string feedParamKey, string[] feeds, string feedParamKey, uint256 time, byte[] extraData) +func (p *abiPacker) DecodeStreamsLookupRequest(data []byte) (*StreamsLookupError, error) { + e := p.streamsABI.Errors["StreamsLookup"] + unpack, err := e.Unpack(data) + if err != nil { + return nil, fmt.Errorf("unpack error: %w", err) + } + errorParameters := unpack.([]interface{}) + + return &StreamsLookupError{ + FeedParamKey: *abi.ConvertType(errorParameters[0], new(string)).(*string), + Feeds: *abi.ConvertType(errorParameters[1], new([]string)).(*[]string), + TimeParamKey: *abi.ConvertType(errorParameters[2], new(string)).(*string), + Time: *abi.ConvertType(errorParameters[3], new(*big.Int)).(**big.Int), + ExtraData: *abi.ConvertType(errorParameters[4], new([]byte)).(*[]byte), + }, nil +} + // GetIneligibleCheckResultWithoutPerformData returns an ineligible check result with ineligibility reason and pipeline execution state but without perform data func GetIneligibleCheckResultWithoutPerformData(p ocr2keepers.UpkeepPayload, reason UpkeepFailureReason, state PipelineExecutionState, retryable bool) ocr2keepers.CheckResult { return ocr2keepers.CheckResult{ diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/packer_test.go b/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/packer_test.go index b333a695bf8..1801b018572 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/packer_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/encoding/packer_test.go @@ -2,12 +2,11 @@ package encoding import ( "encoding/json" + "errors" "fmt" "math/big" - "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" @@ -16,7 +15,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" automation21Utils "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" - iregistry21 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21/core" ) @@ -106,8 +104,7 @@ func TestPacker_PackReport(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - packer, err := newPacker() - assert.NoError(t, err) + packer := NewAbiPacker() bytes, err := packer.PackReport(tc.report) if tc.expectsErr { assert.Error(t, err) @@ -192,8 +189,7 @@ func TestPacker_UnpackCheckResults(t *testing.T) { } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { - packer, err := newPacker() - assert.NoError(t, err) + packer := NewAbiPacker() rs, err := packer.UnpackCheckResult(test.Payload, test.RawData) if test.ExpectedError != nil { assert.Equal(t, test.ExpectedError.Error(), err.Error()) @@ -224,8 +220,7 @@ func TestPacker_UnpackPerformResult(t *testing.T) { } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { - packer, err := newPacker() - assert.NoError(t, err) + packer := NewAbiPacker() state, rs, err := packer.UnpackPerformResult(test.RawData) assert.Nil(t, err) assert.True(t, rs) @@ -272,8 +267,7 @@ func TestPacker_UnpackCheckCallbackResult(t *testing.T) { } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { - packer, err := newPacker() - assert.NoError(t, err) + packer := NewAbiPacker() state, needed, pd, failureReason, gasUsed, err := packer.UnpackCheckCallbackResult(test.CallbackResp) @@ -323,8 +317,7 @@ func TestPacker_UnpackLogTriggerConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - packer, err := newPacker() - assert.NoError(t, err) + packer := NewAbiPacker() res, err := packer.UnpackLogTriggerConfig(tc.raw) if tc.errored { assert.Error(t, err) @@ -345,8 +338,7 @@ func TestPacker_PackReport_UnpackReport(t *testing.T) { Triggers: [][]byte{{1, 2, 3, 4}, {5, 6, 7, 8}}, PerformDatas: [][]byte{{5, 6, 7, 8}, {1, 2, 3, 4}}, } - packer, err := newPacker() - require.NoError(t, err) + packer := NewAbiPacker() res, err := packer.PackReport(report) require.NoError(t, err) report2, err := packer.UnpackReport(res) @@ -381,8 +373,7 @@ func TestPacker_PackGetUpkeepPrivilegeConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - packer, err := newPacker() - require.NoError(t, err, "valid packer required for test") + packer := NewAbiPacker() b, err := packer.PackGetUpkeepPrivilegeConfig(test.upkeepId) @@ -425,8 +416,7 @@ func TestPacker_UnpackGetUpkeepPrivilegeConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - packer, err := newPacker() - require.NoError(t, err, "valid packer required for test") + packer := NewAbiPacker() b, err := packer.UnpackGetUpkeepPrivilegeConfig(test.raw) @@ -447,14 +437,40 @@ func TestPacker_UnpackGetUpkeepPrivilegeConfig(t *testing.T) { } } -func newPacker() (*abiPacker, error) { - keepersABI, err := abi.JSON(strings.NewReader(iregistry21.IKeeperRegistryMasterABI)) - if err != nil { - return nil, err +func TestPacker_DecodeStreamsLookupRequest(t *testing.T) { + tests := []struct { + name string + data []byte + expected *StreamsLookupError + state PipelineExecutionState + err error + }{ + { + name: "success - decode to streams lookup", + data: hexutil.MustDecode("0xf055e4a200000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000002435eb50000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000966656564496448657800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000423078343535343438326435353533343432643431353234323439353435323535346432643534343535333534346534353534303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042307834323534343332643535353334343264343135323432343935343532353534643264353434353533353434653435353430303030303030303030303030303030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b626c6f636b4e756d62657200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000064000000000000000000000000"), + expected: &StreamsLookupError{ + FeedParamKey: "feedIdHex", + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: "blockNumber", + Time: big.NewInt(37969589), + ExtraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, + }, + }, + { + name: "failure - unpack error", + data: []byte{1, 2, 3, 4}, + err: errors.New("unpack error: invalid data for unpacking"), + }, } - utilsABI, err := abi.JSON(strings.NewReader(automation21Utils.AutomationUtilsABI)) - if err != nil { - return nil, err + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + packer := NewAbiPacker() + fl, err := packer.DecodeStreamsLookupRequest(tt.data) + assert.Equal(t, tt.expected, fl) + if tt.err != nil { + assert.Equal(t, tt.err.Error(), err.Error()) + } + }) } - return NewAbiPacker(keepersABI, utilsABI), nil } diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/factory.go b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/factory.go index 4b3fa8cb404..38342550c58 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/factory.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/factory.go @@ -3,7 +3,6 @@ package logprovider import ( "time" - "github.com/ethereum/go-ethereum/accounts/abi" "golang.org/x/time/rate" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" @@ -14,9 +13,9 @@ import ( // New creates a new log event provider and recoverer. // using default values for the options. -func New(lggr logger.Logger, poller logpoller.LogPoller, c client.Client, utilsABI abi.ABI, stateStore core.UpkeepStateReader, finalityDepth uint32) (LogEventProvider, LogRecoverer) { +func New(lggr logger.Logger, poller logpoller.LogPoller, c client.Client, stateStore core.UpkeepStateReader, finalityDepth uint32) (LogEventProvider, LogRecoverer) { filterStore := NewUpkeepFilterStore() - packer := NewLogEventsPacker(utilsABI) + packer := NewLogEventsPacker() opts := NewOptions(int64(finalityDepth)) provider := NewLogProvider(lggr, poller, packer, filterStore, opts) recoverer := NewLogRecoverer(lggr, poller, c, stateStore, packer, filterStore, opts) diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/integration_test.go b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/integration_test.go index b5f229f6015..30a7bafceb9 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/integration_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/integration_test.go @@ -5,11 +5,9 @@ import ( "errors" "fmt" "math/big" - "strings" "testing" "time" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/common" @@ -28,7 +26,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_upkeep_counter_wrapper" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" @@ -54,9 +51,9 @@ func TestIntegration_LogEventProvider(t *testing.T) { opts := logprovider.NewOptions(200) opts.ReadInterval = time.Second / 2 - lp, ethClient, utilsABI := setupDependencies(t, db, backend) + lp, ethClient := setupDependencies(t, db, backend) filterStore := logprovider.NewUpkeepFilterStore() - provider, _ := setup(logger.TestLogger(t), lp, nil, utilsABI, nil, filterStore, &opts) + provider, _ := setup(logger.TestLogger(t), lp, nil, nil, filterStore, &opts) logProvider := provider.(logprovider.LogEventProviderTest) n := 10 @@ -95,10 +92,8 @@ func TestIntegration_LogEventProvider(t *testing.T) { t.Log("restarting log provider") // assuming that our service was closed and restarted, // we should be able to backfill old logs and fetch new ones - logDataABI, err := abi.JSON(strings.NewReader(automation_utils_2_1.AutomationUtilsABI)) - require.NoError(t, err) filterStore := logprovider.NewUpkeepFilterStore() - logProvider2 := logprovider.NewLogProvider(logger.TestLogger(t), lp, logprovider.NewLogEventsPacker(logDataABI), filterStore, opts) + logProvider2 := logprovider.NewLogProvider(logger.TestLogger(t), lp, logprovider.NewLogEventsPacker(), filterStore, opts) poll(backend.Commit()) go func() { @@ -111,7 +106,7 @@ func TestIntegration_LogEventProvider(t *testing.T) { // re-register filters for i, id := range ids { - err = logProvider2.RegisterFilter(ctx, logprovider.FilterOptions{ + err := logProvider2.RegisterFilter(ctx, logprovider.FilterOptions{ UpkeepID: id, TriggerConfig: newPlainLogTriggerConfig(addrs[i]), // using block number at which the upkeep was registered, @@ -144,9 +139,9 @@ func TestIntegration_LogEventProvider_UpdateConfig(t *testing.T) { opts := &logprovider.LogTriggersOptions{ ReadInterval: time.Second / 2, } - lp, ethClient, utilsABI := setupDependencies(t, db, backend) + lp, ethClient := setupDependencies(t, db, backend) filterStore := logprovider.NewUpkeepFilterStore() - provider, _ := setup(logger.TestLogger(t), lp, nil, utilsABI, nil, filterStore, opts) + provider, _ := setup(logger.TestLogger(t), lp, nil, nil, filterStore, opts) logProvider := provider.(logprovider.LogEventProviderTest) backend.Commit() @@ -217,9 +212,9 @@ func TestIntegration_LogEventProvider_Backfill(t *testing.T) { opts := logprovider.NewOptions(200) opts.ReadInterval = time.Second / 4 - lp, ethClient, utilsABI := setupDependencies(t, db, backend) + lp, ethClient := setupDependencies(t, db, backend) filterStore := logprovider.NewUpkeepFilterStore() - provider, _ := setup(logger.TestLogger(t), lp, nil, utilsABI, nil, filterStore, &opts) + provider, _ := setup(logger.TestLogger(t), lp, nil, nil, filterStore, &opts) logProvider := provider.(logprovider.LogEventProviderTest) n := 10 @@ -276,9 +271,9 @@ func TestIntegration_LogEventProvider_RateLimit(t *testing.T) { stopMining() _ = db.Close() } - lp, ethClient, utilsABI := setupDependencies(t, db, backend) + lp, ethClient := setupDependencies(t, db, backend) filterStore := logprovider.NewUpkeepFilterStore() - provider, _ := setup(logger.TestLogger(t), lp, nil, utilsABI, nil, filterStore, opts) + provider, _ := setup(logger.TestLogger(t), lp, nil, nil, filterStore, opts) logProvider := provider.(logprovider.LogEventProviderTest) backend.Commit() lp.PollAndSaveLogs(ctx, 1) // Ensure log poller has a latest block @@ -476,14 +471,14 @@ func TestIntegration_LogRecoverer_Backfill(t *testing.T) { ReadInterval: time.Second / 4, LookbackBlocks: lookbackBlocks, } - lp, ethClient, utilsABI := setupDependencies(t, db, backend) + lp, ethClient := setupDependencies(t, db, backend) filterStore := logprovider.NewUpkeepFilterStore() origDefaultRecoveryInterval := logprovider.RecoveryInterval logprovider.RecoveryInterval = time.Millisecond * 200 defer func() { logprovider.RecoveryInterval = origDefaultRecoveryInterval }() - provider, recoverer := setup(logger.TestLogger(t), lp, nil, utilsABI, &mockUpkeepStateStore{}, filterStore, opts) + provider, recoverer := setup(logger.TestLogger(t), lp, nil, &mockUpkeepStateStore{}, filterStore, opts) logProvider := provider.(logprovider.LogEventProviderTest) backend.Commit() @@ -662,21 +657,17 @@ func newPlainLogTriggerConfig(upkeepAddr common.Address) logprovider.LogTriggerC } } -func setupDependencies(t *testing.T, db *sqlx.DB, backend *backends.SimulatedBackend) (logpoller.LogPollerTest, *evmclient.SimulatedBackendClient, abi.ABI) { +func setupDependencies(t *testing.T, db *sqlx.DB, backend *backends.SimulatedBackend) (logpoller.LogPollerTest, *evmclient.SimulatedBackendClient) { ethClient := evmclient.NewSimulatedBackendClient(t, backend, big.NewInt(1337)) pollerLggr := logger.TestLogger(t) pollerLggr.SetLogLevel(zapcore.WarnLevel) lorm := logpoller.NewORM(big.NewInt(1337), db, pollerLggr, pgtest.NewQConfig(false)) lp := logpoller.NewLogPoller(lorm, ethClient, pollerLggr, 100*time.Millisecond, 1, 2, 2, 1000) - - utilsABI, err := abi.JSON(strings.NewReader(automation_utils_2_1.AutomationUtilsABI)) - require.NoError(t, err) - - return lp, ethClient, utilsABI + return lp, ethClient } -func setup(lggr logger.Logger, poller logpoller.LogPoller, c client.Client, utilsABI abi.ABI, stateStore kevmcore.UpkeepStateReader, filterStore logprovider.UpkeepFilterStore, opts *logprovider.LogTriggersOptions) (logprovider.LogEventProvider, logprovider.LogRecoverer) { - packer := logprovider.NewLogEventsPacker(utilsABI) +func setup(lggr logger.Logger, poller logpoller.LogPoller, c client.Client, stateStore kevmcore.UpkeepStateReader, filterStore logprovider.UpkeepFilterStore, opts *logprovider.LogTriggersOptions) (logprovider.LogEventProvider, logprovider.LogRecoverer) { + packer := logprovider.NewLogEventsPacker() if opts == nil { o := logprovider.NewOptions(200) opts = &o diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/log_packer.go b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/log_packer.go index 538839b011c..655d7dacfe6 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/log_packer.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/log_packer.go @@ -7,6 +7,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21/core" ) type LogDataPacker interface { @@ -17,8 +18,8 @@ type logEventsPacker struct { abi abi.ABI } -func NewLogEventsPacker(utilsABI abi.ABI) *logEventsPacker { - return &logEventsPacker{abi: utilsABI} +func NewLogEventsPacker() *logEventsPacker { + return &logEventsPacker{abi: core.UtilsABI} } func (p *logEventsPacker) PackLogData(log logpoller.Log) ([]byte, error) { @@ -26,7 +27,7 @@ func (p *logEventsPacker) PackLogData(log logpoller.Log) ([]byte, error) { for _, topic := range log.GetTopics() { topics = append(topics, topic) } - b, err := p.abi.Pack("_log", &automation_utils_2_1.Log{ + b, err := p.abi.Methods["_log"].Inputs.Pack(&automation_utils_2_1.Log{ Index: big.NewInt(log.LogIndex), Timestamp: big.NewInt(log.BlockTimestamp.Unix()), TxHash: log.TxHash, @@ -39,5 +40,5 @@ func (p *logEventsPacker) PackLogData(log logpoller.Log) ([]byte, error) { if err != nil { return nil, err } - return b[4:], nil + return b, nil } diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/mocks/registry.go b/core/services/ocr2/plugins/ocr2keeper/evm21/mocks/registry.go index 1827d4cb57f..9af557db671 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/mocks/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/mocks/registry.go @@ -22,23 +22,21 @@ type Registry struct { } // CheckCallback provides a mock function with given fields: opts, id, values, extraData -func (_m *Registry) CheckCallback(opts *bind.TransactOpts, id *big.Int, values [][]byte, extraData []byte) (*types.Transaction, error) { +func (_m *Registry) CheckCallback(opts *bind.CallOpts, id *big.Int, values [][]byte, extraData []byte) (i_keeper_registry_master_wrapper_2_1.CheckCallback, error) { ret := _m.Called(opts, id, values, extraData) - var r0 *types.Transaction + var r0 i_keeper_registry_master_wrapper_2_1.CheckCallback var r1 error - if rf, ok := ret.Get(0).(func(*bind.TransactOpts, *big.Int, [][]byte, []byte) (*types.Transaction, error)); ok { + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int, [][]byte, []byte) (i_keeper_registry_master_wrapper_2_1.CheckCallback, error)); ok { return rf(opts, id, values, extraData) } - if rf, ok := ret.Get(0).(func(*bind.TransactOpts, *big.Int, [][]byte, []byte) *types.Transaction); ok { + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int, [][]byte, []byte) i_keeper_registry_master_wrapper_2_1.CheckCallback); ok { r0 = rf(opts, id, values, extraData) } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Transaction) - } + r0 = ret.Get(0).(i_keeper_registry_master_wrapper_2_1.CheckCallback) } - if rf, ok := ret.Get(1).(func(*bind.TransactOpts, *big.Int, [][]byte, []byte) error); ok { + if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int, [][]byte, []byte) error); ok { r1 = rf(opts, id, values, extraData) } else { r1 = ret.Error(1) diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go index b47b6187baf..d7cd5f26250 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go @@ -62,7 +62,7 @@ type Registry interface { GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) GetUpkeepPrivilegeConfig(opts *bind.CallOpts, upkeepId *big.Int) ([]byte, error) GetUpkeepTriggerConfig(opts *bind.CallOpts, upkeepId *big.Int) ([]byte, error) - CheckCallback(opts *bind.TransactOpts, id *big.Int, values [][]byte, extraData []byte) (*coreTypes.Transaction, error) + CheckCallback(opts *bind.CallOpts, id *big.Int, values [][]byte, extraData []byte) (iregistry21.CheckCallback, error) ParseLog(log coreTypes.Log) (generated.AbigenLog, error) } @@ -75,7 +75,6 @@ func NewEvmRegistry( lggr logger.Logger, addr common.Address, client evm.Chain, - streamsLookupCompatibleABI, keeperRegistryABI abi.ABI, registry *iregistry21.IKeeperRegistryMaster, mc *models.MercuryCredentials, al ActiveUpkeepList, @@ -93,14 +92,14 @@ func NewEvmRegistry( client: client.Client(), logProcessed: make(map[string]bool), registry: registry, - abi: keeperRegistryABI, + abi: core.RegistryABI, active: al, packer: packer, headFunc: func(ocr2keepers.BlockKey) {}, chLog: make(chan logpoller.Log, 1000), mercury: &MercuryConfig{ cred: mc, - abi: streamsLookupCompatibleABI, + abi: core.StreamsCompatibleABI, allowListCache: cache.New(defaultAllowListExpiration, allowListCleanupInterval), }, hc: http.DefaultClient, diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/services.go b/core/services/ocr2/plugins/ocr2keeper/evm21/services.go index 79a9da0c68c..f9d3dd92591 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/services.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/services.go @@ -2,9 +2,7 @@ package evm import ( "fmt" - "strings" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -13,9 +11,7 @@ import ( "github.com/smartcontractkit/sqlx" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" iregistry21 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/streams_lookup_compatible_interface" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/models" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21/encoding" @@ -39,18 +35,6 @@ type AutomationServices interface { } func New(addr common.Address, client evm.Chain, mc *models.MercuryCredentials, keyring ocrtypes.OnchainKeyring, lggr logger.Logger, db *sqlx.DB, dbCfg pg.QConfig) (AutomationServices, error) { - streamsLookupCompatibleABI, err := abi.JSON(strings.NewReader(streams_lookup_compatible_interface.StreamsLookupCompatibleInterfaceABI)) - if err != nil { - return nil, fmt.Errorf("%w: %s", ErrABINotParsable, err) - } - keeperRegistryABI, err := abi.JSON(strings.NewReader(iregistry21.IKeeperRegistryMasterABI)) - if err != nil { - return nil, fmt.Errorf("%w: %s", ErrABINotParsable, err) - } - utilsABI, err := abi.JSON(strings.NewReader(automation_utils_2_1.AutomationUtilsABI)) - if err != nil { - return nil, fmt.Errorf("%w: %s", ErrABINotParsable, err) - } registryContract, err := iregistry21.NewIKeeperRegistryMaster(addr, client.Client()) if err != nil { return nil, fmt.Errorf("%w: failed to create caller for address and backend", ErrInitializationFailure) @@ -66,7 +50,7 @@ func New(addr common.Address, client evm.Chain, mc *models.MercuryCredentials, k services := new(automationServices) services.transmitEventProvider = transmitEventProvider - packer := encoding.NewAbiPacker(keeperRegistryABI, utilsABI) + packer := encoding.NewAbiPacker() services.encoder = encoding.NewReportEncoder(packer) finalityDepth := client.Config().EVM().FinalityDepth() @@ -75,7 +59,7 @@ func New(addr common.Address, client evm.Chain, mc *models.MercuryCredentials, k scanner := upkeepstate.NewPerformedEventsScanner(lggr, client.LogPoller(), addr, finalityDepth) services.upkeepState = upkeepstate.NewUpkeepStateStore(orm, lggr, scanner) - logProvider, logRecoverer := logprovider.New(lggr, client.LogPoller(), client.Client(), utilsABI, services.upkeepState, finalityDepth) + logProvider, logRecoverer := logprovider.New(lggr, client.LogPoller(), client.Client(), services.upkeepState, finalityDepth) services.logProvider = logProvider services.logRecoverer = logRecoverer services.blockSub = NewBlockSubscriber(client.HeadBroadcaster(), client.LogPoller(), finalityDepth, lggr) @@ -85,8 +69,8 @@ func New(addr common.Address, client evm.Chain, mc *models.MercuryCredentials, k al := NewActiveUpkeepList() services.payloadBuilder = NewPayloadBuilder(al, logRecoverer, lggr) - services.reg = NewEvmRegistry(lggr, addr, client, streamsLookupCompatibleABI, - keeperRegistryABI, registryContract, mc, al, services.logProvider, + services.reg = NewEvmRegistry(lggr, addr, client, + registryContract, mc, al, services.logProvider, packer, services.blockSub, finalityDepth) services.upkeepProvider = NewUpkeepProvider(al, services.blockSub, client.LogPoller()) diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go index 6c1789de9c4..469ee27484c 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go @@ -18,7 +18,6 @@ import ( "time" "github.com/avast/retry-go/v4" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/patrickmn/go-cache" @@ -46,13 +45,9 @@ const ( ) type StreamsLookup struct { - feedParamKey string - feeds []string - timeParamKey string - time *big.Int - extraData []byte - upkeepId *big.Int - block uint64 + *encoding.StreamsLookupError + upkeepId *big.Int + block uint64 } // MercuryV02Response represents a JSON structure used by Mercury v0.2 @@ -101,25 +96,26 @@ func (r *EvmRegistry) streamsLookup(ctx context.Context, checkResults []ocr2keep // Try to decode the revert error into streams lookup format. User upkeeps can revert with any reason, see if they // tried to call mercury - lggr.Infof("at block %d upkeep %s trying to decodeStreamsLookup performData=%s", block, upkeepId, hexutil.Encode(checkResults[i].PerformData)) - l, err := r.decodeStreamsLookup(res.PerformData) + lggr.Infof("at block %d upkeep %s trying to DecodeStreamsLookupRequest performData=%s", block, upkeepId, hexutil.Encode(checkResults[i].PerformData)) + streamsLookupErr, err := r.packer.DecodeStreamsLookupRequest(res.PerformData) if err != nil { - lggr.Warnf("at block %d upkeep %s decodeStreamsLookup failed: %v", block, upkeepId, err) + lggr.Warnf("at block %d upkeep %s DecodeStreamsLookupRequest failed: %v", block, upkeepId, err) // user contract did not revert with StreamsLookup error continue } + l := &StreamsLookup{StreamsLookupError: streamsLookupErr} if r.mercury.cred == nil { lggr.Errorf("at block %d upkeep %s tries to access mercury server but mercury credential is not configured", block, upkeepId) continue } - if len(l.feeds) == 0 { + if len(l.Feeds) == 0 { checkResults[i].IneligibilityReason = uint8(encoding.UpkeepFailureReasonInvalidRevertDataInput) lggr.Warnf("at block %s upkeep %s has empty feeds array", block, upkeepId) continue } // mercury permission checking for v0.3 is done by mercury server - if l.feedParamKey == feedIdHex && l.timeParamKey == blockNumber { + if l.FeedParamKey == feedIdHex && l.TimeParamKey == blockNumber { // check permission on the registry for mercury v0.2 opts := r.buildCallOpts(ctx, block) state, reason, retryable, allowed, err := r.allowedToUseMercury(opts, upkeepId.BigInt()) @@ -136,7 +132,7 @@ func (r *EvmRegistry) streamsLookup(ctx context.Context, checkResults []ocr2keep checkResults[i].IneligibilityReason = uint8(encoding.UpkeepFailureReasonMercuryAccessNotAllowed) continue } - } else if l.feedParamKey != feedIDs || l.timeParamKey != timestamp { + } else if l.FeedParamKey != feedIDs || l.TimeParamKey != timestamp { // if mercury version cannot be determined, set failure reason lggr.Warnf("at block %d upkeep %s NOT allowed to query Mercury server", block, upkeepId) checkResults[i].IneligibilityReason = uint8(encoding.UpkeepFailureReasonInvalidRevertDataInput) @@ -147,7 +143,7 @@ func (r *EvmRegistry) streamsLookup(ctx context.Context, checkResults []ocr2keep // the block here is exclusively used to call checkCallback at this block, not to be confused with the block number // in the revert for mercury v0.2, which is denoted by time in the struct bc starting from v0.3, only timestamp will be supported l.block = uint64(block.Int64()) - lggr.Infof("at block %d upkeep %s decodeStreamsLookup feedKey=%s timeKey=%s feeds=%v time=%s extraData=%s", block, upkeepId, l.feedParamKey, l.timeParamKey, l.feeds, l.time, hexutil.Encode(l.extraData)) + lggr.Infof("at block %d upkeep %s DecodeStreamsLookupRequest feedKey=%s timeKey=%s feeds=%v time=%s extraData=%s", block, upkeepId, l.FeedParamKey, l.TimeParamKey, l.Feeds, l.Time, hexutil.Encode(l.ExtraData)) lookups[i] = l } @@ -260,26 +256,8 @@ func (r *EvmRegistry) allowedToUseMercury(opts *bind.CallOpts, upkeepId *big.Int return encoding.NoPipelineError, encoding.UpkeepFailureReasonNone, false, privilegeConfig.MercuryEnabled, nil } -// decodeStreamsLookup decodes the revert error StreamsLookup(string feedParamKey, string[] feeds, string feedParamKey, uint256 time, byte[] extraData) -func (r *EvmRegistry) decodeStreamsLookup(data []byte) (*StreamsLookup, error) { - e := r.mercury.abi.Errors["StreamsLookup"] - unpack, err := e.Unpack(data) - if err != nil { - return nil, fmt.Errorf("unpack error: %w", err) - } - errorParameters := unpack.([]interface{}) - - return &StreamsLookup{ - feedParamKey: *abi.ConvertType(errorParameters[0], new(string)).(*string), - feeds: *abi.ConvertType(errorParameters[1], new([]string)).(*[]string), - timeParamKey: *abi.ConvertType(errorParameters[2], new(string)).(*string), - time: *abi.ConvertType(errorParameters[3], new(*big.Int)).(**big.Int), - extraData: *abi.ConvertType(errorParameters[4], new([]byte)).(*[]byte), - }, nil -} - func (r *EvmRegistry) checkCallback(ctx context.Context, values [][]byte, lookup *StreamsLookup) (encoding.PipelineExecutionState, bool, hexutil.Bytes, error) { - payload, err := r.abi.Pack("checkCallback", lookup.upkeepId, values, lookup.extraData) + payload, err := r.abi.Pack("checkCallback", lookup.upkeepId, values, lookup.ExtraData) if err != nil { return encoding.PackUnpackDecodeFailed, false, nil, err } @@ -301,28 +279,28 @@ func (r *EvmRegistry) checkCallback(ctx context.Context, values [][]byte, lookup // doMercuryRequest sends requests to Mercury API to retrieve mercury data. func (r *EvmRegistry) doMercuryRequest(ctx context.Context, sl *StreamsLookup, lggr logger.Logger) (encoding.PipelineExecutionState, encoding.UpkeepFailureReason, [][]byte, bool, error) { var isMercuryV03 bool - resultLen := len(sl.feeds) + resultLen := len(sl.Feeds) ch := make(chan MercuryData, resultLen) - if len(sl.feeds) == 0 { - return encoding.NoPipelineError, encoding.UpkeepFailureReasonInvalidRevertDataInput, [][]byte{}, false, fmt.Errorf("invalid revert data input: feed param key %s, time param key %s, feeds %s", sl.feedParamKey, sl.timeParamKey, sl.feeds) + if len(sl.Feeds) == 0 { + return encoding.NoPipelineError, encoding.UpkeepFailureReasonInvalidRevertDataInput, [][]byte{}, false, fmt.Errorf("invalid revert data input: feed param key %s, time param key %s, feeds %s", sl.FeedParamKey, sl.TimeParamKey, sl.Feeds) } - if sl.feedParamKey == feedIdHex && sl.timeParamKey == blockNumber { + if sl.FeedParamKey == feedIdHex && sl.TimeParamKey == blockNumber { // only mercury v0.2 - for i := range sl.feeds { + for i := range sl.Feeds { go r.singleFeedRequest(ctx, ch, i, sl, lggr) } - } else if sl.feedParamKey == feedIDs && sl.timeParamKey == timestamp { + } else if sl.FeedParamKey == feedIDs && sl.TimeParamKey == timestamp { // only mercury v0.3 resultLen = 1 isMercuryV03 = true ch = make(chan MercuryData, resultLen) go r.multiFeedsRequest(ctx, ch, sl, lggr) } else { - return encoding.NoPipelineError, encoding.UpkeepFailureReasonInvalidRevertDataInput, [][]byte{}, false, fmt.Errorf("invalid revert data input: feed param key %s, time param key %s, feeds %s", sl.feedParamKey, sl.timeParamKey, sl.feeds) + return encoding.NoPipelineError, encoding.UpkeepFailureReasonInvalidRevertDataInput, [][]byte{}, false, fmt.Errorf("invalid revert data input: feed param key %s, time param key %s, feeds %s", sl.FeedParamKey, sl.TimeParamKey, sl.Feeds) } var reqErr error - results := make([][]byte, len(sl.feeds)) + results := make([][]byte, len(sl.Feeds)) retryable := true allSuccess := true // in v0.2, use the last execution error as the state, if no execution errors, state will be no error @@ -351,12 +329,12 @@ func (r *EvmRegistry) doMercuryRequest(ctx context.Context, sl *StreamsLookup, l // singleFeedRequest sends a v0.2 Mercury request for a single feed report. func (r *EvmRegistry) singleFeedRequest(ctx context.Context, ch chan<- MercuryData, index int, sl *StreamsLookup, lggr logger.Logger) { q := url.Values{ - sl.feedParamKey: {sl.feeds[index]}, - sl.timeParamKey: {sl.time.String()}, + sl.FeedParamKey: {sl.Feeds[index]}, + sl.TimeParamKey: {sl.Time.String()}, } mercuryURL := r.mercury.cred.LegacyURL reqUrl := fmt.Sprintf("%s%s%s", mercuryURL, mercuryPathV02, q.Encode()) - lggr.Debugf("request URL for upkeep %s feed %s: %s", sl.upkeepId.String(), sl.feeds[index], reqUrl) + lggr.Debugf("request URL for upkeep %s feed %s: %s", sl.upkeepId.String(), sl.Feeds[index], reqUrl) req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqUrl, nil) if err != nil { @@ -380,7 +358,7 @@ func (r *EvmRegistry) singleFeedRequest(ctx context.Context, ch chan<- MercuryDa retryable = false resp, err1 := r.hc.Do(req) if err1 != nil { - lggr.Warnf("at block %s upkeep %s GET request fails for feed %s: %v", sl.time.String(), sl.upkeepId.String(), sl.feeds[index], err1) + lggr.Warnf("at block %s upkeep %s GET request fails for feed %s: %v", sl.Time.String(), sl.upkeepId.String(), sl.Feeds[index], err1) retryable = true state = encoding.MercuryFlakyFailure return err1 @@ -400,29 +378,29 @@ func (r *EvmRegistry) singleFeedRequest(ctx context.Context, ch chan<- MercuryDa } if resp.StatusCode == http.StatusNotFound || resp.StatusCode == http.StatusInternalServerError { - lggr.Warnf("at block %s upkeep %s received status code %d for feed %s", sl.time.String(), sl.upkeepId.String(), resp.StatusCode, sl.feeds[index]) + lggr.Warnf("at block %s upkeep %s received status code %d for feed %s", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode, sl.Feeds[index]) retryable = true state = encoding.MercuryFlakyFailure return errors.New(strconv.FormatInt(int64(resp.StatusCode), 10)) } else if resp.StatusCode != http.StatusOK { retryable = false state = encoding.InvalidMercuryRequest - return fmt.Errorf("at block %s upkeep %s received status code %d for feed %s", sl.time.String(), sl.upkeepId.String(), resp.StatusCode, sl.feeds[index]) + return fmt.Errorf("at block %s upkeep %s received status code %d for feed %s", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode, sl.Feeds[index]) } - lggr.Debugf("at block %s upkeep %s received status code %d from mercury v0.2 with BODY=%s", sl.time.String(), sl.upkeepId.String(), resp.StatusCode, hexutil.Encode(body)) + lggr.Debugf("at block %s upkeep %s received status code %d from mercury v0.2 with BODY=%s", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode, hexutil.Encode(body)) var m MercuryV02Response err1 = json.Unmarshal(body, &m) if err1 != nil { - lggr.Warnf("at block %s upkeep %s failed to unmarshal body to MercuryV02Response for feed %s: %v", sl.time.String(), sl.upkeepId.String(), sl.feeds[index], err1) + lggr.Warnf("at block %s upkeep %s failed to unmarshal body to MercuryV02Response for feed %s: %v", sl.Time.String(), sl.upkeepId.String(), sl.Feeds[index], err1) retryable = false state = encoding.MercuryUnmarshalError return err1 } blobBytes, err1 := hexutil.Decode(m.ChainlinkBlob) if err1 != nil { - lggr.Warnf("at block %s upkeep %s failed to decode chainlinkBlob %s for feed %s: %v", sl.time.String(), sl.upkeepId.String(), m.ChainlinkBlob, sl.feeds[index], err1) + lggr.Warnf("at block %s upkeep %s failed to decode chainlinkBlob %s for feed %s: %v", sl.Time.String(), sl.upkeepId.String(), m.ChainlinkBlob, sl.Feeds[index], err1) retryable = false state = encoding.InvalidMercuryResponse return err1 @@ -449,7 +427,7 @@ func (r *EvmRegistry) singleFeedRequest(ctx context.Context, ch chan<- MercuryDa Index: index, Bytes: [][]byte{}, Retryable: retryable, - Error: fmt.Errorf("failed to request feed for %s: %w", sl.feeds[index], retryErr), + Error: fmt.Errorf("failed to request feed for %s: %w", sl.Feeds[index], retryErr), State: state, } ch <- md @@ -460,10 +438,10 @@ func (r *EvmRegistry) singleFeedRequest(ctx context.Context, ch chan<- MercuryDa func (r *EvmRegistry) multiFeedsRequest(ctx context.Context, ch chan<- MercuryData, sl *StreamsLookup, lggr logger.Logger) { // this won't work bc q.Encode() will encode commas as '%2C' but the server is strictly expecting a comma separated list //q := url.Values{ - // feedIDs: {strings.Join(sl.feeds, ",")}, - // timestamp: {sl.time.String()}, + // feedIDs: {strings.Join(sl.Feeds, ",")}, + // timestamp: {sl.Time.String()}, //} - params := fmt.Sprintf("%s=%s&%s=%s", feedIDs, strings.Join(sl.feeds, ","), timestamp, sl.time.String()) + params := fmt.Sprintf("%s=%s&%s=%s", feedIDs, strings.Join(sl.Feeds, ","), timestamp, sl.Time.String()) reqUrl := fmt.Sprintf("%s%s%s", r.mercury.cred.URL, mercuryBatchPathV03, params) lggr.Debugf("request URL for upkeep %s userId %s: %s", sl.upkeepId.String(), r.mercury.cred.Username, reqUrl) @@ -493,7 +471,7 @@ func (r *EvmRegistry) multiFeedsRequest(ctx context.Context, ch chan<- MercuryDa retryable = false resp, err1 := r.hc.Do(req) if err1 != nil { - lggr.Warnf("at timestamp %s upkeep %s GET request fails from mercury v0.3: %v", sl.time.String(), sl.upkeepId.String(), err1) + lggr.Warnf("at timestamp %s upkeep %s GET request fails from mercury v0.3: %v", sl.Time.String(), sl.upkeepId.String(), err1) retryable = true state = encoding.MercuryFlakyFailure return err1 @@ -512,15 +490,15 @@ func (r *EvmRegistry) multiFeedsRequest(ctx context.Context, ch chan<- MercuryDa return err1 } - lggr.Infof("at timestamp %s upkeep %s received status code %d from mercury v0.3", sl.time.String(), sl.upkeepId.String(), resp.StatusCode) + lggr.Infof("at timestamp %s upkeep %s received status code %d from mercury v0.3", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode) if resp.StatusCode == http.StatusUnauthorized { retryable = false state = encoding.UpkeepNotAuthorized - return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by unauthorized upkeep", sl.time.String(), sl.upkeepId.String(), resp.StatusCode) + return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by unauthorized upkeep", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode) } else if resp.StatusCode == http.StatusBadRequest { retryable = false state = encoding.InvalidMercuryRequest - return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by invalid format of timestamp", sl.time.String(), sl.upkeepId.String(), resp.StatusCode) + return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by invalid format of timestamp", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode) } else if resp.StatusCode == http.StatusInternalServerError { retryable = true state = encoding.MercuryFlakyFailure @@ -529,28 +507,28 @@ func (r *EvmRegistry) multiFeedsRequest(ctx context.Context, ch chan<- MercuryDa // in 0.3, this will happen when missing/malformed query args, missing or bad required headers, non-existent feeds, or no permissions for feeds retryable = false state = encoding.InvalidMercuryRequest - return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by missing/malformed query args, missing or bad required headers, non-existent feeds, or no permissions for feeds", sl.time.String(), sl.upkeepId.String(), resp.StatusCode) + return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3, most likely this is caused by missing/malformed query args, missing or bad required headers, non-existent feeds, or no permissions for feeds", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode) } else if resp.StatusCode != http.StatusOK { retryable = false state = encoding.InvalidMercuryRequest - return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3", sl.time.String(), sl.upkeepId.String(), resp.StatusCode) + return fmt.Errorf("at timestamp %s upkeep %s received status code %d from mercury v0.3", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode) } - lggr.Debugf("at block %s upkeep %s received status code %d from mercury v0.3 with BODY=%s", sl.time.String(), sl.upkeepId.String(), resp.StatusCode, hexutil.Encode(body)) + lggr.Debugf("at block %s upkeep %s received status code %d from mercury v0.3 with BODY=%s", sl.Time.String(), sl.upkeepId.String(), resp.StatusCode, hexutil.Encode(body)) var response MercuryV03Response err1 = json.Unmarshal(body, &response) if err1 != nil { - lggr.Warnf("at timestamp %s upkeep %s failed to unmarshal body to MercuryV03Response from mercury v0.3: %v", sl.time.String(), sl.upkeepId.String(), err1) + lggr.Warnf("at timestamp %s upkeep %s failed to unmarshal body to MercuryV03Response from mercury v0.3: %v", sl.Time.String(), sl.upkeepId.String(), err1) retryable = false state = encoding.MercuryUnmarshalError return err1 } // in v0.3, if some feeds are not available, the server will only return available feeds, but we need to make sure ALL feeds are retrieved before calling user contract // hence, retry in this case. retry will help when we send a very new timestamp and reports are not yet generated - if len(response.Reports) != len(sl.feeds) { + if len(response.Reports) != len(sl.Feeds) { // TODO: AUTO-5044: calculate what reports are missing and log a warning - lggr.Warnf("at timestamp %s upkeep %s mercury v0.3 server retruned 200 status with %d reports while we requested %d feeds, treating as 404 (not found) and retrying", sl.time.String(), sl.upkeepId.String(), len(response.Reports), len(sl.feeds)) + lggr.Warnf("at timestamp %s upkeep %s mercury v0.3 server retruned 200 status with %d reports while we requested %d feeds, treating as 404 (not found) and retrying", sl.Time.String(), sl.upkeepId.String(), len(response.Reports), len(sl.Feeds)) retryable = true state = encoding.MercuryFlakyFailure return fmt.Errorf("%d", http.StatusNotFound) @@ -559,7 +537,7 @@ func (r *EvmRegistry) multiFeedsRequest(ctx context.Context, ch chan<- MercuryDa for _, rsp := range response.Reports { b, err := hexutil.Decode(rsp.FullReport) if err != nil { - lggr.Warnf("at timestamp %s upkeep %s failed to decode reportBlob %s: %v", sl.time.String(), sl.upkeepId.String(), rsp.FullReport, err) + lggr.Warnf("at timestamp %s upkeep %s failed to decode reportBlob %s: %v", sl.Time.String(), sl.upkeepId.String(), rsp.FullReport, err) retryable = false state = encoding.InvalidMercuryResponse return err diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup_test.go b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup_test.go index f59cec18c1e..c49c12caacd 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup_test.go @@ -27,7 +27,6 @@ import ( evmClientMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/streams_lookup_compatible_interface" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -40,8 +39,6 @@ func setupEVMRegistry(t *testing.T) *EvmRegistry { addr := common.HexToAddress("0x6cA639822c6C241Fa9A7A6b5032F6F7F1C513CAD") keeperRegistryABI, err := abi.JSON(strings.NewReader(i_keeper_registry_master_wrapper_2_1.IKeeperRegistryMasterABI)) require.Nil(t, err, "need registry abi") - utilsABI, err := abi.JSON(strings.NewReader(automation_utils_2_1.AutomationUtilsABI)) - require.Nil(t, err, "need utils abi") streamsLookupCompatibleABI, err := abi.JSON(strings.NewReader(streams_lookup_compatible_interface.StreamsLookupCompatibleInterfaceABI)) require.Nil(t, err, "need mercury abi") var logPoller logpoller.LogPoller @@ -58,7 +55,7 @@ func setupEVMRegistry(t *testing.T) *EvmRegistry { registry: mockReg, abi: keeperRegistryABI, active: NewActiveUpkeepList(), - packer: encoding.NewAbiPacker(keeperRegistryABI, utilsABI), + packer: encoding.NewAbiPacker(), headFunc: func(ocr2keepers.BlockKey) {}, chLog: make(chan logpoller.Log, 1000), mercury: &MercuryConfig{ @@ -257,44 +254,6 @@ func TestEvmRegistry_StreamsLookup(t *testing.T) { } } -func TestEvmRegistry_DecodeStreamsLookup(t *testing.T) { - tests := []struct { - name string - data []byte - expected *StreamsLookup - state encoding.PipelineExecutionState - err error - }{ - { - name: "success - decode to streams lookup", - data: hexutil.MustDecode("0xf055e4a200000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000002435eb50000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000966656564496448657800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000423078343535343438326435353533343432643431353234323439353435323535346432643534343535333534346534353534303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042307834323534343332643535353334343264343135323432343935343532353534643264353434353533353434653435353430303030303030303030303030303030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b626c6f636b4e756d62657200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000064000000000000000000000000"), - expected: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(37969589), - extraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, - }, - }, - { - name: "failure - unpack error", - data: []byte{1, 2, 3, 4}, - err: errors.New("unpack error: invalid data for unpacking"), - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - r := setupEVMRegistry(t) - fl, err := r.decodeStreamsLookup(tt.data) - assert.Equal(t, tt.expected, fl) - if tt.err != nil { - assert.Equal(t, tt.err.Error(), err.Error()) - } - }) - } -} - func TestEvmRegistry_AllowedToUseMercury(t *testing.T) { upkeepId, ok := new(big.Int).SetString("71022726777042968814359024671382968091267501884371696415772139504780367423725", 10) assert.True(t, ok, t.Name()) @@ -431,12 +390,14 @@ func TestEvmRegistry_DoMercuryRequest(t *testing.T) { { name: "success", lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(25880526), - extraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(25880526), + ExtraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, + }, + upkeepId: upkeepId, }, mockHttpStatusCode: http.StatusOK, mockChainlinkBlobs: []string{"0x00066dfcd1ed2d95b18c948dbc5bd64c687afe93e4ca7d663ddec14c20090ad80000000000000000000000000000000000000000000000000000000000081401000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000280000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001204554482d5553442d415242495452554d2d544553544e455400000000000000000000000000000000000000000000000000000000000000000000000064891c98000000000000000000000000000000000000000000000000000000289ad8d367000000000000000000000000000000000000000000000000000000289acf0b38000000000000000000000000000000000000000000000000000000289b3da40000000000000000000000000000000000000000000000000000000000018ae7ce74d9fa252a8983976eab600dc7590c778d04813430841bc6e765c34cd81a168d00000000000000000000000000000000000000000000000000000000018ae7cb0000000000000000000000000000000000000000000000000000000064891c98000000000000000000000000000000000000000000000000000000000000000260412b94e525ca6cedc9f544fd86f77606d52fe731a5d069dbe836a8bfc0fb8c911963b0ae7a14971f3b4621bffb802ef0605392b9a6c89c7fab1df8633a5ade00000000000000000000000000000000000000000000000000000000000000024500c2f521f83fba5efc2bf3effaaedde43d0a4adff785c1213b712a3aed0d8157642a84324db0cf9695ebd27708d4608eb0337e0dd87b0e43f0fa70c700d911"}, @@ -447,12 +408,14 @@ func TestEvmRegistry_DoMercuryRequest(t *testing.T) { { name: "failure - retryable", lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(25880526), - extraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(25880526), + ExtraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, + }, + upkeepId: upkeepId, }, mockHttpStatusCode: http.StatusInternalServerError, mockChainlinkBlobs: []string{"0x00066dfcd1ed2d95b18c948dbc5bd64c687afe93e4ca7d663ddec14c20090ad80000000000000000000000000000000000000000000000000000000000081401000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000280000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001204554482d5553442d415242495452554d2d544553544e455400000000000000000000000000000000000000000000000000000000000000000000000064891c98000000000000000000000000000000000000000000000000000000289ad8d367000000000000000000000000000000000000000000000000000000289acf0b38000000000000000000000000000000000000000000000000000000289b3da40000000000000000000000000000000000000000000000000000000000018ae7ce74d9fa252a8983976eab600dc7590c778d04813430841bc6e765c34cd81a168d00000000000000000000000000000000000000000000000000000000018ae7cb0000000000000000000000000000000000000000000000000000000064891c98000000000000000000000000000000000000000000000000000000000000000260412b94e525ca6cedc9f544fd86f77606d52fe731a5d069dbe836a8bfc0fb8c911963b0ae7a14971f3b4621bffb802ef0605392b9a6c89c7fab1df8633a5ade00000000000000000000000000000000000000000000000000000000000000024500c2f521f83fba5efc2bf3effaaedde43d0a4adff785c1213b712a3aed0d8157642a84324db0cf9695ebd27708d4608eb0337e0dd87b0e43f0fa70c700d911"}, @@ -464,12 +427,14 @@ func TestEvmRegistry_DoMercuryRequest(t *testing.T) { { name: "failure - not retryable", lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(25880526), - extraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(25880526), + ExtraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, + }, + upkeepId: upkeepId, }, mockHttpStatusCode: http.StatusBadGateway, mockChainlinkBlobs: []string{"0x00066dfcd1ed2d95b18c948dbc5bd64c687afe93e4ca7d663ddec14c20090ad80000000000000000000000000000000000000000000000000000000000081401000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000280000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001204554482d5553442d415242495452554d2d544553544e455400000000000000000000000000000000000000000000000000000000000000000000000064891c98000000000000000000000000000000000000000000000000000000289ad8d367000000000000000000000000000000000000000000000000000000289acf0b38000000000000000000000000000000000000000000000000000000289b3da40000000000000000000000000000000000000000000000000000000000018ae7ce74d9fa252a8983976eab600dc7590c778d04813430841bc6e765c34cd81a168d00000000000000000000000000000000000000000000000000000000018ae7cb0000000000000000000000000000000000000000000000000000000064891c98000000000000000000000000000000000000000000000000000000000000000260412b94e525ca6cedc9f544fd86f77606d52fe731a5d069dbe836a8bfc0fb8c911963b0ae7a14971f3b4621bffb802ef0605392b9a6c89c7fab1df8633a5ade00000000000000000000000000000000000000000000000000000000000000024500c2f521f83fba5efc2bf3effaaedde43d0a4adff785c1213b712a3aed0d8157642a84324db0cf9695ebd27708d4608eb0337e0dd87b0e43f0fa70c700d911"}, @@ -481,12 +446,14 @@ func TestEvmRegistry_DoMercuryRequest(t *testing.T) { { name: "failure - no feeds", lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{}, - timeParamKey: blockNumber, - time: big.NewInt(25880526), - extraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{}, + TimeParamKey: blockNumber, + Time: big.NewInt(25880526), + ExtraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, + }, + upkeepId: upkeepId, }, expectedValues: [][]byte{}, reason: encoding.UpkeepFailureReasonInvalidRevertDataInput, @@ -494,12 +461,14 @@ func TestEvmRegistry_DoMercuryRequest(t *testing.T) { { name: "failure - invalid revert data", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{}, - timeParamKey: blockNumber, - time: big.NewInt(25880526), - extraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{}, + TimeParamKey: blockNumber, + Time: big.NewInt(25880526), + ExtraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, + }, + upkeepId: upkeepId, }, expectedValues: [][]byte{}, reason: encoding.UpkeepFailureReasonInvalidRevertDataInput, @@ -557,11 +526,13 @@ func TestEvmRegistry_SingleFeedRequest(t *testing.T) { name: "success - mercury responds in the first try", index: 0, lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, blob: "0xab2123dc00000012", }, @@ -569,11 +540,13 @@ func TestEvmRegistry_SingleFeedRequest(t *testing.T) { name: "success - retry for 404", index: 0, lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, blob: "0xab2123dcbabbad", retryNumber: 1, @@ -584,11 +557,13 @@ func TestEvmRegistry_SingleFeedRequest(t *testing.T) { name: "success - retry for 500", index: 0, lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, blob: "0xab2123dcbbabad", retryNumber: 2, @@ -599,11 +574,13 @@ func TestEvmRegistry_SingleFeedRequest(t *testing.T) { name: "failure - returns retryable", index: 0, lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, blob: "0xab2123dc", retryNumber: totalAttempt, @@ -615,11 +592,13 @@ func TestEvmRegistry_SingleFeedRequest(t *testing.T) { name: "failure - returns retryable and then non-retryable", index: 0, lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, blob: "0xab2123dc", retryNumber: 1, @@ -631,11 +610,13 @@ func TestEvmRegistry_SingleFeedRequest(t *testing.T) { name: "failure - returns not retryable", index: 0, lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, blob: "0xab2123dc", statusCode: http.StatusBadGateway, @@ -722,11 +703,13 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { { name: "success - mercury responds in the first try", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: timestamp, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: timestamp, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, response: &MercuryV03Response{ Reports: []MercuryV03Report{ @@ -749,11 +732,13 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { { name: "success - retry for 500", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: timestamp, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: timestamp, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, retryNumber: 2, statusCode: http.StatusInternalServerError, @@ -778,11 +763,13 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { { name: "failure - fail to decode reportBlob", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: timestamp, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: timestamp, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, response: &MercuryV03Response{ Reports: []MercuryV03Report{ @@ -807,11 +794,13 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { { name: "failure - returns retryable", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: timestamp, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: timestamp, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, retryNumber: totalAttempt, statusCode: http.StatusInternalServerError, @@ -821,11 +810,13 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { { name: "failure - returns retryable and then non-retryable", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: timestamp, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: timestamp, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, retryNumber: 1, statusCode: http.StatusInternalServerError, @@ -835,11 +826,13 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { { name: "failure - returns status code 420 not retryable", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: timestamp, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: timestamp, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, statusCode: 420, errorMessage: "All attempts fail:\n#1: at timestamp 123456 upkeep 123456789 received status code 420 from mercury v0.3, most likely this is caused by missing/malformed query args, missing or bad required headers, non-existent feeds, or no permissions for feeds", @@ -847,11 +840,13 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { { name: "failure - returns status code 502 not retryable", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: timestamp, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: timestamp, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, statusCode: http.StatusBadGateway, errorMessage: "All attempts fail:\n#1: at timestamp 123456 upkeep 123456789 received status code 502 from mercury v0.3", @@ -859,11 +854,13 @@ func TestEvmRegistry_MultiFeedRequest(t *testing.T) { { name: "success - retry when reports length does not match feeds length", lookup: &StreamsLookup{ - feedParamKey: feedIDs, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: timestamp, - time: big.NewInt(123456), - upkeepId: upkeepId, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIDs, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: timestamp, + Time: big.NewInt(123456), + }, + upkeepId: upkeepId, }, firstResponse: &MercuryV03Response{ Reports: []MercuryV03Report{ @@ -992,13 +989,15 @@ func TestEvmRegistry_CheckCallback(t *testing.T) { { name: "success - empty extra data", lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"ETD-USD", "BTC-ETH"}, - timeParamKey: blockNumber, - time: big.NewInt(100), - extraData: []byte{48, 120, 48, 48}, - upkeepId: upkeepId, - block: bn, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"ETD-USD", "BTC-ETH"}, + TimeParamKey: blockNumber, + Time: big.NewInt(100), + ExtraData: []byte{48, 120, 48, 48}, + }, + upkeepId: upkeepId, + block: bn, }, values: values, statusCode: http.StatusOK, @@ -1010,14 +1009,16 @@ func TestEvmRegistry_CheckCallback(t *testing.T) { { name: "success - with extra data", lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, - timeParamKey: blockNumber, - time: big.NewInt(18952430), - // this is the address of precompile contract ArbSys(0x0000000000000000000000000000000000000064) - extraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, - upkeepId: upkeepId, - block: bn, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"0x4554482d5553442d415242495452554d2d544553544e45540000000000000000", "0x4254432d5553442d415242495452554d2d544553544e45540000000000000000"}, + TimeParamKey: blockNumber, + Time: big.NewInt(18952430), + // this is the address of precompile contract ArbSys(0x0000000000000000000000000000000000000064) + ExtraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100}, + }, + upkeepId: upkeepId, + block: bn, }, values: values, statusCode: http.StatusOK, @@ -1029,13 +1030,15 @@ func TestEvmRegistry_CheckCallback(t *testing.T) { { name: "failure - bad response", lookup: &StreamsLookup{ - feedParamKey: feedIdHex, - feeds: []string{"ETD-USD", "BTC-ETH"}, - timeParamKey: blockNumber, - time: big.NewInt(100), - extraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 48, 120, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - upkeepId: upkeepId, - block: bn, + StreamsLookupError: &encoding.StreamsLookupError{ + FeedParamKey: feedIdHex, + Feeds: []string{"ETD-USD", "BTC-ETH"}, + TimeParamKey: blockNumber, + Time: big.NewInt(100), + ExtraData: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 48, 120, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + }, + upkeepId: upkeepId, + block: bn, }, values: values, statusCode: http.StatusOK, @@ -1051,7 +1054,7 @@ func TestEvmRegistry_CheckCallback(t *testing.T) { t.Run(tt.name, func(t *testing.T) { client := new(evmClientMocks.Client) r := setupEVMRegistry(t) - payload, err := r.abi.Pack("checkCallback", tt.lookup.upkeepId, values, tt.lookup.extraData) + payload, err := r.abi.Pack("checkCallback", tt.lookup.upkeepId, values, tt.lookup.ExtraData) require.Nil(t, err) args := map[string]interface{}{ "to": r.addr.Hex(), From a35a7e13297456d4e3aa7470591c7578b5c0aa54 Mon Sep 17 00:00:00 2001 From: Justin Kaseman Date: Wed, 4 Oct 2023 14:01:19 -0400 Subject: [PATCH 54/84] (test): Add Functions Gas tests (#10657) --- .../gas-snapshots/functions.gas-snapshot | 36 +- .../tests/v1_0_0/FunctionsBilling.t.sol | 199 +++++++++++ .../tests/v1_0_0/FunctionsClient.t.sol | 36 +- .../tests/v1_0_0/FunctionsCoordinator.t.sol | 255 +------------- .../tests/v1_0_0/FunctionsRequest.t.sol | 37 +- .../tests/v1_0_0/FunctionsRouter.t.sol | 4 +- .../src/v0.8/functions/tests/v1_0_0/Gas.t.sol | 319 ++++++++++++++++++ .../v0.8/functions/tests/v1_0_0/OCR2.t.sol | 56 +++ .../v0.8/functions/tests/v1_0_0/Setup.t.sol | 39 ++- .../testhelpers/FunctionsClientTestHelper.sol | 25 +- .../FunctionsClientUpgradeHelper.sol | 9 + 11 files changed, 734 insertions(+), 281 deletions(-) create mode 100644 contracts/src/v0.8/functions/tests/v1_0_0/FunctionsBilling.t.sol create mode 100644 contracts/src/v0.8/functions/tests/v1_0_0/Gas.t.sol diff --git a/contracts/gas-snapshots/functions.gas-snapshot b/contracts/gas-snapshots/functions.gas-snapshot index 0664a2eb997..0c3caa6522e 100644 --- a/contracts/gas-snapshots/functions.gas-snapshot +++ b/contracts/gas-snapshots/functions.gas-snapshot @@ -1,7 +1,12 @@ FunctionsBilling_EstimateCost:test_EstimateCost_RevertsIfGasPriceAboveCeiling() (gas: 32391) FunctionsBilling_EstimateCost:test_EstimateCost_Success() (gas: 53002) +FunctionsBilling_GetConfig:test_GetConfig_Success() (gas: 23088) FunctionsBilling_OracleWithdrawAll:test_OracleWithdrawAll_RevertIfNotOwner() (gas: 13274) FunctionsBilling_OracleWithdrawAll:test_OracleWithdrawAll_SuccessPaysTransmittersWithBalance() (gas: 146635) +FunctionsClient_FulfillRequest:test_FulfillRequest_MaximumGas() (gas: 499079) +FunctionsClient_FulfillRequest:test_FulfillRequest_MinimumGas() (gas: 200226) +FunctionsClient__SendRequest:test__SendRequest_RevertIfInvalidCallbackGasLimit() (gas: 54991) +FunctionsCoordinator_Constructor:test_Constructor_Success() (gas: 11956) FunctionsOracle_sendRequest:testEmptyRequestDataReverts() (gas: 13452) FunctionsOracle_setDONPublicKey:testEmptyPublicKeyReverts() (gas: 10974) FunctionsOracle_setDONPublicKey:testOnlyOwnerReverts() (gas: 11255) @@ -12,6 +17,9 @@ FunctionsOracle_setRegistry:testOnlyOwnerReverts() (gas: 10927) FunctionsOracle_setRegistry:testSetRegistrySuccess() (gas: 35791) FunctionsOracle_setRegistry:testSetRegistry_gas() (gas: 31987) FunctionsOracle_typeAndVersion:testTypeAndVersionSuccess() (gas: 6905) +FunctionsRequest_DEFAULT_BUFFER_SIZE:test_DEFAULT_BUFFER_SIZE() (gas: 246) +FunctionsRequest_EncodeCBOR:test_EncodeCBOR_Success() (gas: 223) +FunctionsRequest_REQUEST_DATA_VERSION:test_REQUEST_DATA_VERSION() (gas: 225) FunctionsRouter_Constructor:test_Constructor_Success() (gas: 12073) FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedCostExceedsCommitment() (gas: 172948) FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInsufficientGas() (gas: 163234) @@ -21,9 +29,9 @@ FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedSubscriptionBalanceInvar FunctionsRouter_Fulfill:test_Fulfill_RevertIfNotCommittedCoordinator() (gas: 28063) FunctionsRouter_Fulfill:test_Fulfill_RevertIfPaused() (gas: 156949) FunctionsRouter_Fulfill:test_Fulfill_SuccessClientNoLongerExists() (gas: 297578) -FunctionsRouter_Fulfill:test_Fulfill_SuccessFulfilled() (gas: 311147) -FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackReverts() (gas: 2076842) -FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackRunsOutOfGas() (gas: 515646) +FunctionsRouter_Fulfill:test_Fulfill_SuccessFulfilled() (gas: 311169) +FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackReverts() (gas: 2485366) +FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackRunsOutOfGas() (gas: 515855) FunctionsRouter_GetAdminFee:test_GetAdminFee_Success() (gas: 18005) FunctionsRouter_GetAllowListId:test_GetAllowListId_Success() (gas: 12926) FunctionsRouter_GetConfig:test_GetConfig_Success() (gas: 37136) @@ -86,10 +94,10 @@ FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNoSubs FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNotAllowedSender() (gas: 57929) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNotSubscriptionOwner() (gas: 89316) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfPaused() (gas: 20191) -FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfPendingRequests() (gas: 193277) +FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfPendingRequests() (gas: 193222) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessForfeitAllBalanceAsDeposit() (gas: 113352) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessForfeitSomeBalanceAsDeposit() (gas: 124604) -FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessRecieveDeposit() (gas: 310123) +FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessRecieveDeposit() (gas: 310090) FunctionsSubscriptions_Constructor:test_Constructor_Success() (gas: 7654) FunctionsSubscriptions_CreateSubscriptionWithConsumer:test_CreateSubscriptionWithConsumer_RevertIfNotAllowedSender() (gas: 28637) FunctionsSubscriptions_CreateSubscriptionWithConsumer:test_CreateSubscriptionWithConsumer_RevertIfPaused() (gas: 17948) @@ -118,7 +126,7 @@ FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_Reve FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_Success() (gas: 54867) FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessDeletesSubscription() (gas: 48362) FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessSubOwnerRefunded() (gas: 50896) -FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessWhenRequestInFlight() (gas: 163911) +FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessWhenRequestInFlight() (gas: 163867) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfAmountMoreThanBalance() (gas: 17924) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfBalanceInvariant() (gas: 165) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfNotOwner() (gas: 15555) @@ -126,7 +134,7 @@ FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_SuccessIfNoAmount() (gas FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_SuccessPaysRecipient() (gas: 54435) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_SuccessSetsBalanceToZero() (gas: 37790) FunctionsSubscriptions_PendingRequestExists:test_PendingRequestExists_SuccessFalseIfNoPendingRequests() (gas: 15025) -FunctionsSubscriptions_PendingRequestExists:test_PendingRequestExists_SuccessTrueIfPendingRequests() (gas: 175411) +FunctionsSubscriptions_PendingRequestExists:test_PendingRequestExists_SuccessTrueIfPendingRequests() (gas: 175356) FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfEmptyNewOwner() (gas: 27610) FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfInvalidNewOwner() (gas: 57707) FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfNoSubscription() (gas: 15000) @@ -141,7 +149,7 @@ FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfNoSubscription FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfNotAllowedSender() (gas: 57778) FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfNotSubscriptionOwner() (gas: 87186) FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfPaused() (gas: 18004) -FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfPendingRequests() (gas: 190709) +FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfPendingRequests() (gas: 190654) FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_Success() (gas: 41979) FunctionsSubscriptions_SetFlags:test_SetFlags_RevertIfNoSubscription() (gas: 12847) FunctionsSubscriptions_SetFlags:test_SetFlags_RevertIfNotOwner() (gas: 15640) @@ -156,9 +164,9 @@ FunctionsSubscriptions_createSubscription:test_CreateSubscription_Success() (gas FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfAcceptorIsNotSender() (gas: 25837) FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfBlockedSender() (gas: 44348) FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfInvalidSigner() (gas: 23597) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfRecipientContractIsNotSender() (gas: 1458254) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfRecipientContractIsNotSender() (gas: 1866530) FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfRecipientIsNotSender() (gas: 26003) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_SuccessIfAcceptingForContract() (gas: 1538373) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_SuccessIfAcceptingForContract() (gas: 1946649) FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_SuccessIfAcceptingForSelf() (gas: 94684) FunctionsTermsOfServiceAllowList_BlockSender:test_BlockSender_RevertIfNotOwner() (gas: 15469) FunctionsTermsOfServiceAllowList_BlockSender:test_BlockSender_Success() (gas: 50421) @@ -173,4 +181,10 @@ FunctionsTermsOfServiceAllowList_IsBlockedSender:test_IsBlockedSender_SuccessTru FunctionsTermsOfServiceAllowList_UnblockSender:test_UnblockSender_RevertIfNotOwner() (gas: 13525) FunctionsTermsOfServiceAllowList_UnblockSender:test_UnblockSender_Success() (gas: 95184) FunctionsTermsOfServiceAllowList_UpdateConfig:test_UpdateConfig_RevertIfNotOwner() (gas: 13727) -FunctionsTermsOfServiceAllowList_UpdateConfig:test_UpdateConfig_Success() (gas: 22073) \ No newline at end of file +FunctionsTermsOfServiceAllowList_UpdateConfig:test_UpdateConfig_Success() (gas: 22073) +Gas_AcceptTermsOfService:test_AcceptTermsOfService_Gas() (gas: 84675) +Gas_AddConsumer:test_AddConsumer_Gas() (gas: 79067) +Gas_CreateSubscription:test_CreateSubscription_Gas() (gas: 73353) +Gas_FundSubscription:test_FundSubscription_Gas() (gas: 38501) +Gas_SendRequest:test_SendRequest_MaximumGas() (gas: 958006) +Gas_SendRequest:test_SendRequest_MinimumGas() (gas: 156382) \ No newline at end of file diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsBilling.t.sol b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsBilling.t.sol new file mode 100644 index 00000000000..a6fb5c2702f --- /dev/null +++ b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsBilling.t.sol @@ -0,0 +1,199 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import {FunctionsCoordinator} from "../../dev/v1_0_0/FunctionsCoordinator.sol"; +import {FunctionsBilling} from "../../dev/v1_0_0/FunctionsBilling.sol"; +import {FunctionsRequest} from "../../dev/v1_0_0/libraries/FunctionsRequest.sol"; + +import {FunctionsRouterSetup, FunctionsSubscriptionSetup, FunctionsMultipleFulfillmentsSetup} from "./Setup.t.sol"; + +/// @notice #constructor +contract FunctionsBilling_Constructor { + +} + +/// @notice #getConfig +contract FunctionsBilling_GetConfig is FunctionsRouterSetup { + function test_GetConfig_Success() public { + // Send as stranger + vm.stopPrank(); + vm.startPrank(STRANGER_ADDRESS); + + FunctionsBilling.Config memory config = s_functionsCoordinator.getConfig(); + assertEq(config.feedStalenessSeconds, getCoordinatorConfig().feedStalenessSeconds); + assertEq(config.gasOverheadBeforeCallback, getCoordinatorConfig().gasOverheadBeforeCallback); + assertEq(config.gasOverheadAfterCallback, getCoordinatorConfig().gasOverheadAfterCallback); + assertEq(config.requestTimeoutSeconds, getCoordinatorConfig().requestTimeoutSeconds); + assertEq(config.donFee, getCoordinatorConfig().donFee); + assertEq(config.maxSupportedRequestDataVersion, getCoordinatorConfig().maxSupportedRequestDataVersion); + assertEq(config.fulfillmentGasPriceOverEstimationBP, getCoordinatorConfig().fulfillmentGasPriceOverEstimationBP); + assertEq(config.fallbackNativePerUnitLink, getCoordinatorConfig().fallbackNativePerUnitLink); + } +} + +/// @notice #updateConfig +contract FunctionsBilling_UpdateConfig { + +} + +/// @notice #getDONFee +contract FunctionsBilling_GetDONFee { + +} + +/// @notice #getAdminFee +contract FunctionsBilling_GetAdminFee { + +} + +/// @notice #getWeiPerUnitLink +contract FunctionsBilling_GetWeiPerUnitLink { + +} + +/// @notice #_getJuelsPerGas +contract FunctionsBilling__GetJuelsPerGas { + // TODO: make contract internal function helper +} + +/// @notice #estimateCost +contract FunctionsBilling_EstimateCost is FunctionsSubscriptionSetup { + function setUp() public virtual override { + FunctionsSubscriptionSetup.setUp(); + + // Get cost estimate as stranger + vm.stopPrank(); + vm.startPrank(STRANGER_ADDRESS); + } + + uint256 private constant REASONABLE_GAS_PRICE_CEILING = 1_000_000_000_000_000; // 1 million gwei + + function test_EstimateCost_RevertsIfGasPriceAboveCeiling() public { + // Build minimal valid request data + string memory sourceCode = "return 'hello world';"; + FunctionsRequest.Request memory request; + FunctionsRequest.initializeRequest( + request, + FunctionsRequest.Location.Inline, + FunctionsRequest.CodeLanguage.JavaScript, + sourceCode + ); + bytes memory requestData = FunctionsRequest.encodeCBOR(request); + + uint32 callbackGasLimit = 5_500; + uint256 gasPriceWei = REASONABLE_GAS_PRICE_CEILING + 1; + + vm.expectRevert(FunctionsBilling.InvalidCalldata.selector); + + s_functionsCoordinator.estimateCost(s_subscriptionId, requestData, callbackGasLimit, gasPriceWei); + } + + function test_EstimateCost_Success() public { + // Build minimal valid request data + string memory sourceCode = "return 'hello world';"; + FunctionsRequest.Request memory request; + FunctionsRequest.initializeRequest( + request, + FunctionsRequest.Location.Inline, + FunctionsRequest.CodeLanguage.JavaScript, + sourceCode + ); + bytes memory requestData = FunctionsRequest.encodeCBOR(request); + + uint32 callbackGasLimit = 5_500; + uint256 gasPriceWei = 1; + + uint96 costEstimate = s_functionsCoordinator.estimateCost( + s_subscriptionId, + requestData, + callbackGasLimit, + gasPriceWei + ); + uint96 expectedCostEstimate = 10873200; + assertEq(costEstimate, expectedCostEstimate); + } +} + +/// @notice #_calculateCostEstimate +contract FunctionsBilling__CalculateCostEstimate { + // TODO: make contract internal function helper +} + +/// @notice #_startBilling +contract FunctionsBilling__StartBilling { + // TODO: make contract internal function helper +} + +/// @notice #_computeRequestId +contract FunctionsBilling__ComputeRequestId { + // TODO: make contract internal function helper +} + +/// @notice #_fulfillAndBill +contract FunctionsBilling__FulfillAndBill { + // TODO: make contract internal function helper +} + +/// @notice #deleteCommitment +contract FunctionsBilling_DeleteCommitment { + +} + +/// @notice #oracleWithdraw +contract FunctionsBilling_OracleWithdraw { + +} + +/// @notice #oracleWithdrawAll +contract FunctionsBilling_OracleWithdrawAll is FunctionsMultipleFulfillmentsSetup { + function setUp() public virtual override { + // Use no DON fee so that a transmitter has a balance of 0 + s_donFee = 0; + + FunctionsMultipleFulfillmentsSetup.setUp(); + } + + function test_OracleWithdrawAll_RevertIfNotOwner() public { + // Send as stranger + vm.stopPrank(); + vm.startPrank(STRANGER_ADDRESS); + + vm.expectRevert("Only callable by owner"); + s_functionsCoordinator.oracleWithdrawAll(); + } + + function test_OracleWithdrawAll_SuccessPaysTransmittersWithBalance() public { + uint256 transmitter1BalanceBefore = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_1); + assertEq(transmitter1BalanceBefore, 0); + uint256 transmitter2BalanceBefore = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_2); + assertEq(transmitter2BalanceBefore, 0); + uint256 transmitter3BalanceBefore = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_3); + assertEq(transmitter3BalanceBefore, 0); + uint256 transmitter4BalanceBefore = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_4); + assertEq(transmitter4BalanceBefore, 0); + + s_functionsCoordinator.oracleWithdrawAll(); + + uint96 expectedTransmitterBalance = s_fulfillmentCoordinatorBalance / 3; + + uint256 transmitter1BalanceAfter = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_1); + assertEq(transmitter1BalanceAfter, expectedTransmitterBalance); + uint256 transmitter2BalanceAfter = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_2); + assertEq(transmitter2BalanceAfter, expectedTransmitterBalance); + uint256 transmitter3BalanceAfter = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_3); + assertEq(transmitter3BalanceAfter, expectedTransmitterBalance); + // Transmitter 4 has no balance + uint256 transmitter4BalanceAfter = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_4); + assertEq(transmitter4BalanceAfter, 0); + } +} + +/// @notice #_getTransmitters +contract FunctionsBilling__GetTransmitters { + // TODO: make contract internal function helper +} + +/// @notice #_disperseFeePool +contract FunctionsBilling__DisperseFeePool { + // TODO: make contract internal function helper +} diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsClient.t.sol b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsClient.t.sol index b2740b7e297..10177d8ed7f 100644 --- a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsClient.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsClient.t.sol @@ -1,14 +1,46 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; +import {BaseTest} from "./BaseTest.t.sol"; +import {FunctionsRouter} from "../../dev/v1_0_0/FunctionsRouter.sol"; +import {FunctionsSubscriptions} from "../../dev/v1_0_0/FunctionsSubscriptions.sol"; +import {FunctionsRequest} from "../../dev/v1_0_0/libraries/FunctionsRequest.sol"; +import {FunctionsResponse} from "../../dev/v1_0_0/libraries/FunctionsResponse.sol"; + +import {FunctionsSubscriptionSetup} from "./Setup.t.sol"; + /// @notice #constructor contract FunctionsClient_Constructor { } /// @notice #_sendRequest -contract FunctionsClient__SendRequest { - +contract FunctionsClient__SendRequest is FunctionsSubscriptionSetup { + // TODO: make contract internal function helper + + function test__SendRequest_RevertIfInvalidCallbackGasLimit() public { + // Build minimal valid request data + string memory sourceCode = "return 'hello world';"; + FunctionsRequest.Request memory request; + FunctionsRequest.initializeRequest( + request, + FunctionsRequest.Location.Inline, + FunctionsRequest.CodeLanguage.JavaScript, + sourceCode + ); + bytes memory requestData = FunctionsRequest.encodeCBOR(request); + + uint8 MAX_CALLBACK_GAS_LIMIT_FLAGS_INDEX = 0; + bytes32 subscriptionFlags = s_functionsRouter.getFlags(s_subscriptionId); + uint8 callbackGasLimitsIndexSelector = uint8(subscriptionFlags[MAX_CALLBACK_GAS_LIMIT_FLAGS_INDEX]); + + FunctionsRouter.Config memory config = s_functionsRouter.getConfig(); + uint32[] memory _maxCallbackGasLimits = config.maxCallbackGasLimits; + uint32 maxCallbackGasLimit = _maxCallbackGasLimits[callbackGasLimitsIndexSelector]; + + vm.expectRevert(abi.encodeWithSelector(FunctionsRouter.GasLimitTooBig.selector, maxCallbackGasLimit)); + s_functionsClient.sendRequestBytes(requestData, s_subscriptionId, 500_000, s_donId); + } } /// @notice #fulfillRequest diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsCoordinator.t.sol b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsCoordinator.t.sol index 088de631d06..174397ca8b5 100644 --- a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsCoordinator.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsCoordinator.t.sol @@ -4,16 +4,16 @@ pragma solidity ^0.8.19; import {FunctionsCoordinator} from "../../dev/v1_0_0/FunctionsCoordinator.sol"; import {FunctionsBilling} from "../../dev/v1_0_0/FunctionsBilling.sol"; import {FunctionsRequest} from "../../dev/v1_0_0/libraries/FunctionsRequest.sol"; +import {FunctionsRouter} from "../../dev/v1_0_0/FunctionsRouter.sol"; -import {FunctionsSubscriptionSetup, FunctionsMultipleFulfillmentsSetup} from "./Setup.t.sol"; - -// ================================================================ -// | Functions Coordinator | -// ================================================================ +import {FunctionsRouterSetup} from "./Setup.t.sol"; /// @notice #constructor -contract FunctionsCoordinator_Constructor { - +contract FunctionsCoordinator_Constructor is FunctionsRouterSetup { + function test_Constructor_Success() public { + assertEq(s_functionsCoordinator.typeAndVersion(), "Functions Coordinator v1.0.0"); + assertEq(s_functionsCoordinator.owner(), OWNER_ADDRESS); + } } /// @notice #getThresholdPublicKey @@ -38,7 +38,7 @@ contract FunctionsCoordinator__SetDONPublicKey { /// @notice #_isTransmitter contract FunctionsCoordinator_IsTransmitter { - + // TODO: make contract internal function helper } /// @notice #setNodePublicKey @@ -63,12 +63,12 @@ contract FunctionsCoordinator_StartRequest { /// @notice #_beforeSetConfig contract FunctionsCoordinator__BeforeSetConfig { - + // TODO: make contract internal function helper } /// @notice #_getTransmitters contract FunctionsCoordinator__GetTransmitters { - + // TODO: make contract internal function helper } /// @notice #_report @@ -80,238 +80,3 @@ contract FunctionsCoordinator__Report { contract FunctionsCoordinator__OnlyOwner { } - -// ================================================================ -// | Functions Billing | -// ================================================================ - -/// @notice #constructor -contract FunctionsBilling_Constructor { - -} - -/// @notice #getConfig -contract FunctionsBilling_GetConfig { - -} - -/// @notice #updateConfig -contract FunctionsBilling_UpdateConfig { - -} - -/// @notice #getDONFee -contract FunctionsBilling_GetDONFee { - -} - -/// @notice #getAdminFee -contract FunctionsBilling_GetAdminFee { - -} - -/// @notice #getWeiPerUnitLink -contract FunctionsBilling_GetWeiPerUnitLink { - -} - -/// @notice #_getJuelsPerGas -contract FunctionsBilling__GetJuelsPerGas { - -} - -/// @notice #estimateCost -contract FunctionsBilling_EstimateCost is FunctionsSubscriptionSetup { - function setUp() public virtual override { - FunctionsSubscriptionSetup.setUp(); - - // Get cost estimate as stranger - vm.stopPrank(); - vm.startPrank(STRANGER_ADDRESS); - } - - uint256 private constant REASONABLE_GAS_PRICE_CEILING = 1_000_000_000_000_000; // 1 million gwei - - function test_EstimateCost_RevertsIfGasPriceAboveCeiling() public { - // Build minimal valid request data - string memory sourceCode = "return 'hello world';"; - FunctionsRequest.Request memory request; - FunctionsRequest.initializeRequest( - request, - FunctionsRequest.Location.Inline, - FunctionsRequest.CodeLanguage.JavaScript, - sourceCode - ); - bytes memory requestData = FunctionsRequest.encodeCBOR(request); - - uint32 callbackGasLimit = 5_500; - uint256 gasPriceWei = REASONABLE_GAS_PRICE_CEILING + 1; - - vm.expectRevert(FunctionsBilling.InvalidCalldata.selector); - - s_functionsCoordinator.estimateCost(s_subscriptionId, requestData, callbackGasLimit, gasPriceWei); - } - - function test_EstimateCost_Success() public { - // Build minimal valid request data - string memory sourceCode = "return 'hello world';"; - FunctionsRequest.Request memory request; - FunctionsRequest.initializeRequest( - request, - FunctionsRequest.Location.Inline, - FunctionsRequest.CodeLanguage.JavaScript, - sourceCode - ); - bytes memory requestData = FunctionsRequest.encodeCBOR(request); - - uint32 callbackGasLimit = 5_500; - uint256 gasPriceWei = 1; - - uint96 costEstimate = s_functionsCoordinator.estimateCost( - s_subscriptionId, - requestData, - callbackGasLimit, - gasPriceWei - ); - uint96 expectedCostEstimate = 10873200; - assertEq(costEstimate, expectedCostEstimate); - } -} - -/// @notice #_calculateCostEstimate -contract FunctionsBilling__CalculateCostEstimate { - -} - -/// @notice #_startBilling -contract FunctionsBilling__StartBilling { - -} - -/// @notice #_computeRequestId -contract FunctionsBilling__ComputeRequestId { - -} - -/// @notice #_fulfillAndBill -contract FunctionsBilling__FulfillAndBill { - -} - -/// @notice #deleteCommitment -contract FunctionsBilling_DeleteCommitment { - -} - -/// @notice #oracleWithdraw -contract FunctionsBilling_OracleWithdraw { - -} - -/// @notice #oracleWithdrawAll -contract FunctionsBilling_OracleWithdrawAll is FunctionsMultipleFulfillmentsSetup { - function setUp() public virtual override { - // Use no DON fee so that a transmitter has a balance of 0 - s_donFee = 0; - - FunctionsMultipleFulfillmentsSetup.setUp(); - } - - function test_OracleWithdrawAll_RevertIfNotOwner() public { - // Send as stranger - vm.stopPrank(); - vm.startPrank(STRANGER_ADDRESS); - - vm.expectRevert("Only callable by owner"); - s_functionsCoordinator.oracleWithdrawAll(); - } - - function test_OracleWithdrawAll_SuccessPaysTransmittersWithBalance() public { - uint256 transmitter1BalanceBefore = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_1); - assertEq(transmitter1BalanceBefore, 0); - uint256 transmitter2BalanceBefore = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_2); - assertEq(transmitter2BalanceBefore, 0); - uint256 transmitter3BalanceBefore = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_3); - assertEq(transmitter3BalanceBefore, 0); - uint256 transmitter4BalanceBefore = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_4); - assertEq(transmitter4BalanceBefore, 0); - - s_functionsCoordinator.oracleWithdrawAll(); - - uint96 expectedTransmitterBalance = s_fulfillmentCoordinatorBalance / 3; - - uint256 transmitter1BalanceAfter = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_1); - assertEq(transmitter1BalanceAfter, expectedTransmitterBalance); - uint256 transmitter2BalanceAfter = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_2); - assertEq(transmitter2BalanceAfter, expectedTransmitterBalance); - uint256 transmitter3BalanceAfter = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_3); - assertEq(transmitter3BalanceAfter, expectedTransmitterBalance); - // Transmitter 4 has no balance - uint256 transmitter4BalanceAfter = s_linkToken.balanceOf(NOP_TRANSMITTER_ADDRESS_4); - assertEq(transmitter4BalanceAfter, 0); - } -} - -/// @notice #_getTransmitters -contract FunctionsBilling__GetTransmitters { - -} - -/// @notice #_disperseFeePool -contract FunctionsBilling__DisperseFeePool { - -} - -// ================================================================ -// | OCR2Base | -// ================================================================ - -/// @notice #constructor -contract OCR2Base_Constructor { - -} - -/// @notice #checkConfigValid -contract OCR2Base_CheckConfigValid { - -} - -/// @notice #latestConfigDigestAndEpoch -contract OCR2Base_LatestConfigDigestAndEpoch { - -} - -/// @notice #setConfig -contract OCR2Base_SetConfig { - -} - -/// @notice #configDigestFromConfigData -contract OCR2Base_ConfigDigestFromConfigData { - -} - -/// @notice #latestConfigDetails -contract OCR2Base_LatestConfigDetails { - -} - -/// @notice #transmitters -contract OCR2Base_Transmitters { - -} - -/// @notice #_report -contract OCR2Base__Report { - -} - -/// @notice #requireExpectedMsgDataLength -contract OCR2Base_RequireExpectedMsgDataLength { - -} - -/// @notice #transmit -contract OCR2Base_Transmit { - -} diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsRequest.t.sol b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsRequest.t.sol index a274bbe8cfc..c14bdca5ecb 100644 --- a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsRequest.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsRequest.t.sol @@ -1,47 +1,60 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -/// @notice #REQUEST_DATA_VERSION -contract FunctionsRequest_REQUEST_DATA_VERSION { +import {FunctionsRequest} from "../../dev/v1_0_0/libraries/FunctionsRequest.sol"; + +import {Test} from "forge-std/Test.sol"; +/// @notice #REQUEST_DATA_VERSION +contract FunctionsRequest_REQUEST_DATA_VERSION is Test { + function test_REQUEST_DATA_VERSION() public { + // Exposes REQUEST_DATA_VERSION + assertEq(FunctionsRequest.REQUEST_DATA_VERSION, 1); + } } /// @notice #DEFAULT_BUFFER_SIZE -contract FunctionsRequest_DEFAULT_BUFFER_SIZE { - +contract FunctionsRequest_DEFAULT_BUFFER_SIZE is Test { + function test_DEFAULT_BUFFER_SIZE() public { + // Exposes DEFAULT_BUFFER_SIZE + assertEq(FunctionsRequest.DEFAULT_BUFFER_SIZE, 256); + } } /// @notice #encodeCBOR -contract FunctionsRequest_EncodeCBOR { - +contract FunctionsRequest_EncodeCBOR is Test { + function test_EncodeCBOR_Success() public { + // Exposes DEFAULT_BUFFER_SIZE + assertEq(FunctionsRequest.DEFAULT_BUFFER_SIZE, 256); + } } /// @notice #initializeRequest -contract FunctionsRequest_InitializeRequest { +contract FunctionsRequest_InitializeRequest is Test { } /// @notice #initializeRequestForInlineJavaScript -contract FunctionsRequest_InitializeRequestForInlineJavaScript { +contract FunctionsRequest_InitializeRequestForInlineJavaScript is Test { } /// @notice #addSecretsReference -contract FunctionsRequest_AddSecretsReference { +contract FunctionsRequest_AddSecretsReference is Test { } /// @notice #addDONHostedSecrets -contract FunctionsRequest_AddDONHostedSecrets { +contract FunctionsRequest_AddDONHostedSecrets is Test { } /// @notice #setArgs -contract FunctionsRequest_SetArgs { +contract FunctionsRequest_SetArgs is Test { } /// @notice #setBytesArgs -contract FunctionsRequest_SetBytesArgs { +contract FunctionsRequest_SetBytesArgs is Test { } diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsRouter.t.sol b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsRouter.t.sol index 1a858c28df6..6c07158377c 100644 --- a/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsRouter.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_0_0/FunctionsRouter.t.sol @@ -1127,7 +1127,7 @@ contract FunctionsRouter_Fulfill is FunctionsClientRequestSetup { emit RequestProcessed({ requestId: requestId, subscriptionId: s_subscriptionId, - totalCostJuels: _getExpectedCost(1379), // gasUsed is manually taken + totalCostJuels: _getExpectedCost(1822), // gasUsed is manually taken transmitter: NOP_TRANSMITTER_ADDRESS_1, resultCode: FunctionsResponse.FulfillResult.USER_CALLBACK_ERROR, response: bytes(response), @@ -1237,7 +1237,7 @@ contract FunctionsRouter_Fulfill is FunctionsClientRequestSetup { emit RequestProcessed({ requestId: s_requests[requestToFulfill].requestId, subscriptionId: s_subscriptionId, - totalCostJuels: _getExpectedCost(5371), // gasUsed is manually taken + totalCostJuels: _getExpectedCost(5393), // gasUsed is manually taken transmitter: NOP_TRANSMITTER_ADDRESS_1, resultCode: FunctionsResponse.FulfillResult.FULFILLED, response: bytes(response), diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/Gas.t.sol b/contracts/src/v0.8/functions/tests/v1_0_0/Gas.t.sol new file mode 100644 index 00000000000..f28a8e6defe --- /dev/null +++ b/contracts/src/v0.8/functions/tests/v1_0_0/Gas.t.sol @@ -0,0 +1,319 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import {BaseTest} from "./BaseTest.t.sol"; +import {FunctionsRouter} from "../../dev/v1_0_0/FunctionsRouter.sol"; +import {FunctionsSubscriptions} from "../../dev/v1_0_0/FunctionsSubscriptions.sol"; +import {FunctionsRequest} from "../../dev/v1_0_0/libraries/FunctionsRequest.sol"; +import {FunctionsResponse} from "../../dev/v1_0_0/libraries/FunctionsResponse.sol"; +import {FunctionsClientTestHelper} from "./testhelpers/FunctionsClientTestHelper.sol"; + +import {FunctionsRoutesSetup, FunctionsOwnerAcceptTermsOfServiceSetup, FunctionsSubscriptionSetup, FunctionsClientRequestSetup} from "./Setup.t.sol"; + +import "forge-std/Vm.sol"; + +/// @notice #acceptTermsOfService +contract Gas_AcceptTermsOfService is FunctionsRoutesSetup { + bytes32 s_sigR; + bytes32 s_sigS; + uint8 s_sigV; + + function setUp() public virtual override { + vm.pauseGasMetering(); + + FunctionsRoutesSetup.setUp(); + + bytes32 message = s_termsOfServiceAllowList.getMessage(OWNER_ADDRESS, OWNER_ADDRESS); + bytes32 prefixedMessage = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", message)); + (s_sigV, s_sigR, s_sigS) = vm.sign(TOS_SIGNER_PRIVATE_KEY, prefixedMessage); + } + + function test_AcceptTermsOfService_Gas() public { + // Pull storage variables into memory + address ownerAddress = OWNER_ADDRESS; + bytes32 sigR = s_sigR; + bytes32 sigS = s_sigS; + uint8 sigV = s_sigV; + vm.resumeGasMetering(); + + s_termsOfServiceAllowList.acceptTermsOfService(ownerAddress, ownerAddress, sigR, sigS, sigV); + } +} + +/// @notice #createSubscription +contract Gas_CreateSubscription is FunctionsOwnerAcceptTermsOfServiceSetup { + function test_CreateSubscription_Gas() public { + s_functionsRouter.createSubscription(); + } +} + +/// @notice #addConsumer +contract Gas_AddConsumer is FunctionsSubscriptionSetup { + function setUp() public virtual override { + vm.pauseGasMetering(); + + FunctionsSubscriptionSetup.setUp(); + } + + function test_AddConsumer_Gas() public { + // Keep input data in memory + uint64 subscriptionId = s_subscriptionId; + address consumerAddress = address(s_functionsCoordinator); // use garbage address + vm.resumeGasMetering(); + + s_functionsRouter.addConsumer(subscriptionId, consumerAddress); + } +} + +/// @notice #fundSubscription +contract Gas_FundSubscription is FunctionsSubscriptionSetup { + function setUp() public virtual override { + vm.pauseGasMetering(); + + FunctionsSubscriptionSetup.setUp(); + } + + function test_FundSubscription_Gas() public { + // Keep input data in memory + address routerAddress = address(s_functionsRouter); + uint96 s_subscriptionFunding = 10 * JUELS_PER_LINK; // 10 LINK + bytes memory data = abi.encode(s_subscriptionId); + vm.resumeGasMetering(); + + s_linkToken.transferAndCall(routerAddress, s_subscriptionFunding, data); + } +} + +/// @notice #sendRequest +contract Gas_SendRequest is FunctionsSubscriptionSetup { + bytes s_minimalRequestData; + bytes s_maximalRequestData; + + function _makeStringOfBytesSize(uint16 bytesSize) internal pure returns (string memory) { + return vm.toString(new bytes((bytesSize - 2) / 2)); + } + + function setUp() public virtual override { + vm.pauseGasMetering(); + + FunctionsSubscriptionSetup.setUp(); + + { + // Create minimum viable request data + FunctionsRequest.Request memory minimalRequest; + string memory minimalSourceCode = "return Functions.encodeString('hello world');"; + FunctionsRequest.initializeRequest( + minimalRequest, + FunctionsRequest.Location.Inline, + FunctionsRequest.CodeLanguage.JavaScript, + minimalSourceCode + ); + s_minimalRequestData = FunctionsRequest.encodeCBOR(minimalRequest); + } + + { + // Create maximum viable request data - 30 KB encoded data + FunctionsRequest.Request memory maxmimalRequest; + + // Create maximum viable request data - 30 KB encoded data + string memory maximalSourceCode = _makeStringOfBytesSize(29_898); // CBOR size without source code is 102 bytes + FunctionsRequest.initializeRequest( + maxmimalRequest, + FunctionsRequest.Location.Inline, + FunctionsRequest.CodeLanguage.JavaScript, + maximalSourceCode + ); + s_maximalRequestData = FunctionsRequest.encodeCBOR(maxmimalRequest); + assertEq(s_maximalRequestData.length, 30_000); + } + } + + /// @dev The order of these test cases matters as the first test will consume more gas by writing over default values + function test_SendRequest_MaximumGas() public { + // Pull storage variables into memory + bytes memory maximalRequestData = s_maximalRequestData; + uint64 subscriptionId = s_subscriptionId; + uint32 callbackGasLimit = 300_000; + bytes32 donId = s_donId; + vm.resumeGasMetering(); + + s_functionsClient.sendRequestBytes(maximalRequestData, subscriptionId, callbackGasLimit, donId); + } + + function test_SendRequest_MinimumGas() public { + // Pull storage variables into memory + bytes memory minimalRequestData = s_minimalRequestData; + uint64 subscriptionId = s_subscriptionId; + uint32 callbackGasLimit = 5_500; + bytes32 donId = s_donId; + vm.resumeGasMetering(); + + s_functionsClient.sendRequestBytes(minimalRequestData, subscriptionId, callbackGasLimit, donId); + } +} + +/// @notice #fulfillRequest +contract FunctionsClient_FulfillRequest is FunctionsClientRequestSetup { + struct Report { + bytes32[] rs; + bytes32[] ss; + bytes32 vs; + bytes report; + bytes32[3] reportContext; + } + + mapping(uint256 reportNumber => Report) s_reports; + + FunctionsClientTestHelper s_functionsClientWithMaximumReturnData; + + function _makeStringOfBytesSize(uint16 bytesSize) internal pure returns (string memory) { + return vm.toString(new bytes((bytesSize - 2) / 2)); + } + + function setUp() public virtual override { + vm.pauseGasMetering(); + + FunctionsSubscriptionSetup.setUp(); + + { + // Deploy consumer that has large revert return data + s_functionsClientWithMaximumReturnData = new FunctionsClientTestHelper(address(s_functionsRouter)); + s_functionsClientWithMaximumReturnData.setRevertFulfillRequest(true); + string memory revertMessage = _makeStringOfBytesSize(30_000); // 30kb - FunctionsRouter cuts off response at MAX_CALLBACK_RETURN_BYTES = 4 + 4 * 32 = 132bytes, go well above that + s_functionsClientWithMaximumReturnData.setRevertFulfillRequestMessage(revertMessage); + s_functionsRouter.addConsumer(s_subscriptionId, address(s_functionsClientWithMaximumReturnData)); + } + + // Set up maximum gas test + { + // Send request #2 for maximum gas test + uint8 requestNumber = 2; + + bytes memory secrets = new bytes(0); + string[] memory args = new string[](0); + bytes[] memory bytesArgs = new bytes[](0); + uint32 callbackGasLimit = 300_000; + + // Create maximum viable request data - 30 KB encoded data + string memory maximalSourceCode = _makeStringOfBytesSize(29_898); // CBOR size without source code is 102 bytes + + _sendAndStoreRequest( + requestNumber, + maximalSourceCode, + secrets, + args, + bytesArgs, + callbackGasLimit, + address(s_functionsClientWithMaximumReturnData) + ); + + // Build the report transmission data + uint256[] memory requestNumberKeys = new uint256[](1); + requestNumberKeys[0] = requestNumber; + string[] memory results = new string[](1); + // Build a 256 byte response size + results[0] = _makeStringOfBytesSize(256); + bytes[] memory errors = new bytes[](1); + errors[0] = new bytes(0); // No error + + (bytes memory report, bytes32[3] memory reportContext) = _buildReport(requestNumberKeys, results, errors); + + uint256[] memory signerPrivateKeys = new uint256[](3); + signerPrivateKeys[0] = NOP_SIGNER_PRIVATE_KEY_1; + signerPrivateKeys[1] = NOP_SIGNER_PRIVATE_KEY_2; + signerPrivateKeys[2] = NOP_SIGNER_PRIVATE_KEY_3; + + (bytes32[] memory rawRs, bytes32[] memory rawSs, bytes32 rawVs) = _signReport( + report, + reportContext, + signerPrivateKeys + ); + + // Store the report data + s_reports[1] = Report({rs: rawRs, ss: rawSs, vs: rawVs, report: report, reportContext: reportContext}); + } + + // Set up minimum gas test + { + // Send requests minimum gas test + uint8 requestsToSend = 1; + uint8 requestNumberOffset = 3; // the setup already has request #1 sent, and the previous test case uses request #2, start from request #3 + + string memory sourceCode = "return Functions.encodeString('hello world');"; + bytes memory secrets = new bytes(0); + string[] memory args = new string[](0); + bytes[] memory bytesArgs = new bytes[](0); + uint32 callbackGasLimit = 5_500; + + for (uint256 i = 0; i < requestsToSend; ++i) { + _sendAndStoreRequest(i + requestNumberOffset, sourceCode, secrets, args, bytesArgs, callbackGasLimit); + } + + // Build the report transmission data + uint256[] memory requestNumberKeys = new uint256[](requestsToSend); + string[] memory results = new string[](requestsToSend); + bytes[] memory errors = new bytes[](requestsToSend); + for (uint256 i = 0; i < requestsToSend; ++i) { + requestNumberKeys[i] = i + requestNumberOffset; + results[i] = "hello world"; + errors[i] = new bytes(0); // no error + } + + (bytes memory report, bytes32[3] memory reportContext) = _buildReport(requestNumberKeys, results, errors); + + uint256[] memory signerPrivateKeys = new uint256[](3); + signerPrivateKeys[0] = NOP_SIGNER_PRIVATE_KEY_1; + signerPrivateKeys[1] = NOP_SIGNER_PRIVATE_KEY_2; + signerPrivateKeys[2] = NOP_SIGNER_PRIVATE_KEY_3; + + (bytes32[] memory rawRs, bytes32[] memory rawSs, bytes32 rawVs) = _signReport( + report, + reportContext, + signerPrivateKeys + ); + + // Store the report data + s_reports[2] = Report({rs: rawRs, ss: rawSs, vs: rawVs, report: report, reportContext: reportContext}); + } + + vm.stopPrank(); + vm.startPrank(NOP_TRANSMITTER_ADDRESS_1); + } + + /// @dev The order of these test cases matters as the first test will consume more gas by writing over default values + function test_FulfillRequest_MaximumGas() public { + // Pull storage variables into memory + uint8 reportNumber = 1; + bytes32[] memory rs = s_reports[reportNumber].rs; + bytes32[] memory ss = s_reports[reportNumber].ss; + bytes32 vs = s_reports[reportNumber].vs; + bytes memory report = s_reports[reportNumber].report; + bytes32[3] memory reportContext = s_reports[reportNumber].reportContext; + vm.resumeGasMetering(); + + // 1 fulfillment in the report, single request takes on all report validation cost + // maximum request + // maximum NOPs + // maximum return data + // first storage write to change default values + s_functionsCoordinator.transmit(reportContext, report, rs, ss, vs); + } + + function test_FulfillRequest_MinimumGas() public { + // Pull storage variables into memory + uint8 reportNumber = 2; + bytes32[] memory rs = s_reports[reportNumber].rs; + bytes32[] memory ss = s_reports[reportNumber].ss; + bytes32 vs = s_reports[reportNumber].vs; + bytes memory report = s_reports[reportNumber].report; + bytes32[3] memory reportContext = s_reports[reportNumber].reportContext; + vm.resumeGasMetering(); + + // max fulfillments in the report, cost of validation split between all + // minimal request + // minimum NOPs + // no return data + // not storage writing default values + s_functionsCoordinator.transmit(reportContext, report, rs, ss, vs); + } +} diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/OCR2.t.sol b/contracts/src/v0.8/functions/tests/v1_0_0/OCR2.t.sol index e69de29bb2d..745ad4f0ae9 100644 --- a/contracts/src/v0.8/functions/tests/v1_0_0/OCR2.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_0_0/OCR2.t.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +// ================================================================ +// | OCR2Base | +// ================================================================ + +/// @notice #constructor +contract OCR2Base_Constructor { + +} + +/// @notice #checkConfigValid +contract OCR2Base_CheckConfigValid { + +} + +/// @notice #latestConfigDigestAndEpoch +contract OCR2Base_LatestConfigDigestAndEpoch { + +} + +/// @notice #setConfig +contract OCR2Base_SetConfig { + +} + +/// @notice #configDigestFromConfigData +contract OCR2Base_ConfigDigestFromConfigData { + +} + +/// @notice #latestConfigDetails +contract OCR2Base_LatestConfigDetails { + +} + +/// @notice #transmitters +contract OCR2Base_Transmitters { + +} + +/// @notice #_report +contract OCR2Base__Report { + // TODO: make contract internal function helper +} + +/// @notice #requireExpectedMsgDataLength +contract OCR2Base_RequireExpectedMsgDataLength { + +} + +/// @notice #transmit +contract OCR2Base_Transmit { + +} diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/Setup.t.sol b/contracts/src/v0.8/functions/tests/v1_0_0/Setup.t.sol index 73644e38636..5226af19d96 100644 --- a/contracts/src/v0.8/functions/tests/v1_0_0/Setup.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_0_0/Setup.t.sol @@ -212,7 +212,7 @@ contract FunctionsClientRequestSetup is FunctionsSubscriptionSetup { FunctionsResponse.Commitment commitment; } - mapping(uint256 => Request) s_requests; + mapping(uint256 requestNumber => Request) s_requests; uint96 s_fulfillmentRouterOwnerBalance = 0; uint96 s_fulfillmentCoordinatorBalance = 0; @@ -244,13 +244,15 @@ contract FunctionsClientRequestSetup is FunctionsSubscriptionSetup { /// @param args - String arguments that will be passed into the source code /// @param bytesArgs - Bytes arguments that will be passed into the source code /// @param callbackGasLimit - Gas limit for the fulfillment callback + /// @param client - The consumer contract to send the request from function _sendAndStoreRequest( uint256 requestNumberKey, string memory sourceCode, bytes memory secrets, string[] memory args, bytes[] memory bytesArgs, - uint32 callbackGasLimit + uint32 callbackGasLimit, + address client ) internal { if (s_requests[requestNumberKey].requestId != bytes32(0)) { revert("Request already written"); @@ -258,7 +260,7 @@ contract FunctionsClientRequestSetup is FunctionsSubscriptionSetup { vm.recordLogs(); - bytes32 requestId = s_functionsClient.sendRequest( + bytes32 requestId = FunctionsClientUpgradeHelper(client).sendRequest( s_donId, sourceCode, secrets, @@ -288,11 +290,32 @@ contract FunctionsClientRequestSetup is FunctionsSubscriptionSetup { } /// @notice Send a request and store information about it in s_requests - /// @param requestNumberKeys - One or more requestNumberKeys that were used to store the request in `s_requests` of the requests, that will be added to the report - /// @param results - The result that will be sent to the consumer contract's callback. For each index, e.g. result[index] or errors[index], only one of should be filled. - /// @param errors - The error that will be sent to the consumer contract's callback. For each index, e.g. result[index] or errors[index], only one of should be filled. - /// @return report - Report bytes data - /// @return reportContext - Report context bytes32 data + /// @param requestNumberKey - the key that the request will be stored in `s_requests` in + /// @param sourceCode - Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted + /// @param secrets - Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets()) + /// @param args - String arguments that will be passed into the source code + /// @param bytesArgs - Bytes arguments that will be passed into the source code + /// @param callbackGasLimit - Gas limit for the fulfillment callback + /// @dev @param client - The consumer contract to send the request from (overloaded to fill client with s_functionsClient) + function _sendAndStoreRequest( + uint256 requestNumberKey, + string memory sourceCode, + bytes memory secrets, + string[] memory args, + bytes[] memory bytesArgs, + uint32 callbackGasLimit + ) internal { + _sendAndStoreRequest( + requestNumberKey, + sourceCode, + secrets, + args, + bytesArgs, + callbackGasLimit, + address(s_functionsClient) + ); + } + function _buildReport( uint256[] memory requestNumberKeys, string[] memory results, diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/testhelpers/FunctionsClientTestHelper.sol b/contracts/src/v0.8/functions/tests/v1_0_0/testhelpers/FunctionsClientTestHelper.sol index 987bf3e48ab..57129d0153f 100644 --- a/contracts/src/v0.8/functions/tests/v1_0_0/testhelpers/FunctionsClientTestHelper.sol +++ b/contracts/src/v0.8/functions/tests/v1_0_0/testhelpers/FunctionsClientTestHelper.sol @@ -14,6 +14,7 @@ contract FunctionsClientTestHelper is FunctionsClient { event FulfillRequestInvoked(bytes32 requestId, bytes response, bytes err); bool private s_revertFulfillRequest; + string private s_revertFulfillRequestMessage = "asked to revert"; bool private s_doInvalidOperation; bool private s_doInvalidReentrantOperation; bool private s_doValidReentrantOperation; @@ -23,6 +24,24 @@ contract FunctionsClientTestHelper is FunctionsClient { constructor(address router) FunctionsClient(router) {} + function sendRequest( + bytes32 donId, + string calldata source, + bytes calldata secrets, + string[] calldata args, + bytes[] memory bytesArgs, + uint64 subscriptionId, + uint32 callbackGasLimit + ) public returns (bytes32 requestId) { + FunctionsRequest.Request memory req; + req.initializeRequestForInlineJavaScript(source); + if (secrets.length > 0) req.addSecretsReference(secrets); + if (args.length > 0) req.setArgs(args); + if (bytesArgs.length > 0) req.setBytesArgs(bytesArgs); + + return _sendRequest(FunctionsRequest.encodeCBOR(req), subscriptionId, callbackGasLimit, donId); + } + function sendSimpleRequestWithJavaScript( string memory sourceCode, uint64 subscriptionId, @@ -68,7 +87,7 @@ contract FunctionsClientTestHelper is FunctionsClient { function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override { if (s_revertFulfillRequest) { - revert("asked to revert"); + revert(s_revertFulfillRequestMessage); } if (s_doInvalidOperation) { uint256 x = 1; @@ -88,6 +107,10 @@ contract FunctionsClientTestHelper is FunctionsClient { s_revertFulfillRequest = on; } + function setRevertFulfillRequestMessage(string memory message) external { + s_revertFulfillRequestMessage = message; + } + function setDoInvalidOperation(bool on) external { s_doInvalidOperation = on; } diff --git a/contracts/src/v0.8/functions/tests/v1_0_0/testhelpers/FunctionsClientUpgradeHelper.sol b/contracts/src/v0.8/functions/tests/v1_0_0/testhelpers/FunctionsClientUpgradeHelper.sol index e04ead8ad83..4cfa41d1e46 100644 --- a/contracts/src/v0.8/functions/tests/v1_0_0/testhelpers/FunctionsClientUpgradeHelper.sol +++ b/contracts/src/v0.8/functions/tests/v1_0_0/testhelpers/FunctionsClientUpgradeHelper.sol @@ -41,6 +41,15 @@ contract FunctionsClientUpgradeHelper is FunctionsClient, ConfirmedOwner { return _sendRequest(FunctionsRequest.encodeCBOR(req), subscriptionId, callbackGasLimit, donId); } + function sendRequestBytes( + bytes memory data, + uint64 subscriptionId, + uint32 callbackGasLimit, + bytes32 donId + ) public returns (bytes32 requestId) { + return _sendRequest(data, subscriptionId, callbackGasLimit, donId); + } + /** * @notice Same as sendRequest but for DONHosted secrets */ From f56010799489bb43934464e22fc778b8e70d7a20 Mon Sep 17 00:00:00 2001 From: Tate Date: Wed, 4 Oct 2023 17:43:52 -0600 Subject: [PATCH 55/84] Update e2e docker tests to use killgrave mock adapter instead of mock-server (#10866) * Update e2e docker tests to use killgrave mock adapter instead of mock-server * remove mock-server from the builder --- .../actions/ocr2_helpers_local.go | 21 ++++---- .../actions/ocr_helpers_local.go | 25 +++++----- .../actions/vrfv2_actions/vrfv2_steps.go | 2 +- integration-tests/docker/cmd/test_env.go | 2 +- integration-tests/docker/test_env/test_env.go | 22 ++++----- .../docker/test_env/test_env_builder.go | 49 ++++++++----------- .../docker/test_env/test_env_config.go | 14 +++--- integration-tests/go.mod | 3 +- integration-tests/go.sum | 8 ++- integration-tests/smoke/automation_test.go | 1 - integration-tests/smoke/cron_test.go | 14 ++++-- integration-tests/smoke/flux_test.go | 11 +++-- integration-tests/smoke/forwarder_ocr_test.go | 7 ++- .../smoke/forwarders_ocr2_test.go | 7 +-- integration-tests/smoke/keeper_test.go | 1 - integration-tests/smoke/ocr2_test.go | 7 +-- integration-tests/smoke/ocr_test.go | 6 +-- integration-tests/smoke/runlog_test.go | 11 +++-- integration-tests/smoke/vrf_test.go | 1 - 19 files changed, 108 insertions(+), 104 deletions(-) diff --git a/integration-tests/actions/ocr2_helpers_local.go b/integration-tests/actions/ocr2_helpers_local.go index 0b20e4cfee7..b3fe6eb041f 100644 --- a/integration-tests/actions/ocr2_helpers_local.go +++ b/integration-tests/actions/ocr2_helpers_local.go @@ -4,6 +4,7 @@ import ( "crypto/ed25519" "encoding/hex" "fmt" + "net/http" "strings" "time" @@ -11,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/lib/pq" "github.com/rs/zerolog/log" - ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" + "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -29,9 +30,9 @@ func CreateOCRv2JobsLocal( ocrInstances []contracts.OffchainAggregatorV2, bootstrapNode *client.ChainlinkClient, workerChainlinkNodes []*client.ChainlinkClient, - mockserver *ctfClient.MockserverClient, - mockServerPath string, // Path on the mock server for the Chainlink nodes to query - mockServerValue int, // Value to get from the mock server when querying the path + mockAdapter *test_env.Killgrave, + mockAdapterPath string, // Path on the mock server for the Chainlink nodes to query + mockAdapterValue int, // Value to get from the mock server when querying the path chainId uint64, // EVM chain ID forwardingAllowed bool, ) error { @@ -42,12 +43,12 @@ func CreateOCRv2JobsLocal( } p2pV2Bootstrapper := fmt.Sprintf("%s@%s:%d", bootstrapP2PIds.Data[0].Attributes.PeerID, bootstrapNode.InternalIP(), 6690) // Set the value for the jobs to report on - err = mockserver.SetValuePath(mockServerPath, mockServerValue) + err = mockAdapter.SetAdapterBasedIntValuePath(mockAdapterPath, []string{http.MethodGet, http.MethodPost}, mockAdapterValue) if err != nil { return err } // Set the juelsPerFeeCoinSource config value - err = mockserver.SetValuePath(fmt.Sprintf("%s/juelsPerFeeCoinSource", mockServerPath), mockServerValue) + err = mockAdapter.SetAdapterBasedIntValuePath(fmt.Sprintf("%s/juelsPerFeeCoinSource", mockAdapterPath), []string{http.MethodGet, http.MethodPost}, mockAdapterValue) if err != nil { return err } @@ -62,7 +63,7 @@ func CreateOCRv2JobsLocal( RelayConfig: map[string]interface{}{ "chainID": chainId, }, - MonitoringEndpoint: null.StringFrom(fmt.Sprintf("%s/%s", mockserver.Config.ClusterURL, mockServerPath)), + MonitoringEndpoint: null.StringFrom(fmt.Sprintf("%s/%s", mockAdapter.InternalEndpoint, mockAdapterPath)), ContractConfigTrackerPollInterval: *models.NewInterval(15 * time.Second), }, } @@ -83,12 +84,12 @@ func CreateOCRv2JobsLocal( nodeOCRKeyId := nodeOCRKeys.Data[0].ID bta := &client.BridgeTypeAttributes{ - Name: fmt.Sprintf("%s-%s", mockServerPath, uuid.NewString()), - URL: fmt.Sprintf("%s/%s", mockserver.Config.ClusterURL, mockServerPath), + Name: fmt.Sprintf("%s-%s", mockAdapterPath, uuid.NewString()), + URL: fmt.Sprintf("%s/%s", mockAdapter.InternalEndpoint, mockAdapterPath), } juelsBridge := &client.BridgeTypeAttributes{ Name: fmt.Sprintf("juels-%s", uuid.NewString()), - URL: fmt.Sprintf("%s/%s/juelsPerFeeCoinSource", mockserver.Config.ClusterURL, mockServerPath), + URL: fmt.Sprintf("%s/%s/juelsPerFeeCoinSource", mockAdapter.InternalEndpoint, mockAdapterPath), } err = chainlinkNode.MustCreateBridge(bta) if err != nil { diff --git a/integration-tests/actions/ocr_helpers_local.go b/integration-tests/actions/ocr_helpers_local.go index ae2f3686daf..4d8afc52c49 100644 --- a/integration-tests/actions/ocr_helpers_local.go +++ b/integration-tests/actions/ocr_helpers_local.go @@ -3,6 +3,7 @@ package actions import ( "fmt" "math/big" + "net/http" "strings" "github.com/ethereum/go-ethereum" @@ -11,7 +12,7 @@ import ( "github.com/pkg/errors" "github.com/rs/zerolog" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" + "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" "golang.org/x/sync/errgroup" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -141,7 +142,7 @@ func CreateOCRJobsLocal( bootstrapNode *client.ChainlinkClient, workerNodes []*client.ChainlinkClient, mockValue int, - mockserver *ctfClient.MockserverClient, + mockAdapter *test_env.Killgrave, evmChainID string, ) error { for _, ocrInstance := range ocrInstances { @@ -184,9 +185,9 @@ func CreateOCRJobsLocal( } bta := &client.BridgeTypeAttributes{ Name: nodeContractPairID, - URL: fmt.Sprintf("%s/%s", mockserver.Config.ClusterURL, strings.TrimPrefix(nodeContractPairID, "/")), + URL: fmt.Sprintf("%s/%s", mockAdapter.InternalEndpoint, strings.TrimPrefix(nodeContractPairID, "/")), } - err = SetAdapterResponseLocal(mockValue, ocrInstance, node, mockserver) + err = SetAdapterResponseLocal(mockValue, ocrInstance, node, mockAdapter) if err != nil { return fmt.Errorf("setting adapter response for OCR node failed: %w", err) } @@ -234,16 +235,16 @@ func SetAdapterResponseLocal( response int, ocrInstance contracts.OffchainAggregator, chainlinkNode *client.ChainlinkClient, - mockserver *ctfClient.MockserverClient, + mockAdapter *test_env.Killgrave, ) error { nodeContractPairID, err := BuildNodeContractPairIDLocal(chainlinkNode, ocrInstance) if err != nil { return err } path := fmt.Sprintf("/%s", nodeContractPairID) - err = mockserver.SetValuePath(path, response) + err = mockAdapter.SetAdapterBasedIntValuePath(path, []string{http.MethodGet, http.MethodPost}, response) if err != nil { - return fmt.Errorf("setting mockserver value path failed: %w", err) + return fmt.Errorf("setting mock adapter value path failed: %w", err) } return nil } @@ -252,7 +253,7 @@ func SetAllAdapterResponsesToTheSameValueLocal( response int, ocrInstances []contracts.OffchainAggregator, chainlinkNodes []*client.ChainlinkClient, - mockserver *ctfClient.MockserverClient, + mockAdapter *test_env.Killgrave, ) error { eg := &errgroup.Group{} for _, o := range ocrInstances { @@ -260,7 +261,7 @@ func SetAllAdapterResponsesToTheSameValueLocal( for _, n := range chainlinkNodes { node := n eg.Go(func() error { - return SetAdapterResponseLocal(response, ocrInstance, node, mockserver) + return SetAdapterResponseLocal(response, ocrInstance, node, mockAdapter) }) } } @@ -358,7 +359,7 @@ func CreateOCRJobsWithForwarderLocal( bootstrapNode *client.ChainlinkClient, workerNodes []*client.ChainlinkClient, mockValue int, - mockserver *ctfClient.MockserverClient, + mockAdapter *test_env.Killgrave, evmChainID string, ) error { for _, ocrInstance := range ocrInstances { @@ -401,9 +402,9 @@ func CreateOCRJobsWithForwarderLocal( } bta := &client.BridgeTypeAttributes{ Name: nodeContractPairID, - URL: fmt.Sprintf("%s/%s", mockserver.Config.ClusterURL, strings.TrimPrefix(nodeContractPairID, "/")), + URL: fmt.Sprintf("%s/%s", mockAdapter.InternalEndpoint, strings.TrimPrefix(nodeContractPairID, "/")), } - err = SetAdapterResponseLocal(mockValue, ocrInstance, node, mockserver) + err = SetAdapterResponseLocal(mockValue, ocrInstance, node, mockAdapter) if err != nil { return err } diff --git a/integration-tests/actions/vrfv2_actions/vrfv2_steps.go b/integration-tests/actions/vrfv2_actions/vrfv2_steps.go index bdf0cf1f927..4beb49a23cb 100644 --- a/integration-tests/actions/vrfv2_actions/vrfv2_steps.go +++ b/integration-tests/actions/vrfv2_actions/vrfv2_steps.go @@ -155,7 +155,7 @@ func SetupLocalLoadTestEnv(nodesFunding *big.Float, subFundingLINK *big.Int) (*t env, err := test_env.NewCLTestEnvBuilder(). WithGeth(). WithLogWatcher(). - WithMockServer(1). + WithMockAdapter(). WithCLNodes(1). WithFunding(nodesFunding). Build() diff --git a/integration-tests/docker/cmd/test_env.go b/integration-tests/docker/cmd/test_env.go index 1acf5947505..31b7de5dcdd 100644 --- a/integration-tests/docker/cmd/test_env.go +++ b/integration-tests/docker/cmd/test_env.go @@ -36,7 +36,7 @@ func main() { _, err := test_env.NewCLTestEnvBuilder(). WithGeth(). - WithMockServer(1). + WithMockAdapter(). WithCLNodes(6). Build() if err != nil { diff --git a/integration-tests/docker/test_env/test_env.go b/integration-tests/docker/test_env/test_env.go index 88b32f85be3..02db1ae788c 100644 --- a/integration-tests/docker/test_env/test_env.go +++ b/integration-tests/docker/test_env/test_env.go @@ -46,7 +46,7 @@ type CLClusterTestEnv struct { CLNodes []*ClNode Geth *test_env.Geth // for tests using --dev networks PrivateChain []test_env.PrivateChain // for tests using non-dev networks - MockServer *test_env.MockServer + MockAdapter *test_env.Killgrave EVMClient blockchain.EVMClient ContractDeployer contracts.ContractDeployer ContractLoader contracts.ContractLoader @@ -62,20 +62,20 @@ func NewTestEnv() (*CLClusterTestEnv, error) { } n := []string{network.Name} return &CLClusterTestEnv{ - Geth: test_env.NewGeth(n), - MockServer: test_env.NewMockServer(n), - Network: network, - l: log.Logger, + Geth: test_env.NewGeth(n), + MockAdapter: test_env.NewKillgrave(n, ""), + Network: network, + l: log.Logger, }, nil } // WithTestEnvConfig sets the test environment cfg. -// Sets up the Geth and MockServer containers with the provided cfg. +// Sets up the Geth and MockAdapter containers with the provided cfg. func (te *CLClusterTestEnv) WithTestEnvConfig(cfg *TestEnvConfig) *CLClusterTestEnv { te.Cfg = cfg n := []string{te.Network.Name} - te.Geth = test_env.NewGeth(n, test_env.WithContainerName(cfg.Geth.ContainerName)) - te.MockServer = test_env.NewMockServer(n, test_env.WithContainerName(cfg.MockServer.ContainerName)) + te.Geth = test_env.NewGeth(n, test_env.WithContainerName(te.Cfg.Geth.ContainerName)) + te.MockAdapter = test_env.NewKillgrave(n, te.Cfg.MockAdapter.ImpostersPath, test_env.WithContainerName(te.Cfg.MockAdapter.ContainerName)) return te } @@ -83,7 +83,7 @@ func (te *CLClusterTestEnv) WithTestLogger(t *testing.T) *CLClusterTestEnv { te.t = t te.l = logging.GetTestLogger(t) te.Geth.WithTestLogger(t) - te.MockServer.WithTestLogger(t) + te.MockAdapter.WithTestLogger(t) return te } @@ -135,8 +135,8 @@ func (te *CLClusterTestEnv) StartGeth() (blockchain.EVMNetwork, test_env.Interna return te.Geth.StartContainer() } -func (te *CLClusterTestEnv) StartMockServer() error { - return te.MockServer.StartContainer() +func (te *CLClusterTestEnv) StartMockAdapter() error { + return te.MockAdapter.StartContainer() } func (te *CLClusterTestEnv) GetAPIs() []*client.ChainlinkClient { diff --git a/integration-tests/docker/test_env/test_env_builder.go b/integration-tests/docker/test_env/test_env_builder.go index 7eeeff2489f..ced617bc060 100644 --- a/integration-tests/docker/test_env/test_env_builder.go +++ b/integration-tests/docker/test_env/test_env_builder.go @@ -22,21 +22,20 @@ import ( ) type CLTestEnvBuilder struct { - hasLogWatch bool - hasGeth bool - hasMockServer bool - hasForwarders bool - clNodeConfig *chainlink.Config - secretsConfig string - nonDevGethNetworks []blockchain.EVMNetwork - clNodesCount int - externalAdapterCount int - customNodeCsaKeys []string - defaultNodeCsaKeys []string - l zerolog.Logger - t *testing.T - te *CLClusterTestEnv - isNonEVM bool + hasLogWatch bool + hasGeth bool + hasKillgrave bool + hasForwarders bool + clNodeConfig *chainlink.Config + secretsConfig string + nonDevGethNetworks []blockchain.EVMNetwork + clNodesCount int + customNodeCsaKeys []string + defaultNodeCsaKeys []string + l zerolog.Logger + t *testing.T + te *CLClusterTestEnv + isNonEVM bool /* funding */ ETHFunds *big.Float @@ -44,8 +43,7 @@ type CLTestEnvBuilder struct { func NewCLTestEnvBuilder() *CLTestEnvBuilder { return &CLTestEnvBuilder{ - externalAdapterCount: 1, - l: log.Logger, + l: log.Logger, } } @@ -127,9 +125,8 @@ func (b *CLTestEnvBuilder) WithSecretsConfig(secrets string) *CLTestEnvBuilder { return b } -func (b *CLTestEnvBuilder) WithMockServer(externalAdapterCount int) *CLTestEnvBuilder { - b.hasMockServer = true - b.externalAdapterCount = externalAdapterCount +func (b *CLTestEnvBuilder) WithMockAdapter() *CLTestEnvBuilder { + b.hasKillgrave = true return b } @@ -149,8 +146,7 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { } b.l.Info(). Bool("hasGeth", b.hasGeth). - Bool("hasMockServer", b.hasMockServer). - Int("externalAdapterCount", b.externalAdapterCount). + Bool("hasKillgrave", b.hasKillgrave). Int("clNodesCount", b.clNodesCount). Strs("customNodeCsaKeys", b.customNodeCsaKeys). Strs("defaultNodeCsaKeys", b.defaultNodeCsaKeys). @@ -168,16 +164,13 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { } } - if b.hasMockServer { - err = b.te.StartMockServer() - if err != nil { - return nil, err - } - err = b.te.MockServer.SetExternalAdapterMocks(b.externalAdapterCount) + if b.hasKillgrave { + err = b.te.StartMockAdapter() if err != nil { return nil, err } } + if b.nonDevGethNetworks != nil { b.te.WithPrivateChain(b.nonDevGethNetworks) err := b.te.StartPrivateChain() diff --git a/integration-tests/docker/test_env/test_env_config.go b/integration-tests/docker/test_env/test_env_config.go index da38575a86a..dfac6f9520a 100644 --- a/integration-tests/docker/test_env/test_env_config.go +++ b/integration-tests/docker/test_env/test_env_config.go @@ -7,15 +7,15 @@ import ( ) type TestEnvConfig struct { - Networks []string `json:"networks"` - Geth GethConfig `json:"geth"` - MockServer MockServerConfig `json:"mockserver"` - Nodes []ClNodeConfig `json:"nodes"` + Networks []string `json:"networks"` + Geth GethConfig `json:"geth"` + MockAdapter MockAdapterConfig `json:"mock_adapter"` + Nodes []ClNodeConfig `json:"nodes"` } -type MockServerConfig struct { - ContainerName string `json:"container_name"` - EAMockUrls []string `json:"external_adapters_mock_urls"` +type MockAdapterConfig struct { + ContainerName string `json:"container_name"` + ImpostersPath string `json:"imposters_path"` } type GethConfig struct { diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 97a1da1665f..b9a4641eaf6 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -20,7 +20,7 @@ require ( github.com/rs/zerolog v1.30.0 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-env v0.38.1 - github.com/smartcontractkit/chainlink-testing-framework v1.17.4 + github.com/smartcontractkit/chainlink-testing-framework v1.17.6 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 github.com/smartcontractkit/ocr2keepers v0.7.27 @@ -354,6 +354,7 @@ require ( github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e // indirect github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/otiai10/copy v1.14.0 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 17bdc669e72..802011b54ed 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2181,6 +2181,10 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= +github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= +github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= +github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= +github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= github.com/ovh/go-ovh v1.3.0 h1:mvZaddk4E4kLcXhzb+cxBsMPYp2pHqiQpWYkInsuZPQ= github.com/ovh/go-ovh v1.3.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -2366,8 +2370,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97ac github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918/go.mod h1:/yp/sqD8Iz5GU5fcercjrw0ivJF7HDcupYg+Gjr7EPg= -github.com/smartcontractkit/chainlink-testing-framework v1.17.4 h1:N7YK1VZrSxG3PEwY0S7NXJQgSiEvWHR6uKhytfHMTjA= -github.com/smartcontractkit/chainlink-testing-framework v1.17.4/go.mod h1:izzRx4cNihkVP9XY15isSCMW1QAlRK1w5eE23/MbZHM= +github.com/smartcontractkit/chainlink-testing-framework v1.17.6 h1:hcsP1eyzrqQf3veK4xh0T37PFkq5AasDwlgJfl11atY= +github.com/smartcontractkit/chainlink-testing-framework v1.17.6/go.mod h1:rypNxetVFh6bwaoHn05bsd4vCtgdEsF+1Vdyy/AhAR8= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/integration-tests/smoke/automation_test.go b/integration-tests/smoke/automation_test.go index 0eabac7844b..db34cb28e1e 100644 --- a/integration-tests/smoke/automation_test.go +++ b/integration-tests/smoke/automation_test.go @@ -1017,7 +1017,6 @@ func setupAutomationTestDocker( env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). WithCLNodes(5). WithCLNodeConfig(clNodeConfig). WithSecretsConfig(secretsConfig). diff --git a/integration-tests/smoke/cron_test.go b/integration-tests/smoke/cron_test.go index 717ff8db1e9..26e039289cf 100644 --- a/integration-tests/smoke/cron_test.go +++ b/integration-tests/smoke/cron_test.go @@ -2,6 +2,7 @@ package smoke import ( "fmt" + "net/http" "testing" "github.com/google/uuid" @@ -21,7 +22,7 @@ func TestCronBasic(t *testing.T) { env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). + WithMockAdapter(). WithCLNodes(1). Build() require.NoError(t, err) @@ -31,12 +32,12 @@ func TestCronBasic(t *testing.T) { } }) - err = env.MockServer.Client.SetValuePath("/variable", 5) - require.NoError(t, err, "Setting value path in mockserver shouldn't fail") + err = env.MockAdapter.SetAdapterBasedIntValuePath("/variable", []string{http.MethodGet, http.MethodPost}, 5) + require.NoError(t, err, "Setting value path in mock adapter shouldn't fail") bta := &client.BridgeTypeAttributes{ Name: fmt.Sprintf("variable-%s", uuid.NewString()), - URL: fmt.Sprintf("%s/variable", env.MockServer.InternalEndpoint), + URL: fmt.Sprintf("%s/variable", env.MockAdapter.InternalEndpoint), RequestData: "{}", } err = env.CLNodes[0].API.MustCreateBridge(bta) @@ -51,6 +52,9 @@ func TestCronBasic(t *testing.T) { gom := gomega.NewGomegaWithT(t) gom.Eventually(func(g gomega.Gomega) { jobRuns, err := env.CLNodes[0].API.MustReadRunsByJob(job.Data.ID) + if err != nil { + l.Info().Err(err).Msg("error while waiting for job runs") + } g.Expect(err).ShouldNot(gomega.HaveOccurred(), "Reading Job run data shouldn't fail") g.Expect(len(jobRuns.Data)).Should(gomega.BeNumerically(">=", 5), "Expected number of job runs to be greater than 5, but got %d", len(jobRuns.Data)) @@ -58,5 +62,5 @@ func TestCronBasic(t *testing.T) { for _, jr := range jobRuns.Data { g.Expect(jr.Attributes.Errors).Should(gomega.Equal([]interface{}{nil}), "Job run %s shouldn't have errors", jr.ID) } - }, "20m", "3s").Should(gomega.Succeed()) + }, "2m", "3s").Should(gomega.Succeed()) } diff --git a/integration-tests/smoke/flux_test.go b/integration-tests/smoke/flux_test.go index ed907e9e460..c2fbf2d435b 100644 --- a/integration-tests/smoke/flux_test.go +++ b/integration-tests/smoke/flux_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "math/big" + "net/http" "strings" "testing" "time" @@ -27,7 +28,7 @@ func TestFluxBasic(t *testing.T) { env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). + WithMockAdapter(). WithCLNodes(3). Build() require.NoError(t, err) @@ -43,8 +44,8 @@ func TestFluxBasic(t *testing.T) { adapterUUID := uuid.NewString() adapterPath := fmt.Sprintf("/variable-%s", adapterUUID) - err = env.MockServer.Client.SetValuePath(adapterPath, 1e5) - require.NoError(t, err, "Setting mockserver value path shouldn't fail") + err = env.MockAdapter.SetAdapterBasedIntValuePath(adapterPath, []string{http.MethodPost}, 1e5) + require.NoError(t, err, "Setting mock adapter value path shouldn't fail") lt, err := actions.DeployLINKToken(env.ContractDeployer) require.NoError(t, err, "Deploying Link Token Contract shouldn't fail") @@ -81,7 +82,7 @@ func TestFluxBasic(t *testing.T) { require.NoError(t, err, "Getting oracle details from the Flux aggregator contract shouldn't fail") l.Info().Str("Oracles", strings.Join(oracles, ",")).Msg("Oracles set") - adapterFullURL := fmt.Sprintf("%s%s", env.MockServer.Client.Config.ClusterURL, adapterPath) + adapterFullURL := fmt.Sprintf("%s%s", env.MockAdapter.InternalEndpoint, adapterPath) l.Info().Str("AdapterFullURL", adapterFullURL).Send() bta := &client.BridgeTypeAttributes{ Name: fmt.Sprintf("variable-%s", adapterUUID), @@ -126,7 +127,7 @@ func TestFluxBasic(t *testing.T) { fluxRound = contracts.NewFluxAggregatorRoundConfirmer(fluxInstance, big.NewInt(2), fluxRoundTimeout, l) env.EVMClient.AddHeaderEventSubscription(fluxInstance.Address(), fluxRound) - err = env.MockServer.Client.SetValuePath(adapterPath, 1e10) + err = env.MockAdapter.SetAdapterBasedIntValuePath(adapterPath, []string{http.MethodPost}, 1e10) require.NoError(t, err, "Setting value path in mock server shouldn't fail") err = env.EVMClient.WaitForEvents() require.NoError(t, err, "Waiting for event subscriptions in nodes shouldn't fail") diff --git a/integration-tests/smoke/forwarder_ocr_test.go b/integration-tests/smoke/forwarder_ocr_test.go index f0d20e5245c..a6c0cacb96c 100644 --- a/integration-tests/smoke/forwarder_ocr_test.go +++ b/integration-tests/smoke/forwarder_ocr_test.go @@ -21,7 +21,7 @@ func TestForwarderOCRBasic(t *testing.T) { env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). + WithMockAdapter(). WithForwarders(). WithCLNodes(6). WithFunding(big.NewFloat(.1)). @@ -69,19 +69,18 @@ func TestForwarderOCRBasic(t *testing.T) { ) require.NoError(t, err, "Error deploying OCR contracts") - err = actions.CreateOCRJobsWithForwarderLocal(ocrInstances, bootstrapNode, workerNodes, 5, env.MockServer.Client, env.EVMClient.GetChainID().String()) + err = actions.CreateOCRJobsWithForwarderLocal(ocrInstances, bootstrapNode, workerNodes, 5, env.MockAdapter, env.EVMClient.GetChainID().String()) require.NoError(t, err, "failed to setup forwarder jobs") err = actions.StartNewRound(1, ocrInstances, env.EVMClient, l) require.NoError(t, err) err = env.EVMClient.WaitForEvents() require.NoError(t, err, "Error waiting for events") - //time.Sleep(999 * time.Second) answer, err := ocrInstances[0].GetLatestAnswer(context.Background()) require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail") require.Equal(t, int64(5), answer.Int64(), "Expected latest answer from OCR contract to be 5 but got %d", answer.Int64()) - err = actions.SetAllAdapterResponsesToTheSameValueLocal(10, ocrInstances, workerNodes, env.MockServer.Client) + err = actions.SetAllAdapterResponsesToTheSameValueLocal(10, ocrInstances, workerNodes, env.MockAdapter) require.NoError(t, err) err = actions.StartNewRound(2, ocrInstances, env.EVMClient, l) require.NoError(t, err) diff --git a/integration-tests/smoke/forwarders_ocr2_test.go b/integration-tests/smoke/forwarders_ocr2_test.go index 48d1d20b4dc..2840658122e 100644 --- a/integration-tests/smoke/forwarders_ocr2_test.go +++ b/integration-tests/smoke/forwarders_ocr2_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "math/big" + "net/http" "testing" "time" @@ -25,7 +26,7 @@ func TestForwarderOCR2Basic(t *testing.T) { env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). + WithMockAdapter(). WithCLNodeConfig(node.NewConfig(node.NewBaseConfig(), node.WithOCR2(), node.WithP2Pv2(), @@ -80,7 +81,7 @@ func TestForwarderOCR2Basic(t *testing.T) { err = env.EVMClient.WaitForEvents() require.NoError(t, err, "Error waiting for events") - err = actions.CreateOCRv2JobsLocal(ocrInstances, bootstrapNode, workerNodes, env.MockServer.Client, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), true) + err = actions.CreateOCRv2JobsLocal(ocrInstances, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), true) require.NoError(t, err, "Error creating OCRv2 jobs with forwarders") err = env.EVMClient.WaitForEvents() require.NoError(t, err, "Error waiting for events") @@ -101,7 +102,7 @@ func TestForwarderOCR2Basic(t *testing.T) { for i := 2; i <= 3; i++ { ocrRoundVal := (5 + i) % 10 - err = env.MockServer.Client.SetValuePath("ocr2", ocrRoundVal) + err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, ocrRoundVal) require.NoError(t, err) err = actions.StartNewOCR2Round(int64(i), ocrInstances, env.EVMClient, time.Minute*10, l) require.NoError(t, err) diff --git a/integration-tests/smoke/keeper_test.go b/integration-tests/smoke/keeper_test.go index 0e4cb7ce041..5b002b7b9ba 100644 --- a/integration-tests/smoke/keeper_test.go +++ b/integration-tests/smoke/keeper_test.go @@ -1110,7 +1110,6 @@ func setupKeeperTest(t *testing.T) ( env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). WithCLNodes(5). WithCLNodeConfig(clNodeConfig). WithFunding(big.NewFloat(.5)). diff --git a/integration-tests/smoke/ocr2_test.go b/integration-tests/smoke/ocr2_test.go index c6804e48d01..ccc75574f21 100644 --- a/integration-tests/smoke/ocr2_test.go +++ b/integration-tests/smoke/ocr2_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "math/big" + "net/http" "strings" "testing" "time" @@ -34,7 +35,7 @@ func TestOCRv2Basic(t *testing.T) { env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). + WithMockAdapter(). WithCLNodeConfig(node.NewConfig(node.NewBaseConfig(), node.WithOCR2(), node.WithP2Pv2(), @@ -74,7 +75,7 @@ func TestOCRv2Basic(t *testing.T) { aggregatorContracts, err := actions.DeployOCRv2Contracts(1, linkToken, env.ContractDeployer, transmitters, env.EVMClient, ocrOffchainOptions) require.NoError(t, err, "Error deploying OCRv2 aggregator contracts") - err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockServer.Client, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), false) + err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), false) require.NoError(t, err, "Error creating OCRv2 jobs") ocrv2Config, err := actions.BuildMedianOCR2ConfigLocal(workerNodes, ocrOffchainOptions) @@ -92,7 +93,7 @@ func TestOCRv2Basic(t *testing.T) { roundData.Answer.Int64(), ) - err = env.MockServer.Client.SetValuePath("ocr2", 10) + err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 10) require.NoError(t, err) err = actions.StartNewOCR2Round(2, aggregatorContracts, env.EVMClient, time.Minute*5, l) require.NoError(t, err) diff --git a/integration-tests/smoke/ocr_test.go b/integration-tests/smoke/ocr_test.go index 56d045fa097..dad3b0272fe 100644 --- a/integration-tests/smoke/ocr_test.go +++ b/integration-tests/smoke/ocr_test.go @@ -20,7 +20,7 @@ func TestOCRBasic(t *testing.T) { env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). + WithMockAdapter(). WithCLNodes(6). WithFunding(big.NewFloat(.1)). Build() @@ -44,7 +44,7 @@ func TestOCRBasic(t *testing.T) { err = env.EVMClient.WaitForEvents() require.NoError(t, err, "Error waiting for events") - err = actions.CreateOCRJobsLocal(ocrInstances, bootstrapNode, workerNodes, 5, env.MockServer.Client, env.EVMClient.GetChainID().String()) + err = actions.CreateOCRJobsLocal(ocrInstances, bootstrapNode, workerNodes, 5, env.MockAdapter, env.EVMClient.GetChainID().String()) require.NoError(t, err) err = actions.StartNewRound(1, ocrInstances, env.EVMClient, l) @@ -54,7 +54,7 @@ func TestOCRBasic(t *testing.T) { require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail") require.Equal(t, int64(5), answer.Int64(), "Expected latest answer from OCR contract to be 5 but got %d", answer.Int64()) - err = actions.SetAllAdapterResponsesToTheSameValueLocal(10, ocrInstances, workerNodes, env.MockServer.Client) + err = actions.SetAllAdapterResponsesToTheSameValueLocal(10, ocrInstances, workerNodes, env.MockAdapter) require.NoError(t, err) err = actions.StartNewRound(2, ocrInstances, env.EVMClient, l) require.NoError(t, err) diff --git a/integration-tests/smoke/runlog_test.go b/integration-tests/smoke/runlog_test.go index 0bfc41eca71..380d0602c06 100644 --- a/integration-tests/smoke/runlog_test.go +++ b/integration-tests/smoke/runlog_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "math/big" + "net/http" "strings" "testing" @@ -24,7 +25,7 @@ func TestRunLogBasic(t *testing.T) { env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). + WithMockAdapter(). WithCLNodes(1). WithFunding(big.NewFloat(.1)). Build() @@ -46,14 +47,14 @@ func TestRunLogBasic(t *testing.T) { err = lt.Transfer(consumer.Address(), big.NewInt(2e18)) require.NoError(t, err, "Transferring %d to consumer contract shouldn't fail", big.NewInt(2e18)) - err = env.MockServer.Client.SetValuePath("/variable", 5) - require.NoError(t, err, "Setting mockserver value path shouldn't fail") + err = env.MockAdapter.SetAdapterBasedIntValuePath("/variable", []string{http.MethodPost}, 5) + require.NoError(t, err, "Setting mock adapter value path shouldn't fail") jobUUID := uuid.New() bta := client.BridgeTypeAttributes{ Name: fmt.Sprintf("five-%s", jobUUID.String()), - URL: fmt.Sprintf("%s/variable", env.MockServer.Client.Config.ClusterURL), + URL: fmt.Sprintf("%s/variable", env.MockAdapter.InternalEndpoint), } err = env.CLNodes[0].API.MustCreateBridge(&bta) require.NoError(t, err, "Creating bridge shouldn't fail") @@ -82,7 +83,7 @@ func TestRunLogBasic(t *testing.T) { oracle.Address(), jobID, big.NewInt(1e18), - fmt.Sprintf("%s/variable", env.MockServer.Client.Config.ClusterURL), + fmt.Sprintf("%s/variable", env.MockAdapter.InternalEndpoint), "data,result", big.NewInt(100), ) diff --git a/integration-tests/smoke/vrf_test.go b/integration-tests/smoke/vrf_test.go index 47f8cd8e30f..b4a129ad8dc 100644 --- a/integration-tests/smoke/vrf_test.go +++ b/integration-tests/smoke/vrf_test.go @@ -26,7 +26,6 @@ func TestVRFBasic(t *testing.T) { env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). - WithMockServer(1). WithCLNodes(1). WithFunding(big.NewFloat(.1)). Build() From edbcda7b18b88a5e68f1b7486216a2abb5420d7c Mon Sep 17 00:00:00 2001 From: Makram Date: Thu, 5 Oct 2023 15:30:30 +0300 Subject: [PATCH 56/84] feature: support ovm in ChainSpecificUtil (#10757) * feature: support ovm in ChainSpecificUtil So far ChainSpecificUtil.sol has only supported arbitrum. This change adds support for OVM/OP stack blockchains by using the OVM_GasPriceOracle predeploy. * feature: support OP L1 data fees * Update chain-specific util with optimism fees and optimism tests * Fix scripts * Fix wrappers after merge * Reduce upgraded version contract size --------- Co-authored-by: Chris <104409744+vreff@users.noreply.github.com> --- contracts/scripts/native_solc_compile_all_vrf | 3 +- contracts/src/v0.8/ChainSpecificUtil.sol | 99 ++++++- .../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol | 4 +- .../VRFCoordinatorV2PlusUpgradedVersion.sol | 13 +- contracts/src/v0.8/vrf/VRFCoordinatorV2.sol | 2 +- .../testhelpers/ChainSpecificUtilHelper.sol | 23 ++ .../v0.8/foundry/vrf/ChainSpecificUtil.t.sol | 195 +++++++++++++ .../chain_specific_util_helper.go | 274 ++++++++++++++++++ .../vrf_coordinator_v2/vrf_coordinator_v2.go | 2 +- .../vrf_coordinator_v2_5.go | 2 +- .../vrf_v2plus_upgraded_version.go | 90 +----- .../generated/vrfv2_wrapper/vrfv2_wrapper.go | 2 +- .../vrfv2plus_wrapper/vrfv2plus_wrapper.go | 2 +- ...rapper-dependency-versions-do-not-edit.txt | 11 +- core/gethwrappers/go_generate.go | 3 +- core/scripts/vrfv2plus/testnet/main.go | 46 +++ 16 files changed, 657 insertions(+), 114 deletions(-) create mode 100644 contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol create mode 100644 contracts/test/v0.8/foundry/vrf/ChainSpecificUtil.t.sol create mode 100644 core/gethwrappers/generated/chain_specific_util_helper/chain_specific_util_helper.go diff --git a/contracts/scripts/native_solc_compile_all_vrf b/contracts/scripts/native_solc_compile_all_vrf index 0a3b1367bdf..49666bde7f6 100755 --- a/contracts/scripts/native_solc_compile_all_vrf +++ b/contracts/scripts/native_solc_compile_all_vrf @@ -40,6 +40,7 @@ compileContract mocks/VRFCoordinatorMock.sol # VRF V2 compileContract vrf/VRFConsumerBaseV2.sol +compileContract vrf/testhelpers/ChainSpecificUtilHelper.sol compileContract vrf/testhelpers/VRFConsumerV2.sol compileContract vrf/testhelpers/VRFMaliciousConsumerV2.sol compileContract vrf/testhelpers/VRFTestHelper.sol @@ -57,7 +58,7 @@ compileContract vrf/VRFOwner.sol # VRF V2Plus compileContract dev/interfaces/IVRFCoordinatorV2PlusInternal.sol compileContract dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol -compileContractAltOpts dev/vrf/VRFCoordinatorV2_5.sol 500 +compileContractAltOpts dev/vrf/VRFCoordinatorV2_5.sol 50 compileContract dev/vrf/BatchVRFCoordinatorV2Plus.sol compileContract dev/vrf/VRFV2PlusWrapper.sol compileContract dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol diff --git a/contracts/src/v0.8/ChainSpecificUtil.sol b/contracts/src/v0.8/ChainSpecificUtil.sol index 088ffbd3db8..67e788d0ee4 100644 --- a/contracts/src/v0.8/ChainSpecificUtil.sol +++ b/contracts/src/v0.8/ChainSpecificUtil.sol @@ -3,19 +3,56 @@ pragma solidity ^0.8.4; import {ArbSys} from "./vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; import {ArbGasInfo} from "./vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; +import {OVM_GasPriceOracle} from "./vendor/@eth-optimism/contracts/v0.8.6/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; -//@dev A library that abstracts out opcodes that behave differently across chains. -//@dev The methods below return values that are pertinent to the given chain. -//@dev For instance, ChainSpecificUtil.getBlockNumber() returns L2 block number in L2 chains +/// @dev A library that abstracts out opcodes that behave differently across chains. +/// @dev The methods below return values that are pertinent to the given chain. +/// @dev For instance, ChainSpecificUtil.getBlockNumber() returns L2 block number in L2 chains library ChainSpecificUtil { + // ------------ Start Arbitrum Constants ------------ + + /// @dev ARBSYS_ADDR is the address of the ArbSys precompile on Arbitrum. + /// @dev reference: https://github.com/OffchainLabs/nitro/blob/v2.0.14/contracts/src/precompiles/ArbSys.sol#L10 address private constant ARBSYS_ADDR = address(0x0000000000000000000000000000000000000064); ArbSys private constant ARBSYS = ArbSys(ARBSYS_ADDR); + + /// @dev ARBGAS_ADDR is the address of the ArbGasInfo precompile on Arbitrum. + /// @dev reference: https://github.com/OffchainLabs/nitro/blob/v2.0.14/contracts/src/precompiles/ArbGasInfo.sol#L10 address private constant ARBGAS_ADDR = address(0x000000000000000000000000000000000000006C); ArbGasInfo private constant ARBGAS = ArbGasInfo(ARBGAS_ADDR); + uint256 private constant ARB_MAINNET_CHAIN_ID = 42161; uint256 private constant ARB_GOERLI_TESTNET_CHAIN_ID = 421613; uint256 private constant ARB_SEPOLIA_TESTNET_CHAIN_ID = 421614; + // ------------ End Arbitrum Constants ------------ + + // ------------ Start Optimism Constants ------------ + /// @dev L1_FEE_DATA_PADDING includes 35 bytes for L1 data padding for Optimism + bytes internal constant L1_FEE_DATA_PADDING = + "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; + /// @dev OVM_GASPRICEORACLE_ADDR is the address of the OVM_GasPriceOracle precompile on Optimism. + /// @dev reference: https://community.optimism.io/docs/developers/build/transaction-fees/#estimating-the-l1-data-fee + address private constant OVM_GASPRICEORACLE_ADDR = address(0x420000000000000000000000000000000000000F); + OVM_GasPriceOracle private constant OVM_GASPRICEORACLE = OVM_GasPriceOracle(OVM_GASPRICEORACLE_ADDR); + + uint256 private constant OP_MAINNET_CHAIN_ID = 10; + uint256 private constant OP_GOERLI_CHAIN_ID = 420; + uint256 private constant OP_SEPOLIA_CHAIN_ID = 11155420; + + /// @dev Base is a OP stack based rollup and follows the same L1 pricing logic as Optimism. + uint256 private constant BASE_MAINNET_CHAIN_ID = 8453; + uint256 private constant BASE_GOERLI_CHAIN_ID = 84531; + + // ------------ End Optimism Constants ------------ + + /** + * @notice Returns the blockhash for the given blockNumber. + * @notice If the blockNumber is more than 256 blocks in the past, returns the empty string. + * @notice When on a known Arbitrum chain, it uses ArbSys.arbBlockHash to get the blockhash. + * @notice Otherwise, it uses the blockhash opcode. + * @notice Note that the blockhash opcode will return the L2 blockhash on Optimism. + */ function getBlockhash(uint64 blockNumber) internal view returns (bytes32) { uint256 chainid = block.chainid; if (isArbitrumChainId(chainid)) { @@ -27,6 +64,12 @@ library ChainSpecificUtil { return blockhash(blockNumber); } + /** + * @notice Returns the block number of the current block. + * @notice When on a known Arbitrum chain, it uses ArbSys.arbBlockNumber to get the block number. + * @notice Otherwise, it uses the block.number opcode. + * @notice Note that the block.number opcode will return the L2 block number on Optimism. + */ function getBlockNumber() internal view returns (uint256) { uint256 chainid = block.chainid; if (isArbitrumChainId(chainid)) { @@ -35,10 +78,20 @@ library ChainSpecificUtil { return block.number; } - function getCurrentTxL1GasFees() internal view returns (uint256) { + /** + * @notice Returns the L1 fees that will be paid for the current transaction, given any calldata + * @notice for the current transaction. + * @notice When on a known Arbitrum chain, it uses ArbGas.getCurrentTxL1GasFees to get the fees. + * @notice On Arbitrum, the provided calldata is not used to calculate the fees. + * @notice On Optimism, the provided calldata is passed to the OVM_GasPriceOracle predeploy + * @notice and getL1Fee is called to get the fees. + */ + function getCurrentTxL1GasFees(bytes memory txCallData) internal view returns (uint256) { uint256 chainid = block.chainid; if (isArbitrumChainId(chainid)) { return ARBGAS.getCurrentTxL1GasFees(); + } else if (isOptimismChainId(chainid)) { + return OVM_GASPRICEORACLE.getL1Fee(bytes.concat(txCallData, L1_FEE_DATA_PADDING)); } return 0; } @@ -54,6 +107,8 @@ library ChainSpecificUtil { // see https://developer.arbitrum.io/devs-how-tos/how-to-estimate-gas#where-do-we-get-all-this-information-from // for the justification behind the 140 number. return l1PricePerByte * (calldataSizeBytes + 140); + } else if (isOptimismChainId(chainid)) { + return calculateOptimismL1DataFee(calldataSizeBytes); } return 0; } @@ -67,4 +122,40 @@ library ChainSpecificUtil { chainId == ARB_GOERLI_TESTNET_CHAIN_ID || chainId == ARB_SEPOLIA_TESTNET_CHAIN_ID; } + + /** + * @notice Return true if and only if the provided chain ID is an Optimism chain ID. + * @notice Note that optimism chain id's are also OP stack chain id's. + */ + function isOptimismChainId(uint256 chainId) internal pure returns (bool) { + return + chainId == OP_MAINNET_CHAIN_ID || + chainId == OP_GOERLI_CHAIN_ID || + chainId == OP_SEPOLIA_CHAIN_ID || + chainId == BASE_MAINNET_CHAIN_ID || + chainId == BASE_GOERLI_CHAIN_ID; + } + + function calculateOptimismL1DataFee(uint256 calldataSizeBytes) internal view returns (uint256) { + // from: https://community.optimism.io/docs/developers/build/transaction-fees/#the-l1-data-fee + // l1_data_fee = l1_gas_price * (tx_data_gas + fixed_overhead) * dynamic_overhead + // tx_data_gas = count_zero_bytes(tx_data) * 4 + count_non_zero_bytes(tx_data) * 16 + // note we conservatively assume all non-zero bytes. + uint256 l1BaseFeeWei = OVM_GASPRICEORACLE.l1BaseFee(); + uint256 numZeroBytes = 0; + uint256 numNonzeroBytes = calldataSizeBytes - numZeroBytes; + uint256 txDataGas = numZeroBytes * 4 + numNonzeroBytes * 16; + uint256 fixedOverhead = OVM_GASPRICEORACLE.overhead(); + + // The scalar is some value like 0.684, but is represented as + // that times 10 ^ number of scalar decimals. + // e.g scalar = 0.684 * 10^6 + // The divisor is used to divide that and have a net result of the true scalar. + uint256 scalar = OVM_GASPRICEORACLE.scalar(); + uint256 scalarDecimals = OVM_GASPRICEORACLE.decimals(); + uint256 divisor = 10 ** scalarDecimals; + + uint256 l1DataFee = (l1BaseFeeWei * (txDataGas + fixedOverhead) * scalar) / divisor; + return l1DataFee; + } } diff --git a/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol b/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol index 113f098614d..3cd5d05e6e8 100644 --- a/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol +++ b/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol @@ -483,7 +483,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { uint256 weiPerUnitGas ) internal view returns (uint96) { // Will return non-zero on chains that have this enabled - uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(); + uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(msg.data); // calculate the payment without the premium uint256 baseFeeWei = weiPerUnitGas * (gasAfterPaymentCalculation + startGas - gasleft()); // calculate the flat fee in wei @@ -505,7 +505,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { revert InvalidLinkWeiPrice(weiPerUnitLink); } // Will return non-zero on chains that have this enabled - uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(); + uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(msg.data); // (1e18 juels/link) ((wei/gas * gas) + l1wei) / (wei/link) = juels uint256 paymentNoFee = (1e18 * (weiPerUnitGas * (gasAfterPaymentCalculation + startGas - gasleft()) + l1CostWei)) / uint256(weiPerUnitLink); diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol index a8d2abfc4bc..94017adde73 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol @@ -36,7 +36,6 @@ contract VRFCoordinatorV2PlusUpgradedVersion is error ProvingKeyAlreadyRegistered(bytes32 keyHash); error NoSuchProvingKey(bytes32 keyHash); error InvalidLinkWeiPrice(int256 linkWei); - error InsufficientGasForConsumer(uint256 have, uint256 want); error NoCorrespondingRequest(); error IncorrectCommitment(); error BlockhashNotInStore(uint256 blockNum); @@ -57,7 +56,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is bytes extraArgs; } - mapping(bytes32 => address) /* keyHash */ /* oracle */ public s_provingKeys; + mapping(bytes32 => address) /* keyHash */ /* oracle */ internal s_provingKeys; bytes32[] public s_provingKeyHashes; mapping(uint256 => bytes32) /* requestID */ /* commitment */ public s_requestCommitments; @@ -81,9 +80,9 @@ contract VRFCoordinatorV2PlusUpgradedVersion is bool success ); - int256 public s_fallbackWeiPerUnitLink; + int256 internal s_fallbackWeiPerUnitLink; - FeeConfig public s_feeConfig; + FeeConfig internal s_feeConfig; struct FeeConfig { // Flat fee charged per fulfillment in millionths of link @@ -476,7 +475,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is uint256 weiPerUnitGas ) internal view returns (uint96) { // Will return non-zero on chains that have this enabled - uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(); + uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(msg.data); // calculate the payment without the premium uint256 baseFeeWei = weiPerUnitGas * (gasAfterPaymentCalculation + startGas - gasleft()); // calculate the flat fee in wei @@ -498,7 +497,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is revert InvalidLinkWeiPrice(weiPerUnitLink); } // Will return non-zero on chains that have this enabled - uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(); + uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(msg.data); // (1e18 juels/link) ((wei/gas * gas) + l1wei) / (wei/link) = juels uint256 paymentNoFee = (1e18 * (weiPerUnitGas * (gasAfterPaymentCalculation + startGas - gasleft()) + l1CostWei)) / uint256(weiPerUnitLink); @@ -670,7 +669,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is } function migrationVersion() public pure returns (uint8 version) { - return 1; + return 2; } /** diff --git a/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol b/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol index 52b7ab295e2..bed0d361b35 100644 --- a/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol +++ b/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol @@ -581,7 +581,7 @@ contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCo revert InvalidLinkWeiPrice(weiPerUnitLink); } // Will return non-zero on chains that have this enabled - uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(); + uint256 l1CostWei = ChainSpecificUtil.getCurrentTxL1GasFees(msg.data); // (1e18 juels/link) ((wei/gas * gas) + l1wei) / (wei/link) = juels uint256 paymentNoFee = (1e18 * (weiPerUnitGas * (gasAfterPaymentCalculation + startGas - gasleft()) + l1CostWei)) / uint256(weiPerUnitLink); diff --git a/contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol b/contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol new file mode 100644 index 00000000000..6c22dbf9e4f --- /dev/null +++ b/contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "../../ChainSpecificUtil.sol"; + +/// @dev A helper contract that exposes ChainSpecificUtil methods for testing +contract ChainSpecificUtilHelper { + function getBlockhash(uint64 blockNumber) external view returns (bytes32) { + return ChainSpecificUtil.getBlockhash(blockNumber); + } + + function getBlockNumber() external view returns (uint256) { + return ChainSpecificUtil.getBlockNumber(); + } + + function getCurrentTxL1GasFees(string memory txCallData) external view returns (uint256) { + return ChainSpecificUtil.getCurrentTxL1GasFees(bytes(txCallData)); + } + + function getL1CalldataGasCost(uint256 calldataSize) external view returns (uint256) { + return ChainSpecificUtil.getL1CalldataGasCost(calldataSize); + } +} diff --git a/contracts/test/v0.8/foundry/vrf/ChainSpecificUtil.t.sol b/contracts/test/v0.8/foundry/vrf/ChainSpecificUtil.t.sol new file mode 100644 index 00000000000..06f234cfdae --- /dev/null +++ b/contracts/test/v0.8/foundry/vrf/ChainSpecificUtil.t.sol @@ -0,0 +1,195 @@ +pragma solidity 0.8.6; + +import "../BaseTest.t.sol"; +import {ChainSpecificUtil} from "../../../../src/v0.8/ChainSpecificUtil.sol"; +import {ArbSys} from "../../../../src/v0.8/vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; +import {ArbGasInfo} from "../../../../src/v0.8/vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; +import {OVM_GasPriceOracle} from "../../../../src/v0.8/vendor/@eth-optimism/contracts/v0.8.6/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; + +contract ChainSpecificUtilTest is BaseTest { + // ------------ Start Arbitrum Constants ------------ + + /// @dev ARBSYS_ADDR is the address of the ArbSys precompile on Arbitrum. + /// @dev reference: https://github.com/OffchainLabs/nitro/blob/v2.0.14/contracts/src/precompiles/ArbSys.sol#L10 + address private constant ARBSYS_ADDR = address(0x0000000000000000000000000000000000000064); + ArbSys private constant ARBSYS = ArbSys(ARBSYS_ADDR); + + /// @dev ARBGAS_ADDR is the address of the ArbGasInfo precompile on Arbitrum. + /// @dev reference: https://github.com/OffchainLabs/nitro/blob/v2.0.14/contracts/src/precompiles/ArbGasInfo.sol#L10 + address private constant ARBGAS_ADDR = address(0x000000000000000000000000000000000000006C); + ArbGasInfo private constant ARBGAS = ArbGasInfo(ARBGAS_ADDR); + + uint256 private constant ARB_MAINNET_CHAIN_ID = 42161; + uint256 private constant ARB_GOERLI_TESTNET_CHAIN_ID = 421613; + uint256 private constant ARB_SEPOLIA_TESTNET_CHAIN_ID = 421614; + + // ------------ End Arbitrum Constants ------------ + + // ------------ Start Optimism Constants ------------ + /// @dev L1_FEE_DATA_PADDING includes 35 bytes for L1 data padding for Optimism + bytes internal constant L1_FEE_DATA_PADDING = + "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; + /// @dev OVM_GASPRICEORACLE_ADDR is the address of the OVM_GasPriceOracle precompile on Optimism. + /// @dev reference: https://community.optimism.io/docs/developers/build/transaction-fees/#estimating-the-l1-data-fee + address private constant OVM_GASPRICEORACLE_ADDR = address(0x420000000000000000000000000000000000000F); + OVM_GasPriceOracle private constant OVM_GASPRICEORACLE = OVM_GasPriceOracle(OVM_GASPRICEORACLE_ADDR); + + uint256 private constant OP_MAINNET_CHAIN_ID = 10; + uint256 private constant OP_GOERLI_CHAIN_ID = 420; + uint256 private constant OP_SEPOLIA_CHAIN_ID = 11155420; + + /// @dev Base is a OP stack based rollup and follows the same L1 pricing logic as Optimism. + uint256 private constant BASE_MAINNET_CHAIN_ID = 8453; + uint256 private constant BASE_GOERLI_CHAIN_ID = 84531; + + // ------------ End Optimism Constants ------------ + + function setUp() public override { + BaseTest.setUp(); + vm.clearMockedCalls(); + } + + function testGetBlockhashArbitrum() public { + uint256[3] memory chainIds = [ARB_MAINNET_CHAIN_ID, ARB_GOERLI_TESTNET_CHAIN_ID, ARB_SEPOLIA_TESTNET_CHAIN_ID]; + bytes32[3] memory expectedBlockHashes = [keccak256("mainnet"), keccak256("goerli"), keccak256("sepolia")]; + uint256[3] memory expectedBlockNumbers = [uint256(10), 11, 12]; + for (uint256 i = 0; i < chainIds.length; i++) { + vm.chainId(chainIds[i]); + bytes32 expectedBlockHash = expectedBlockHashes[i]; + uint256 expectedBlockNumber = expectedBlockNumbers[i]; + vm.mockCall( + ARBSYS_ADDR, + abi.encodeWithSelector(ArbSys.arbBlockNumber.selector), + abi.encode(expectedBlockNumber + 1) + ); + vm.mockCall( + ARBSYS_ADDR, + abi.encodeWithSelector(ArbSys.arbBlockHash.selector, expectedBlockNumber), + abi.encodePacked(expectedBlockHash) + ); + bytes32 actualBlockHash = ChainSpecificUtil.getBlockhash(uint64(expectedBlockNumber)); + assertEq(expectedBlockHash, actualBlockHash, "incorrect blockhash"); + } + } + + function testGetBlockhashOptimism() public { + // Optimism L2 block hash is simply blockhash() + bytes32 actualBlockhash = ChainSpecificUtil.getBlockhash(uint64(block.number - 1)); + assertEq(blockhash(block.number - 1), actualBlockhash); + } + + function testGetBlockNumberArbitrum() public { + uint256[2] memory chainIds = [ARB_MAINNET_CHAIN_ID, ARB_GOERLI_TESTNET_CHAIN_ID]; + uint256[3] memory expectedBlockNumbers = [uint256(10), 11, 12]; + for (uint256 i = 0; i < chainIds.length; i++) { + vm.chainId(chainIds[i]); + uint256 expectedBlockNumber = expectedBlockNumbers[i]; + vm.mockCall(ARBSYS_ADDR, abi.encodeWithSelector(ArbSys.arbBlockNumber.selector), abi.encode(expectedBlockNumber)); + uint256 actualBlockNumber = ChainSpecificUtil.getBlockNumber(); + assertEq(expectedBlockNumber, actualBlockNumber, "incorrect block number"); + } + } + + function testGetBlockNumberOptimism() public { + // Optimism L2 block number is simply block.number + uint256 actualBlockNumber = ChainSpecificUtil.getBlockNumber(); + assertEq(block.number, actualBlockNumber); + } + + function testGetCurrentTxL1GasFeesArbitrum() public { + uint256[3] memory chainIds = [ARB_MAINNET_CHAIN_ID, ARB_GOERLI_TESTNET_CHAIN_ID, ARB_SEPOLIA_TESTNET_CHAIN_ID]; + uint256[3] memory expectedGasFees = [uint256(10 gwei), 12 gwei, 14 gwei]; + for (uint256 i = 0; i < chainIds.length; i++) { + vm.chainId(chainIds[i]); + uint256 expectedGasFee = expectedGasFees[i]; + vm.mockCall( + ARBGAS_ADDR, + abi.encodeWithSelector(ArbGasInfo.getCurrentTxL1GasFees.selector), + abi.encode(expectedGasFee) + ); + uint256 actualGasFee = ChainSpecificUtil.getCurrentTxL1GasFees(""); + assertEq(expectedGasFee, actualGasFee, "incorrect gas fees"); + } + } + + function testGetCurrentTxL1GasFeesOptimism() public { + // set optimism chain id + uint256[5] memory chainIds = [ + OP_MAINNET_CHAIN_ID, + OP_GOERLI_CHAIN_ID, + OP_SEPOLIA_CHAIN_ID, + BASE_MAINNET_CHAIN_ID, + BASE_GOERLI_CHAIN_ID + ]; + uint256[5] memory expectedGasFees = [uint256(10 gwei), 12 gwei, 14 gwei, 16 gwei, 18 gwei]; + for (uint256 i = 0; i < chainIds.length; i++) { + vm.chainId(chainIds[i]); + uint256 expectedL1Fee = expectedGasFees[i]; + bytes memory someCalldata = abi.encode(address(0), "blah", uint256(1)); + vm.mockCall( + OVM_GASPRICEORACLE_ADDR, + abi.encodeWithSelector(OVM_GasPriceOracle.getL1Fee.selector, bytes.concat(someCalldata, L1_FEE_DATA_PADDING)), + abi.encode(expectedL1Fee) + ); + uint256 actualL1Fee = ChainSpecificUtil.getCurrentTxL1GasFees(someCalldata); + assertEq(expectedL1Fee, actualL1Fee, "incorrect gas fees"); + } + } + + function testGetL1CalldataGasCostArbitrum() public { + uint256[3] memory chainIds = [ARB_MAINNET_CHAIN_ID, ARB_GOERLI_TESTNET_CHAIN_ID, ARB_SEPOLIA_TESTNET_CHAIN_ID]; + for (uint256 i = 0; i < chainIds.length; i++) { + vm.chainId(chainIds[i]); + vm.mockCall( + ARBGAS_ADDR, + abi.encodeWithSelector(ArbGasInfo.getPricesInWei.selector), + abi.encode(0, 10, 0, 0, 0, 0) + ); + + // fee = l1PricePerByte * (calldataSizeBytes + 140) + // fee = 10 * (10 + 140) = 1500 + uint256 dataFee = ChainSpecificUtil.getL1CalldataGasCost(10); + assertEq(dataFee, 1500); + } + } + + function testGetL1CalldataGasCostOptimism() public { + uint256[5] memory chainIds = [ + OP_MAINNET_CHAIN_ID, + OP_GOERLI_CHAIN_ID, + OP_SEPOLIA_CHAIN_ID, + BASE_MAINNET_CHAIN_ID, + BASE_GOERLI_CHAIN_ID + ]; + for (uint256 i = 0; i < chainIds.length; i++) { + vm.chainId(chainIds[i]); + vm.mockCall( + OVM_GASPRICEORACLE_ADDR, + abi.encodeWithSelector(bytes4(hex"519b4bd3")), // l1BaseFee() + abi.encode(10) + ); + vm.mockCall( + OVM_GASPRICEORACLE_ADDR, + abi.encodeWithSelector(bytes4(hex"0c18c162")), // overhead() + abi.encode(160) + ); + vm.mockCall( + OVM_GASPRICEORACLE_ADDR, + abi.encodeWithSelector(bytes4(hex"f45e65d8")), // scalar() + abi.encode(500_000) + ); + vm.mockCall( + OVM_GASPRICEORACLE_ADDR, + abi.encodeWithSelector(bytes4(hex"313ce567")), // decimals() + abi.encode(6) + ); + + // tx_data_gas = count_zero_bytes(tx_data) * 4 + count_non_zero_bytes(tx_data) * 16 + // tx_data_gas = 0 * 4 + 10 * 16 = 160 + // l1_data_fee = l1_gas_price * (tx_data_gas + fixed_overhead) * dynamic_overhead + // l1_data_fee = 10 * (160 + 160) * 500_000 / 1_000_000 = 1600 + uint256 dataFee = ChainSpecificUtil.getL1CalldataGasCost(10); + assertEq(dataFee, 1600); + } + } +} diff --git a/core/gethwrappers/generated/chain_specific_util_helper/chain_specific_util_helper.go b/core/gethwrappers/generated/chain_specific_util_helper/chain_specific_util_helper.go new file mode 100644 index 00000000000..aa4dc0f88d9 --- /dev/null +++ b/core/gethwrappers/generated/chain_specific_util_helper/chain_specific_util_helper.go @@ -0,0 +1,274 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package chain_specific_util_helper + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ChainSpecificUtilHelperMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"getBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockNumber\",\"type\":\"uint64\"}],\"name\":\"getBlockhash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"txCallData\",\"type\":\"string\"}],\"name\":\"getCurrentTxL1GasFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"calldataSize\",\"type\":\"uint256\"}],\"name\":\"getL1CalldataGasCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b50610c1a806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806342cbb15c1461005157806397e329a91461006b578063b778b1121461007e578063da9027ef14610091575b600080fd5b6100596100a4565b60405190815260200160405180910390f35b6100596100793660046108bf565b6100b3565b61005961008c36600461085c565b6100c4565b61005961009f36600461078d565b6100cf565b60006100ae6100da565b905090565b60006100be82610177565b92915050565b60006100be8261027d565b60006100be82610355565b6000466100e681610441565b1561017057606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561013257600080fd5b505afa158015610146573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016a9190610774565b91505090565b4391505090565b60004661018381610441565b1561026d576101008367ffffffffffffffff1661019e6100da565b6101a89190610b20565b11806101c557506101b76100da565b8367ffffffffffffffff1610155b156101d35750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152606490632b407a82906024015b60206040518083038186803b15801561022e57600080fd5b505afa158015610242573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102669190610774565b9392505050565b505067ffffffffffffffff164090565b60004661028981610441565b15610335576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b1580156102d757600080fd5b505afa1580156102eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030f9190610875565b5050505091505083608c6103239190610969565b61032d9082610ae3565b949350505050565b61033e81610464565b1561034c576102668361049e565b50600092915050565b60004661036181610441565b156103ad57606c73ffffffffffffffffffffffffffffffffffffffff1663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022e57600080fd5b6103b681610464565b1561034c5773420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff166349948e0e84604051806080016040528060488152602001610bc6604891396040516020016104169291906108e9565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016102169190610918565b600061a4b1821480610455575062066eed82145b806100be57505062066eee1490565b6000600a82148061047657506101a482145b80610483575062aa37dc82145b8061048f575061210582145b806100be57505062014a331490565b60008073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663519b4bd36040518163ffffffff1660e01b815260040160206040518083038186803b1580156104fb57600080fd5b505afa15801561050f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105339190610774565b90506000806105428186610b20565b90506000610551826010610ae3565b61055c846004610ae3565b6105669190610969565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff16630c18c1626040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c457600080fd5b505afa1580156105d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fc9190610774565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663f45e65d86040518163ffffffff1660e01b815260040160206040518083038186803b15801561065a57600080fd5b505afa15801561066e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106929190610774565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156106f057600080fd5b505afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190610774565b9050600061073782600a610a1d565b9050600081846107478789610969565b610751908c610ae3565b61075b9190610ae3565b6107659190610981565b9b9a5050505050505050505050565b60006020828403121561078657600080fd5b5051919050565b60006020828403121561079f57600080fd5b813567ffffffffffffffff808211156107b757600080fd5b818401915084601f8301126107cb57600080fd5b8135818111156107dd576107dd610b96565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561082357610823610b96565b8160405282815287602084870101111561083c57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561086e57600080fd5b5035919050565b60008060008060008060c0878903121561088e57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b6000602082840312156108d157600080fd5b813567ffffffffffffffff8116811461026657600080fd5b600083516108fb818460208801610b37565b83519083019061090f818360208801610b37565b01949350505050565b6020815260008251806020840152610937816040850160208701610b37565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000821982111561097c5761097c610b67565b500190565b6000826109b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600181815b80851115610a1557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156109fb576109fb610b67565b80851615610a0857918102915b93841c93908002906109c1565b509250929050565b60006102668383600082610a33575060016100be565b81610a40575060006100be565b8160018114610a565760028114610a6057610a7c565b60019150506100be565b60ff841115610a7157610a71610b67565b50506001821b6100be565b5060208310610133831016604e8410600b8410161715610a9f575081810a6100be565b610aa983836109bc565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610adb57610adb610b67565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610b1b57610b1b610b67565b500290565b600082821015610b3257610b32610b67565b500390565b60005b83811015610b52578181015183820152602001610b3a565b83811115610b61576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfe307866666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666a164736f6c6343000806000a", +} + +var ChainSpecificUtilHelperABI = ChainSpecificUtilHelperMetaData.ABI + +var ChainSpecificUtilHelperBin = ChainSpecificUtilHelperMetaData.Bin + +func DeployChainSpecificUtilHelper(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ChainSpecificUtilHelper, error) { + parsed, err := ChainSpecificUtilHelperMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ChainSpecificUtilHelperBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ChainSpecificUtilHelper{ChainSpecificUtilHelperCaller: ChainSpecificUtilHelperCaller{contract: contract}, ChainSpecificUtilHelperTransactor: ChainSpecificUtilHelperTransactor{contract: contract}, ChainSpecificUtilHelperFilterer: ChainSpecificUtilHelperFilterer{contract: contract}}, nil +} + +type ChainSpecificUtilHelper struct { + address common.Address + abi abi.ABI + ChainSpecificUtilHelperCaller + ChainSpecificUtilHelperTransactor + ChainSpecificUtilHelperFilterer +} + +type ChainSpecificUtilHelperCaller struct { + contract *bind.BoundContract +} + +type ChainSpecificUtilHelperTransactor struct { + contract *bind.BoundContract +} + +type ChainSpecificUtilHelperFilterer struct { + contract *bind.BoundContract +} + +type ChainSpecificUtilHelperSession struct { + Contract *ChainSpecificUtilHelper + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ChainSpecificUtilHelperCallerSession struct { + Contract *ChainSpecificUtilHelperCaller + CallOpts bind.CallOpts +} + +type ChainSpecificUtilHelperTransactorSession struct { + Contract *ChainSpecificUtilHelperTransactor + TransactOpts bind.TransactOpts +} + +type ChainSpecificUtilHelperRaw struct { + Contract *ChainSpecificUtilHelper +} + +type ChainSpecificUtilHelperCallerRaw struct { + Contract *ChainSpecificUtilHelperCaller +} + +type ChainSpecificUtilHelperTransactorRaw struct { + Contract *ChainSpecificUtilHelperTransactor +} + +func NewChainSpecificUtilHelper(address common.Address, backend bind.ContractBackend) (*ChainSpecificUtilHelper, error) { + abi, err := abi.JSON(strings.NewReader(ChainSpecificUtilHelperABI)) + if err != nil { + return nil, err + } + contract, err := bindChainSpecificUtilHelper(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ChainSpecificUtilHelper{address: address, abi: abi, ChainSpecificUtilHelperCaller: ChainSpecificUtilHelperCaller{contract: contract}, ChainSpecificUtilHelperTransactor: ChainSpecificUtilHelperTransactor{contract: contract}, ChainSpecificUtilHelperFilterer: ChainSpecificUtilHelperFilterer{contract: contract}}, nil +} + +func NewChainSpecificUtilHelperCaller(address common.Address, caller bind.ContractCaller) (*ChainSpecificUtilHelperCaller, error) { + contract, err := bindChainSpecificUtilHelper(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ChainSpecificUtilHelperCaller{contract: contract}, nil +} + +func NewChainSpecificUtilHelperTransactor(address common.Address, transactor bind.ContractTransactor) (*ChainSpecificUtilHelperTransactor, error) { + contract, err := bindChainSpecificUtilHelper(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ChainSpecificUtilHelperTransactor{contract: contract}, nil +} + +func NewChainSpecificUtilHelperFilterer(address common.Address, filterer bind.ContractFilterer) (*ChainSpecificUtilHelperFilterer, error) { + contract, err := bindChainSpecificUtilHelper(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ChainSpecificUtilHelperFilterer{contract: contract}, nil +} + +func bindChainSpecificUtilHelper(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ChainSpecificUtilHelperMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ChainSpecificUtilHelper.Contract.ChainSpecificUtilHelperCaller.contract.Call(opts, result, method, params...) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ChainSpecificUtilHelper.Contract.ChainSpecificUtilHelperTransactor.contract.Transfer(opts) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ChainSpecificUtilHelper.Contract.ChainSpecificUtilHelperTransactor.contract.Transact(opts, method, params...) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ChainSpecificUtilHelper.Contract.contract.Call(opts, result, method, params...) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ChainSpecificUtilHelper.Contract.contract.Transfer(opts) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ChainSpecificUtilHelper.Contract.contract.Transact(opts, method, params...) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCaller) GetBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ChainSpecificUtilHelper.contract.Call(opts, &out, "getBlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperSession) GetBlockNumber() (*big.Int, error) { + return _ChainSpecificUtilHelper.Contract.GetBlockNumber(&_ChainSpecificUtilHelper.CallOpts) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCallerSession) GetBlockNumber() (*big.Int, error) { + return _ChainSpecificUtilHelper.Contract.GetBlockNumber(&_ChainSpecificUtilHelper.CallOpts) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCaller) GetBlockhash(opts *bind.CallOpts, blockNumber uint64) ([32]byte, error) { + var out []interface{} + err := _ChainSpecificUtilHelper.contract.Call(opts, &out, "getBlockhash", blockNumber) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperSession) GetBlockhash(blockNumber uint64) ([32]byte, error) { + return _ChainSpecificUtilHelper.Contract.GetBlockhash(&_ChainSpecificUtilHelper.CallOpts, blockNumber) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCallerSession) GetBlockhash(blockNumber uint64) ([32]byte, error) { + return _ChainSpecificUtilHelper.Contract.GetBlockhash(&_ChainSpecificUtilHelper.CallOpts, blockNumber) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCaller) GetCurrentTxL1GasFees(opts *bind.CallOpts, txCallData string) (*big.Int, error) { + var out []interface{} + err := _ChainSpecificUtilHelper.contract.Call(opts, &out, "getCurrentTxL1GasFees", txCallData) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperSession) GetCurrentTxL1GasFees(txCallData string) (*big.Int, error) { + return _ChainSpecificUtilHelper.Contract.GetCurrentTxL1GasFees(&_ChainSpecificUtilHelper.CallOpts, txCallData) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCallerSession) GetCurrentTxL1GasFees(txCallData string) (*big.Int, error) { + return _ChainSpecificUtilHelper.Contract.GetCurrentTxL1GasFees(&_ChainSpecificUtilHelper.CallOpts, txCallData) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCaller) GetL1CalldataGasCost(opts *bind.CallOpts, calldataSize *big.Int) (*big.Int, error) { + var out []interface{} + err := _ChainSpecificUtilHelper.contract.Call(opts, &out, "getL1CalldataGasCost", calldataSize) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperSession) GetL1CalldataGasCost(calldataSize *big.Int) (*big.Int, error) { + return _ChainSpecificUtilHelper.Contract.GetL1CalldataGasCost(&_ChainSpecificUtilHelper.CallOpts, calldataSize) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelperCallerSession) GetL1CalldataGasCost(calldataSize *big.Int) (*big.Int, error) { + return _ChainSpecificUtilHelper.Contract.GetL1CalldataGasCost(&_ChainSpecificUtilHelper.CallOpts, calldataSize) +} + +func (_ChainSpecificUtilHelper *ChainSpecificUtilHelper) Address() common.Address { + return _ChainSpecificUtilHelper.address +} + +type ChainSpecificUtilHelperInterface interface { + GetBlockNumber(opts *bind.CallOpts) (*big.Int, error) + + GetBlockhash(opts *bind.CallOpts, blockNumber uint64) ([32]byte, error) + + GetCurrentTxL1GasFees(opts *bind.CallOpts, txCallData string) (*big.Int, error) + + GetL1CalldataGasCost(opts *bind.CallOpts, calldataSize *big.Int) (*big.Int, error) + + Address() common.Address +} diff --git a/core/gethwrappers/generated/vrf_coordinator_v2/vrf_coordinator_v2.go b/core/gethwrappers/generated/vrf_coordinator_v2/vrf_coordinator_v2.go index 0a647479174..1f9ef1eda20 100644 --- a/core/gethwrappers/generated/vrf_coordinator_v2/vrf_coordinator_v2.go +++ b/core/gethwrappers/generated/vrf_coordinator_v2/vrf_coordinator_v2.go @@ -64,7 +64,7 @@ type VRFProof struct { var VRFCoordinatorV2MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkEthFeed\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier2\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier3\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier4\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier5\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier2\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier3\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier4\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier5\",\"type\":\"uint24\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_ETH_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"deregisterProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"internalType\":\"structVRFCoordinatorV2.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"name\":\"getCommitment\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSubId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier2\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier3\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier4\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier5\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier2\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier3\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier4\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier5\",\"type\":\"uint24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"}],\"name\":\"getFeeTier\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier2\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier3\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier4\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPMTier5\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier2\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier3\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier4\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"reqsForTier5\",\"type\":\"uint24\"}],\"internalType\":\"structVRFCoordinatorV2.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x60e06040523480156200001157600080fd5b50604051620059bc380380620059bc8339810160408190526200003491620001b1565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e8565b5050506001600160601b0319606093841b811660805290831b811660a052911b1660c052620001fb565b6001600160a01b038116331415620001435760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001ac57600080fd5b919050565b600080600060608486031215620001c757600080fd5b620001d28462000194565b9250620001e26020850162000194565b9150620001f26040850162000194565b90509250925092565b60805160601c60a05160601c60c05160601c615757620002656000396000818161051901526138e70152600081816106030152613e0c01526000818161036d015281816114da0152818161237701528181612dae01528181612eea015261350f01526157576000f3fe608060405234801561001057600080fd5b506004361061025b5760003560e01c80636f64f03f11610145578063ad178361116100bd578063d2f9f9a71161008c578063e72f6e3011610071578063e72f6e30146106e0578063e82ad7d4146106f3578063f2fde38b1461071657600080fd5b8063d2f9f9a7146106ba578063d7ae1d30146106cd57600080fd5b8063ad178361146105fe578063af198b9714610625578063c3f909d414610655578063caf70c4a146106a757600080fd5b80638da5cb5b11610114578063a21a23e4116100f9578063a21a23e4146105c0578063a47c7696146105c8578063a4c0ed36146105eb57600080fd5b80638da5cb5b1461059c5780639f87fad7146105ad57600080fd5b80636f64f03f1461055b5780637341c10c1461056e57806379ba509714610581578063823597401461058957600080fd5b8063356dac71116101d85780635fbbc0d2116101a757806366316d8d1161018c57806366316d8d14610501578063689c45171461051457806369bcdb7d1461053b57600080fd5b80635fbbc0d2146103f357806364d51a2a146104f957600080fd5b8063356dac71146103a757806340d6bb82146103af5780634cb48a54146103cd5780635d3b1d30146103e057600080fd5b806308821d581161022f57806315c48b841161021457806315c48b841461030e578063181f5a77146103295780631b6b6d231461036857600080fd5b806308821d58146102cf57806312b58349146102e257600080fd5b80620122911461026057806302bcc5b61461028057806304c357cb1461029557806306bfa637146102a8575b600080fd5b610268610729565b604051610277939291906152a1565b60405180910390f35b61029361028e3660046150ed565b6107a5565b005b6102936102a3366004615108565b610837565b60055467ffffffffffffffff165b60405167ffffffffffffffff9091168152602001610277565b6102936102dd366004614dfe565b6109eb565b6005546801000000000000000090046bffffffffffffffffffffffff165b604051908152602001610277565b61031660c881565b60405161ffff9091168152602001610277565b604080518082018252601681527f565246436f6f7264696e61746f72563220312e302e300000000000000000000060208201529051610277919061524c565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610277565b600a54610300565b6103b86101f481565b60405163ffffffff9091168152602001610277565b6102936103db366004614f97565b610bb0565b6103006103ee366004614e71565b610fa7565b600c546040805163ffffffff80841682526401000000008404811660208301526801000000000000000084048116928201929092526c010000000000000000000000008304821660608201527001000000000000000000000000000000008304909116608082015262ffffff740100000000000000000000000000000000000000008304811660a0830152770100000000000000000000000000000000000000000000008304811660c08301527a0100000000000000000000000000000000000000000000000000008304811660e08301527d01000000000000000000000000000000000000000000000000000000000090920490911661010082015261012001610277565b610316606481565b61029361050f366004614db6565b611385565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b6103006105493660046150d4565b60009081526009602052604090205490565b610293610569366004614cfb565b6115d4565b61029361057c366004615108565b611704565b610293611951565b6102936105973660046150ed565b611a1a565b6000546001600160a01b031661038f565b6102936105bb366004615108565b611be0565b6102b661201f565b6105db6105d63660046150ed565b612202565b604051610277949392919061543f565b6102936105f9366004614d2f565b612325565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b610638610633366004614ecf565b61257c565b6040516bffffffffffffffffffffffff9091168152602001610277565b600b546040805161ffff8316815263ffffffff6201000084048116602083015267010000000000000084048116928201929092526b010000000000000000000000909204166060820152608001610277565b6103006106b5366004614e1a565b612a16565b6103b86106c83660046150ed565b612a46565b6102936106db366004615108565b612c3b565b6102936106ee366004614ce0565b612d75565b6107066107013660046150ed565b612fb2565b6040519015158152602001610277565b610293610724366004614ce0565b6131d5565b600b546007805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561079357602002820191906000526020600020905b81548152602001906001019080831161077f575b50505050509050925092509250909192565b6107ad6131e6565b67ffffffffffffffff81166000908152600360205260409020546001600160a01b0316610806576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020546108349082906001600160a01b0316613242565b50565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680610893576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038216146108e5576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024015b60405180910390fd5b600b546601000000000000900460ff161561092c576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff84166000908152600360205260409020600101546001600160a01b038481169116146109e55767ffffffffffffffff841660008181526003602090815260409182902060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091558251338152918201527f69436ea6df009049404f564eff6622cd00522b0bd6a89efd9e52a355c4a879be91015b60405180910390a25b50505050565b6109f36131e6565b604080518082018252600091610a22919084906002908390839080828437600092019190915250612a16915050565b6000818152600660205260409020549091506001600160a01b031680610a77576040517f77f5b84c000000000000000000000000000000000000000000000000000000008152600481018390526024016108dc565b600082815260066020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b600754811015610b67578260078281548110610aca57610aca6156ec565b90600052602060002001541415610b55576007805460009190610aef906001906155a6565b81548110610aff57610aff6156ec565b906000526020600020015490508060078381548110610b2057610b206156ec565b6000918252602090912001556007805480610b3d57610b3d6156bd565b60019003818190600052602060002001600090559055505b80610b5f816155ea565b915050610aac565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610ba391815260200190565b60405180910390a2505050565b610bb86131e6565b60c861ffff87161115610c0b576040517fa738697600000000000000000000000000000000000000000000000000000000815261ffff871660048201819052602482015260c860448201526064016108dc565b60008213610c48576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018390526024016108dc565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001690971762010000909502949094177fffffffffffffffffffffffffffffffffff000000000000000000ffffffffffff166701000000000000009092027fffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffff16919091176b010000000000000000000000909302929092179093558651600c80549489015189890151938a0151978a0151968a015160c08b015160e08c01516101008d01519588167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009099169890981764010000000093881693909302929092177fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff1668010000000000000000958716959095027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff16949094176c0100000000000000000000000098861698909802979097177fffffffffffffffffff00000000000000ffffffffffffffffffffffffffffffff1670010000000000000000000000000000000096909416959095027fffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffff16929092177401000000000000000000000000000000000000000062ffffff92831602177fffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffff1677010000000000000000000000000000000000000000000000958216959095027fffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffff16949094177a01000000000000000000000000000000000000000000000000000092851692909202919091177cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167d0100000000000000000000000000000000000000000000000000000000009390911692909202919091178155600a84905590517fc21e3bd2e0b339d2848f0dd956947a88966c242c0c0c582a33137a5c1ceb5cb291610f97918991899189918991899190615300565b60405180910390a1505050505050565b600b546000906601000000000000900460ff1615610ff1576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff85166000908152600360205260409020546001600160a01b031661104a576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260026020908152604080832067ffffffffffffffff808a16855292529091205416806110ba576040517ff0019fe600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff871660048201523360248201526044016108dc565b600b5461ffff90811690861610806110d6575060c861ffff8616115b1561112657600b546040517fa738697600000000000000000000000000000000000000000000000000000000815261ffff8088166004830152909116602482015260c860448201526064016108dc565b600b5463ffffffff620100009091048116908516111561118d57600b546040517ff5d7e01e00000000000000000000000000000000000000000000000000000000815263ffffffff80871660048301526201000090920490911660248201526044016108dc565b6101f463ffffffff841611156111df576040517f47386bec00000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526101f460248201526044016108dc565b60006111ec826001615502565b6040805160208082018c9052338284015267ffffffffffffffff808c16606084015284166080808401919091528351808403909101815260a08301845280519082012060c083018d905260e080840182905284518085039091018152610100909301909352815191012091925081611262613667565b60408051602081019390935282015267ffffffffffffffff8a16606082015263ffffffff8089166080830152871660a08201523360c082015260e00160408051808303601f19018152828252805160209182012060008681526009835283902055848352820183905261ffff8a169082015263ffffffff808916606083015287166080820152339067ffffffffffffffff8b16908c907f63373d1c4696214b898952999c9aaec57dac1ee2723cec59bea6888f489a97729060a00160405180910390a45033600090815260026020908152604080832067ffffffffffffffff808d16855292529091208054919093167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009091161790915591505095945050505050565b600b546601000000000000900460ff16156113cc576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600860205260409020546bffffffffffffffffffffffff80831691161015611426576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260086020526040812080548392906114539084906bffffffffffffffffffffffff166155bd565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555080600560088282829054906101000a90046bffffffffffffffffffffffff166114aa91906155bd565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb83836040518363ffffffff1660e01b81526004016115489291906001600160a01b039290921682526bffffffffffffffffffffffff16602082015260400190565b602060405180830381600087803b15801561156257600080fd5b505af1158015611576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a9190614e36565b6115d0576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6115dc6131e6565b60408051808201825260009161160b919084906002908390839080828437600092019190915250612a16915050565b6000818152600660205260409020549091506001600160a01b031615611660576040517f4a0b8fa7000000000000000000000000000000000000000000000000000000008152600481018290526024016108dc565b600081815260066020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091556007805460018101825594527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610ba3565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680611760576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038216146117ad576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff16156117f4576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff84166000908152600360205260409020600201546064141561184b576040517f05a48e0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260026020908152604080832067ffffffffffffffff80891685529252909120541615611885576109e5565b6001600160a01b038316600081815260026020818152604080842067ffffffffffffffff8a1680865290835281852080547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166001908117909155600384528286209094018054948501815585529382902090920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001685179055905192835290917f43dc749a04ac8fb825cbd514f7c0e13f13bc6f2ee66043b76629d51776cff8e091016109dc565b6001546001600160a01b031633146119ab5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108dc565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600b546601000000000000900460ff1615611a61576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020546001600160a01b0316611aba576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020600101546001600160a01b03163314611b425767ffffffffffffffff8116600090815260036020526040908190206001015490517fd084e9750000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016108dc565b67ffffffffffffffff81166000818152600360209081526040918290208054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001909301805490931690925583516001600160a01b03909116808252928101919091529092917f6f1dc65165ffffedfd8e507b4a0f1fcfdada045ed11f6c26ba27cedfe87802f0910160405180910390a25050565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680611c3c576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614611c89576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff1615611cd0576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611cd984612fb2565b15611d10576040517fb42f66e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260026020908152604080832067ffffffffffffffff808916855292529091205416611d91576040517ff0019fe600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff851660048201526001600160a01b03841660248201526044016108dc565b67ffffffffffffffff8416600090815260036020908152604080832060020180548251818502810185019093528083529192909190830182828015611dff57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611de1575b50505050509050600060018251611e1691906155a6565b905060005b8251811015611f8e57856001600160a01b0316838281518110611e4057611e406156ec565b60200260200101516001600160a01b03161415611f7c576000838381518110611e6b57611e6b6156ec565b6020026020010151905080600360008a67ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000206002018381548110611eb157611eb16156ec565b600091825260208083209190910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03949094169390931790925567ffffffffffffffff8a168152600390915260409020600201805480611f1e57611f1e6156bd565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905550611f8e565b80611f86816155ea565b915050611e1b565b506001600160a01b038516600081815260026020908152604080832067ffffffffffffffff8b168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001690555192835290917f182bff9831466789164ca77075fffd84916d35a8180ba73c27e45634549b445b91015b60405180910390a2505050505050565b600b546000906601000000000000900460ff1615612069576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805467ffffffffffffffff1690600061208383615623565b82546101009290920a67ffffffffffffffff8181021990931691831602179091556005541690506000806040519080825280602002602001820160405280156120d6578160200160208202803683370190505b506040805180820182526000808252602080830182815267ffffffffffffffff888116808552600484528685209551865493516bffffffffffffffffffffffff9091167fffffffffffffffffffffffff0000000000000000000000000000000000000000948516176c01000000000000000000000000919093160291909117909455845160608101865233815280830184815281870188815295855260038452959093208351815483166001600160a01b03918216178255955160018201805490931696169590951790559151805194955090936121ba9260028501920190614a3a565b505060405133815267ffffffffffffffff841691507f464722b4166576d3dcbba877b999bc35cf911f4eaf434b7eba68fa113951d0bf9060200160405180910390a250905090565b67ffffffffffffffff8116600090815260036020526040812054819081906060906001600160a01b0316612262576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff80861660009081526004602090815260408083205460038352928190208054600290910180548351818602810186019094528084526bffffffffffffffffffffffff8616966c01000000000000000000000000909604909516946001600160a01b0390921693909291839183018282801561230f57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116122f1575b5050505050905093509350935093509193509193565b600b546601000000000000900460ff161561236c576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146123ce576040517f44b0e3c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208114612408576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612416828401846150ed565b67ffffffffffffffff81166000908152600360205260409020549091506001600160a01b0316612472576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff8116600090815260046020526040812080546bffffffffffffffffffffffff16918691906124a9838561552e565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555084600560088282829054906101000a90046bffffffffffffffffffffffff16612500919061552e565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508167ffffffffffffffff167fd39ec07f4e209f627a4c427971473820dc129761ba28de8906bd56f57101d4f882878461256791906154ea565b6040805192835260208301919091520161200f565b600b546000906601000000000000900460ff16156125c6576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005a905060008060006125da87876136f7565b9250925092506000866060015163ffffffff1667ffffffffffffffff8111156126055761260561571b565b60405190808252806020026020018201604052801561262e578160200160208202803683370190505b50905060005b876060015163ffffffff168110156126a25760408051602081018590529081018290526060016040516020818303038152906040528051906020012060001c828281518110612685576126856156ec565b60209081029190910101528061269a816155ea565b915050612634565b506000838152600960205260408082208290555181907f1fe543e300000000000000000000000000000000000000000000000000000000906126ea90879086906024016153f1565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252600b80547fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff166601000000000000179055908a015160808b015191925060009161279a9163ffffffff169084613a05565b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff1690556020808c01805167ffffffffffffffff9081166000908152600490935260408084205492518216845290922080549394506c01000000000000000000000000918290048316936001939192600c9261281e928692900416615502565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060006128758a600b600001600b9054906101000a900463ffffffff1663ffffffff1661286f85612a46565b3a613a53565b6020808e015167ffffffffffffffff166000908152600490915260409020549091506bffffffffffffffffffffffff808316911610156128e1576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808d015167ffffffffffffffff166000908152600490915260408120805483929061291d9084906bffffffffffffffffffffffff166155bd565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008b8152600660209081526040808320546001600160a01b0316835260089091528120805485945090926129799185911661552e565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550877f7dffc5ae5ee4e2e4df1651cf6ad329a73cebdb728f37ea0187b9b17e036756e48883866040516129fc939291909283526bffffffffffffffffffffffff9190911660208301521515604082015260600190565b60405180910390a299505050505050505050505b92915050565b600081604051602001612a29919061523e565b604051602081830303815290604052805190602001209050919050565b6040805161012081018252600c5463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c010000000000000000000000008104831660608301527001000000000000000000000000000000008104909216608082015262ffffff740100000000000000000000000000000000000000008304811660a08301819052770100000000000000000000000000000000000000000000008404821660c08401527a0100000000000000000000000000000000000000000000000000008404821660e08401527d0100000000000000000000000000000000000000000000000000000000009093041661010082015260009167ffffffffffffffff841611612b64575192915050565b8267ffffffffffffffff168160a0015162ffffff16108015612b9957508060c0015162ffffff168367ffffffffffffffff1611155b15612ba8576020015192915050565b8267ffffffffffffffff168160c0015162ffffff16108015612bdd57508060e0015162ffffff168367ffffffffffffffff1611155b15612bec576040015192915050565b8267ffffffffffffffff168160e0015162ffffff16108015612c22575080610100015162ffffff168367ffffffffffffffff1611155b15612c31576060015192915050565b6080015192915050565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680612c97576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614612ce4576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff1615612d2b576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d3484612fb2565b15612d6b576040517fb42f66e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109e58484613242565b612d7d6131e6565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612df857600080fd5b505afa158015612e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e309190614e58565b6005549091506801000000000000000090046bffffffffffffffffffffffff1681811115612e94576040517fa99da30200000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016108dc565b81811015612fad576000612ea882846155a6565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152602482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb90604401602060405180830381600087803b158015612f3057600080fd5b505af1158015612f44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f689190614e36565b50604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a1505b505050565b67ffffffffffffffff81166000908152600360209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561304757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613029575b505050505081525050905060005b8160400151518110156131cb5760005b6007548110156131b857600061318160078381548110613087576130876156ec565b9060005260206000200154856040015185815181106130a8576130a86156ec565b60200260200101518860026000896040015189815181106130cb576130cb6156ec565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812067ffffffffffffffff808f16835293522054166040805160208082018790526001600160a01b03959095168183015267ffffffffffffffff9384166060820152919092166080808301919091528251808303909101815260a08201835280519084012060c082019490945260e080820185905282518083039091018152610100909101909152805191012091565b50600081815260096020526040902054909150156131a55750600195945050505050565b50806131b0816155ea565b915050613065565b50806131c3816155ea565b915050613055565b5060009392505050565b6131dd6131e6565b61083481613b73565b6000546001600160a01b031633146132405760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108dc565b565b600b546601000000000000900460ff1615613289576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff82166000908152600360209081526040808320815160608101835281546001600160a01b0390811682526001830154168185015260028201805484518187028101870186528181529295939486019383018282801561331a57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116132fc575b5050509190925250505067ffffffffffffffff80851660009081526004602090815260408083208151808301909252546bffffffffffffffffffffffff81168083526c01000000000000000000000000909104909416918101919091529293505b8360400151518110156134145760026000856040015183815181106133a2576133a26156ec565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812067ffffffffffffffff8a168252909252902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001690558061340c816155ea565b91505061337b565b5067ffffffffffffffff8516600090815260036020526040812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116825560018201805490911690559061346f6002830182614ab7565b505067ffffffffffffffff8516600090815260046020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055600580548291906008906134df9084906801000000000000000090046bffffffffffffffffffffffff166155bd565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb85836bffffffffffffffffffffffff166040518363ffffffff1660e01b815260040161357d9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561359757600080fd5b505af11580156135ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135cf9190614e36565b613605576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b03861681526bffffffffffffffffffffffff8316602082015267ffffffffffffffff8716917fe8ed5b475a5b5987aa9165e8731bb78043f39eee32ec5a1169a89e27fcd49815910160405180910390a25050505050565b60004661367381613c35565b156136f05760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156136b257600080fd5b505afa1580156136c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ea9190614e58565b91505090565b4391505090565b60008060006137098560000151612a16565b6000818152600660205260409020549093506001600160a01b03168061375e576040517f77f5b84c000000000000000000000000000000000000000000000000000000008152600481018590526024016108dc565b608086015160405161377d918691602001918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526009909352912054909350806137dc576040517f3688124a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85516020808801516040808a015160608b015160808c01519251613848968b96909594910195865267ffffffffffffffff948516602087015292909316604085015263ffffffff90811660608501529190911660808301526001600160a01b031660a082015260c00190565b604051602081830303815290604052805190602001208114613896576040517fd529142c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006138a58760000151613c58565b9050806139b15786516040517fe9413d3800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b15801561393157600080fd5b505afa158015613945573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139699190614e58565b9050806139b15786516040517f175dadad00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108dc565b60008860800151826040516020016139d3929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506139f88982613d56565b9450505050509250925092565b60005a611388811015613a1757600080fd5b611388810390508460408204820311613a2f57600080fd5b50823b613a3b57600080fd5b60008083516020850160008789f190505b9392505050565b600080613a5e613dc1565b905060008113613a9d576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018290526024016108dc565b6000613aa7613ec8565b9050600082825a613ab88b8b6154ea565b613ac291906155a6565b613acc9088615569565b613ad691906154ea565b613ae890670de0b6b3a7640000615569565b613af29190615555565b90506000613b0b63ffffffff881664e8d4a51000615569565b9050613b23816b033b2e3c9fd0803ce80000006155a6565b821115613b5c576040517fe80fa38100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613b6681836154ea565b9998505050505050505050565b6001600160a01b038116331415613bcc5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108dc565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061a4b1821480613c49575062066eed82145b80612a1057505062066eee1490565b600046613c6481613c35565b15613d46576101008367ffffffffffffffff16613c7f613667565b613c8991906155a6565b1180613ca65750613c98613667565b8367ffffffffffffffff1610155b15613cb45750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152606490632b407a829060240160206040518083038186803b158015613d0e57600080fd5b505afa158015613d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a4c9190614e58565b505067ffffffffffffffff164090565b6000613d8a8360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151613f1b565b60038360200151604051602001613da29291906153dd565b60408051601f1981840301815291905280516020909101209392505050565b600b54604080517ffeaf968c0000000000000000000000000000000000000000000000000000000081529051600092670100000000000000900463ffffffff169182151591849182917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b158015613e5a57600080fd5b505afa158015613e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e929190615132565b509450909250849150508015613eb65750613ead82426155a6565b8463ffffffff16105b15613ec05750600a545b949350505050565b600046613ed481613c35565b15613f1357606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156136b257600080fd5b600091505090565b613f2489614156565b613f705760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e20637572766500000000000060448201526064016108dc565b613f7988614156565b613fc55760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e206375727665000000000000000000000060448201526064016108dc565b613fce83614156565b61401a5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e20637572766500000060448201526064016108dc565b61402382614156565b61406f5760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e2063757276650000000060448201526064016108dc565b61407b878a888761422f565b6140c75760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e6573730000000000000060448201526064016108dc565b60006140d38a87614380565b905060006140e6898b878b8689896143e4565b905060006140f7838d8d8a86614510565b9050808a146141485760405162461bcd60e51b815260206004820152600d60248201527f696e76616c69642070726f6f660000000000000000000000000000000000000060448201526064016108dc565b505050505050505050505050565b80516000906401000003d019116141af5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e617465000000000000000000000000000060448201526064016108dc565b60208201516401000003d019116142085760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e617465000000000000000000000000000060448201526064016108dc565b60208201516401000003d0199080096142288360005b6020020151614550565b1492915050565b60006001600160a01b0382166142875760405162461bcd60e51b815260206004820152600b60248201527f626164207769746e65737300000000000000000000000000000000000000000060448201526064016108dc565b60208401516000906001161561429e57601c6142a1565b601b5b905060007ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641418587600060200201510986517ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614358573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614388614ad5565b6143b5600184846040516020016143a19392919061521d565b604051602081830303815290604052614574565b90505b6143c181614156565b612a105780516040805160208101929092526143dd91016143a1565b90506143b8565b6143ec614ad5565b825186516401000003d019908190069106141561444b5760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e6374000060448201526064016108dc565b6144568789886145c3565b6144a25760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c65640000000000000000000060448201526064016108dc565b6144ad8486856145c3565b6144f95760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c656400000000000000000060448201526064016108dc565b61450486848461470b565b98975050505050505050565b60006002868686858760405160200161452e969594939291906151ab565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b61457c614ad5565b614585826147d2565b815261459a61459582600061421e565b61480d565b6020820181905260029006600114156145be576020810180516401000003d0190390525b919050565b6000826146125760405162461bcd60e51b815260206004820152600b60248201527f7a65726f207363616c617200000000000000000000000000000000000000000060448201526064016108dc565b835160208501516000906146289060029061564b565b1561463457601c614637565b601b5b905060007ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641418387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa1580156146b7573d6000803e3d6000fd5b5050506020604051035190506000866040516020016146d69190615199565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614713614ad5565b8351602080860151855191860151600093849384936147349390919061482d565b919450925090506401000003d0198582096001146147945760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a0000000000000060448201526064016108dc565b60405180604001604052806401000003d019806147b3576147b361568e565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d01981106145be576040805160208082019390935281518082038401815290820190915280519101206147da565b6000612a108260026148266401000003d01960016154ea565b901c61490d565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a089050600061486d838385856149cd565b909850905061487e88828e886149f1565b909850905061488f88828c876149f1565b909850905060006148a28d878b856149f1565b90985090506148b3888286866149cd565b90985090506148c488828e896149f1565b90985090508181146148f9576401000003d019818a0998506401000003d01982890997506401000003d01981830996506148fd565b8196505b5050505050509450945094915050565b600080614918614af3565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a082015261494a614b11565b60208160c08460057ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa9250826149c35760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c75726521000000000000000000000000000060448201526064016108dc565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614aa7579160200282015b82811115614aa757825182547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03909116178255602090920191600190910190614a5a565b50614ab3929150614b2f565b5090565b50805460008255906000526020600020908101906108349190614b2f565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614ab35760008155600101614b30565b80356001600160a01b03811681146145be57600080fd5b8060408101831015612a1057600080fd5b600082601f830112614b7d57600080fd5b6040516040810181811067ffffffffffffffff82111715614ba057614ba061571b565b8060405250808385604086011115614bb757600080fd5b60005b6002811015614bd9578135835260209283019290910190600101614bba565b509195945050505050565b600060a08284031215614bf657600080fd5b60405160a0810181811067ffffffffffffffff82111715614c1957614c1961571b565b604052905080614c2883614cae565b8152614c3660208401614cae565b6020820152614c4760408401614c9a565b6040820152614c5860608401614c9a565b6060820152614c6960808401614b44565b60808201525092915050565b803561ffff811681146145be57600080fd5b803562ffffff811681146145be57600080fd5b803563ffffffff811681146145be57600080fd5b803567ffffffffffffffff811681146145be57600080fd5b805169ffffffffffffffffffff811681146145be57600080fd5b600060208284031215614cf257600080fd5b613a4c82614b44565b60008060608385031215614d0e57600080fd5b614d1783614b44565b9150614d268460208501614b5b565b90509250929050565b60008060008060608587031215614d4557600080fd5b614d4e85614b44565b935060208501359250604085013567ffffffffffffffff80821115614d7257600080fd5b818701915087601f830112614d8657600080fd5b813581811115614d9557600080fd5b886020828501011115614da757600080fd5b95989497505060200194505050565b60008060408385031215614dc957600080fd5b614dd283614b44565b915060208301356bffffffffffffffffffffffff81168114614df357600080fd5b809150509250929050565b600060408284031215614e1057600080fd5b613a4c8383614b5b565b600060408284031215614e2c57600080fd5b613a4c8383614b6c565b600060208284031215614e4857600080fd5b81518015158114613a4c57600080fd5b600060208284031215614e6a57600080fd5b5051919050565b600080600080600060a08688031215614e8957600080fd5b85359450614e9960208701614cae565b9350614ea760408701614c75565b9250614eb560608701614c9a565b9150614ec360808701614c9a565b90509295509295909350565b600080828403610240811215614ee457600080fd5b6101a080821215614ef457600080fd5b614efc6154c0565b9150614f088686614b6c565b8252614f178660408701614b6c565b60208301526080850135604083015260a0850135606083015260c08501356080830152614f4660e08601614b44565b60a0830152610100614f5a87828801614b6c565b60c0840152614f6d876101408801614b6c565b60e08401526101808601358184015250819350614f8c86828701614be4565b925050509250929050565b6000806000806000808688036101c0811215614fb257600080fd5b614fbb88614c75565b9650614fc960208901614c9a565b9550614fd760408901614c9a565b9450614fe560608901614c9a565b935060808801359250610120807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608301121561502057600080fd5b6150286154c0565b915061503660a08a01614c9a565b825261504460c08a01614c9a565b602083015261505560e08a01614c9a565b6040830152610100615068818b01614c9a565b6060840152615078828b01614c9a565b608084015261508a6101408b01614c87565b60a084015261509c6101608b01614c87565b60c08401526150ae6101808b01614c87565b60e08401526150c06101a08b01614c87565b818401525050809150509295509295509295565b6000602082840312156150e657600080fd5b5035919050565b6000602082840312156150ff57600080fd5b613a4c82614cae565b6000806040838503121561511b57600080fd5b61512483614cae565b9150614d2660208401614b44565b600080600080600060a0868803121561514a57600080fd5b61515386614cc6565b9450602086015193506040860151925060608601519150614ec360808701614cc6565b8060005b60028110156109e557815184526020938401939091019060010161517a565b6151a38183615176565b604001919050565b8681526151bb6020820187615176565b6151c86060820186615176565b6151d560a0820185615176565b6151e260e0820184615176565b60609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166101208201526101340195945050505050565b83815261522d6020820184615176565b606081019190915260800192915050565b60408101612a108284615176565b600060208083528351808285015260005b818110156152795785810183015185820160400152820161525d565b8181111561528b576000604083870101525b50601f01601f1916929092016040019392505050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b818110156152f2578451835293830193918301916001016152d6565b509098975050505050505050565b60006101c08201905061ffff8816825263ffffffff808816602084015280871660408401528086166060840152846080840152835481811660a085015261535460c08501838360201c1663ffffffff169052565b61536b60e08501838360401c1663ffffffff169052565b6153836101008501838360601c1663ffffffff169052565b61539b6101208501838360801c1663ffffffff169052565b62ffffff60a082901c811661014086015260b882901c811661016086015260d082901c1661018085015260e81c6101a090930192909252979650505050505050565b82815260608101613a4c6020830184615176565b6000604082018483526020604081850152818551808452606086019150828701935060005b8181101561543257845183529383019391830191600101615416565b5090979650505050505050565b6000608082016bffffffffffffffffffffffff87168352602067ffffffffffffffff8716818501526001600160a01b0380871660408601526080606086015282865180855260a087019150838801945060005b818110156154b0578551841683529484019491840191600101615492565b50909a9950505050505050505050565b604051610120810167ffffffffffffffff811182821017156154e4576154e461571b565b60405290565b600082198211156154fd576154fd61565f565b500190565b600067ffffffffffffffff8083168185168083038211156155255761552561565f565b01949350505050565b60006bffffffffffffffffffffffff8083168185168083038211156155255761552561565f565b6000826155645761556461568e565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156155a1576155a161565f565b500290565b6000828210156155b8576155b861565f565b500390565b60006bffffffffffffffffffffffff838116908316818110156155e2576155e261565f565b039392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561561c5761561c61565f565b5060010190565b600067ffffffffffffffff808316818114156156415761564161565f565b6001019392505050565b60008261565a5761565a61568e565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea164736f6c6343000806000a", + Bin: "0x60e06040523480156200001157600080fd5b5060405162005b3b38038062005b3b8339810160408190526200003491620001b1565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e8565b5050506001600160601b0319606093841b811660805290831b811660a052911b1660c052620001fb565b6001600160a01b038116331415620001435760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001ac57600080fd5b919050565b600080600060608486031215620001c757600080fd5b620001d28462000194565b9250620001e26020850162000194565b9150620001f26040850162000194565b90509250925092565b60805160601c60a05160601c60c05160601c6158d6620002656000396000818161051901526138e70152600081816106030152613e4501526000818161036d015281816114da0152818161237701528181612dae01528181612eea015261350f01526158d66000f3fe608060405234801561001057600080fd5b506004361061025b5760003560e01c80636f64f03f11610145578063ad178361116100bd578063d2f9f9a71161008c578063e72f6e3011610071578063e72f6e30146106e0578063e82ad7d4146106f3578063f2fde38b1461071657600080fd5b8063d2f9f9a7146106ba578063d7ae1d30146106cd57600080fd5b8063ad178361146105fe578063af198b9714610625578063c3f909d414610655578063caf70c4a146106a757600080fd5b80638da5cb5b11610114578063a21a23e4116100f9578063a21a23e4146105c0578063a47c7696146105c8578063a4c0ed36146105eb57600080fd5b80638da5cb5b1461059c5780639f87fad7146105ad57600080fd5b80636f64f03f1461055b5780637341c10c1461056e57806379ba509714610581578063823597401461058957600080fd5b8063356dac71116101d85780635fbbc0d2116101a757806366316d8d1161018c57806366316d8d14610501578063689c45171461051457806369bcdb7d1461053b57600080fd5b80635fbbc0d2146103f357806364d51a2a146104f957600080fd5b8063356dac71146103a757806340d6bb82146103af5780634cb48a54146103cd5780635d3b1d30146103e057600080fd5b806308821d581161022f57806315c48b841161021457806315c48b841461030e578063181f5a77146103295780631b6b6d231461036857600080fd5b806308821d58146102cf57806312b58349146102e257600080fd5b80620122911461026057806302bcc5b61461028057806304c357cb1461029557806306bfa637146102a8575b600080fd5b610268610729565b604051610277939291906153b5565b60405180910390f35b61029361028e3660046151e8565b6107a5565b005b6102936102a3366004615203565b610837565b60055467ffffffffffffffff165b60405167ffffffffffffffff9091168152602001610277565b6102936102dd366004614ef9565b6109eb565b6005546801000000000000000090046bffffffffffffffffffffffff165b604051908152602001610277565b61031660c881565b60405161ffff9091168152602001610277565b604080518082018252601681527f565246436f6f7264696e61746f72563220312e302e30000000000000000000006020820152905161027791906153a2565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610277565b600a54610300565b6103b86101f481565b60405163ffffffff9091168152602001610277565b6102936103db366004615092565b610bb0565b6103006103ee366004614f6c565b610fa7565b600c546040805163ffffffff80841682526401000000008404811660208301526801000000000000000084048116928201929092526c010000000000000000000000008304821660608201527001000000000000000000000000000000008304909116608082015262ffffff740100000000000000000000000000000000000000008304811660a0830152770100000000000000000000000000000000000000000000008304811660c08301527a0100000000000000000000000000000000000000000000000000008304811660e08301527d01000000000000000000000000000000000000000000000000000000000090920490911661010082015261012001610277565b610316606481565b61029361050f366004614eb1565b611385565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b6103006105493660046151cf565b60009081526009602052604090205490565b610293610569366004614df6565b6115d4565b61029361057c366004615203565b611704565b610293611951565b6102936105973660046151e8565b611a1a565b6000546001600160a01b031661038f565b6102936105bb366004615203565b611be0565b6102b661201f565b6105db6105d63660046151e8565b612202565b6040516102779493929190615553565b6102936105f9366004614e2a565b612325565b61038f7f000000000000000000000000000000000000000000000000000000000000000081565b610638610633366004614fca565b61257c565b6040516bffffffffffffffffffffffff9091168152602001610277565b600b546040805161ffff8316815263ffffffff6201000084048116602083015267010000000000000084048116928201929092526b010000000000000000000000909204166060820152608001610277565b6103006106b5366004614f15565b612a16565b6103b86106c83660046151e8565b612a46565b6102936106db366004615203565b612c3b565b6102936106ee366004614ddb565b612d75565b6107066107013660046151e8565b612fb2565b6040519015158152602001610277565b610293610724366004614ddb565b6131d5565b600b546007805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561079357602002820191906000526020600020905b81548152602001906001019080831161077f575b50505050509050925092509250909192565b6107ad6131e6565b67ffffffffffffffff81166000908152600360205260409020546001600160a01b0316610806576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020546108349082906001600160a01b0316613242565b50565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680610893576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038216146108e5576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024015b60405180910390fd5b600b546601000000000000900460ff161561092c576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff84166000908152600360205260409020600101546001600160a01b038481169116146109e55767ffffffffffffffff841660008181526003602090815260409182902060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091558251338152918201527f69436ea6df009049404f564eff6622cd00522b0bd6a89efd9e52a355c4a879be91015b60405180910390a25b50505050565b6109f36131e6565b604080518082018252600091610a22919084906002908390839080828437600092019190915250612a16915050565b6000818152600660205260409020549091506001600160a01b031680610a77576040517f77f5b84c000000000000000000000000000000000000000000000000000000008152600481018390526024016108dc565b600082815260066020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b600754811015610b67578260078281548110610aca57610aca615823565b90600052602060002001541415610b55576007805460009190610aef906001906156b1565b81548110610aff57610aff615823565b906000526020600020015490508060078381548110610b2057610b20615823565b6000918252602090912001556007805480610b3d57610b3d6157f4565b60019003818190600052602060002001600090559055505b80610b5f81615721565b915050610aac565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610ba391815260200190565b60405180910390a2505050565b610bb86131e6565b60c861ffff87161115610c0b576040517fa738697600000000000000000000000000000000000000000000000000000000815261ffff871660048201819052602482015260c860448201526064016108dc565b60008213610c48576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018390526024016108dc565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001690971762010000909502949094177fffffffffffffffffffffffffffffffffff000000000000000000ffffffffffff166701000000000000009092027fffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffff16919091176b010000000000000000000000909302929092179093558651600c80549489015189890151938a0151978a0151968a015160c08b015160e08c01516101008d01519588167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009099169890981764010000000093881693909302929092177fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff1668010000000000000000958716959095027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff16949094176c0100000000000000000000000098861698909802979097177fffffffffffffffffff00000000000000ffffffffffffffffffffffffffffffff1670010000000000000000000000000000000096909416959095027fffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffff16929092177401000000000000000000000000000000000000000062ffffff92831602177fffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffff1677010000000000000000000000000000000000000000000000958216959095027fffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffff16949094177a01000000000000000000000000000000000000000000000000000092851692909202919091177cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167d0100000000000000000000000000000000000000000000000000000000009390911692909202919091178155600a84905590517fc21e3bd2e0b339d2848f0dd956947a88966c242c0c0c582a33137a5c1ceb5cb291610f97918991899189918991899190615414565b60405180910390a1505050505050565b600b546000906601000000000000900460ff1615610ff1576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff85166000908152600360205260409020546001600160a01b031661104a576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260026020908152604080832067ffffffffffffffff808a16855292529091205416806110ba576040517ff0019fe600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff871660048201523360248201526044016108dc565b600b5461ffff90811690861610806110d6575060c861ffff8616115b1561112657600b546040517fa738697600000000000000000000000000000000000000000000000000000000815261ffff8088166004830152909116602482015260c860448201526064016108dc565b600b5463ffffffff620100009091048116908516111561118d57600b546040517ff5d7e01e00000000000000000000000000000000000000000000000000000000815263ffffffff80871660048301526201000090920490911660248201526044016108dc565b6101f463ffffffff841611156111df576040517f47386bec00000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526101f460248201526044016108dc565b60006111ec826001615616565b6040805160208082018c9052338284015267ffffffffffffffff808c16606084015284166080808401919091528351808403909101815260a08301845280519082012060c083018d905260e080840182905284518085039091018152610100909301909352815191012091925081611262613667565b60408051602081019390935282015267ffffffffffffffff8a16606082015263ffffffff8089166080830152871660a08201523360c082015260e00160408051808303601f19018152828252805160209182012060008681526009835283902055848352820183905261ffff8a169082015263ffffffff808916606083015287166080820152339067ffffffffffffffff8b16908c907f63373d1c4696214b898952999c9aaec57dac1ee2723cec59bea6888f489a97729060a00160405180910390a45033600090815260026020908152604080832067ffffffffffffffff808d16855292529091208054919093167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009091161790915591505095945050505050565b600b546601000000000000900460ff16156113cc576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600860205260409020546bffffffffffffffffffffffff80831691161015611426576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260086020526040812080548392906114539084906bffffffffffffffffffffffff166156c8565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555080600560088282829054906101000a90046bffffffffffffffffffffffff166114aa91906156c8565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb83836040518363ffffffff1660e01b81526004016115489291906001600160a01b039290921682526bffffffffffffffffffffffff16602082015260400190565b602060405180830381600087803b15801561156257600080fd5b505af1158015611576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a9190614f31565b6115d0576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6115dc6131e6565b60408051808201825260009161160b919084906002908390839080828437600092019190915250612a16915050565b6000818152600660205260409020549091506001600160a01b031615611660576040517f4a0b8fa7000000000000000000000000000000000000000000000000000000008152600481018290526024016108dc565b600081815260066020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091556007805460018101825594527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610ba3565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680611760576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038216146117ad576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff16156117f4576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff84166000908152600360205260409020600201546064141561184b576040517f05a48e0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260026020908152604080832067ffffffffffffffff80891685529252909120541615611885576109e5565b6001600160a01b038316600081815260026020818152604080842067ffffffffffffffff8a1680865290835281852080547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166001908117909155600384528286209094018054948501815585529382902090920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001685179055905192835290917f43dc749a04ac8fb825cbd514f7c0e13f13bc6f2ee66043b76629d51776cff8e091016109dc565b6001546001600160a01b031633146119ab5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108dc565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600b546601000000000000900460ff1615611a61576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020546001600160a01b0316611aba576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600360205260409020600101546001600160a01b03163314611b425767ffffffffffffffff8116600090815260036020526040908190206001015490517fd084e9750000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016108dc565b67ffffffffffffffff81166000818152600360209081526040918290208054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001909301805490931690925583516001600160a01b03909116808252928101919091529092917f6f1dc65165ffffedfd8e507b4a0f1fcfdada045ed11f6c26ba27cedfe87802f0910160405180910390a25050565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680611c3c576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614611c89576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff1615611cd0576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611cd984612fb2565b15611d10576040517fb42f66e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260026020908152604080832067ffffffffffffffff808916855292529091205416611d91576040517ff0019fe600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff851660048201526001600160a01b03841660248201526044016108dc565b67ffffffffffffffff8416600090815260036020908152604080832060020180548251818502810185019093528083529192909190830182828015611dff57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611de1575b50505050509050600060018251611e1691906156b1565b905060005b8251811015611f8e57856001600160a01b0316838281518110611e4057611e40615823565b60200260200101516001600160a01b03161415611f7c576000838381518110611e6b57611e6b615823565b6020026020010151905080600360008a67ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000206002018381548110611eb157611eb1615823565b600091825260208083209190910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03949094169390931790925567ffffffffffffffff8a168152600390915260409020600201805480611f1e57611f1e6157f4565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905550611f8e565b80611f8681615721565b915050611e1b565b506001600160a01b038516600081815260026020908152604080832067ffffffffffffffff8b168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001690555192835290917f182bff9831466789164ca77075fffd84916d35a8180ba73c27e45634549b445b91015b60405180910390a2505050505050565b600b546000906601000000000000900460ff1615612069576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805467ffffffffffffffff169060006120838361575a565b82546101009290920a67ffffffffffffffff8181021990931691831602179091556005541690506000806040519080825280602002602001820160405280156120d6578160200160208202803683370190505b506040805180820182526000808252602080830182815267ffffffffffffffff888116808552600484528685209551865493516bffffffffffffffffffffffff9091167fffffffffffffffffffffffff0000000000000000000000000000000000000000948516176c01000000000000000000000000919093160291909117909455845160608101865233815280830184815281870188815295855260038452959093208351815483166001600160a01b03918216178255955160018201805490931696169590951790559151805194955090936121ba9260028501920190614b35565b505060405133815267ffffffffffffffff841691507f464722b4166576d3dcbba877b999bc35cf911f4eaf434b7eba68fa113951d0bf9060200160405180910390a250905090565b67ffffffffffffffff8116600090815260036020526040812054819081906060906001600160a01b0316612262576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff80861660009081526004602090815260408083205460038352928190208054600290910180548351818602810186019094528084526bffffffffffffffffffffffff8616966c01000000000000000000000000909604909516946001600160a01b0390921693909291839183018282801561230f57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116122f1575b5050505050905093509350935093509193509193565b600b546601000000000000900460ff161561236c576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146123ce576040517f44b0e3c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208114612408576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612416828401846151e8565b67ffffffffffffffff81166000908152600360205260409020549091506001600160a01b0316612472576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff8116600090815260046020526040812080546bffffffffffffffffffffffff16918691906124a98385615639565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555084600560088282829054906101000a90046bffffffffffffffffffffffff166125009190615639565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508167ffffffffffffffff167fd39ec07f4e209f627a4c427971473820dc129761ba28de8906bd56f57101d4f882878461256791906155fe565b6040805192835260208301919091520161200f565b600b546000906601000000000000900460ff16156125c6576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005a905060008060006125da87876136f7565b9250925092506000866060015163ffffffff1667ffffffffffffffff81111561260557612605615852565b60405190808252806020026020018201604052801561262e578160200160208202803683370190505b50905060005b876060015163ffffffff168110156126a25760408051602081018590529081018290526060016040516020818303038152906040528051906020012060001c82828151811061268557612685615823565b60209081029190910101528061269a81615721565b915050612634565b506000838152600960205260408082208290555181907f1fe543e300000000000000000000000000000000000000000000000000000000906126ea9087908690602401615505565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252600b80547fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff166601000000000000179055908a015160808b015191925060009161279a9163ffffffff169084613a05565b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff1690556020808c01805167ffffffffffffffff9081166000908152600490935260408084205492518216845290922080549394506c01000000000000000000000000918290048316936001939192600c9261281e928692900416615616565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060006128758a600b600001600b9054906101000a900463ffffffff1663ffffffff1661286f85612a46565b3a613a53565b6020808e015167ffffffffffffffff166000908152600490915260409020549091506bffffffffffffffffffffffff808316911610156128e1576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808d015167ffffffffffffffff166000908152600490915260408120805483929061291d9084906bffffffffffffffffffffffff166156c8565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008b8152600660209081526040808320546001600160a01b03168352600890915281208054859450909261297991859116615639565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550877f7dffc5ae5ee4e2e4df1651cf6ad329a73cebdb728f37ea0187b9b17e036756e48883866040516129fc939291909283526bffffffffffffffffffffffff9190911660208301521515604082015260600190565b60405180910390a299505050505050505050505b92915050565b600081604051602001612a299190615394565b604051602081830303815290604052805190602001209050919050565b6040805161012081018252600c5463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c010000000000000000000000008104831660608301527001000000000000000000000000000000008104909216608082015262ffffff740100000000000000000000000000000000000000008304811660a08301819052770100000000000000000000000000000000000000000000008404821660c08401527a0100000000000000000000000000000000000000000000000000008404821660e08401527d0100000000000000000000000000000000000000000000000000000000009093041661010082015260009167ffffffffffffffff841611612b64575192915050565b8267ffffffffffffffff168160a0015162ffffff16108015612b9957508060c0015162ffffff168367ffffffffffffffff1611155b15612ba8576020015192915050565b8267ffffffffffffffff168160c0015162ffffff16108015612bdd57508060e0015162ffffff168367ffffffffffffffff1611155b15612bec576040015192915050565b8267ffffffffffffffff168160e0015162ffffff16108015612c22575080610100015162ffffff168367ffffffffffffffff1611155b15612c31576060015192915050565b6080015192915050565b67ffffffffffffffff821660009081526003602052604090205482906001600160a01b031680612c97576040517f1f6a65b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614612ce4576040517fd8a3fb520000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108dc565b600b546601000000000000900460ff1615612d2b576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d3484612fb2565b15612d6b576040517fb42f66e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109e58484613242565b612d7d6131e6565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612df857600080fd5b505afa158015612e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e309190614f53565b6005549091506801000000000000000090046bffffffffffffffffffffffff1681811115612e94576040517fa99da30200000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016108dc565b81811015612fad576000612ea882846156b1565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152602482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb90604401602060405180830381600087803b158015612f3057600080fd5b505af1158015612f44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f689190614f31565b50604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a1505b505050565b67ffffffffffffffff81166000908152600360209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561304757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613029575b505050505081525050905060005b8160400151518110156131cb5760005b6007548110156131b85760006131816007838154811061308757613087615823565b9060005260206000200154856040015185815181106130a8576130a8615823565b60200260200101518860026000896040015189815181106130cb576130cb615823565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812067ffffffffffffffff808f16835293522054166040805160208082018790526001600160a01b03959095168183015267ffffffffffffffff9384166060820152919092166080808301919091528251808303909101815260a08201835280519084012060c082019490945260e080820185905282518083039091018152610100909101909152805191012091565b50600081815260096020526040902054909150156131a55750600195945050505050565b50806131b081615721565b915050613065565b50806131c381615721565b915050613055565b5060009392505050565b6131dd6131e6565b61083481613bab565b6000546001600160a01b031633146132405760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108dc565b565b600b546601000000000000900460ff1615613289576040517fed3ba6a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff82166000908152600360209081526040808320815160608101835281546001600160a01b0390811682526001830154168185015260028201805484518187028101870186528181529295939486019383018282801561331a57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116132fc575b5050509190925250505067ffffffffffffffff80851660009081526004602090815260408083208151808301909252546bffffffffffffffffffffffff81168083526c01000000000000000000000000909104909416918101919091529293505b8360400151518110156134145760026000856040015183815181106133a2576133a2615823565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812067ffffffffffffffff8a168252909252902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001690558061340c81615721565b91505061337b565b5067ffffffffffffffff8516600090815260036020526040812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116825560018201805490911690559061346f6002830182614bb2565b505067ffffffffffffffff8516600090815260046020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055600580548291906008906134df9084906801000000000000000090046bffffffffffffffffffffffff166156c8565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb85836bffffffffffffffffffffffff166040518363ffffffff1660e01b815260040161357d9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561359757600080fd5b505af11580156135ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135cf9190614f31565b613605576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b03861681526bffffffffffffffffffffffff8316602082015267ffffffffffffffff8716917fe8ed5b475a5b5987aa9165e8731bb78043f39eee32ec5a1169a89e27fcd49815910160405180910390a25050505050565b60004661367381613c6d565b156136f05760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156136b257600080fd5b505afa1580156136c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ea9190614f53565b91505090565b4391505090565b60008060006137098560000151612a16565b6000818152600660205260409020549093506001600160a01b03168061375e576040517f77f5b84c000000000000000000000000000000000000000000000000000000008152600481018590526024016108dc565b608086015160405161377d918691602001918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526009909352912054909350806137dc576040517f3688124a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85516020808801516040808a015160608b015160808c01519251613848968b96909594910195865267ffffffffffffffff948516602087015292909316604085015263ffffffff90811660608501529190911660808301526001600160a01b031660a082015260c00190565b604051602081830303815290604052805190602001208114613896576040517fd529142c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006138a58760000151613c90565b9050806139b15786516040517fe9413d3800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b15801561393157600080fd5b505afa158015613945573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139699190614f53565b9050806139b15786516040517f175dadad00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108dc565b60008860800151826040516020016139d3929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506139f88982613d8f565b9450505050509250925092565b60005a611388811015613a1757600080fd5b611388810390508460408204820311613a2f57600080fd5b50823b613a3b57600080fd5b60008083516020850160008789f190505b9392505050565b600080613a5e613dfa565b905060008113613a9d576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018290526024016108dc565b6000613adf6000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613f0192505050565b9050600082825a613af08b8b6155fe565b613afa91906156b1565b613b049088615674565b613b0e91906155fe565b613b2090670de0b6b3a7640000615674565b613b2a9190615660565b90506000613b4363ffffffff881664e8d4a51000615674565b9050613b5b816b033b2e3c9fd0803ce80000006156b1565b821115613b94576040517fe80fa38100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613b9e81836155fe565b9998505050505050505050565b6001600160a01b038116331415613c045760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108dc565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061a4b1821480613c81575062066eed82145b80612a1057505062066eee1490565b600046613c9c81613c6d565b15613d7f576101008367ffffffffffffffff16613cb7613667565b613cc191906156b1565b1180613cde5750613cd0613667565b8367ffffffffffffffff1610155b15613cec5750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152606490632b407a82906024015b60206040518083038186803b158015613d4757600080fd5b505afa158015613d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a4c9190614f53565b505067ffffffffffffffff164090565b6000613dc38360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151613fdc565b60038360200151604051602001613ddb9291906154f1565b60408051601f1981840301815291905280516020909101209392505050565b600b54604080517ffeaf968c0000000000000000000000000000000000000000000000000000000081529051600092670100000000000000900463ffffffff169182151591849182917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b158015613e9357600080fd5b505afa158015613ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ecb919061522d565b509450909250849150508015613eef5750613ee682426156b1565b8463ffffffff16105b15613ef95750600a545b949350505050565b600046613f0d81613c6d565b15613f4c57606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d4757600080fd5b613f5581614217565b15613fd35773420000000000000000000000000000000000000f6001600160a01b03166349948e0e8460405180608001604052806048815260200161588260489139604051602001613fa89291906152d2565b6040516020818303038152906040526040518263ffffffff1660e01b8152600401613d2f91906153a2565b50600092915050565b613fe589614251565b6140315760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e20637572766500000000000060448201526064016108dc565b61403a88614251565b6140865760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e206375727665000000000000000000000060448201526064016108dc565b61408f83614251565b6140db5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e20637572766500000060448201526064016108dc565b6140e482614251565b6141305760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e2063757276650000000060448201526064016108dc565b61413c878a888761432a565b6141885760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e6573730000000000000060448201526064016108dc565b60006141948a8761447b565b905060006141a7898b878b8689896144df565b905060006141b8838d8d8a8661460b565b9050808a146142095760405162461bcd60e51b815260206004820152600d60248201527f696e76616c69642070726f6f660000000000000000000000000000000000000060448201526064016108dc565b505050505050505050505050565b6000600a82148061422957506101a482145b80614236575062aa37dc82145b80614242575061210582145b80612a1057505062014a331490565b80516000906401000003d019116142aa5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e617465000000000000000000000000000060448201526064016108dc565b60208201516401000003d019116143035760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e617465000000000000000000000000000060448201526064016108dc565b60208201516401000003d0199080096143238360005b602002015161464b565b1492915050565b60006001600160a01b0382166143825760405162461bcd60e51b815260206004820152600b60248201527f626164207769746e65737300000000000000000000000000000000000000000060448201526064016108dc565b60208401516000906001161561439957601c61439c565b601b5b905060007ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641418587600060200201510986517ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614453573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614483614bd0565b6144b06001848460405160200161449c93929190615373565b60405160208183030381529060405261466f565b90505b6144bc81614251565b612a105780516040805160208101929092526144d8910161449c565b90506144b3565b6144e7614bd0565b825186516401000003d01990819006910614156145465760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e6374000060448201526064016108dc565b6145518789886146be565b61459d5760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c65640000000000000000000060448201526064016108dc565b6145a88486856146be565b6145f45760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c656400000000000000000060448201526064016108dc565b6145ff868484614806565b98975050505050505050565b60006002868686858760405160200161462996959493929190615301565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614677614bd0565b614680826148cd565b8152614695614690826000614319565b614908565b6020820181905260029006600114156146b9576020810180516401000003d0190390525b919050565b60008261470d5760405162461bcd60e51b815260206004820152600b60248201527f7a65726f207363616c617200000000000000000000000000000000000000000060448201526064016108dc565b8351602085015160009061472390600290615782565b1561472f57601c614732565b601b5b905060007ffffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641418387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa1580156147b2573d6000803e3d6000fd5b5050506020604051035190506000866040516020016147d191906152c0565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b61480e614bd0565b83516020808601518551918601516000938493849361482f93909190614928565b919450925090506401000003d01985820960011461488f5760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a0000000000000060448201526064016108dc565b60405180604001604052806401000003d019806148ae576148ae6157c5565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d01981106146b9576040805160208082019390935281518082038401815290820190915280519101206148d5565b6000612a108260026149216401000003d01960016155fe565b901c614a08565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a089050600061496883838585614ac8565b909850905061497988828e88614aec565b909850905061498a88828c87614aec565b9098509050600061499d8d878b85614aec565b90985090506149ae88828686614ac8565b90985090506149bf88828e89614aec565b90985090508181146149f4576401000003d019818a0998506401000003d01982890997506401000003d01981830996506149f8565b8196505b5050505050509450945094915050565b600080614a13614bee565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614a45614c0c565b60208160c08460057ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa925082614abe5760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c75726521000000000000000000000000000060448201526064016108dc565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614ba2579160200282015b82811115614ba257825182547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03909116178255602090920191600190910190614b55565b50614bae929150614c2a565b5090565b50805460008255906000526020600020908101906108349190614c2a565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614bae5760008155600101614c2b565b80356001600160a01b03811681146146b957600080fd5b8060408101831015612a1057600080fd5b600082601f830112614c7857600080fd5b6040516040810181811067ffffffffffffffff82111715614c9b57614c9b615852565b8060405250808385604086011115614cb257600080fd5b60005b6002811015614cd4578135835260209283019290910190600101614cb5565b509195945050505050565b600060a08284031215614cf157600080fd5b60405160a0810181811067ffffffffffffffff82111715614d1457614d14615852565b604052905080614d2383614da9565b8152614d3160208401614da9565b6020820152614d4260408401614d95565b6040820152614d5360608401614d95565b6060820152614d6460808401614c3f565b60808201525092915050565b803561ffff811681146146b957600080fd5b803562ffffff811681146146b957600080fd5b803563ffffffff811681146146b957600080fd5b803567ffffffffffffffff811681146146b957600080fd5b805169ffffffffffffffffffff811681146146b957600080fd5b600060208284031215614ded57600080fd5b613a4c82614c3f565b60008060608385031215614e0957600080fd5b614e1283614c3f565b9150614e218460208501614c56565b90509250929050565b60008060008060608587031215614e4057600080fd5b614e4985614c3f565b935060208501359250604085013567ffffffffffffffff80821115614e6d57600080fd5b818701915087601f830112614e8157600080fd5b813581811115614e9057600080fd5b886020828501011115614ea257600080fd5b95989497505060200194505050565b60008060408385031215614ec457600080fd5b614ecd83614c3f565b915060208301356bffffffffffffffffffffffff81168114614eee57600080fd5b809150509250929050565b600060408284031215614f0b57600080fd5b613a4c8383614c56565b600060408284031215614f2757600080fd5b613a4c8383614c67565b600060208284031215614f4357600080fd5b81518015158114613a4c57600080fd5b600060208284031215614f6557600080fd5b5051919050565b600080600080600060a08688031215614f8457600080fd5b85359450614f9460208701614da9565b9350614fa260408701614d70565b9250614fb060608701614d95565b9150614fbe60808701614d95565b90509295509295909350565b600080828403610240811215614fdf57600080fd5b6101a080821215614fef57600080fd5b614ff76155d4565b91506150038686614c67565b82526150128660408701614c67565b60208301526080850135604083015260a0850135606083015260c0850135608083015261504160e08601614c3f565b60a083015261010061505587828801614c67565b60c0840152615068876101408801614c67565b60e0840152610180860135818401525081935061508786828701614cdf565b925050509250929050565b6000806000806000808688036101c08112156150ad57600080fd5b6150b688614d70565b96506150c460208901614d95565b95506150d260408901614d95565b94506150e060608901614d95565b935060808801359250610120807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608301121561511b57600080fd5b6151236155d4565b915061513160a08a01614d95565b825261513f60c08a01614d95565b602083015261515060e08a01614d95565b6040830152610100615163818b01614d95565b6060840152615173828b01614d95565b60808401526151856101408b01614d82565b60a08401526151976101608b01614d82565b60c08401526151a96101808b01614d82565b60e08401526151bb6101a08b01614d82565b818401525050809150509295509295509295565b6000602082840312156151e157600080fd5b5035919050565b6000602082840312156151fa57600080fd5b613a4c82614da9565b6000806040838503121561521657600080fd5b61521f83614da9565b9150614e2160208401614c3f565b600080600080600060a0868803121561524557600080fd5b61524e86614dc1565b9450602086015193506040860151925060608601519150614fbe60808701614dc1565b8060005b60028110156109e5578151845260209384019390910190600101615275565b600081518084526152ac8160208601602086016156f5565b601f01601f19169290920160200192915050565b6152ca8183615271565b604001919050565b600083516152e48184602088016156f5565b8351908301906152f88183602088016156f5565b01949350505050565b8681526153116020820187615271565b61531e6060820186615271565b61532b60a0820185615271565b61533860e0820184615271565b60609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166101208201526101340195945050505050565b8381526153836020820184615271565b606081019190915260800192915050565b60408101612a108284615271565b602081526000613a4c6020830184615294565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615406578451835293830193918301916001016153ea565b509098975050505050505050565b60006101c08201905061ffff8816825263ffffffff808816602084015280871660408401528086166060840152846080840152835481811660a085015261546860c08501838360201c1663ffffffff169052565b61547f60e08501838360401c1663ffffffff169052565b6154976101008501838360601c1663ffffffff169052565b6154af6101208501838360801c1663ffffffff169052565b62ffffff60a082901c811661014086015260b882901c811661016086015260d082901c1661018085015260e81c6101a090930192909252979650505050505050565b82815260608101613a4c6020830184615271565b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156155465784518352938301939183019160010161552a565b5090979650505050505050565b6000608082016bffffffffffffffffffffffff87168352602067ffffffffffffffff8716818501526001600160a01b0380871660408601526080606086015282865180855260a087019150838801945060005b818110156155c45785518416835294840194918401916001016155a6565b50909a9950505050505050505050565b604051610120810167ffffffffffffffff811182821017156155f8576155f8615852565b60405290565b6000821982111561561157615611615796565b500190565b600067ffffffffffffffff8083168185168083038211156152f8576152f8615796565b60006bffffffffffffffffffffffff8083168185168083038211156152f8576152f8615796565b60008261566f5761566f6157c5565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156156ac576156ac615796565b500290565b6000828210156156c3576156c3615796565b500390565b60006bffffffffffffffffffffffff838116908316818110156156ed576156ed615796565b039392505050565b60005b838110156157105781810151838201526020016156f8565b838111156109e55750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561575357615753615796565b5060010190565b600067ffffffffffffffff8083168181141561577857615778615796565b6001019392505050565b600082615791576157916157c5565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfe307866666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666a164736f6c6343000806000a", } var VRFCoordinatorV2ABI = VRFCoordinatorV2MetaData.ABI diff --git a/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go b/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go index 35de7b358a7..e09c7c46e29 100644 --- a/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go +++ b/core/gethwrappers/generated/vrf_coordinator_v2_5/vrf_coordinator_v2_5.go @@ -67,7 +67,7 @@ type VRFV2PlusClientRandomWordsRequest struct { var VRFCoordinatorV25MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2_5.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountNative\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldNativeBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNativeBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithNative\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"deregisterMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"deregisterProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2_5.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverNativeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2_5.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b506040516200615438038062006154833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615f79620001db600039600081816106150152613a860152615f796000f3fe6080604052600436106102dc5760003560e01c806379ba50971161017f578063b08c8795116100e1578063da2f26101161008a578063e72f6e3011610064578063e72f6e3014610964578063ee9d2d3814610984578063f2fde38b146109b157600080fd5b8063da2f2610146108dd578063dac83d2914610913578063dc311dd31461093357600080fd5b8063caf70c4a116100bb578063caf70c4a1461087d578063cb6317971461089d578063d98e620e146108bd57600080fd5b8063b08c87951461081d578063b2a7cac51461083d578063bec4c08c1461085d57600080fd5b80639b1c385e11610143578063a4c0ed361161011d578063a4c0ed36146107b0578063aa433aff146107d0578063aefb212f146107f057600080fd5b80639b1c385e146107435780639d40a6fd14610763578063a21a23e41461079b57600080fd5b806379ba5097146106bd5780638402595e146106d257806386fe91c7146106f25780638da5cb5b1461071257806395b55cfc1461073057600080fd5b8063330987b31161024357806365982744116101ec5780636b6feccc116101c65780636b6feccc146106375780636f64f03f1461067d57806372e9d5651461069d57600080fd5b806365982744146105c357806366316d8d146105e3578063689c45171461060357600080fd5b806341af6c871161021d57806341af6c871461055e5780635d06b4ab1461058e57806364d51a2a146105ae57600080fd5b8063330987b3146104f3578063405b84fa1461051357806340d6bb821461053357600080fd5b80630ae09540116102a55780631b6b6d231161027f5780631b6b6d231461047f57806329492657146104b7578063294daa49146104d757600080fd5b80630ae09540146103f857806315c48b841461041857806318e3dd271461044057600080fd5b8062012291146102e157806304104edb1461030e578063043bd6ae14610330578063088070f51461035457806308821d58146103d8575b600080fd5b3480156102ed57600080fd5b506102f66109d1565b60405161030593929190615add565b60405180910390f35b34801561031a57600080fd5b5061032e61032936600461542a565b610a4d565b005b34801561033c57600080fd5b5061034660115481565b604051908152602001610305565b34801561036057600080fd5b50600d546103a09061ffff81169063ffffffff62010000820481169160ff600160301b820416916701000000000000008204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a001610305565b3480156103e457600080fd5b5061032e6103f336600461556a565b610c0f565b34801561040457600080fd5b5061032e61041336600461580c565b610da3565b34801561042457600080fd5b5061042d60c881565b60405161ffff9091168152602001610305565b34801561044c57600080fd5b50600a5461046790600160601b90046001600160601b031681565b6040516001600160601b039091168152602001610305565b34801561048b57600080fd5b5060025461049f906001600160a01b031681565b6040516001600160a01b039091168152602001610305565b3480156104c357600080fd5b5061032e6104d2366004615447565b610e71565b3480156104e357600080fd5b5060405160018152602001610305565b3480156104ff57600080fd5b5061046761050e36600461563c565b610fee565b34801561051f57600080fd5b5061032e61052e36600461580c565b6114d8565b34801561053f57600080fd5b506105496101f481565b60405163ffffffff9091168152602001610305565b34801561056a57600080fd5b5061057e6105793660046155bf565b6118ff565b6040519015158152602001610305565b34801561059a57600080fd5b5061032e6105a936600461542a565b611b00565b3480156105ba57600080fd5b5061042d606481565b3480156105cf57600080fd5b5061032e6105de36600461547c565b611bbe565b3480156105ef57600080fd5b5061032e6105fe366004615447565b611c1e565b34801561060f57600080fd5b5061049f7f000000000000000000000000000000000000000000000000000000000000000081565b34801561064357600080fd5b506012546106609063ffffffff8082169164010000000090041682565b6040805163ffffffff938416815292909116602083015201610305565b34801561068957600080fd5b5061032e6106983660046154b5565b611de6565b3480156106a957600080fd5b5060035461049f906001600160a01b031681565b3480156106c957600080fd5b5061032e611ee5565b3480156106de57600080fd5b5061032e6106ed36600461542a565b611f96565b3480156106fe57600080fd5b50600a54610467906001600160601b031681565b34801561071e57600080fd5b506000546001600160a01b031661049f565b61032e61073e3660046155bf565b6120b1565b34801561074f57600080fd5b5061034661075e366004615719565b6121f8565b34801561076f57600080fd5b50600754610783906001600160401b031681565b6040516001600160401b039091168152602001610305565b3480156107a757600080fd5b506103466125ed565b3480156107bc57600080fd5b5061032e6107cb3660046154e2565b61283d565b3480156107dc57600080fd5b5061032e6107eb3660046155bf565b6129dd565b3480156107fc57600080fd5b5061081061080b366004615831565b612a3d565b6040516103059190615a42565b34801561082957600080fd5b5061032e61083836600461576e565b612b3e565b34801561084957600080fd5b5061032e6108583660046155bf565b612cd2565b34801561086957600080fd5b5061032e61087836600461580c565b612e00565b34801561088957600080fd5b50610346610898366004615586565b612f9c565b3480156108a957600080fd5b5061032e6108b836600461580c565b612fcc565b3480156108c957600080fd5b506103466108d83660046155bf565b6132cf565b3480156108e957600080fd5b5061049f6108f83660046155bf565b600e602052600090815260409020546001600160a01b031681565b34801561091f57600080fd5b5061032e61092e36600461580c565b6132f0565b34801561093f57600080fd5b5061095361094e3660046155bf565b61340f565b604051610305959493929190615c45565b34801561097057600080fd5b5061032e61097f36600461542a565b61350a565b34801561099057600080fd5b5061034661099f3660046155bf565b60106020526000908152604090205481565b3480156109bd57600080fd5b5061032e6109cc36600461542a565b6136f2565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff16939192839190830182828015610a3b57602002820191906000526020600020905b815481526020019060010190808311610a27575b50505050509050925092509250909192565b610a55613703565b60135460005b81811015610be257826001600160a01b031660138281548110610a8057610a80615f1d565b6000918252602090912001546001600160a01b03161415610bd0576013610aa8600184615e16565b81548110610ab857610ab8615f1d565b600091825260209091200154601380546001600160a01b039092169183908110610ae457610ae4615f1d565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055826013610b1b600185615e16565b81548110610b2b57610b2b615f1d565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506013805480610b6a57610b6a615f07565b6000828152602090819020600019908301810180546001600160a01b03191690559091019091556040516001600160a01b03851681527ff80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af37910160405180910390a1505050565b80610bda81615e85565b915050610a5b565b50604051635428d44960e01b81526001600160a01b03831660048201526024015b60405180910390fd5b50565b610c17613703565b604080518082018252600091610c46919084906002908390839080828437600092019190915250612f9c915050565b6000818152600e60205260409020549091506001600160a01b031680610c8257604051631dfd6e1360e21b815260048101839052602401610c03565b6000828152600e6020526040812080546001600160a01b03191690555b600f54811015610d5a5782600f8281548110610cbd57610cbd615f1d565b90600052602060002001541415610d4857600f805460009190610ce290600190615e16565b81548110610cf257610cf2615f1d565b9060005260206000200154905080600f8381548110610d1357610d13615f1d565b600091825260209091200155600f805480610d3057610d30615f07565b60019003818190600052602060002001600090559055505b80610d5281615e85565b915050610c9f565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610d9691815260200190565b60405180910390a2505050565b60008281526005602052604090205482906001600160a01b031680610ddb57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614610e0f57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615610e3a5760405163769dd35360e11b815260040160405180910390fd5b610e43846118ff565b15610e6157604051631685ecdd60e31b815260040160405180910390fd5b610e6b848461375f565b50505050565b600d54600160301b900460ff1615610e9c5760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610ed857604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610f009084906001600160601b0316615e2d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610f489190615e2d565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610fc2576040519150601f19603f3d011682016040523d82523d6000602084013e610fc7565b606091505b5050905080610fe95760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff161561101c5760405163769dd35360e11b815260040160405180910390fd5b60005a9050600061102d858561391b565b90506000846060015163ffffffff166001600160401b0381111561105357611053615f33565b60405190808252806020026020018201604052801561107c578160200160208202803683370190505b50905060005b856060015163ffffffff168110156110fc578260400151816040516020016110b4929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c8282815181106110df576110df615f1d565b6020908102919091010152806110f481615e85565b915050611082565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b9161113491908690602401615b50565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805466ff0000000000001916600160301b17905590880151608089015191925060009161119c9163ffffffff169084613ba8565b600d805466ff00000000000019169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b03166111df816001615d96565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a0151805161122c90600190615e16565b8151811061123c5761123c615f1d565b602091010151600d5460f89190911c600114915060009061126d908a90600160581b900463ffffffff163a85613bf6565b90508115611376576020808c01516000908152600690915260409020546001600160601b03808316600160601b9092041610156112bd57604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c906112f4908490600160601b90046001600160601b0316615e2d565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c90915281208054859450909261134d91859116615dc1565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550611462565b6020808c01516000908152600690915260409020546001600160601b03808316911610156113b757604051631e9acf1760e31b815260040160405180910390fd5b6020808c0151600090815260069091526040812080548392906113e49084906001600160601b0316615e2d565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b90915281208054859450909261143d91859116615dc1565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a6040015184886040516114bf939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff16156115035760405163769dd35360e11b815260040160405180910390fd5b61150c81613c46565b61153457604051635428d44960e01b81526001600160a01b0382166004820152602401610c03565b6000806000806115438661340f565b945094505093509350336001600160a01b0316826001600160a01b0316146115ad5760405162461bcd60e51b815260206004820152601660248201527f4e6f7420737562736372697074696f6e206f776e6572000000000000000000006044820152606401610c03565b6115b6866118ff565b156116035760405162461bcd60e51b815260206004820152601660248201527f50656e64696e67207265717565737420657869737473000000000000000000006044820152606401610c03565b60006040518060c00160405280611618600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b0316815250905060008160405160200161166c9190615a68565b604051602081830303815290604052905061168688613cb0565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b038816906116bf908590600401615a55565b6000604051808303818588803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611715905057506001600160601b03861615155b156117f45760025460405163a9059cbb60e01b81526001600160a01b0389811660048301526001600160601b03891660248301529091169063a9059cbb90604401602060405180830381600087803b15801561177057600080fd5b505af1158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a891906155a2565b6117f45760405162461bcd60e51b815260206004820152601260248201527f696e73756666696369656e742066756e647300000000000000000000000000006044820152606401610c03565b600d805466ff0000000000001916600160301b17905560005b83518110156118a25783818151811061182857611828615f1d565b6020908102919091010151604051638ea9811760e01b81526001600160a01b038a8116600483015290911690638ea9811790602401600060405180830381600087803b15801561187757600080fd5b505af115801561188b573d6000803e3d6000fd5b50505050808061189a90615e85565b91505061180d565b50600d805466ff00000000000019169055604080516001600160a01b0389168152602081018a90527fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187910160405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561198957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161196b575b505050505081525050905060005b816040015151811015611af65760005b600f54811015611ae3576000611aac600f83815481106119c9576119c9615f1d565b9060005260206000200154856040015185815181106119ea576119ea615f1d565b6020026020010151886004600089604001518981518110611a0d57611a0d615f1d565b6020908102919091018101516001600160a01b03908116835282820193909352604091820160009081208e82528252829020548251808301889052959093168583015260608501939093526001600160401b039091166080808501919091528151808503909101815260a08401825280519083012060c084019490945260e0808401859052815180850390910181526101009093019052815191012091565b5060008181526010602052604090205490915015611ad05750600195945050505050565b5080611adb81615e85565b9150506119a7565b5080611aee81615e85565b915050611997565b5060009392505050565b611b08613703565b611b1181613c46565b15611b3a5760405163ac8a27ef60e01b81526001600160a01b0382166004820152602401610c03565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af016259060200160405180910390a150565b611bc6613703565b6002546001600160a01b031615611bf057604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff1615611c495760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b0316611c725760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b0380831691161015611cae57604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b602052604081208054839290611cd69084906001600160601b0316615e2d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b0316611d1e9190615e2d565b82546101009290920a6001600160601b0381810219909316918316021790915560025460405163a9059cbb60e01b81526001600160a01b03868116600483015292851660248201529116915063a9059cbb90604401602060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc591906155a2565b611de257604051631e9acf1760e31b815260040160405180910390fd5b5050565b611dee613703565b604080518082018252600091611e1d919084906002908390839080828437600092019190915250612f9c915050565b6000818152600e60205260409020549091506001600160a01b031615611e5957604051634a0b8fa760e01b815260048101829052602401610c03565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610d96565b6001546001600160a01b03163314611f3f5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610c03565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611f9e613703565b600a544790600160601b90046001600160601b031681811115611fde576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015610fe9576000611ff28284615e16565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114612041576040519150601f19603f3d011682016040523d82523d6000602084013e612046565b606091505b50509050806120685760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b0387168152602081018490527f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c910160405180910390a15050505050565b600d54600160301b900460ff16156120dc5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661211157604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c6121408385615dc1565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b03166121889190615dc1565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e9028234846121db9190615d7e565b604080519283526020830191909152015b60405180910390a25050565b600d54600090600160301b900460ff16156122265760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b031661226157604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b0316806122b2576040516379bfd40160e01b815260208401356004820152336024820152604401610c03565b600d5461ffff166122c96060850160408601615753565b61ffff1610806122ec575060c86122e66060850160408601615753565b61ffff16115b15612332576123016060840160408501615753565b600d5460405163539c34bb60e11b815261ffff92831660048201529116602482015260c86044820152606401610c03565b600d5462010000900463ffffffff166123516080850160608601615853565b63ffffffff1611156123a15761236d6080840160608501615853565b600d54604051637aebf00f60e11b815263ffffffff9283166004820152620100009091049091166024820152604401610c03565b6101f46123b460a0850160808601615853565b63ffffffff1611156123fa576123d060a0840160808501615853565b6040516311ce1afb60e21b815263ffffffff90911660048201526101f46024820152604401610c03565b6000612407826001615d96565b604080518635602080830182905233838501528089013560608401526001600160401b0385166080808501919091528451808503909101815260a0808501865281519183019190912060c085019390935260e0808501849052855180860390910181526101009094019094528251920191909120929350906000906124979061249290890189615c9a565b613eff565b905060006124a482613f7c565b9050836124af613fed565b60208a01356124c460808c0160608d01615853565b6124d460a08d0160808e01615853565b33866040516020016124ec9796959493929190615ba8565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d60400160208101906125639190615753565b8e60600160208101906125769190615853565b8f60800160208101906125899190615853565b8960405161259c96959493929190615b69565b60405180910390a450503360009081526004602090815260408083208983013584529091529020805467ffffffffffffffff19166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561261b5760405163769dd35360e11b815260040160405180910390fd5b600033612629600143615e16565b600754604051606093841b6bffffffffffffffffffffffff199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006126a883615ea0565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b038111156126e7576126e7615f33565b604051908082528060200260200182016040528015612710578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b0392831617835592516001830180549094169116179091559251805194955090936127f19260028501920190615140565b506128019150600890508361407d565b5060405133815282907f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d9060200160405180910390a250905090565b600d54600160301b900460ff16156128685760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03163314612893576040516344b0e3c360e01b815260040160405180910390fd5b602081146128b457604051638129bbcd60e01b815260040160405180910390fd5b60006128c2828401846155bf565b6000818152600560205260409020549091506001600160a01b03166128fa57604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b0316918691906129218385615dc1565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166129699190615dc1565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846129bc9190615d7e565b604080519283526020830191909152015b60405180910390a2505050505050565b6129e5613703565b6000818152600560205260409020546001600160a01b0316612a1a57604051630fb532db60e11b815260040160405180910390fd5b600081815260056020526040902054610c0c9082906001600160a01b031661375f565b60606000612a4b6008614089565b9050808410612a6d57604051631390f2a160e01b815260040160405180910390fd5b6000612a798486615d7e565b905081811180612a87575083155b612a915780612a93565b815b90506000612aa18683615e16565b6001600160401b03811115612ab857612ab8615f33565b604051908082528060200260200182016040528015612ae1578160200160208202803683370190505b50905060005b8151811015612b3457612b05612afd8883615d7e565b600890614093565b828281518110612b1757612b17615f1d565b602090810291909101015280612b2c81615e85565b915050612ae7565b5095945050505050565b612b46613703565b60c861ffff87161115612b805760405163539c34bb60e11b815261ffff871660048201819052602482015260c86044820152606401610c03565b60008213612ba4576040516321ea67b360e11b815260048101839052602401610c03565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff19168817620100008702176effffffffffffffffff000000000000191667010000000000000085026effffffff0000000000000000000000191617600160581b83021790558a51601280548d87015192891667ffffffffffffffff199091161764010000000092891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff1615612cfd5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316612d3257604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612d8b576000818152600560205260409081902060010154905163d084e97560e01b81526001600160a01b039091166004820152602401610c03565b6000818152600560209081526040918290208054336001600160a01b0319808316821784556001909301805490931690925583516001600160a01b0390911680825292810191909152909183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691016121ec565b60008281526005602052604090205482906001600160a01b031680612e3857604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612e6c57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff1615612e975760405163769dd35360e11b815260040160405180910390fd5b60008481526005602052604090206002015460641415612eca576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b031615612f0157610e6b565b6001600160a01b03831660008181526004602090815260408083208884528252808320805467ffffffffffffffff19166001908117909155600583528184206002018054918201815584529282902090920180546001600160a01b03191684179055905191825285917f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e191015b60405180910390a250505050565b600081604051602001612faf9190615a34565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b03168061300457604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461303857604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156130635760405163769dd35360e11b815260040160405180910390fd5b61306c846118ff565b1561308a57604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b03166130e6576040516379bfd40160e01b8152600481018590526001600160a01b0384166024820152604401610c03565b60008481526005602090815260408083206002018054825181850281018501909352808352919290919083018282801561314957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161312b575b505050505090506000600182516131609190615e16565b905060005b825181101561326c57856001600160a01b031683828151811061318a5761318a615f1d565b60200260200101516001600160a01b0316141561325a5760008383815181106131b5576131b5615f1d565b6020026020010151905080600560008a815260200190815260200160002060020183815481106131e7576131e7615f1d565b600091825260208083209190910180546001600160a01b0319166001600160a01b03949094169390931790925589815260059091526040902060020180548061323257613232615f07565b600082815260209020810160001990810180546001600160a01b03191690550190555061326c565b8061326481615e85565b915050613165565b506001600160a01b03851660008181526004602090815260408083208a8452825291829020805467ffffffffffffffff19169055905191825287917f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a791016129cd565b600f81815481106132df57600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061332857604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461335c57604051636c51fda960e11b81526001600160a01b0382166004820152602401610c03565b600d54600160301b900460ff16156133875760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b03848116911614610e6b5760008481526005602090815260409182902060010180546001600160a01b0319166001600160a01b03871690811790915582513381529182015285917f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19101612f8e565b6000818152600560205260408120548190819081906060906001600160a01b031661344d57604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156134f057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116134d2575b505050505090509450945094509450945091939590929450565b613512613703565b6002546001600160a01b031661353b5760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561357f57600080fd5b505afa158015613593573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135b791906155d8565b600a549091506001600160601b0316818111156135f1576040516354ced18160e11b81526004810182905260248101839052604401610c03565b81811015610fe95760006136058284615e16565b60025460405163a9059cbb60e01b81526001600160a01b0387811660048301526024820184905292935091169063a9059cbb90604401602060405180830381600087803b15801561365557600080fd5b505af1158015613669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061368d91906155a2565b6136aa57604051631f01ff1360e21b815260040160405180910390fd5b604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600910160405180910390a150505050565b6136fa613703565b610c0c8161409f565b6000546001600160a01b0316331461375d5760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c03565b565b60008061376b84613cb0565b60025491935091506001600160a01b03161580159061379257506001600160601b03821615155b156138425760025460405163a9059cbb60e01b81526001600160a01b0385811660048301526001600160601b03851660248301529091169063a9059cbb90604401602060405180830381600087803b1580156137ed57600080fd5b505af1158015613801573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382591906155a2565b61384257604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613898576040519150601f19603f3d011682016040523d82523d6000602084013e61389d565b606091505b50509050806138bf5760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006139478460000151612f9c565b6000818152600e60205260409020549091506001600160a01b03168061398357604051631dfd6e1360e21b815260048101839052602401610c03565b60008286608001516040516020016139a5929190918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526010909352912054909150806139eb57604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613a1a978a979096959101615bf2565b604051602081830303815290604052805190602001208114613a4f5760405163354a450b60e21b815260040160405180910390fd5b6000613a5e8760000151614149565b905080613b36578651604051631d2827a760e31b81526001600160401b0390911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b158015613ad057600080fd5b505afa158015613ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b0891906155d8565b905080613b3657865160405163175dadad60e01b81526001600160401b039091166004820152602401610c03565b6000886080015182604051602001613b58929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c90506000613b7f8a8361422a565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a611388811015613bba57600080fd5b611388810390508460408204820311613bd257600080fd5b50823b613bde57600080fd5b60008083516020850160008789f190505b9392505050565b60008115613c2457601254613c1d9086908690640100000000900463ffffffff1686614295565b9050613c3e565b601254613c3b908690869063ffffffff16866142ff565b90505b949350505050565b6000805b601354811015613ca757826001600160a01b031660138281548110613c7157613c71615f1d565b6000918252602090912001546001600160a01b03161415613c955750600192915050565b80613c9f81615e85565b915050613c4a565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287968796949594860193919290830182828015613d3c57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613d1e575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613e19576004600084604001518381518110613dc857613dc8615f1d565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208982529092529020805467ffffffffffffffff1916905580613e1181615e85565b915050613da1565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613e5160028301826151a5565b5050600085815260066020526040812055613e6d6008866143ed565b50600a8054859190600090613e8c9084906001600160601b0316615e2d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613ed49190615e2d565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081019091526000815281613f2857506040805160208101909152600081526114d2565b63125fa26760e31b613f3a8385615e55565b6001600160e01b03191614613f6257604051632923fee760e11b815260040160405180910390fd5b613f6f8260048186615d54565b810190613bef91906155f1565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613fb591511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b600046613ff9816143f9565b156140765760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561403857600080fd5b505afa15801561404c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061407091906155d8565b91505090565b4391505090565b6000613bef838361441c565b60006114d2825490565b6000613bef838361446b565b6001600160a01b0381163314156140f85760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c03565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600046614155816143f9565b1561421b57610100836001600160401b031661416f613fed565b6141799190615e16565b11806141955750614188613fed565b836001600160401b031610155b156141a35750600092915050565b6040516315a03d4160e11b81526001600160401b0384166004820152606490632b407a829060240160206040518083038186803b1580156141e357600080fd5b505afa1580156141f7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bef91906155d8565b50506001600160401b03164090565b600061425e8360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151614495565b60038360200151604051602001614276929190615b3c565b60408051601f1981840301815291905280516020909101209392505050565b6000806142a06146c0565b905060005a6142af8888615d7e565b6142b99190615e16565b6142c39085615df7565b905060006142dc63ffffffff871664e8d4a51000615df7565b9050826142e98284615d7e565b6142f39190615d7e565b98975050505050505050565b60008061430a614713565b905060008113614330576040516321ea67b360e11b815260048101829052602401610c03565b600061433a6146c0565b9050600082825a61434b8b8b615d7e565b6143559190615e16565b61435f9088615df7565b6143699190615d7e565b61437b90670de0b6b3a7640000615df7565b6143859190615de3565b9050600061439e63ffffffff881664e8d4a51000615df7565b90506143b6816b033b2e3c9fd0803ce8000000615e16565b8211156143d65760405163e80fa38160e01b815260040160405180910390fd5b6143e08183615d7e565b9998505050505050505050565b6000613bef83836147e2565b600061a4b182148061440d575062066eed82145b806114d257505062066eee1490565b6000818152600183016020526040812054614463575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556114d2565b5060006114d2565b600082600001828154811061448257614482615f1d565b9060005260206000200154905092915050565b61449e896148d5565b6144ea5760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e2063757276650000000000006044820152606401610c03565b6144f3886148d5565b61453f5760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e20637572766500000000000000000000006044820152606401610c03565b614548836148d5565b6145945760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e2063757276650000006044820152606401610c03565b61459d826148d5565b6145e95760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e206375727665000000006044820152606401610c03565b6145f5878a88876149ae565b6146415760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e657373000000000000006044820152606401610c03565b600061464d8a87614ad1565b90506000614660898b878b868989614b35565b90506000614671838d8d8a86614c55565b9050808a146146b25760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610c03565b505050505050505050505050565b6000466146cc816143f9565b1561470b57606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561403857600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093670100000000000000900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561477557600080fd5b505afa158015614789573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147ad919061586e565b5094509092508491505080156147d157506147c88242615e16565b8463ffffffff16105b15613c3e5750601154949350505050565b600081815260018301602052604081205480156148cb576000614806600183615e16565b855490915060009061481a90600190615e16565b905081811461487f57600086600001828154811061483a5761483a615f1d565b906000526020600020015490508087600001848154811061485d5761485d615f1d565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061489057614890615f07565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506114d2565b60009150506114d2565b80516000906401000003d0191161492e5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d019116149875760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e61746500000000000000000000000000006044820152606401610c03565b60208201516401000003d0199080096149a78360005b6020020151614c95565b1492915050565b60006001600160a01b0382166149f45760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b6044820152606401610c03565b602084015160009060011615614a0b57601c614a0e565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614aa9573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614ad96151c3565b614b0660018484604051602001614af293929190615a13565b604051602081830303815290604052614cb9565b90505b614b12816148d5565b6114d2578051604080516020810192909252614b2e9101614af2565b9050614b09565b614b3d6151c3565b825186516401000003d0199081900691061415614b9c5760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e637400006044820152606401610c03565b614ba7878988614d07565b614bf35760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c6564000000000000000000006044820152606401610c03565b614bfe848685614d07565b614c4a5760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c65640000000000000000006044820152606401610c03565b6142f3868484614e2f565b600060028686868587604051602001614c73969594939291906159b4565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614cc16151c3565b614cca82614ef6565b8152614cdf614cda82600061499d565b614f31565b6020820181905260029006600114156125e8576020810180516401000003d019039052919050565b600082614d445760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b6044820152606401610c03565b83516020850151600090614d5a90600290615ec7565b15614d6657601c614d69565b601b5b9050600070014551231950b75fc4402da1732fc9bebe198387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa158015614ddb573d6000803e3d6000fd5b505050602060405103519050600086604051602001614dfa91906159a2565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614e376151c3565b835160208086015185519186015160009384938493614e5893909190614f51565b919450925090506401000003d019858209600114614eb85760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a000000000000006044820152606401610c03565b60405180604001604052806401000003d01980614ed757614ed7615ef1565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d01981106125e857604080516020808201939093528151808203840181529082019091528051910120614efe565b60006114d2826002614f4a6401000003d0196001615d7e565b901c615031565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614f91838385856150d3565b9098509050614fa288828e886150f7565b9098509050614fb388828c876150f7565b90985090506000614fc68d878b856150f7565b9098509050614fd7888286866150d3565b9098509050614fe888828e896150f7565b909850905081811461501d576401000003d019818a0998506401000003d01982890997506401000003d0198183099650615021565b8196505b5050505050509450945094915050565b60008061503c6151e1565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a082015261506e6151ff565b60208160c0846005600019fa9250826150c95760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c7572652100000000000000000000000000006044820152606401610c03565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215615195579160200282015b8281111561519557825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615160565b506151a192915061521d565b5090565b5080546000825590600052602060002090810190610c0c919061521d565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b808211156151a1576000815560010161521e565b80356125e881615f49565b80604081018310156114d257600080fd5b600082601f83011261525f57600080fd5b615267615ce7565b80838560408601111561527957600080fd5b60005b600281101561529b57813584526020938401939091019060010161527c565b509095945050505050565b600082601f8301126152b757600080fd5b81356001600160401b03808211156152d1576152d1615f33565b604051601f8301601f19908116603f011681019082821181831017156152f9576152f9615f33565b8160405283815286602085880101111561531257600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060c0828403121561534457600080fd5b61534c615d0f565b905081356001600160401b03808216821461536657600080fd5b8183526020840135602084015261537f604085016153e5565b6040840152615390606085016153e5565b60608401526153a160808501615232565b608084015260a08401359150808211156153ba57600080fd5b506153c7848285016152a6565b60a08301525092915050565b803561ffff811681146125e857600080fd5b803563ffffffff811681146125e857600080fd5b805169ffffffffffffffffffff811681146125e857600080fd5b80356001600160601b03811681146125e857600080fd5b60006020828403121561543c57600080fd5b8135613bef81615f49565b6000806040838503121561545a57600080fd5b823561546581615f49565b915061547360208401615413565b90509250929050565b6000806040838503121561548f57600080fd5b823561549a81615f49565b915060208301356154aa81615f49565b809150509250929050565b600080606083850312156154c857600080fd5b82356154d381615f49565b9150615473846020850161523d565b600080600080606085870312156154f857600080fd5b843561550381615f49565b93506020850135925060408501356001600160401b038082111561552657600080fd5b818701915087601f83011261553a57600080fd5b81358181111561554957600080fd5b88602082850101111561555b57600080fd5b95989497505060200194505050565b60006040828403121561557c57600080fd5b613bef838361523d565b60006040828403121561559857600080fd5b613bef838361524e565b6000602082840312156155b457600080fd5b8151613bef81615f5e565b6000602082840312156155d157600080fd5b5035919050565b6000602082840312156155ea57600080fd5b5051919050565b60006020828403121561560357600080fd5b604051602081018181106001600160401b038211171561562557615625615f33565b604052823561563381615f5e565b81529392505050565b6000808284036101c081121561565157600080fd5b6101a08082121561566157600080fd5b615669615d31565b9150615675868661524e565b8252615684866040870161524e565b60208301526080850135604083015260a0850135606083015260c085013560808301526156b360e08601615232565b60a08301526101006156c78782880161524e565b60c08401526156da87610140880161524e565b60e0840152610180860135908301529092508301356001600160401b0381111561570357600080fd5b61570f85828601615332565b9150509250929050565b60006020828403121561572b57600080fd5b81356001600160401b0381111561574157600080fd5b820160c08185031215613bef57600080fd5b60006020828403121561576557600080fd5b613bef826153d3565b60008060008060008086880360e081121561578857600080fd5b615791886153d3565b965061579f602089016153e5565b95506157ad604089016153e5565b94506157bb606089016153e5565b9350608088013592506040609f19820112156157d657600080fd5b506157df615ce7565b6157eb60a089016153e5565b81526157f960c089016153e5565b6020820152809150509295509295509295565b6000806040838503121561581f57600080fd5b8235915060208301356154aa81615f49565b6000806040838503121561584457600080fd5b50508035926020909101359150565b60006020828403121561586557600080fd5b613bef826153e5565b600080600080600060a0868803121561588657600080fd5b61588f866153f9565b94506020860151935060408601519250606086015191506158b2608087016153f9565b90509295509295909350565b600081518084526020808501945080840160005b838110156158f75781516001600160a01b0316875295820195908201906001016158d2565b509495945050505050565b8060005b6002811015610e6b578151845260209384019390910190600101615906565b600081518084526020808501945080840160005b838110156158f757815187529582019590820190600101615939565b6000815180845260005b8181101561597b5760208185018101518683018201520161595f565b8181111561598d576000602083870101525b50601f01601f19169290920160200192915050565b6159ac8183615902565b604001919050565b8681526159c46020820187615902565b6159d16060820186615902565b6159de60a0820185615902565b6159eb60e0820184615902565b60609190911b6bffffffffffffffffffffffff19166101208201526101340195945050505050565b838152615a236020820184615902565b606081019190915260800192915050565b604081016114d28284615902565b602081526000613bef6020830184615925565b602081526000613bef6020830184615955565b6020815260ff8251166020820152602082015160408201526001600160a01b0360408301511660608201526000606083015160c06080840152615aae60e08401826158be565b905060808401516001600160601b0380821660a08601528060a08701511660c086015250508091505092915050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615b2e57845183529383019391830191600101615b12565b509098975050505050505050565b82815260608101613bef6020830184615902565b828152604060208201526000613c3e6040830184615925565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a08301526142f360c0830184615955565b878152866020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143e060e0830184615955565b8781526001600160401b0387166020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526143e060e0830184615955565b60006001600160601b0380881683528087166020840152506001600160401b03851660408301526001600160a01b038416606083015260a06080830152615c8f60a08301846158be565b979650505050505050565b6000808335601e19843603018112615cb157600080fd5b8301803591506001600160401b03821115615ccb57600080fd5b602001915036819003821315615ce057600080fd5b9250929050565b604080519081016001600160401b0381118282101715615d0957615d09615f33565b60405290565b60405160c081016001600160401b0381118282101715615d0957615d09615f33565b60405161012081016001600160401b0381118282101715615d0957615d09615f33565b60008085851115615d6457600080fd5b83861115615d7157600080fd5b5050820193919092039150565b60008219821115615d9157615d91615edb565b500190565b60006001600160401b03808316818516808303821115615db857615db8615edb565b01949350505050565b60006001600160601b03808316818516808303821115615db857615db8615edb565b600082615df257615df2615ef1565b500490565b6000816000190483118215151615615e1157615e11615edb565b500290565b600082821015615e2857615e28615edb565b500390565b60006001600160601b0383811690831681811015615e4d57615e4d615edb565b039392505050565b6001600160e01b03198135818116916004851015615e7d5780818660040360031b1b83161692505b505092915050565b6000600019821415615e9957615e99615edb565b5060010190565b60006001600160401b0380831681811415615ebd57615ebd615edb565b6001019392505050565b600082615ed657615ed6615ef1565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c0c57600080fd5b8015158114610c0c57600080fdfea164736f6c6343000806000a", + Bin: "0x60a06040523480156200001157600080fd5b506040516200615d3803806200615d833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615f82620001db60003960008181610566015261384f0152615f826000f3fe60806040526004361061023c5760003560e01c806379ba50971161012f578063b08c8795116100b1578063b08c87951461076d578063b2a7cac51461078d578063bec4c08c146107ad578063caf70c4a146107cd578063cb631797146107ed578063d98e620e1461080d578063da2f26101461082d578063dac83d2914610863578063dc311dd314610883578063e72f6e30146108b4578063ee9d2d38146108d4578063f2fde38b1461090157600080fd5b806379ba50971461060d5780638402595e1461062257806386fe91c7146106425780638da5cb5b1461066257806395b55cfc146106805780639b1c385e146106935780639d40a6fd146106b3578063a21a23e4146106eb578063a4c0ed3614610700578063aa433aff14610720578063aefb212f1461074057600080fd5b8063330987b3116101c3578063330987b314610444578063405b84fa1461046457806340d6bb821461048457806341af6c87146104af5780635d06b4ab146104df57806364d51a2a146104ff578063659827441461051457806366316d8d14610534578063689c4517146105545780636b6feccc146105885780636f64f03f146105cd57806372e9d565146105ed57600080fd5b80620122911461024157806304104edb1461026e578063043bd6ae14610290578063088070f5146102b457806308821d58146103345780630ae095401461035457806315c48b841461037457806318e3dd271461039c5780631b6b6d23146103db5780632949265714610408578063294daa4914610428575b600080fd5b34801561024d57600080fd5b50610256610921565b60405161026593929190615a61565b60405180910390f35b34801561027a57600080fd5b5061028e61028936600461533c565b61099d565b005b34801561029c57600080fd5b506102a660115481565b604051908152602001610265565b3480156102c057600080fd5b50600d546102fc9061ffff81169063ffffffff62010000820481169160ff600160301b82041691600160381b8204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a001610265565b34801561034057600080fd5b5061028e61034f36600461547c565b610b53565b34801561036057600080fd5b5061028e61036f36600461571e565b610ce7565b34801561038057600080fd5b5061038960c881565b60405161ffff9091168152602001610265565b3480156103a857600080fd5b50600a546103c390600160601b90046001600160601b031681565b6040516001600160601b039091168152602001610265565b3480156103e757600080fd5b506002546103fb906001600160a01b031681565b604051610265919061594f565b34801561041457600080fd5b5061028e610423366004615359565b610dac565b34801561043457600080fd5b5060405160018152602001610265565b34801561045057600080fd5b506103c361045f36600461554e565b610f29565b34801561047057600080fd5b5061028e61047f36600461571e565b61140d565b34801561049057600080fd5b5061049a6101f481565b60405163ffffffff9091168152602001610265565b3480156104bb57600080fd5b506104cf6104ca3660046154d1565b6117f8565b6040519015158152602001610265565b3480156104eb57600080fd5b5061028e6104fa36600461533c565b611999565b34801561050b57600080fd5b50610389606481565b34801561052057600080fd5b5061028e61052f36600461538e565b611a50565b34801561054057600080fd5b5061028e61054f366004615359565b611ab0565b34801561056057600080fd5b506103fb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561059457600080fd5b506012546105b09063ffffffff80821691600160201b90041682565b6040805163ffffffff938416815292909116602083015201610265565b3480156105d957600080fd5b5061028e6105e83660046153c7565b611c78565b3480156105f957600080fd5b506003546103fb906001600160a01b031681565b34801561061957600080fd5b5061028e611d77565b34801561062e57600080fd5b5061028e61063d36600461533c565b611e21565b34801561064e57600080fd5b50600a546103c3906001600160601b031681565b34801561066e57600080fd5b506000546001600160a01b03166103fb565b61028e61068e3660046154d1565b611f33565b34801561069f57600080fd5b506102a66106ae36600461562b565b61207a565b3480156106bf57600080fd5b506007546106d3906001600160401b031681565b6040516001600160401b039091168152602001610265565b3480156106f757600080fd5b506102a661240c565b34801561070c57600080fd5b5061028e61071b3660046153f4565b61265a565b34801561072c57600080fd5b5061028e61073b3660046154d1565b6127fa565b34801561074c57600080fd5b5061076061075b366004615743565b61285a565b60405161026591906159c6565b34801561077957600080fd5b5061028e610788366004615680565b61295b565b34801561079957600080fd5b5061028e6107a83660046154d1565b612ade565b3480156107b957600080fd5b5061028e6107c836600461571e565b612c02565b3480156107d957600080fd5b506102a66107e8366004615498565b612d99565b3480156107f957600080fd5b5061028e61080836600461571e565b612dc9565b34801561081957600080fd5b506102a66108283660046154d1565b6130b6565b34801561083957600080fd5b506103fb6108483660046154d1565b600e602052600090815260409020546001600160a01b031681565b34801561086f57600080fd5b5061028e61087e36600461571e565b6130d7565b34801561088f57600080fd5b506108a361089e3660046154d1565b6131e7565b604051610265959493929190615be3565b3480156108c057600080fd5b5061028e6108cf36600461533c565b6132e2565b3480156108e057600080fd5b506102a66108ef3660046154d1565b60106020526000908152604090205481565b34801561090d57600080fd5b5061028e61091c36600461533c565b6134c3565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561098b57602002820191906000526020600020905b815481526020019060010190808311610977575b50505050509050925092509250909192565b6109a56134d4565b60135460005b81811015610b2b57826001600160a01b0316601382815481106109d0576109d0615ede565b6000918252602090912001546001600160a01b03161415610b195760136109f8600184615dab565b81548110610a0857610a08615ede565b600091825260209091200154601380546001600160a01b039092169183908110610a3457610a34615ede565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055826013610a6b600185615dab565b81548110610a7b57610a7b615ede565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506013805480610aba57610aba615ec8565b600082815260209020810160001990810180546001600160a01b03191690550190556040517ff80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af3790610b0c90859061594f565b60405180910390a1505050565b80610b2381615e46565b9150506109ab565b5081604051635428d44960e01b8152600401610b47919061594f565b60405180910390fd5b50565b610b5b6134d4565b604080518082018252600091610b8a919084906002908390839080828437600092019190915250612d99915050565b6000818152600e60205260409020549091506001600160a01b031680610bc657604051631dfd6e1360e21b815260048101839052602401610b47565b6000828152600e6020526040812080546001600160a01b03191690555b600f54811015610c9e5782600f8281548110610c0157610c01615ede565b90600052602060002001541415610c8c57600f805460009190610c2690600190615dab565b81548110610c3657610c36615ede565b9060005260206000200154905080600f8381548110610c5757610c57615ede565b600091825260209091200155600f805480610c7457610c74615ec8565b60019003818190600052602060002001600090559055505b80610c9681615e46565b915050610be3565b50806001600160a01b03167f72be339577868f868798bac2c93e52d6f034fef4689a9848996c14ebb7416c0d83604051610cda91815260200190565b60405180910390a2505050565b60008281526005602052604090205482906001600160a01b031680610d1f57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614610d4a5780604051636c51fda960e11b8152600401610b47919061594f565b600d54600160301b900460ff1615610d755760405163769dd35360e11b815260040160405180910390fd5b610d7e846117f8565b15610d9c57604051631685ecdd60e31b815260040160405180910390fd5b610da68484613529565b50505050565b600d54600160301b900460ff1615610dd75760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610e1357604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610e3b9084906001600160601b0316615dc2565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610e839190615dc2565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610efd576040519150601f19603f3d011682016040523d82523d6000602084013e610f02565b606091505b5050905080610f245760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff1615610f575760405163769dd35360e11b815260040160405180910390fd5b60005a90506000610f6885856136e4565b90506000846060015163ffffffff166001600160401b03811115610f8e57610f8e615ef4565b604051908082528060200260200182016040528015610fb7578160200160208202803683370190505b50905060005b856060015163ffffffff1681101561103757826040015181604051602001610fef929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c82828151811061101a5761101a615ede565b60209081029190910101528061102f81615e46565b915050610fbd565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b9161106f91908690602401615aeb565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805460ff60301b1916600160301b1790559088015160808901519192506000916110d49163ffffffff169084613971565b600d805460ff60301b19169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b0316611114816001615d34565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a0151805161116190600190615dab565b8151811061117157611171615ede565b602091010151600d5460f89190911c60011491506000906111a2908a90600160581b900463ffffffff163a856139bf565b905081156112ab576020808c01516000908152600690915260409020546001600160601b03808316600160601b9092041610156111f257604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c90611229908490600160601b90046001600160601b0316615dc2565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c90915281208054859450909261128291859116615d56565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550611397565b6020808c01516000908152600690915260409020546001600160601b03808316911610156112ec57604051631e9acf1760e31b815260040160405180910390fd5b6020808c0151600090815260069091526040812080548392906113199084906001600160601b0316615dc2565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b90915281208054859450909261137291859116615d56565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a6040015184886040516113f4939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff16156114385760405163769dd35360e11b815260040160405180910390fd5b61144181613a0e565b6114605780604051635428d44960e01b8152600401610b47919061594f565b60008060008061146f866131e7565b945094505093509350336001600160a01b0316826001600160a01b0316146114d25760405162461bcd60e51b81526020600482015260166024820152752737ba1039bab139b1b934b83a34b7b71037bbb732b960511b6044820152606401610b47565b6114db866117f8565b156115215760405162461bcd60e51b815260206004820152601660248201527550656e64696e6720726571756573742065786973747360501b6044820152606401610b47565b60006040518060c00160405280611536600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b0316815250905060008160405160200161158a91906159ec565b60405160208183030381529060405290506115a488613a78565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b038816906115dd9085906004016159d9565b6000604051808303818588803b1580156115f657600080fd5b505af115801561160a573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611633905057506001600160601b03861615155b156116fd5760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061166a908a908a90600401615996565b602060405180830381600087803b15801561168457600080fd5b505af1158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc91906154b4565b6116fd5760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b6044820152606401610b47565b600d805460ff60301b1916600160301b17905560005b83518110156117a65783818151811061172e5761172e615ede565b60200260200101516001600160a01b0316638ea98117896040518263ffffffff1660e01b8152600401611761919061594f565b600060405180830381600087803b15801561177b57600080fd5b505af115801561178f573d6000803e3d6000fd5b50505050808061179e90615e46565b915050611713565b50600d805460ff60301b191690556040517fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187906117e69089908b90615963565b60405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561188257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611864575b505050505081525050905060005b81604001515181101561198f5760005b600f5481101561197c576000611945600f83815481106118c2576118c2615ede565b9060005260206000200154856040015185815181106118e3576118e3615ede565b602002602001015188600460008960400151898151811061190657611906615ede565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208d82529092529020546001600160401b0316613cc6565b50600081815260106020526040902054909150156119695750600195945050505050565b508061197481615e46565b9150506118a0565b508061198781615e46565b915050611890565b5060009392505050565b6119a16134d4565b6119aa81613a0e565b156119ca578060405163ac8a27ef60e01b8152600401610b47919061594f565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383161790556040517fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af0162590611a4590839061594f565b60405180910390a150565b611a586134d4565b6002546001600160a01b031615611a8257604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff1615611adb5760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b0316611b045760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b0380831691161015611b4057604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b602052604081208054839290611b689084906001600160601b0316615dc2565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b0316611bb09190615dc2565b82546001600160601b039182166101009390930a92830291909202199091161790555060025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90611c059085908590600401615996565b602060405180830381600087803b158015611c1f57600080fd5b505af1158015611c33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5791906154b4565b611c7457604051631e9acf1760e31b815260040160405180910390fd5b5050565b611c806134d4565b604080518082018252600091611caf919084906002908390839080828437600092019190915250612d99915050565b6000818152600e60205260409020549091506001600160a01b031615611ceb57604051634a0b8fa760e01b815260048101829052602401610b47565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b89101610cda565b6001546001600160a01b03163314611dca5760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b6044820152606401610b47565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611e296134d4565b600a544790600160601b90046001600160601b031681811115611e69576040516354ced18160e11b81526004810182905260248101839052604401610b47565b81811015610f24576000611e7d8284615dab565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114611ecc576040519150601f19603f3d011682016040523d82523d6000602084013e611ed1565b606091505b5050905080611ef35760405163950b247960e01b815260040160405180910390fd5b7f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c8583604051611f24929190615963565b60405180910390a15050505050565b600d54600160301b900460ff1615611f5e5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316611f9357604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c611fc28385615d56565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b031661200a9190615d56565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e90282348461205d9190615d1c565b604080519283526020830191909152015b60405180910390a25050565b600d54600090600160301b900460ff16156120a85760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b03166120e357604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b031680612130578260200135336040516379bfd40160e01b8152600401610b47929190615ac0565b600d5461ffff166121476060850160408601615665565b61ffff16108061216a575060c86121646060850160408601615665565b61ffff16115b156121b05761217f6060840160408501615665565b600d5460405163539c34bb60e11b815261ffff92831660048201529116602482015260c86044820152606401610b47565b600d5462010000900463ffffffff166121cf6080850160608601615765565b63ffffffff16111561221f576121eb6080840160608501615765565b600d54604051637aebf00f60e11b815263ffffffff9283166004820152620100009091049091166024820152604401610b47565b6101f461223260a0850160808601615765565b63ffffffff1611156122785761224e60a0840160808501615765565b6040516311ce1afb60e21b815263ffffffff90911660048201526101f46024820152604401610b47565b6000612285826001615d34565b905060008061229b863533602089013586613cc6565b909250905060006122b76122b260a0890189615c38565b613d3f565b905060006122c482613dbc565b9050836122cf613e2d565b60208a01356122e460808c0160608d01615765565b6122f460a08d0160808e01615765565b338660405160200161230c9796959493929190615b43565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d60400160208101906123839190615665565b8e60600160208101906123969190615765565b8f60800160208101906123a99190615765565b896040516123bc96959493929190615b04565b60405180910390a45050336000908152600460209081526040808320898301358452909152902080546001600160401b0319166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561243a5760405163769dd35360e11b815260040160405180910390fd5b600033612448600143615dab565b600754604051606093841b6001600160601b03199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006124c283615e61565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b0381111561250157612501615ef4565b60405190808252806020026020018201604052801561252a578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b03928316178355925160018301805490941691161790915592518051949550909361260b9260028501920190615052565b5061261b91506008905083613ebd565b50817f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d3360405161264c919061594f565b60405180910390a250905090565b600d54600160301b900460ff16156126855760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b031633146126b0576040516344b0e3c360e01b815260040160405180910390fd5b602081146126d157604051638129bbcd60e01b815260040160405180910390fd5b60006126df828401846154d1565b6000818152600560205260409020549091506001600160a01b031661271757604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b03169186919061273e8385615d56565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166127869190615d56565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846127d99190615d1c565b604080519283526020830191909152015b60405180910390a2505050505050565b6128026134d4565b6000818152600560205260409020546001600160a01b031661283757604051630fb532db60e11b815260040160405180910390fd5b600081815260056020526040902054610b509082906001600160a01b0316613529565b606060006128686008613ec9565b905080841061288a57604051631390f2a160e01b815260040160405180910390fd5b60006128968486615d1c565b9050818111806128a4575083155b6128ae57806128b0565b815b905060006128be8683615dab565b6001600160401b038111156128d5576128d5615ef4565b6040519080825280602002602001820160405280156128fe578160200160208202803683370190505b50905060005b81518110156129515761292261291a8883615d1c565b600890613ed3565b82828151811061293457612934615ede565b60209081029190910101528061294981615e46565b915050612904565b5095945050505050565b6129636134d4565b60c861ffff8716111561299d5760405163539c34bb60e11b815261ffff871660048201819052602482015260c86044820152606401610b47565b600082136129c1576040516321ea67b360e11b815260048101839052602401610b47565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff191688176201000087021768ffffffffffffffffff60301b1916600160381b850263ffffffff60581b191617600160581b83021790558a51601280548d8701519289166001600160401b031990911617600160201b92891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff1615612b095760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316612b3e57604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612b95576000818152600560205260409081902060010154905163d084e97560e01b8152610b47916001600160a01b03169060040161594f565b6000818152600560205260409081902080546001600160a01b031980821633908117845560019093018054909116905591516001600160a01b039092169183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c93869161206e91859161597c565b60008281526005602052604090205482906001600160a01b031680612c3a57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612c655780604051636c51fda960e11b8152600401610b47919061594f565b600d54600160301b900460ff1615612c905760405163769dd35360e11b815260040160405180910390fd5b60008481526005602052604090206002015460641415612cc3576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b031615612cfa57610da6565b6001600160a01b0383166000818152600460209081526040808320888452825280832080546001600160401b031916600190811790915560058352818420600201805491820181558452919092200180546001600160a01b0319169092179091555184907f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e190612d8b90869061594f565b60405180910390a250505050565b600081604051602001612dac91906159b8565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b031680612e0157604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612e2c5780604051636c51fda960e11b8152600401610b47919061594f565b600d54600160301b900460ff1615612e575760405163769dd35360e11b815260040160405180910390fd5b612e60846117f8565b15612e7e57604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316612ecc5783836040516379bfd40160e01b8152600401610b47929190615ac0565b600084815260056020908152604080832060020180548251818502810185019093528083529192909190830182828015612f2f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612f11575b50505050509050600060018251612f469190615dab565b905060005b825181101561305257856001600160a01b0316838281518110612f7057612f70615ede565b60200260200101516001600160a01b03161415613040576000838381518110612f9b57612f9b615ede565b6020026020010151905080600560008a81526020019081526020016000206002018381548110612fcd57612fcd615ede565b600091825260208083209190910180546001600160a01b0319166001600160a01b03949094169390931790925589815260059091526040902060020180548061301857613018615ec8565b600082815260209020810160001990810180546001600160a01b031916905501905550613052565b8061304a81615e46565b915050612f4b565b506001600160a01b03851660009081526004602090815260408083208984529091529081902080546001600160401b03191690555186907f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7906127ea90889061594f565b600f81815481106130c657600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061310f57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461313a5780604051636c51fda960e11b8152600401610b47919061594f565b600d54600160301b900460ff16156131655760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b03848116911614610da6576000848152600560205260409081902060010180546001600160a01b0319166001600160a01b0386161790555184907f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a190612d8b903390879061597c565b6000818152600560205260408120548190819081906060906001600160a01b031661322557604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156132c857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116132aa575b505050505090509450945094509450945091939590929450565b6132ea6134d4565b6002546001600160a01b03166133135760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81526000916001600160a01b0316906370a082319061334490309060040161594f565b60206040518083038186803b15801561335c57600080fd5b505afa158015613370573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061339491906154ea565b600a549091506001600160601b0316818111156133ce576040516354ced18160e11b81526004810182905260248101839052604401610b47565b81811015610f245760006133e28284615dab565b60025460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906134159087908590600401615963565b602060405180830381600087803b15801561342f57600080fd5b505af1158015613443573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061346791906154b4565b61348457604051631f01ff1360e21b815260040160405180910390fd5b7f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b43660084826040516134b5929190615963565b60405180910390a150505050565b6134cb6134d4565b610b5081613edf565b6000546001600160a01b031633146135275760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b6044820152606401610b47565b565b60008061353584613a78565b60025491935091506001600160a01b03161580159061355c57506001600160601b03821615155b1561360b5760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061359c9086906001600160601b03871690600401615963565b602060405180830381600087803b1580156135b657600080fd5b505af11580156135ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135ee91906154b4565b61360b57604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613661576040519150601f19603f3d011682016040523d82523d6000602084013e613666565b606091505b50509050806136885760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006137108460000151612d99565b6000818152600e60205260409020549091506001600160a01b03168061374c57604051631dfd6e1360e21b815260048101839052602401610b47565b600082866080015160405160200161376e929190918252602082015260400190565b60408051601f19818403018152918152815160209283012060008181526010909352912054909150806137b457604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d015193516137e3978a979096959101615b8f565b6040516020818303038152906040528051906020012081146138185760405163354a450b60e21b815260040160405180910390fd5b60006138278760000151613f83565b9050806138ff578651604051631d2827a760e31b81526001600160401b0390911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d389060240160206040518083038186803b15801561389957600080fd5b505afa1580156138ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138d191906154ea565b9050806138ff57865160405163175dadad60e01b81526001600160401b039091166004820152602401610b47565b6000886080015182604051602001613921929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905060006139488a83614065565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a61138881101561398357600080fd5b61138881039050846040820482031161399b57600080fd5b50823b6139a757600080fd5b60008083516020850160008789f190505b9392505050565b600081156139ec576012546139e59086908690600160201b900463ffffffff16866140d0565b9050613a06565b601254613a03908690869063ffffffff1686614172565b90505b949350505050565b6000805b601354811015613a6f57826001600160a01b031660138281548110613a3957613a39615ede565b6000918252602090912001546001600160a01b03161415613a5d5750600192915050565b80613a6781615e46565b915050613a12565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287968796949594860193919290830182828015613b0457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613ae6575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613be0576004600084604001518381518110613b9057613b90615ede565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902080546001600160401b031916905580613bd881615e46565b915050613b69565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613c1860028301826150b7565b5050600085815260066020526040812055613c34600886614298565b50600a8054859190600090613c539084906001600160601b0316615dc2565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613c9b9190615dc2565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b6040805160208082018790526001600160a01b03959095168183015260608101939093526001600160401b03919091166080808401919091528151808403909101815260a08301825280519084012060c083019490945260e0808301859052815180840390910181526101009092019052805191012091565b60408051602081019091526000815281613d685750604080516020810190915260008152611407565b63125fa26760e31b613d7a8385615dea565b6001600160e01b03191614613da257604051632923fee760e11b815260040160405180910390fd5b613daf8260048186615cf2565b8101906139b89190615503565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613df591511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b600046613e39816142a4565b15613eb65760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015613e7857600080fd5b505afa158015613e8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613eb091906154ea565b91505090565b4391505090565b60006139b883836142c7565b6000611407825490565b60006139b88383614316565b6001600160a01b038116331415613f325760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b6044820152606401610b47565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600046613f8f816142a4565b1561405657610100836001600160401b0316613fa9613e2d565b613fb39190615dab565b1180613fcf5750613fc2613e2d565b836001600160401b031610155b15613fdd5750600092915050565b6040516315a03d4160e11b81526001600160401b0384166004820152606490632b407a82906024015b60206040518083038186803b15801561401e57600080fd5b505afa158015614032573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b891906154ea565b50506001600160401b03164090565b60006140998360000151846020015185604001518660600151868860a001518960c001518a60e001518b6101000151614340565b600383602001516040516020016140b1929190615ad7565b60408051601f1981840301815291905280516020909101209392505050565b6000806141136000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061455c92505050565b905060005a6141228888615d1c565b61412c9190615dab565b6141369085615d8c565b9050600061414f63ffffffff871664e8d4a51000615d8c565b90508261415c8284615d1c565b6141669190615d1c565b98975050505050505050565b60008061417d614621565b9050600081136141a3576040516321ea67b360e11b815260048101829052602401610b47565b60006141e56000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061455c92505050565b9050600082825a6141f68b8b615d1c565b6142009190615dab565b61420a9088615d8c565b6142149190615d1c565b61422690670de0b6b3a7640000615d8c565b6142309190615d78565b9050600061424963ffffffff881664e8d4a51000615d8c565b9050614261816b033b2e3c9fd0803ce8000000615dab565b8211156142815760405163e80fa38160e01b815260040160405180910390fd5b61428b8183615d1c565b9998505050505050505050565b60006139b883836146ec565b600061a4b18214806142b8575062066eed82145b8061140757505062066eee1490565b600081815260018301602052604081205461430e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611407565b506000611407565b600082600001828154811061432d5761432d615ede565b9060005260206000200154905092915050565b614349896147df565b6143925760405162461bcd60e51b815260206004820152601a6024820152797075626c6963206b6579206973206e6f74206f6e20637572766560301b6044820152606401610b47565b61439b886147df565b6143df5760405162461bcd60e51b815260206004820152601560248201527467616d6d61206973206e6f74206f6e20637572766560581b6044820152606401610b47565b6143e8836147df565b6144345760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e2063757276650000006044820152606401610b47565b61443d826147df565b6144895760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e206375727665000000006044820152606401610b47565b614495878a88876148a2565b6144dd5760405162461bcd60e51b81526020600482015260196024820152786164647228632a706b2b732a6729213d5f755769746e65737360381b6044820152606401610b47565b60006144e98a876149c5565b905060006144fc898b878b868989614a29565b9050600061450d838d8d8a86614b3c565b9050808a1461454e5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610b47565b505050505050505050505050565b600046614568816142a4565b156145a757606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561401e57600080fd5b6145b081614b7c565b15613a6f57600f602160991b016001600160a01b03166349948e0e84604051806080016040528060488152602001615f2e604891396040516020016145f69291906158a5565b6040516020818303038152906040526040518263ffffffff1660e01b815260040161400691906159d9565b600d5460035460408051633fabe5a360e21b81529051600093600160381b900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561467f57600080fd5b505afa158015614693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146b79190615780565b5094509092508491505080156146db57506146d28242615dab565b8463ffffffff16105b15613a065750601154949350505050565b600081815260018301602052604081205480156147d5576000614710600183615dab565b855490915060009061472490600190615dab565b905081811461478957600086600001828154811061474457614744615ede565b906000526020600020015490508087600001848154811061476757614767615ede565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061479a5761479a615ec8565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611407565b6000915050611407565b80516000906401000003d0191161482d5760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420782d6f7264696e61746560701b6044820152606401610b47565b60208201516401000003d0191161487b5760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420792d6f7264696e61746560701b6044820152606401610b47565b60208201516401000003d01990800961489b8360005b6020020151614bb6565b1492915050565b60006001600160a01b0382166148e85760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b6044820152606401610b47565b6020840151600090600116156148ff57601c614902565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa15801561499d573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b6149cd6150d5565b6149fa600184846040516020016149e69392919061592e565b604051602081830303815290604052614bda565b90505b614a06816147df565b611407578051604080516020810192909252614a2291016149e6565b90506149fd565b614a316150d5565b825186516401000003d0199081900691061415614a905760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e637400006044820152606401610b47565b614a9b878988614c28565b614ae05760405162461bcd60e51b8152602060048201526016602482015275119a5c9cdd081b5d5b0818da1958dac819985a5b195960521b6044820152606401610b47565b614aeb848685614c28565b614b315760405162461bcd60e51b815260206004820152601760248201527614d958dbdb99081b5d5b0818da1958dac819985a5b1959604a1b6044820152606401610b47565b614166868484614d50565b600060028686868587604051602001614b5a969594939291906158d4565b60408051601f1981840301815291905280516020909101209695505050505050565b6000600a821480614b8e57506101a482145b80614b9b575062aa37dc82145b80614ba7575061210582145b8061140757505062014a331490565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614be26150d5565b614beb82614e13565b8152614c00614bfb826000614891565b614e4e565b602082018190526002900660011415612407576020810180516401000003d019039052919050565b600082614c655760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b6044820152606401610b47565b83516020850151600090614c7b90600290615e88565b15614c8757601c614c8a565b601b5b9050600070014551231950b75fc4402da1732fc9bebe198387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa158015614cfc573d6000803e3d6000fd5b505050602060405103519050600086604051602001614d1b9190615893565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614d586150d5565b835160208086015185519186015160009384938493614d7993909190614e6e565b919450925090506401000003d019858209600114614dd55760405162461bcd60e51b815260206004820152601960248201527834b73b2d1036bab9ba1031329034b73b32b939b29037b3103d60391b6044820152606401610b47565b60405180604001604052806401000003d01980614df457614df4615eb2565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d019811061240757604080516020808201939093528151808203840181529082019091528051910120614e1b565b6000611407826002614e676401000003d0196001615d1c565b901c614f4e565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614eae83838585614fe5565b9098509050614ebf88828e88615009565b9098509050614ed088828c87615009565b90985090506000614ee38d878b85615009565b9098509050614ef488828686614fe5565b9098509050614f0588828e89615009565b9098509050818114614f3a576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614f3e565b8196505b5050505050509450945094915050565b600080614f596150f3565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614f8b615111565b60208160c0846005600019fa925082614fdb5760405162461bcd60e51b81526020600482015260126024820152716269674d6f64457870206661696c7572652160701b6044820152606401610b47565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b8280548282559060005260206000209081019282156150a7579160200282015b828111156150a757825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615072565b506150b392915061512f565b5090565b5080546000825590600052602060002090810190610b50919061512f565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b808211156150b35760008155600101615130565b803561240781615f0a565b806040810183101561140757600080fd5b600082601f83011261517157600080fd5b615179615c85565b80838560408601111561518b57600080fd5b60005b60028110156151ad57813584526020938401939091019060010161518e565b509095945050505050565b600082601f8301126151c957600080fd5b81356001600160401b03808211156151e3576151e3615ef4565b604051601f8301601f19908116603f0116810190828211818310171561520b5761520b615ef4565b8160405283815286602085880101111561522457600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060c0828403121561525657600080fd5b61525e615cad565b905081356001600160401b03808216821461527857600080fd5b81835260208401356020840152615291604085016152f7565b60408401526152a2606085016152f7565b60608401526152b360808501615144565b608084015260a08401359150808211156152cc57600080fd5b506152d9848285016151b8565b60a08301525092915050565b803561ffff8116811461240757600080fd5b803563ffffffff8116811461240757600080fd5b805169ffffffffffffffffffff8116811461240757600080fd5b80356001600160601b038116811461240757600080fd5b60006020828403121561534e57600080fd5b81356139b881615f0a565b6000806040838503121561536c57600080fd5b823561537781615f0a565b915061538560208401615325565b90509250929050565b600080604083850312156153a157600080fd5b82356153ac81615f0a565b915060208301356153bc81615f0a565b809150509250929050565b600080606083850312156153da57600080fd5b82356153e581615f0a565b9150615385846020850161514f565b6000806000806060858703121561540a57600080fd5b843561541581615f0a565b93506020850135925060408501356001600160401b038082111561543857600080fd5b818701915087601f83011261544c57600080fd5b81358181111561545b57600080fd5b88602082850101111561546d57600080fd5b95989497505060200194505050565b60006040828403121561548e57600080fd5b6139b8838361514f565b6000604082840312156154aa57600080fd5b6139b88383615160565b6000602082840312156154c657600080fd5b81516139b881615f1f565b6000602082840312156154e357600080fd5b5035919050565b6000602082840312156154fc57600080fd5b5051919050565b60006020828403121561551557600080fd5b604051602081018181106001600160401b038211171561553757615537615ef4565b604052823561554581615f1f565b81529392505050565b6000808284036101c081121561556357600080fd5b6101a08082121561557357600080fd5b61557b615ccf565b91506155878686615160565b82526155968660408701615160565b60208301526080850135604083015260a0850135606083015260c085013560808301526155c560e08601615144565b60a08301526101006155d987828801615160565b60c08401526155ec876101408801615160565b60e0840152610180860135908301529092508301356001600160401b0381111561561557600080fd5b61562185828601615244565b9150509250929050565b60006020828403121561563d57600080fd5b81356001600160401b0381111561565357600080fd5b820160c081850312156139b857600080fd5b60006020828403121561567757600080fd5b6139b8826152e5565b60008060008060008086880360e081121561569a57600080fd5b6156a3886152e5565b96506156b1602089016152f7565b95506156bf604089016152f7565b94506156cd606089016152f7565b9350608088013592506040609f19820112156156e857600080fd5b506156f1615c85565b6156fd60a089016152f7565b815261570b60c089016152f7565b6020820152809150509295509295509295565b6000806040838503121561573157600080fd5b8235915060208301356153bc81615f0a565b6000806040838503121561575657600080fd5b50508035926020909101359150565b60006020828403121561577757600080fd5b6139b8826152f7565b600080600080600060a0868803121561579857600080fd5b6157a18661530b565b94506020860151935060408601519250606086015191506157c46080870161530b565b90509295509295909350565b600081518084526020808501945080840160005b838110156158095781516001600160a01b0316875295820195908201906001016157e4565b509495945050505050565b8060005b6002811015610da6578151845260209384019390910190600101615818565b600081518084526020808501945080840160005b838110156158095781518752958201959082019060010161584b565b6000815180845261587f816020860160208601615e1a565b601f01601f19169290920160200192915050565b61589d8183615814565b604001919050565b600083516158b7818460208801615e1a565b8351908301906158cb818360208801615e1a565b01949350505050565b8681526158e46020820187615814565b6158f16060820186615814565b6158fe60a0820185615814565b61590b60e0820184615814565b60609190911b6001600160601b0319166101208201526101340195945050505050565b83815261593e6020820184615814565b606081019190915260800192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039290921682526001600160601b0316602082015260400190565b604081016114078284615814565b6020815260006139b86020830184615837565b6020815260006139b86020830184615867565b6020815260ff82511660208201526020820151604082015260018060a01b0360408301511660608201526000606083015160c06080840152615a3160e08401826157d0565b60808501516001600160601b0390811660a0868101919091529095015190941660c0909301929092525090919050565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615ab257845183529383019391830191600101615a96565b509098975050505050505050565b9182526001600160a01b0316602082015260400190565b828152606081016139b86020830184615814565b828152604060208201526000613a066040830184615837565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261416660c0830184615867565b878152602081018790526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c0820181905260009061428b90830184615867565b8781526001600160401b03871660208201526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c0820181905260009061428b90830184615867565b6001600160601b038681168252851660208201526001600160401b03841660408201526001600160a01b038316606082015260a060808201819052600090615c2d908301846157d0565b979650505050505050565b6000808335601e19843603018112615c4f57600080fd5b8301803591506001600160401b03821115615c6957600080fd5b602001915036819003821315615c7e57600080fd5b9250929050565b604080519081016001600160401b0381118282101715615ca757615ca7615ef4565b60405290565b60405160c081016001600160401b0381118282101715615ca757615ca7615ef4565b60405161012081016001600160401b0381118282101715615ca757615ca7615ef4565b60008085851115615d0257600080fd5b83861115615d0f57600080fd5b5050820193919092039150565b60008219821115615d2f57615d2f615e9c565b500190565b60006001600160401b038083168185168083038211156158cb576158cb615e9c565b60006001600160601b038281168482168083038211156158cb576158cb615e9c565b600082615d8757615d87615eb2565b500490565b6000816000190483118215151615615da657615da6615e9c565b500290565b600082821015615dbd57615dbd615e9c565b500390565b60006001600160601b0383811690831681811015615de257615de2615e9c565b039392505050565b6001600160e01b03198135818116916004851015615e125780818660040360031b1b83161692505b505092915050565b60005b83811015615e35578181015183820152602001615e1d565b83811115610da65750506000910152565b6000600019821415615e5a57615e5a615e9c565b5060010190565b60006001600160401b0380831681811415615e7e57615e7e615e9c565b6001019392505050565b600082615e9757615e97615eb2565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b5057600080fd5b8015158114610b5057600080fdfe307866666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666a164736f6c6343000806000a", } var VRFCoordinatorV25ABI = VRFCoordinatorV25MetaData.ABI diff --git a/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go b/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go index b42d110b85a..852501d09ec 100644 --- a/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go +++ b/core/gethwrappers/generated/vrf_v2plus_upgraded_version/vrf_v2plus_upgraded_version.go @@ -66,8 +66,8 @@ type VRFV2PlusClientRandomWordsRequest struct { } var VRFCoordinatorV2PlusUpgradedVersionMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"want\",\"type\":\"uint256\"}],\"name\":\"InsufficientGasForConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transferredValue\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"expectedValue\",\"type\":\"uint96\"}],\"name\":\"InvalidNativeBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"requestVersion\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"expectedVersion\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubscriptionIDCollisionFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountNative\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldNativeBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNativeBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithNative\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedData\",\"type\":\"bytes\"}],\"name\":\"onMigration\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverNativeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b50604051620060b4380380620060b4833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615ed9620001db600039600081816104eb01526136f60152615ed96000f3fe6080604052600436106102015760003560e01c806201229114610206578063043bd6ae14610233578063088070f5146102575780630ae09540146102d757806315c48b84146102f957806318e3dd27146103215780631b6b6d2314610360578063294926571461038d578063294daa49146103ad578063330987b3146103c9578063405b84fa146103e957806340d6bb821461040957806341af6c87146104345780635d06b4ab1461046457806364d51a2a14610484578063659827441461049957806366316d8d146104b9578063689c4517146104d95780636b6feccc1461050d5780636f64f03f1461054357806372e9d5651461056357806379ba5097146105835780638402595e1461059857806386fe91c7146105b85780638da5cb5b146105d857806395b55cfc146105f65780639b1c385e146106095780639d40a6fd14610629578063a21a23e414610656578063a4c0ed361461066b578063aa433aff1461068b578063aefb212f146106ab578063b08c8795146106d8578063b2a7cac5146106f8578063bec4c08c14610718578063caf70c4a14610738578063cb63179714610758578063ce3f471914610778578063d98e620e1461078b578063da2f2610146107ab578063dac83d29146107e1578063dc311dd314610801578063e72f6e3014610832578063ee9d2d3814610852578063f2fde38b1461087f575b600080fd5b34801561021257600080fd5b5061021b61089f565b60405161022a939291906159cf565b60405180910390f35b34801561023f57600080fd5b5061024960115481565b60405190815260200161022a565b34801561026357600080fd5b50600d5461029f9061ffff81169063ffffffff62010000820481169160ff600160301b82041691600160381b8204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a00161022a565b3480156102e357600080fd5b506102f76102f2366004615650565b61091b565b005b34801561030557600080fd5b5061030e60c881565b60405161ffff909116815260200161022a565b34801561032d57600080fd5b50600a5461034890600160601b90046001600160601b031681565b6040516001600160601b03909116815260200161022a565b34801561036c57600080fd5b50600254610380906001600160a01b031681565b60405161022a9190615873565b34801561039957600080fd5b506102f76103a83660046151c2565b6109e9565b3480156103b957600080fd5b506040516001815260200161022a565b3480156103d557600080fd5b506103486103e43660046153be565b610b66565b3480156103f557600080fd5b506102f7610404366004615650565b611041565b34801561041557600080fd5b5061041f6101f481565b60405163ffffffff909116815260200161022a565b34801561044057600080fd5b5061045461044f366004615300565b61142c565b604051901515815260200161022a565b34801561047057600080fd5b506102f761047f3660046151a5565b6115cd565b34801561049057600080fd5b5061030e606481565b3480156104a557600080fd5b506102f76104b43660046151f7565b611684565b3480156104c557600080fd5b506102f76104d43660046151c2565b6116e4565b3480156104e557600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b34801561051957600080fd5b506012546105359063ffffffff80821691600160201b90041682565b60405161022a929190615b51565b34801561054f57600080fd5b506102f761055e366004615230565b6118ac565b34801561056f57600080fd5b50600354610380906001600160a01b031681565b34801561058f57600080fd5b506102f76119b3565b3480156105a457600080fd5b506102f76105b33660046151a5565b611a5d565b3480156105c457600080fd5b50600a54610348906001600160601b031681565b3480156105e457600080fd5b506000546001600160a01b0316610380565b6102f7610604366004615300565b611b69565b34801561061557600080fd5b5061024961062436600461549b565b611cad565b34801561063557600080fd5b50600754610649906001600160401b031681565b60405161022a9190615b68565b34801561066257600080fd5b5061024961201d565b34801561067757600080fd5b506102f761068636600461526c565b61226b565b34801561069757600080fd5b506102f76106a6366004615300565b612408565b3480156106b757600080fd5b506106cb6106c6366004615675565b61246b565b60405161022a91906158ea565b3480156106e457600080fd5b506102f76106f33660046155b2565b61256c565b34801561070457600080fd5b506102f7610713366004615300565b6126e0565b34801561072457600080fd5b506102f7610733366004615650565b612804565b34801561074457600080fd5b506102496107533660046152c7565b61299b565b34801561076457600080fd5b506102f7610773366004615650565b6129cb565b6102f7610786366004615332565b612cb8565b34801561079757600080fd5b506102496107a6366004615300565b612fc9565b3480156107b757600080fd5b506103806107c6366004615300565b600e602052600090815260409020546001600160a01b031681565b3480156107ed57600080fd5b506102f76107fc366004615650565b612fea565b34801561080d57600080fd5b5061082161081c366004615300565b6130fa565b60405161022a959493929190615b7c565b34801561083e57600080fd5b506102f761084d3660046151a5565b6131f5565b34801561085e57600080fd5b5061024961086d366004615300565b60106020526000908152604090205481565b34801561088b57600080fd5b506102f761089a3660046151a5565b6133d0565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561090957602002820191906000526020600020905b8154815260200190600101908083116108f5575b50505050509050925092509250909192565b60008281526005602052604090205482906001600160a01b03168061095357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146109875780604051636c51fda960e11b815260040161097e9190615873565b60405180910390fd5b600d54600160301b900460ff16156109b25760405163769dd35360e11b815260040160405180910390fd5b6109bb8461142c565b156109d957604051631685ecdd60e31b815260040160405180910390fd5b6109e384846133e1565b50505050565b600d54600160301b900460ff1615610a145760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b0380831691161015610a5057604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c602052604081208054839290610a789084906001600160601b0316615d8d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610ac09190615d8d565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b5050905080610b615760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff1615610b945760405163769dd35360e11b815260040160405180910390fd5b60005a90506000610ba5858561359c565b90506000846060015163ffffffff166001600160401b03811115610bcb57610bcb615e93565b604051908082528060200260200182016040528015610bf4578160200160208202803683370190505b50905060005b856060015163ffffffff16811015610c6b57826040015181604051602001610c239291906158fd565b6040516020818303038152906040528051906020012060001c828281518110610c4e57610c4e615e7d565b602090810291909101015280610c6381615de5565b915050610bfa565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b91610ca391908690602401615a59565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805460ff60301b1916600160301b179055908801516080890151919250600091610d089163ffffffff16908461380f565b600d805460ff60301b19169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b0316610d48816001615cf6565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a01518051610d9590600190615d76565b81518110610da557610da5615e7d565b602091010151600d5460f89190911c6001149150600090610dd6908a90600160581b900463ffffffff163a8561385d565b90508115610edf576020808c01516000908152600690915260409020546001600160601b03808316600160601b909204161015610e2657604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c90610e5d908490600160601b90046001600160601b0316615d8d565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c909152812080548594509092610eb691859116615d21565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550610fcb565b6020808c01516000908152600690915260409020546001600160601b0380831691161015610f2057604051631e9acf1760e31b815260040160405180910390fd5b6020808c015160009081526006909152604081208054839290610f4d9084906001600160601b0316615d8d565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b909152812080548594509092610fa691859116615d21565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a604001518488604051611028939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff161561106c5760405163769dd35360e11b815260040160405180910390fd5b611075816138ac565b6110945780604051635428d44960e01b815260040161097e9190615873565b6000806000806110a3866130fa565b945094505093509350336001600160a01b0316826001600160a01b0316146111065760405162461bcd60e51b81526020600482015260166024820152752737ba1039bab139b1b934b83a34b7b71037bbb732b960511b604482015260640161097e565b61110f8661142c565b156111555760405162461bcd60e51b815260206004820152601660248201527550656e64696e6720726571756573742065786973747360501b604482015260640161097e565b60006040518060c0016040528061116a600190565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b031681525090506000816040516020016111be919061593c565b60405160208183030381529060405290506111d888613916565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b03881690611211908590600401615929565b6000604051808303818588803b15801561122a57600080fd5b505af115801561123e573d6000803e3d6000fd5b50506002546001600160a01b031615801593509150611267905057506001600160601b03861615155b156113315760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061129e908a908a906004016158ba565b602060405180830381600087803b1580156112b857600080fd5b505af11580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f091906152e3565b6113315760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015260640161097e565b600d805460ff60301b1916600160301b17905560005b83518110156113da5783818151811061136257611362615e7d565b60200260200101516001600160a01b0316638ea98117896040518263ffffffff1660e01b81526004016113959190615873565b600060405180830381600087803b1580156113af57600080fd5b505af11580156113c3573d6000803e3d6000fd5b5050505080806113d290615de5565b915050611347565b50600d805460ff60301b191690556040517fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be41879061141a9089908b90615887565b60405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b03908116825260018301541681850152600282018054845181870281018701865281815287969395860193909291908301828280156114b657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611498575b505050505081525050905060005b8160400151518110156115c35760005b600f548110156115b0576000611579600f83815481106114f6576114f6615e7d565b90600052602060002001548560400151858151811061151757611517615e7d565b602002602001015188600460008960400151898151811061153a5761153a615e7d565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208d82529092529020546001600160401b0316613b64565b506000818152601060205260409020549091501561159d5750600195945050505050565b50806115a881615de5565b9150506114d4565b50806115bb81615de5565b9150506114c4565b5060009392505050565b6115d5613bed565b6115de816138ac565b156115fe578060405163ac8a27ef60e01b815260040161097e9190615873565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383161790556040517fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af0162590611679908390615873565b60405180910390a150565b61168c613bed565b6002546001600160a01b0316156116b657604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff161561170f5760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03166117385760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b038083169116101561177457604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b60205260408120805483929061179c9084906001600160601b0316615d8d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b03166117e49190615d8d565b82546001600160601b039182166101009390930a92830291909202199091161790555060025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061183990859085906004016158ba565b602060405180830381600087803b15801561185357600080fd5b505af1158015611867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188b91906152e3565b6118a857604051631e9acf1760e31b815260040160405180910390fd5b5050565b6118b4613bed565b6040805180820182526000916118e391908490600290839083908082843760009201919091525061299b915050565b6000818152600e60205260409020549091506001600160a01b03161561191f57604051634a0b8fa760e01b81526004810182905260240161097e565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b8910160405180910390a2505050565b6001546001600160a01b03163314611a065760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015260640161097e565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611a65613bed565b600a544790600160601b90046001600160601b031681811115611a9f5780826040516354ced18160e11b815260040161097e9291906158fd565b81811015610b61576000611ab38284615d76565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114611b02576040519150601f19603f3d011682016040523d82523d6000602084013e611b07565b606091505b5050905080611b295760405163950b247960e01b815260040160405180910390fd5b7f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c8583604051611b5a929190615887565b60405180910390a15050505050565b600d54600160301b900460ff1615611b945760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316611bc957604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c611bf88385615d21565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b0316611c409190615d21565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902823484611c939190615cde565b604051611ca19291906158fd565b60405180910390a25050565b600d54600090600160301b900460ff1615611cdb5760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b0316611d1657604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b031680611d63578260200135336040516379bfd40160e01b815260040161097e929190615a2e565b600d5461ffff16611d7a6060850160408601615597565b61ffff161080611d9d575060c8611d976060850160408601615597565b61ffff16115b15611dd757611db26060840160408501615597565b600d5460405163539c34bb60e11b815261097e929161ffff169060c8906004016159b1565b600d5462010000900463ffffffff16611df66080850160608601615697565b63ffffffff161115611e3c57611e126080840160608501615697565b600d54604051637aebf00f60e11b815261097e929162010000900463ffffffff1690600401615b51565b6101f4611e4f60a0850160808601615697565b63ffffffff161115611e8957611e6b60a0840160808501615697565b6101f46040516311ce1afb60e21b815260040161097e929190615b51565b6000611e96826001615cf6565b9050600080611eac863533602089013586613b64565b90925090506000611ec8611ec360a0890189615bd1565b613c42565b90506000611ed582613cbf565b905083611ee0613d30565b60208a0135611ef560808c0160608d01615697565b611f0560a08d0160808e01615697565b3386604051602001611f1d9796959493929190615ab1565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d6040016020810190611f949190615597565b8e6060016020810190611fa79190615697565b8f6080016020810190611fba9190615697565b89604051611fcd96959493929190615a72565b60405180910390a45050336000908152600460209081526040808320898301358452909152902080546001600160401b0319166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff161561204b5760405163769dd35360e11b815260040160405180910390fd5b600033612059600143615d76565b600754604051606093841b6001600160601b03199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b039091169060006120d383615e00565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b0381111561211257612112615e93565b60405190808252806020026020018201604052801561213b578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b03928316178355925160018301805490941691161790915592518051949550909361221c9260028501920190614e16565b5061222c91506008905083613dc0565b50817f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d3360405161225d9190615873565b60405180910390a250905090565b600d54600160301b900460ff16156122965760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b031633146122c1576040516344b0e3c360e01b815260040160405180910390fd5b602081146122e257604051638129bbcd60e01b815260040160405180910390fd5b60006122f082840184615300565b6000818152600560205260409020549091506001600160a01b031661232857604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b03169186919061234f8385615d21565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166123979190615d21565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846123ea9190615cde565b6040516123f89291906158fd565b60405180910390a2505050505050565b612410613bed565b6000818152600560205260409020546001600160a01b031661244557604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020546124689082906001600160a01b03166133e1565b50565b606060006124796008613dcc565b905080841061249b57604051631390f2a160e01b815260040160405180910390fd5b60006124a78486615cde565b9050818111806124b5575083155b6124bf57806124c1565b815b905060006124cf8683615d76565b6001600160401b038111156124e6576124e6615e93565b60405190808252806020026020018201604052801561250f578160200160208202803683370190505b50905060005b81518110156125625761253361252b8883615cde565b600890613dd6565b82828151811061254557612545615e7d565b60209081029190910101528061255a81615de5565b915050612515565b5095945050505050565b612574613bed565b60c861ffff871611156125a157858660c860405163539c34bb60e11b815260040161097e939291906159b1565b600082136125c5576040516321ea67b360e11b81526004810183905260240161097e565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff1916881762010000870217600160301b600160781b031916600160381b850263ffffffff60581b191617600160581b83021790558a51601280548d8701519289166001600160401b031990911617600160201b92891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff161561270b5760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661274057604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b03163314612797576000818152600560205260409081902060010154905163d084e97560e01b815261097e916001600160a01b031690600401615873565b6000818152600560205260409081902080546001600160a01b031980821633908117845560019093018054909116905591516001600160a01b039092169183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691611ca19185916158a0565b60008281526005602052604090205482906001600160a01b03168061283c57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146128675780604051636c51fda960e11b815260040161097e9190615873565b600d54600160301b900460ff16156128925760405163769dd35360e11b815260040160405180910390fd5b600084815260056020526040902060020154606414156128c5576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316156128fc576109e3565b6001600160a01b0383166000818152600460209081526040808320888452825280832080546001600160401b031916600190811790915560058352818420600201805491820181558452919092200180546001600160a01b0319169092179091555184907f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e19061298d908690615873565b60405180910390a250505050565b6000816040516020016129ae91906158dc565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b031680612a0357604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612a2e5780604051636c51fda960e11b815260040161097e9190615873565b600d54600160301b900460ff1615612a595760405163769dd35360e11b815260040160405180910390fd5b612a628461142c565b15612a8057604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316612ace5783836040516379bfd40160e01b815260040161097e929190615a2e565b600084815260056020908152604080832060020180548251818502810185019093528083529192909190830182828015612b3157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612b13575b50505050509050600060018251612b489190615d76565b905060005b8251811015612c5457856001600160a01b0316838281518110612b7257612b72615e7d565b60200260200101516001600160a01b03161415612c42576000838381518110612b9d57612b9d615e7d565b6020026020010151905080600560008a81526020019081526020016000206002018381548110612bcf57612bcf615e7d565b600091825260208083209190910180546001600160a01b0319166001600160a01b039490941693909317909255898152600590915260409020600201805480612c1a57612c1a615e67565b600082815260209020810160001990810180546001600160a01b031916905501905550612c54565b80612c4c81615de5565b915050612b4d565b506001600160a01b03851660009081526004602090815260408083208984529091529081902080546001600160401b03191690555186907f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7906123f8908890615873565b6000612cc6828401846154d5565b9050806000015160ff16600114612cff57805160405163237d181f60e21b815260ff90911660048201526001602482015260440161097e565b8060a001516001600160601b03163414612d435760a08101516040516306acf13560e41b81523460048201526001600160601b03909116602482015260440161097e565b6020808201516000908152600590915260409020546001600160a01b031615612d7f576040516326afa43560e11b815260040160405180910390fd5b60005b816060015151811015612e1f5760016004600084606001518481518110612dab57612dab615e7d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008460200151815260200190815260200160002060006101000a8154816001600160401b0302191690836001600160401b031602179055508080612e1790615de5565b915050612d82565b50604080516060808201835260808401516001600160601b03908116835260a0850151811660208085019182526000858701818152828901805183526006845288832097518854955192516001600160401b0316600160c01b026001600160c01b03938816600160601b026001600160c01b0319909716919097161794909417169390931790945584518084018652868601516001600160a01b03908116825281860184815294880151828801908152925184526005865295909220825181549087166001600160a01b0319918216178255935160018201805491909716941693909317909455925180519192612f1e92600285019290910190614e16565b5050506080810151600a8054600090612f419084906001600160601b0316615d21565b92506101000a8154816001600160601b0302191690836001600160601b031602179055508060a00151600a600c8282829054906101000a90046001600160601b0316612f8d9190615d21565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506109e381602001516008613dc090919063ffffffff16565b600f8181548110612fd957600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b03168061302257604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461304d5780604051636c51fda960e11b815260040161097e9190615873565b600d54600160301b900460ff16156130785760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b038481169116146109e3576000848152600560205260409081902060010180546001600160a01b0319166001600160a01b0386161790555184907f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a19061298d90339087906158a0565b6000818152600560205260408120548190819081906060906001600160a01b031661313857604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b03909416939183918301828280156131db57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116131bd575b505050505090509450945094509450945091939590929450565b6131fd613bed565b6002546001600160a01b03166132265760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190613257903090600401615873565b60206040518083038186803b15801561326f57600080fd5b505afa158015613283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132a79190615319565b600a549091506001600160601b0316818111156132db5780826040516354ced18160e11b815260040161097e9291906158fd565b81811015610b615760006132ef8284615d76565b60025460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906133229087908590600401615887565b602060405180830381600087803b15801561333c57600080fd5b505af1158015613350573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061337491906152e3565b61339157604051631f01ff1360e21b815260040160405180910390fd5b7f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b43660084826040516133c2929190615887565b60405180910390a150505050565b6133d8613bed565b61246881613de2565b6000806133ed84613916565b60025491935091506001600160a01b03161580159061341457506001600160601b03821615155b156134c35760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906134549086906001600160601b03871690600401615887565b602060405180830381600087803b15801561346e57600080fd5b505af1158015613482573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134a691906152e3565b6134c357604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613519576040519150601f19603f3d011682016040523d82523d6000602084013e61351e565b606091505b50509050806135405760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b604080516060810182526000808252602082018190529181019190915260006135c8846000015161299b565b6000818152600e60205260409020549091506001600160a01b03168061360457604051631dfd6e1360e21b81526004810183905260240161097e565b600082866080015160405160200161361d9291906158fd565b60408051601f198184030181529181528151602092830120600081815260109093529120549091508061366357604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d01519351613692978a979096959101615afd565b6040516020818303038152906040528051906020012081146136c75760405163354a450b60e21b815260040160405180910390fd5b60006136d68760000151613e86565b90508061379d578651604051631d2827a760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163e9413d389161372a9190600401615b68565b60206040518083038186803b15801561374257600080fd5b505afa158015613756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061377a9190615319565b90508061379d57865160405163175dadad60e01b815261097e9190600401615b68565b60008860800151826040516020016137bf929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905060006137e68a83613f63565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a61138881101561382157600080fd5b61138881039050846040820482031161383957600080fd5b50823b61384557600080fd5b60008083516020850160008789f190505b9392505050565b6000811561388a576012546138839086908690600160201b900463ffffffff1686613fce565b90506138a4565b6012546138a1908690869063ffffffff1686614038565b90505b949350505050565b6000805b60135481101561390d57826001600160a01b0316601382815481106138d7576138d7615e7d565b6000918252602090912001546001600160a01b031614156138fb5750600192915050565b8061390581615de5565b9150506138b0565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879687969495948601939192908301828280156139a257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613984575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b826040015151811015613a7e576004600084604001518381518110613a2e57613a2e615e7d565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902080546001600160401b031916905580613a7681615de5565b915050613a07565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613ab66002830182614e7b565b5050600085815260066020526040812055613ad2600886614125565b50600a8054859190600090613af19084906001600160601b0316615d8d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613b399190615d8d565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081018690526001600160a01b03851691810191909152606081018390526001600160401b03821660808201526000908190819060a00160408051601f198184030181529082905280516020918201209250613bc99189918491016158fd565b60408051808303601f19018152919052805160209091012097909650945050505050565b6000546001600160a01b03163314613c405760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b604482015260640161097e565b565b60408051602081019091526000815281613c6b575060408051602081019091526000815261103b565b63125fa26760e31b613c7d8385615db5565b6001600160e01b03191614613ca557604051632923fee760e11b815260040160405180910390fd5b613cb28260048186615cb4565b8101906138569190615373565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613cf891511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b600046613d3c81614131565b15613db95760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d7b57600080fd5b505afa158015613d8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613db39190615319565b91505090565b4391505090565b60006138568383614154565b600061103b825490565b600061385683836141a3565b6001600160a01b038116331415613e355760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b604482015260640161097e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600046613e9281614131565b15613f5457610100836001600160401b0316613eac613d30565b613eb69190615d76565b1180613ed25750613ec5613d30565b836001600160401b031610155b15613ee05750600092915050565b6040516315a03d4160e11b8152606490632b407a8290613f04908690600401615b68565b60206040518083038186803b158015613f1c57600080fd5b505afa158015613f30573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138569190615319565b50506001600160401b03164090565b6000613f978360000151846020015185604001518660600151868860a001518960c001518a60e001518b61010001516141cd565b60038360200151604051602001613faf929190615a45565b60408051601f1981840301815291905280516020909101209392505050565b600080613fd96143e8565b905060005a613fe88888615cde565b613ff29190615d76565b613ffc9085615d57565b9050600061401563ffffffff871664e8d4a51000615d57565b9050826140228284615cde565b61402c9190615cde565b98975050505050505050565b60008061404361443b565b905060008113614069576040516321ea67b360e11b81526004810182905260240161097e565b60006140736143e8565b9050600082825a6140848b8b615cde565b61408e9190615d76565b6140989088615d57565b6140a29190615cde565b6140b490670de0b6b3a7640000615d57565b6140be9190615d43565b905060006140d763ffffffff881664e8d4a51000615d57565b90506140ee81676765c793fa10079d601b1b615d76565b82111561410e5760405163e80fa38160e01b815260040160405180910390fd5b6141188183615cde565b9998505050505050505050565b60006138568383614506565b600061a4b1821480614145575062066eed82145b8061103b57505062066eee1490565b600081815260018301602052604081205461419b5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561103b565b50600061103b565b60008260000182815481106141ba576141ba615e7d565b9060005260206000200154905092915050565b6141d6896145f9565b61421f5760405162461bcd60e51b815260206004820152601a6024820152797075626c6963206b6579206973206e6f74206f6e20637572766560301b604482015260640161097e565b614228886145f9565b61426c5760405162461bcd60e51b815260206004820152601560248201527467616d6d61206973206e6f74206f6e20637572766560581b604482015260640161097e565b614275836145f9565b6142c15760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e206375727665000000604482015260640161097e565b6142ca826145f9565b6143155760405162461bcd60e51b815260206004820152601c60248201527b73486173685769746e657373206973206e6f74206f6e20637572766560201b604482015260640161097e565b614321878a88876146bc565b6143695760405162461bcd60e51b81526020600482015260196024820152786164647228632a706b2b732a6729213d5f755769746e65737360381b604482015260640161097e565b60006143758a876147d0565b90506000614388898b878b868989614834565b90506000614399838d8d8a86614947565b9050808a146143da5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b604482015260640161097e565b505050505050505050505050565b6000466143f481614131565b1561443357606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015613d7b57600080fd5b600091505090565b600d5460035460408051633fabe5a360e21b81529051600093600160381b900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b15801561449957600080fd5b505afa1580156144ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144d191906156b2565b5094509092508491505080156144f557506144ec8242615d76565b8463ffffffff16105b156138a45750601154949350505050565b600081815260018301602052604081205480156145ef57600061452a600183615d76565b855490915060009061453e90600190615d76565b90508181146145a357600086600001828154811061455e5761455e615e7d565b906000526020600020015490508087600001848154811061458157614581615e7d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145b4576145b4615e67565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061103b565b600091505061103b565b80516000906401000003d019116146475760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420782d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d019116146955760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420792d6f7264696e61746560701b604482015260640161097e565b60208201516401000003d0199080096146b58360005b6020020151614987565b1492915050565b60006001600160a01b0382166147025760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b604482015260640161097e565b60208401516000906001161561471957601c61471c565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020909101918290529293506001916147869186918891879061590b565b6020604051602081039080840390855afa1580156147a8573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b6147d8614e99565b614805600184846040516020016147f193929190615852565b6040516020818303038152906040526149ab565b90505b614811816145f9565b61103b57805160408051602081019290925261482d91016147f1565b9050614808565b61483c614e99565b825186516401000003d019908190069106141561489b5760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e63740000604482015260640161097e565b6148a68789886149f9565b6148eb5760405162461bcd60e51b8152602060048201526016602482015275119a5c9cdd081b5d5b0818da1958dac819985a5b195960521b604482015260640161097e565b6148f68486856149f9565b61493c5760405162461bcd60e51b815260206004820152601760248201527614d958dbdb99081b5d5b0818da1958dac819985a5b1959604a1b604482015260640161097e565b61402c868484614b14565b600060028686868587604051602001614965969594939291906157f8565b60408051601f1981840301815291905280516020909101209695505050505050565b6000806401000003d01980848509840990506401000003d019600782089392505050565b6149b3614e99565b6149bc82614bd7565b81526149d16149cc8260006146ab565b614c12565b602082018190526002900660011415612018576020810180516401000003d019039052919050565b600082614a365760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b604482015260640161097e565b83516020850151600090614a4c90600290615e27565b15614a5857601c614a5b565b601b5b9050600070014551231950b75fc4402da1732fc9bebe19838709604080516000808252602090910191829052919250600190614a9e90839086908890879061590b565b6020604051602081039080840390855afa158015614ac0573d6000803e3d6000fd5b505050602060405103519050600086604051602001614adf91906157e6565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614b1c614e99565b835160208086015185519186015160009384938493614b3d93909190614c32565b919450925090506401000003d019858209600114614b995760405162461bcd60e51b815260206004820152601960248201527834b73b2d1036bab9ba1031329034b73b32b939b29037b3103d60391b604482015260640161097e565b60405180604001604052806401000003d01980614bb857614bb8615e51565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d019811061201857604080516020808201939093528151808203840181529082019091528051910120614bdf565b600061103b826002614c2b6401000003d0196001615cde565b901c614d12565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614c7283838585614da9565b9098509050614c8388828e88614dcd565b9098509050614c9488828c87614dcd565b90985090506000614ca78d878b85614dcd565b9098509050614cb888828686614da9565b9098509050614cc988828e89614dcd565b9098509050818114614cfe576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614d02565b8196505b5050505050509450945094915050565b600080614d1d614eb7565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614d4f614ed5565b60208160c0846005600019fa925082614d9f5760405162461bcd60e51b81526020600482015260126024820152716269674d6f64457870206661696c7572652160701b604482015260640161097e565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614e6b579160200282015b82811115614e6b57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614e36565b50614e77929150614ef3565b5090565b50805460008255906000526020600020908101906124689190614ef3565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614e775760008155600101614ef4565b803561201881615ea9565b600082601f830112614f2457600080fd5b813560206001600160401b03821115614f3f57614f3f615e93565b8160051b614f4e828201615c84565b838152828101908684018388018501891015614f6957600080fd5b600093505b85841015614f95578035614f8181615ea9565b835260019390930192918401918401614f6e565b50979650505050505050565b600082601f830112614fb257600080fd5b614fba615c17565b808385604086011115614fcc57600080fd5b60005b6002811015614fee578135845260209384019390910190600101614fcf565b509095945050505050565b60008083601f84011261500b57600080fd5b5081356001600160401b0381111561502257600080fd5b60208301915083602082850101111561503a57600080fd5b9250929050565b600082601f83011261505257600080fd5b81356001600160401b0381111561506b5761506b615e93565b61507e601f8201601f1916602001615c84565b81815284602083860101111561509357600080fd5b816020850160208301376000918101602001919091529392505050565b600060c082840312156150c257600080fd5b6150ca615c3f565b905081356001600160401b0380821682146150e457600080fd5b818352602084013560208401526150fd60408501615163565b604084015261510e60608501615163565b606084015261511f60808501614f08565b608084015260a084013591508082111561513857600080fd5b5061514584828501615041565b60a08301525092915050565b803561ffff8116811461201857600080fd5b803563ffffffff8116811461201857600080fd5b80516001600160501b038116811461201857600080fd5b80356001600160601b038116811461201857600080fd5b6000602082840312156151b757600080fd5b813561385681615ea9565b600080604083850312156151d557600080fd5b82356151e081615ea9565b91506151ee6020840161518e565b90509250929050565b6000806040838503121561520a57600080fd5b823561521581615ea9565b9150602083013561522581615ea9565b809150509250929050565b6000806060838503121561524357600080fd5b823561524e81615ea9565b91506060830184101561526057600080fd5b50926020919091019150565b6000806000806060858703121561528257600080fd5b843561528d81615ea9565b93506020850135925060408501356001600160401b038111156152af57600080fd5b6152bb87828801614ff9565b95989497509550505050565b6000604082840312156152d957600080fd5b6138568383614fa1565b6000602082840312156152f557600080fd5b815161385681615ebe565b60006020828403121561531257600080fd5b5035919050565b60006020828403121561532b57600080fd5b5051919050565b6000806020838503121561534557600080fd5b82356001600160401b0381111561535b57600080fd5b61536785828601614ff9565b90969095509350505050565b60006020828403121561538557600080fd5b604051602081016001600160401b03811182821017156153a7576153a7615e93565b60405282356153b581615ebe565b81529392505050565b6000808284036101c08112156153d357600080fd5b6101a0808212156153e357600080fd5b6153eb615c61565b91506153f78686614fa1565b82526154068660408701614fa1565b60208301526080850135604083015260a0850135606083015260c0850135608083015261543560e08601614f08565b60a083015261010061544987828801614fa1565b60c084015261545c876101408801614fa1565b60e0840152610180860135908301529092508301356001600160401b0381111561548557600080fd5b615491858286016150b0565b9150509250929050565b6000602082840312156154ad57600080fd5b81356001600160401b038111156154c357600080fd5b820160c0818503121561385657600080fd5b6000602082840312156154e757600080fd5b81356001600160401b03808211156154fe57600080fd5b9083019060c0828603121561551257600080fd5b61551a615c3f565b823560ff8116811461552b57600080fd5b81526020838101359082015261554360408401614f08565b604082015260608301358281111561555a57600080fd5b61556687828601614f13565b6060830152506155786080840161518e565b608082015261558960a0840161518e565b60a082015295945050505050565b6000602082840312156155a957600080fd5b61385682615151565b60008060008060008086880360e08112156155cc57600080fd5b6155d588615151565b96506155e360208901615163565b95506155f160408901615163565b94506155ff60608901615163565b9350608088013592506040609f198201121561561a57600080fd5b50615623615c17565b61562f60a08901615163565b815261563d60c08901615163565b6020820152809150509295509295509295565b6000806040838503121561566357600080fd5b82359150602083013561522581615ea9565b6000806040838503121561568857600080fd5b50508035926020909101359150565b6000602082840312156156a957600080fd5b61385682615163565b600080600080600060a086880312156156ca57600080fd5b6156d386615177565b94506020860151935060408601519250606086015191506156f660808701615177565b90509295509295909350565b600081518084526020808501945080840160005b8381101561573b5781516001600160a01b031687529582019590820190600101615716565b509495945050505050565b8060005b60028110156109e357815184526020938401939091019060010161574a565b600081518084526020808501945080840160005b8381101561573b5781518752958201959082019060010161577d565b6000815180845260005b818110156157bf576020818501810151868301820152016157a3565b818111156157d1576000602083870101525b50601f01601f19169290920160200192915050565b6157f08183615746565b604001919050565b8681526158086020820187615746565b6158156060820186615746565b61582260a0820185615746565b61582f60e0820184615746565b60609190911b6001600160601b0319166101208201526101340195945050505050565b8381526158626020820184615746565b606081019190915260800192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039290921682526001600160601b0316602082015260400190565b6040810161103b8284615746565b6020815260006138566020830184615769565b918252602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b6020815260006138566020830184615799565b6020815260ff82511660208201526020820151604082015260018060a01b0360408301511660608201526000606083015160c0608084015261598160e0840182615702565b60808501516001600160601b0390811660a0868101919091529095015190941660c0909301929092525090919050565b61ffff93841681529183166020830152909116604082015260600190565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615a2057845183529383019391830191600101615a04565b509098975050505050505050565b9182526001600160a01b0316602082015260400190565b828152606081016138566020830184615746565b8281526040602082015260006138a46040830184615769565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a083015261402c60c0830184615799565b878152602081018790526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c0820181905260009061411890830184615799565b8781526001600160401b03871660208201526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c0820181905260009061411890830184615799565b63ffffffff92831681529116602082015260400190565b6001600160401b0391909116815260200190565b6001600160601b038681168252851660208201526001600160401b03841660408201526001600160a01b038316606082015260a060808201819052600090615bc690830184615702565b979650505050505050565b6000808335601e19843603018112615be857600080fd5b8301803591506001600160401b03821115615c0257600080fd5b60200191503681900382131561503a57600080fd5b604080519081016001600160401b0381118282101715615c3957615c39615e93565b60405290565b60405160c081016001600160401b0381118282101715615c3957615c39615e93565b60405161012081016001600160401b0381118282101715615c3957615c39615e93565b604051601f8201601f191681016001600160401b0381118282101715615cac57615cac615e93565b604052919050565b60008085851115615cc457600080fd5b83861115615cd157600080fd5b5050820193919092039150565b60008219821115615cf157615cf1615e3b565b500190565b60006001600160401b03828116848216808303821115615d1857615d18615e3b565b01949350505050565b60006001600160601b03828116848216808303821115615d1857615d18615e3b565b600082615d5257615d52615e51565b500490565b6000816000190483118215151615615d7157615d71615e3b565b500290565b600082821015615d8857615d88615e3b565b500390565b60006001600160601b0383811690831681811015615dad57615dad615e3b565b039392505050565b6001600160e01b03198135818116916004851015615ddd5780818660040360031b1b83161692505b505092915050565b6000600019821415615df957615df9615e3b565b5060010190565b60006001600160401b0382811680821415615e1d57615e1d615e3b565b6001019392505050565b600082615e3657615e36615e51565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461246857600080fd5b801515811461246857600080fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transferredValue\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"expectedValue\",\"type\":\"uint96\"}],\"name\":\"InvalidNativeBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"requestVersion\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"expectedVersion\",\"type\":\"uint8\"}],\"name\":\"InvalidVersion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubscriptionIDCollisionFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountNative\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldNativeBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNativeBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithNative\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRF.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.RequestCommitment\",\"name\":\"rc\",\"type\":\"tuple\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestConfig\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedData\",\"type\":\"bytes\"}],\"name\":\"onMigration\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverNativeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"internalType\":\"structVRFCoordinatorV2PlusUpgradedVersion.FeeConfig\",\"name\":\"feeConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b50604051620061a6380380620061a6833981016040819052620000349162000183565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d7565b50505060601b6001600160601b031916608052620001b5565b6001600160a01b038116331415620001325760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019657600080fd5b81516001600160a01b0381168114620001ae57600080fd5b9392505050565b60805160601c615fcb620001db600039600081816104a601526136530152615fcb6000f3fe6080604052600436106101e05760003560e01c8062012291146101e5578063088070f5146102125780630ae095401461029257806315c48b84146102b457806318e3dd27146102dc5780631b6b6d231461031b5780632949265714610348578063294daa4914610368578063330987b314610384578063405b84fa146103a457806340d6bb82146103c457806341af6c87146103ef5780635d06b4ab1461041f57806364d51a2a1461043f578063659827441461045457806366316d8d14610474578063689c4517146104945780636f64f03f146104c857806372e9d565146104e857806379ba5097146105085780638402595e1461051d57806386fe91c71461053d5780638da5cb5b1461055d57806395b55cfc1461057b5780639b1c385e1461058e5780639d40a6fd146105bc578063a21a23e4146105e9578063a4c0ed36146105fe578063aa433aff1461061e578063aefb212f1461063e578063b08c87951461066b578063b2a7cac51461068b578063bec4c08c146106ab578063caf70c4a146106cb578063cb631797146106eb578063ce3f47191461070b578063d98e620e1461071e578063dac83d291461073e578063dc311dd31461075e578063e72f6e301461078f578063ee9d2d38146107af578063f2fde38b146107dc575b600080fd5b3480156101f157600080fd5b506101fa6107fc565b60405161020993929190615a56565b60405180910390f35b34801561021e57600080fd5b50600d5461025a9061ffff81169063ffffffff62010000820481169160ff600160301b82041691600160381b8204811691600160581b90041685565b6040805161ffff909616865263ffffffff9485166020870152921515928501929092528216606084015216608082015260a001610209565b34801561029e57600080fd5b506102b26102ad3660046156c9565b610878565b005b3480156102c057600080fd5b506102c960c881565b60405161ffff9091168152602001610209565b3480156102e857600080fd5b50600a5461030390600160601b90046001600160601b031681565b6040516001600160601b039091168152602001610209565b34801561032757600080fd5b5060025461033b906001600160a01b031681565b60405161020991906158fa565b34801561035457600080fd5b506102b261036336600461523b565b610946565b34801561037457600080fd5b5060405160028152602001610209565b34801561039057600080fd5b5061030361039f36600461541e565b610ac3565b3480156103b057600080fd5b506102b26103bf3660046156c9565b610f9e565b3480156103d057600080fd5b506103da6101f481565b60405163ffffffff9091168152602001610209565b3480156103fb57600080fd5b5061040f61040a3660046156b0565b611389565b6040519015158152602001610209565b34801561042b57600080fd5b506102b261043a36600461521e565b61152a565b34801561044b57600080fd5b506102c9606481565b34801561046057600080fd5b506102b261046f366004615270565b6115e1565b34801561048057600080fd5b506102b261048f36600461523b565b611641565b3480156104a057600080fd5b5061033b7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104d457600080fd5b506102b26104e33660046152a9565b611809565b3480156104f457600080fd5b5060035461033b906001600160a01b031681565b34801561051457600080fd5b506102b2611910565b34801561052957600080fd5b506102b261053836600461521e565b6119ba565b34801561054957600080fd5b50600a54610303906001600160601b031681565b34801561056957600080fd5b506000546001600160a01b031661033b565b6102b26105893660046156b0565b611ac6565b34801561059a57600080fd5b506105ae6105a93660046154fb565b611c0a565b604051908152602001610209565b3480156105c857600080fd5b506007546105dc906001600160401b031681565b6040516102099190615bef565b3480156105f557600080fd5b506105ae611f7a565b34801561060a57600080fd5b506102b26106193660046152e5565b6121c8565b34801561062a57600080fd5b506102b26106393660046156b0565b612365565b34801561064a57600080fd5b5061065e6106593660046156ee565b6123c8565b6040516102099190615971565b34801561067757600080fd5b506102b2610686366004615612565b6124c9565b34801561069757600080fd5b506102b26106a63660046156b0565b61263d565b3480156106b757600080fd5b506102b26106c63660046156c9565b612761565b3480156106d757600080fd5b506105ae6106e6366004615340565b6128f8565b3480156106f757600080fd5b506102b26107063660046156c9565b612928565b6102b2610719366004615392565b612c15565b34801561072a57600080fd5b506105ae6107393660046156b0565b612f26565b34801561074a57600080fd5b506102b26107593660046156c9565b612f47565b34801561076a57600080fd5b5061077e6107793660046156b0565b613057565b604051610209959493929190615c03565b34801561079b57600080fd5b506102b26107aa36600461521e565b613152565b3480156107bb57600080fd5b506105ae6107ca3660046156b0565b60106020526000908152604090205481565b3480156107e857600080fd5b506102b26107f736600461521e565b61332d565b600d54600f805460408051602080840282018101909252828152600094859460609461ffff8316946201000090930463ffffffff1693919283919083018282801561086657602002820191906000526020600020905b815481526020019060010190808311610852575b50505050509050925092509250909192565b60008281526005602052604090205482906001600160a01b0316806108b057604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146108e45780604051636c51fda960e11b81526004016108db91906158fa565b60405180910390fd5b600d54600160301b900460ff161561090f5760405163769dd35360e11b815260040160405180910390fd5b61091884611389565b1561093657604051631685ecdd60e31b815260040160405180910390fd5b610940848461333e565b50505050565b600d54600160301b900460ff16156109715760405163769dd35360e11b815260040160405180910390fd5b336000908152600c60205260409020546001600160601b03808316911610156109ad57604051631e9acf1760e31b815260040160405180910390fd5b336000908152600c6020526040812080548392906109d59084906001600160601b0316615e0b565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a600c8282829054906101000a90046001600160601b0316610a1d9190615e0b565b92506101000a8154816001600160601b0302191690836001600160601b031602179055506000826001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114610a97576040519150601f19603f3d011682016040523d82523d6000602084013e610a9c565b606091505b5050905080610abe5760405163950b247960e01b815260040160405180910390fd5b505050565b600d54600090600160301b900460ff1615610af15760405163769dd35360e11b815260040160405180910390fd5b60005a90506000610b0285856134f9565b90506000846060015163ffffffff166001600160401b03811115610b2857610b28615f3d565b604051908082528060200260200182016040528015610b51578160200160208202803683370190505b50905060005b856060015163ffffffff16811015610bc857826040015181604051602001610b80929190615984565b6040516020818303038152906040528051906020012060001c828281518110610bab57610bab615f27565b602090810291909101015280610bc081615e8f565b915050610b57565b5060208083018051600090815260109092526040808320839055905190518291631fe543e360e01b91610c0091908690602401615ae0565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600d805460ff60301b1916600160301b179055908801516080890151919250600091610c659163ffffffff16908461376c565b600d805460ff60301b19169055602089810151600090815260069091526040902054909150600160c01b90046001600160401b0316610ca5816001615d7d565b6020808b0151600090815260069091526040812080546001600160401b0393909316600160c01b026001600160c01b039093169290921790915560a08a01518051610cf290600190615df4565b81518110610d0257610d02615f27565b602091010151600d5460f89190911c6001149150600090610d33908a90600160581b900463ffffffff163a856137ba565b90508115610e3c576020808c01516000908152600690915260409020546001600160601b03808316600160601b909204161015610d8357604051631e9acf1760e31b815260040160405180910390fd5b60208b81015160009081526006909152604090208054829190600c90610dba908490600160601b90046001600160601b0316615e0b565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600c909152812080548594509092610e1391859116615d9f565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550610f28565b6020808c01516000908152600690915260409020546001600160601b0380831691161015610e7d57604051631e9acf1760e31b815260040160405180910390fd5b6020808c015160009081526006909152604081208054839290610eaa9084906001600160601b0316615e0b565b82546101009290920a6001600160601b0381810219909316918316021790915589516000908152600e60209081526040808320546001600160a01b03168352600b909152812080548594509092610f0391859116615d9f565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b8a6020015188602001517f49580fdfd9497e1ed5c1b1cec0495087ae8e3f1267470ec2fb015db32e3d6aa78a604001518488604051610f85939291909283526001600160601b039190911660208301521515604082015260600190565b60405180910390a3985050505050505050505b92915050565b600d54600160301b900460ff1615610fc95760405163769dd35360e11b815260040160405180910390fd5b610fd281613809565b610ff15780604051635428d44960e01b81526004016108db91906158fa565b60008060008061100086613057565b945094505093509350336001600160a01b0316826001600160a01b0316146110635760405162461bcd60e51b81526020600482015260166024820152752737ba1039bab139b1b934b83a34b7b71037bbb732b960511b60448201526064016108db565b61106c86611389565b156110b25760405162461bcd60e51b815260206004820152601660248201527550656e64696e6720726571756573742065786973747360501b60448201526064016108db565b60006040518060c001604052806110c7600290565b60ff168152602001888152602001846001600160a01b03168152602001838152602001866001600160601b03168152602001856001600160601b0316815250905060008160405160200161111b91906159c3565b604051602081830303815290604052905061113588613873565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b0388169061116e9085906004016159b0565b6000604051808303818588803b15801561118757600080fd5b505af115801561119b573d6000803e3d6000fd5b50506002546001600160a01b0316158015935091506111c4905057506001600160601b03861615155b1561128e5760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906111fb908a908a90600401615941565b602060405180830381600087803b15801561121557600080fd5b505af1158015611229573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124d919061535c565b61128e5760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b60448201526064016108db565b600d805460ff60301b1916600160301b17905560005b8351811015611337578381815181106112bf576112bf615f27565b60200260200101516001600160a01b0316638ea98117896040518263ffffffff1660e01b81526004016112f291906158fa565b600060405180830381600087803b15801561130c57600080fd5b505af1158015611320573d6000803e3d6000fd5b50505050808061132f90615e8f565b9150506112a4565b50600d805460ff60301b191690556040517fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187906113779089908b9061590e565b60405180910390a15050505050505050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879693958601939092919083018282801561141357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116113f5575b505050505081525050905060005b8160400151518110156115205760005b600f5481101561150d5760006114d6600f838154811061145357611453615f27565b90600052602060002001548560400151858151811061147457611474615f27565b602002602001015188600460008960400151898151811061149757611497615f27565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208d82529092529020546001600160401b0316613ac1565b50600081815260106020526040902054909150156114fa5750600195945050505050565b508061150581615e8f565b915050611431565b508061151881615e8f565b915050611421565b5060009392505050565b611532613b4a565b61153b81613809565b1561155b578060405163ac8a27ef60e01b81526004016108db91906158fa565b601380546001810182556000919091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0900180546001600160a01b0319166001600160a01b0383161790556040517fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af01625906115d69083906158fa565b60405180910390a150565b6115e9613b4a565b6002546001600160a01b03161561161357604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b600d54600160301b900460ff161561166c5760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b03166116955760405163c1f0c0a160e01b815260040160405180910390fd5b336000908152600b60205260409020546001600160601b03808316911610156116d157604051631e9acf1760e31b815260040160405180910390fd5b336000908152600b6020526040812080548392906116f99084906001600160601b0316615e0b565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555080600a60008282829054906101000a90046001600160601b03166117419190615e0b565b82546001600160601b039182166101009390930a92830291909202199091161790555060025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906117969085908590600401615941565b602060405180830381600087803b1580156117b057600080fd5b505af11580156117c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e8919061535c565b61180557604051631e9acf1760e31b815260040160405180910390fd5b5050565b611811613b4a565b6040805180820182526000916118409190849060029083908390808284376000920191909152506128f8915050565b6000818152600e60205260409020549091506001600160a01b03161561187c57604051634a0b8fa760e01b8152600481018290526024016108db565b6000818152600e6020908152604080832080546001600160a01b0319166001600160a01b038816908117909155600f805460018101825594527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909301849055518381527fe729ae16526293f74ade739043022254f1489f616295a25bf72dfb4511ed73b8910160405180910390a2505050565b6001546001600160a01b031633146119635760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b60448201526064016108db565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6119c2613b4a565b600a544790600160601b90046001600160601b0316818111156119fc5780826040516354ced18160e11b81526004016108db929190615984565b81811015610abe576000611a108284615df4565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114611a5f576040519150601f19603f3d011682016040523d82523d6000602084013e611a64565b606091505b5050905080611a865760405163950b247960e01b815260040160405180910390fd5b7f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c8583604051611ab792919061590e565b60405180910390a15050505050565b600d54600160301b900460ff1615611af15760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b0316611b2657604051630fb532db60e11b815260040160405180910390fd5b60008181526006602052604090208054600160601b90046001600160601b0316903490600c611b558385615d9f565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b0316611b9d9190615d9f565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902823484611bf09190615d65565b604051611bfe929190615984565b60405180910390a25050565b600d54600090600160301b900460ff1615611c385760405163769dd35360e11b815260040160405180910390fd5b6020808301356000908152600590915260409020546001600160a01b0316611c7357604051630fb532db60e11b815260040160405180910390fd5b3360009081526004602090815260408083208583013584529091529020546001600160401b031680611cc0578260200135336040516379bfd40160e01b81526004016108db929190615ab5565b600d5461ffff16611cd760608501604086016155f7565b61ffff161080611cfa575060c8611cf460608501604086016155f7565b61ffff16115b15611d3457611d0f60608401604085016155f7565b600d5460405163539c34bb60e11b81526108db929161ffff169060c890600401615a38565b600d5462010000900463ffffffff16611d536080850160608601615710565b63ffffffff161115611d9957611d6f6080840160608501615710565b600d54604051637aebf00f60e11b81526108db929162010000900463ffffffff1690600401615bd8565b6101f4611dac60a0850160808601615710565b63ffffffff161115611de657611dc860a0840160808501615710565b6101f46040516311ce1afb60e21b81526004016108db929190615bd8565b6000611df3826001615d7d565b9050600080611e09863533602089013586613ac1565b90925090506000611e25611e2060a0890189615c58565b613b9f565b90506000611e3282613c1c565b905083611e3d613c8d565b60208a0135611e5260808c0160608d01615710565b611e6260a08d0160808e01615710565b3386604051602001611e7a9796959493929190615b38565b604051602081830303815290604052805190602001206010600086815260200190815260200160002081905550336001600160a01b0316886020013589600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e87878d6040016020810190611ef191906155f7565b8e6060016020810190611f049190615710565b8f6080016020810190611f179190615710565b89604051611f2a96959493929190615af9565b60405180910390a45050336000908152600460209081526040808320898301358452909152902080546001600160401b0319166001600160401b039490941693909317909255925050505b919050565b600d54600090600160301b900460ff1615611fa85760405163769dd35360e11b815260040160405180910390fd5b600033611fb6600143615df4565b600754604051606093841b6001600160601b03199081166020830152924060348201523090931b909116605483015260c01b6001600160c01b031916606882015260700160408051601f198184030181529190528051602090910120600780549192506001600160401b0390911690600061203083615eaa565b91906101000a8154816001600160401b0302191690836001600160401b03160217905550506000806001600160401b0381111561206f5761206f615f3d565b604051908082528060200260200182016040528015612098578160200160208202803683370190505b506040805160608082018352600080835260208084018281528486018381528984526006835286842095518654925191516001600160601b039182166001600160c01b031990941693909317600160601b9190921602176001600160c01b0316600160c01b6001600160401b039092169190910217909355835191820184523382528183018181528285018681528883526005855294909120825181546001600160a01b03199081166001600160a01b0392831617835592516001830180549094169116179091559251805194955090936121799260028501920190614e8f565b5061218991506008905083613d1d565b50817f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d336040516121ba91906158fa565b60405180910390a250905090565b600d54600160301b900460ff16156121f35760405163769dd35360e11b815260040160405180910390fd5b6002546001600160a01b0316331461221e576040516344b0e3c360e01b815260040160405180910390fd5b6020811461223f57604051638129bbcd60e01b815260040160405180910390fd5b600061224d828401846156b0565b6000818152600560205260409020549091506001600160a01b031661228557604051630fb532db60e11b815260040160405180910390fd5b600081815260066020526040812080546001600160601b0316918691906122ac8385615d9f565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166122f49190615d9f565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a8287846123479190615d65565b604051612355929190615984565b60405180910390a2505050505050565b61236d613b4a565b6000818152600560205260409020546001600160a01b03166123a257604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020546123c59082906001600160a01b031661333e565b50565b606060006123d66008613d29565b90508084106123f857604051631390f2a160e01b815260040160405180910390fd5b60006124048486615d65565b905081811180612412575083155b61241c578061241e565b815b9050600061242c8683615df4565b6001600160401b0381111561244357612443615f3d565b60405190808252806020026020018201604052801561246c578160200160208202803683370190505b50905060005b81518110156124bf576124906124888883615d65565b600890613d33565b8282815181106124a2576124a2615f27565b6020908102919091010152806124b781615e8f565b915050612472565b5095945050505050565b6124d1613b4a565b60c861ffff871611156124fe57858660c860405163539c34bb60e11b81526004016108db93929190615a38565b60008213612522576040516321ea67b360e11b8152600481018390526024016108db565b6040805160a0808201835261ffff891680835263ffffffff89811660208086018290526000868801528a831660608088018290528b85166080988901819052600d805465ffffffffffff1916881762010000870217600160301b600160781b031916600160381b850263ffffffff60581b191617600160581b83021790558a51601280548d8701519289166001600160401b031990911617600160201b92891692909202919091179081905560118d90558a519788528785019590955298860191909152840196909652938201879052838116928201929092529190921c90911660c08201527f777357bb93f63d088f18112d3dba38457aec633eb8f1341e1d418380ad328e789060e00160405180910390a1505050505050565b600d54600160301b900460ff16156126685760405163769dd35360e11b815260040160405180910390fd5b6000818152600560205260409020546001600160a01b031661269d57604051630fb532db60e11b815260040160405180910390fd5b6000818152600560205260409020600101546001600160a01b031633146126f4576000818152600560205260409081902060010154905163d084e97560e01b81526108db916001600160a01b0316906004016158fa565b6000818152600560205260409081902080546001600160a01b031980821633908117845560019093018054909116905591516001600160a01b039092169183917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c938691611bfe918591615927565b60008281526005602052604090205482906001600160a01b03168061279957604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b038216146127c45780604051636c51fda960e11b81526004016108db91906158fa565b600d54600160301b900460ff16156127ef5760405163769dd35360e11b815260040160405180910390fd5b60008481526005602052604090206002015460641415612822576040516305a48e0f60e01b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b03161561285957610940565b6001600160a01b0383166000818152600460209081526040808320888452825280832080546001600160401b031916600190811790915560058352818420600201805491820181558452919092200180546001600160a01b0319169092179091555184907f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e1906128ea9086906158fa565b60405180910390a250505050565b60008160405160200161290b9190615963565b604051602081830303815290604052805190602001209050919050565b60008281526005602052604090205482906001600160a01b03168061296057604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b0382161461298b5780604051636c51fda960e11b81526004016108db91906158fa565b600d54600160301b900460ff16156129b65760405163769dd35360e11b815260040160405180910390fd5b6129bf84611389565b156129dd57604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b03831660009081526004602090815260408083208784529091529020546001600160401b0316612a2b5783836040516379bfd40160e01b81526004016108db929190615ab5565b600084815260056020908152604080832060020180548251818502810185019093528083529192909190830182828015612a8e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612a70575b50505050509050600060018251612aa59190615df4565b905060005b8251811015612bb157856001600160a01b0316838281518110612acf57612acf615f27565b60200260200101516001600160a01b03161415612b9f576000838381518110612afa57612afa615f27565b6020026020010151905080600560008a81526020019081526020016000206002018381548110612b2c57612b2c615f27565b600091825260208083209190910180546001600160a01b0319166001600160a01b039490941693909317909255898152600590915260409020600201805480612b7757612b77615f11565b600082815260209020810160001990810180546001600160a01b031916905501905550612bb1565b80612ba981615e8f565b915050612aaa565b506001600160a01b03851660009081526004602090815260408083208984529091529081902080546001600160401b03191690555186907f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7906123559088906158fa565b6000612c2382840184615535565b9050806000015160ff16600114612c5c57805160405163237d181f60e21b815260ff9091166004820152600160248201526044016108db565b8060a001516001600160601b03163414612ca05760a08101516040516306acf13560e41b81523460048201526001600160601b0390911660248201526044016108db565b6020808201516000908152600590915260409020546001600160a01b031615612cdc576040516326afa43560e11b815260040160405180910390fd5b60005b816060015151811015612d7c5760016004600084606001518481518110612d0857612d08615f27565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008460200151815260200190815260200160002060006101000a8154816001600160401b0302191690836001600160401b031602179055508080612d7490615e8f565b915050612cdf565b50604080516060808201835260808401516001600160601b03908116835260a0850151811660208085019182526000858701818152828901805183526006845288832097518854955192516001600160401b0316600160c01b026001600160c01b03938816600160601b026001600160c01b0319909716919097161794909417169390931790945584518084018652868601516001600160a01b03908116825281860184815294880151828801908152925184526005865295909220825181549087166001600160a01b0319918216178255935160018201805491909716941693909317909455925180519192612e7b92600285019290910190614e8f565b5050506080810151600a8054600090612e9e9084906001600160601b0316615d9f565b92506101000a8154816001600160601b0302191690836001600160601b031602179055508060a00151600a600c8282829054906101000a90046001600160601b0316612eea9190615d9f565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555061094081602001516008613d1d90919063ffffffff16565b600f8181548110612f3657600080fd5b600091825260209091200154905081565b60008281526005602052604090205482906001600160a01b031680612f7f57604051630fb532db60e11b815260040160405180910390fd5b336001600160a01b03821614612faa5780604051636c51fda960e11b81526004016108db91906158fa565b600d54600160301b900460ff1615612fd55760405163769dd35360e11b815260040160405180910390fd5b6000848152600560205260409020600101546001600160a01b03848116911614610940576000848152600560205260409081902060010180546001600160a01b0319166001600160a01b0386161790555184907f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a1906128ea9033908790615927565b6000818152600560205260408120548190819081906060906001600160a01b031661309557604051630fb532db60e11b815260040160405180910390fd5b60008681526006602090815260408083205460058352928190208054600290910180548351818602810186019094528084526001600160601b0380871696600160601b810490911695600160c01b9091046001600160401b0316946001600160a01b039094169391839183018282801561313857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161311a575b505050505090509450945094509450945091939590929450565b61315a613b4a565b6002546001600160a01b03166131835760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81526000916001600160a01b0316906370a08231906131b49030906004016158fa565b60206040518083038186803b1580156131cc57600080fd5b505afa1580156131e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132049190615379565b600a549091506001600160601b0316818111156132385780826040516354ced18160e11b81526004016108db929190615984565b81811015610abe57600061324c8284615df4565b60025460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb9061327f908790859060040161590e565b602060405180830381600087803b15801561329957600080fd5b505af11580156132ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132d1919061535c565b6132ee57604051631f01ff1360e21b815260040160405180910390fd5b7f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600848260405161331f92919061590e565b60405180910390a150505050565b613335613b4a565b6123c581613d3f565b60008061334a84613873565b60025491935091506001600160a01b03161580159061337157506001600160601b03821615155b156134205760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906133b19086906001600160601b0387169060040161590e565b602060405180830381600087803b1580156133cb57600080fd5b505af11580156133df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613403919061535c565b61342057604051631e9acf1760e31b815260040160405180910390fd5b6000836001600160a01b0316826001600160601b031660405160006040518083038185875af1925050503d8060008114613476576040519150601f19603f3d011682016040523d82523d6000602084013e61347b565b606091505b505090508061349d5760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b03861681526001600160601b038581166020830152841681830152905186917f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4919081900360600190a25050505050565b6040805160608101825260008082526020820181905291810191909152600061352584600001516128f8565b6000818152600e60205260409020549091506001600160a01b03168061356157604051631dfd6e1360e21b8152600481018390526024016108db565b600082866080015160405160200161357a929190615984565b60408051601f19818403018152918152815160209283012060008181526010909352912054909150806135c057604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d015193516135ef978a979096959101615b84565b6040516020818303038152906040528051906020012081146136245760405163354a450b60e21b815260040160405180910390fd5b60006136338760000151613de3565b9050806136fa578651604051631d2827a760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163e9413d38916136879190600401615bef565b60206040518083038186803b15801561369f57600080fd5b505afa1580156136b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136d79190615379565b9050806136fa57865160405163175dadad60e01b81526108db9190600401615bef565b600088608001518260405160200161371c929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905060006137438a83613ec0565b604080516060810182529889526020890196909652948701949094525093979650505050505050565b60005a61138881101561377e57600080fd5b61138881039050846040820482031161379657600080fd5b50823b6137a257600080fd5b60008083516020850160008789f190505b9392505050565b600081156137e7576012546137e09086908690600160201b900463ffffffff1686613f2b565b9050613801565b6012546137fe908690869063ffffffff1686613fcd565b90505b949350505050565b6000805b60135481101561386a57826001600160a01b03166013828154811061383457613834615f27565b6000918252602090912001546001600160a01b031614156138585750600192915050565b8061386281615e8f565b91505061380d565b50600092915050565b6000818152600560209081526040808320815160608101835281546001600160a01b039081168252600183015416818501526002820180548451818702810187018652818152879687969495948601939192908301828280156138ff57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116138e1575b505050919092525050506000858152600660209081526040808320815160608101835290546001600160601b03808216808452600160601b8304909116948301859052600160c01b9091046001600160401b0316928201929092529096509094509192505b8260400151518110156139db57600460008460400151838151811061398b5761398b615f27565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902080546001600160401b0319169055806139d381615e8f565b915050613964565b50600085815260056020526040812080546001600160a01b03199081168255600182018054909116905590613a136002830182614ef4565b5050600085815260066020526040812055613a2f6008866140f2565b50600a8054859190600090613a4e9084906001600160601b0316615e0b565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555082600a600c8282829054906101000a90046001600160601b0316613a969190615e0b565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050915091565b60408051602081018690526001600160a01b03851691810191909152606081018390526001600160401b03821660808201526000908190819060a00160408051601f198184030181529082905280516020918201209250613b26918991849101615984565b60408051808303601f19018152919052805160209091012097909650945050505050565b6000546001600160a01b03163314613b9d5760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b60448201526064016108db565b565b60408051602081019091526000815281613bc85750604080516020810190915260008152610f98565b63125fa26760e31b613bda8385615e33565b6001600160e01b03191614613c0257604051632923fee760e11b815260040160405180910390fd5b613c0f8260048186615d3b565b8101906137b391906153d3565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401613c5591511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b600046613c99816140fe565b15613d165760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b815260040160206040518083038186803b158015613cd857600080fd5b505afa158015613cec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d109190615379565b91505090565b4391505090565b60006137b38383614121565b6000610f98825490565b60006137b38383614170565b6001600160a01b038116331415613d925760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b60448201526064016108db565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600046613def816140fe565b15613eb157610100836001600160401b0316613e09613c8d565b613e139190615df4565b1180613e2f5750613e22613c8d565b836001600160401b031610155b15613e3d5750600092915050565b6040516315a03d4160e11b8152606490632b407a8290613e61908690600401615bef565b60206040518083038186803b158015613e7957600080fd5b505afa158015613e8d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137b39190615379565b50506001600160401b03164090565b6000613ef48360000151846020015185604001518660600151868860a001518960c001518a60e001518b610100015161419a565b60038360200151604051602001613f0c929190615acc565b60408051601f1981840301815291905280516020909101209392505050565b600080613f6e6000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506143b592505050565b905060005a613f7d8888615d65565b613f879190615df4565b613f919085615dd5565b90506000613faa63ffffffff871664e8d4a51000615dd5565b905082613fb78284615d65565b613fc19190615d65565b98975050505050505050565b600080613fd861447a565b905060008113613ffe576040516321ea67b360e11b8152600481018290526024016108db565b60006140406000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506143b592505050565b9050600082825a6140518b8b615d65565b61405b9190615df4565b6140659088615dd5565b61406f9190615d65565b61408190670de0b6b3a7640000615dd5565b61408b9190615dc1565b905060006140a463ffffffff881664e8d4a51000615dd5565b90506140bb81676765c793fa10079d601b1b615df4565b8211156140db5760405163e80fa38160e01b815260040160405180910390fd5b6140e58183615d65565b9998505050505050505050565b60006137b38383614545565b600061a4b1821480614112575062066eed82145b80610f9857505062066eee1490565b600081815260018301602052604081205461416857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f98565b506000610f98565b600082600001828154811061418757614187615f27565b9060005260206000200154905092915050565b6141a389614638565b6141ec5760405162461bcd60e51b815260206004820152601a6024820152797075626c6963206b6579206973206e6f74206f6e20637572766560301b60448201526064016108db565b6141f588614638565b6142395760405162461bcd60e51b815260206004820152601560248201527467616d6d61206973206e6f74206f6e20637572766560581b60448201526064016108db565b61424283614638565b61428e5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e20637572766500000060448201526064016108db565b61429782614638565b6142e25760405162461bcd60e51b815260206004820152601c60248201527b73486173685769746e657373206973206e6f74206f6e20637572766560201b60448201526064016108db565b6142ee878a88876146fb565b6143365760405162461bcd60e51b81526020600482015260196024820152786164647228632a706b2b732a6729213d5f755769746e65737360381b60448201526064016108db565b60006143428a8761480f565b90506000614355898b878b868989614873565b90506000614366838d8d8a86614986565b9050808a146143a75760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b60448201526064016108db565b505050505050505050505050565b6000466143c1816140fe565b1561440057606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015613e7957600080fd5b614409816149c6565b1561386a57600f602160991b016001600160a01b03166349948e0e84604051806080016040528060488152602001615f776048913960405160200161444f929190615850565b6040516020818303038152906040526040518263ffffffff1660e01b8152600401613e6191906159b0565b600d5460035460408051633fabe5a360e21b81529051600093600160381b900463ffffffff169283151592859283926001600160a01b03169163feaf968c9160048083019260a0929190829003018186803b1580156144d857600080fd5b505afa1580156144ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614510919061572b565b509450909250849150508015614534575061452b8242615df4565b8463ffffffff16105b156138015750601154949350505050565b6000818152600183016020526040812054801561462e576000614569600183615df4565b855490915060009061457d90600190615df4565b90508181146145e257600086600001828154811061459d5761459d615f27565b90600052602060002001549050808760000184815481106145c0576145c0615f27565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145f3576145f3615f11565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610f98565b6000915050610f98565b80516000906401000003d019116146865760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420782d6f7264696e61746560701b60448201526064016108db565b60208201516401000003d019116146d45760405162461bcd60e51b8152602060048201526012602482015271696e76616c696420792d6f7264696e61746560701b60448201526064016108db565b60208201516401000003d0199080096146f48360005b6020020151614a00565b1492915050565b60006001600160a01b0382166147415760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b60448201526064016108db565b60208401516000906001161561475857601c61475b565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020909101918290529293506001916147c591869188918790615992565b6020604051602081039080840390855afa1580156147e7573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614817614f12565b61484460018484604051602001614830939291906158d9565b604051602081830303815290604052614a24565b90505b61485081614638565b610f9857805160408051602081019290925261486c9101614830565b9050614847565b61487b614f12565b825186516401000003d01990819006910614156148da5760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e6374000060448201526064016108db565b6148e5878988614a72565b61492a5760405162461bcd60e51b8152602060048201526016602482015275119a5c9cdd081b5d5b0818da1958dac819985a5b195960521b60448201526064016108db565b614935848685614a72565b61497b5760405162461bcd60e51b815260206004820152601760248201527614d958dbdb99081b5d5b0818da1958dac819985a5b1959604a1b60448201526064016108db565b613fc1868484614b8d565b6000600286868685876040516020016149a49695949392919061587f565b60408051601f1981840301815291905280516020909101209695505050505050565b6000600a8214806149d857506101a482145b806149e5575062aa37dc82145b806149f1575061210582145b80610f9857505062014a331490565b6000806401000003d01980848509840990506401000003d019600782089392505050565b614a2c614f12565b614a3582614c50565b8152614a4a614a458260006146ea565b614c8b565b602082018190526002900660011415611f75576020810180516401000003d019039052919050565b600082614aaf5760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b60448201526064016108db565b83516020850151600090614ac590600290615ed1565b15614ad157601c614ad4565b601b5b9050600070014551231950b75fc4402da1732fc9bebe19838709604080516000808252602090910191829052919250600190614b17908390869088908790615992565b6020604051602081039080840390855afa158015614b39573d6000803e3d6000fd5b505050602060405103519050600086604051602001614b58919061583e565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614b95614f12565b835160208086015185519186015160009384938493614bb693909190614cab565b919450925090506401000003d019858209600114614c125760405162461bcd60e51b815260206004820152601960248201527834b73b2d1036bab9ba1031329034b73b32b939b29037b3103d60391b60448201526064016108db565b60405180604001604052806401000003d01980614c3157614c31615efb565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d0198110611f7557604080516020808201939093528151808203840181529082019091528051910120614c58565b6000610f98826002614ca46401000003d0196001615d65565b901c614d8b565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614ceb83838585614e22565b9098509050614cfc88828e88614e46565b9098509050614d0d88828c87614e46565b90985090506000614d208d878b85614e46565b9098509050614d3188828686614e22565b9098509050614d4288828e89614e46565b9098509050818114614d77576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614d7b565b8196505b5050505050509450945094915050565b600080614d96614f30565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614dc8614f4e565b60208160c0846005600019fa925082614e185760405162461bcd60e51b81526020600482015260126024820152716269674d6f64457870206661696c7572652160701b60448201526064016108db565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614ee4579160200282015b82811115614ee457825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614eaf565b50614ef0929150614f6c565b5090565b50805460008255906000526020600020908101906123c59190614f6c565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614ef05760008155600101614f6d565b8035611f7581615f53565b600082601f830112614f9d57600080fd5b813560206001600160401b03821115614fb857614fb8615f3d565b8160051b614fc7828201615d0b565b838152828101908684018388018501891015614fe257600080fd5b600093505b8584101561500e578035614ffa81615f53565b835260019390930192918401918401614fe7565b50979650505050505050565b600082601f83011261502b57600080fd5b615033615c9e565b80838560408601111561504557600080fd5b60005b6002811015615067578135845260209384019390910190600101615048565b509095945050505050565b60008083601f84011261508457600080fd5b5081356001600160401b0381111561509b57600080fd5b6020830191508360208285010111156150b357600080fd5b9250929050565b600082601f8301126150cb57600080fd5b81356001600160401b038111156150e4576150e4615f3d565b6150f7601f8201601f1916602001615d0b565b81815284602083860101111561510c57600080fd5b816020850160208301376000918101602001919091529392505050565b600060c0828403121561513b57600080fd5b615143615cc6565b905081356001600160401b03808216821461515d57600080fd5b81835260208401356020840152615176604085016151dc565b6040840152615187606085016151dc565b606084015261519860808501614f81565b608084015260a08401359150808211156151b157600080fd5b506151be848285016150ba565b60a08301525092915050565b803561ffff81168114611f7557600080fd5b803563ffffffff81168114611f7557600080fd5b80516001600160501b0381168114611f7557600080fd5b80356001600160601b0381168114611f7557600080fd5b60006020828403121561523057600080fd5b81356137b381615f53565b6000806040838503121561524e57600080fd5b823561525981615f53565b915061526760208401615207565b90509250929050565b6000806040838503121561528357600080fd5b823561528e81615f53565b9150602083013561529e81615f53565b809150509250929050565b600080606083850312156152bc57600080fd5b82356152c781615f53565b9150606083018410156152d957600080fd5b50926020919091019150565b600080600080606085870312156152fb57600080fd5b843561530681615f53565b93506020850135925060408501356001600160401b0381111561532857600080fd5b61533487828801615072565b95989497509550505050565b60006040828403121561535257600080fd5b6137b3838361501a565b60006020828403121561536e57600080fd5b81516137b381615f68565b60006020828403121561538b57600080fd5b5051919050565b600080602083850312156153a557600080fd5b82356001600160401b038111156153bb57600080fd5b6153c785828601615072565b90969095509350505050565b6000602082840312156153e557600080fd5b604051602081016001600160401b038111828210171561540757615407615f3d565b604052823561541581615f68565b81529392505050565b6000808284036101c081121561543357600080fd5b6101a08082121561544357600080fd5b61544b615ce8565b9150615457868661501a565b8252615466866040870161501a565b60208301526080850135604083015260a0850135606083015260c0850135608083015261549560e08601614f81565b60a08301526101006154a98782880161501a565b60c08401526154bc87610140880161501a565b60e0840152610180860135908301529092508301356001600160401b038111156154e557600080fd5b6154f185828601615129565b9150509250929050565b60006020828403121561550d57600080fd5b81356001600160401b0381111561552357600080fd5b820160c081850312156137b357600080fd5b60006020828403121561554757600080fd5b81356001600160401b038082111561555e57600080fd5b9083019060c0828603121561557257600080fd5b61557a615cc6565b823560ff8116811461558b57600080fd5b8152602083810135908201526155a360408401614f81565b60408201526060830135828111156155ba57600080fd5b6155c687828601614f8c565b6060830152506155d860808401615207565b60808201526155e960a08401615207565b60a082015295945050505050565b60006020828403121561560957600080fd5b6137b3826151ca565b60008060008060008086880360e081121561562c57600080fd5b615635886151ca565b9650615643602089016151dc565b9550615651604089016151dc565b945061565f606089016151dc565b9350608088013592506040609f198201121561567a57600080fd5b50615683615c9e565b61568f60a089016151dc565b815261569d60c089016151dc565b6020820152809150509295509295509295565b6000602082840312156156c257600080fd5b5035919050565b600080604083850312156156dc57600080fd5b82359150602083013561529e81615f53565b6000806040838503121561570157600080fd5b50508035926020909101359150565b60006020828403121561572257600080fd5b6137b3826151dc565b600080600080600060a0868803121561574357600080fd5b61574c866151f0565b945060208601519350604086015192506060860151915061576f608087016151f0565b90509295509295909350565b600081518084526020808501945080840160005b838110156157b45781516001600160a01b03168752958201959082019060010161578f565b509495945050505050565b8060005b60028110156109405781518452602093840193909101906001016157c3565b600081518084526020808501945080840160005b838110156157b4578151875295820195908201906001016157f6565b6000815180845261582a816020860160208601615e63565b601f01601f19169290920160200192915050565b61584881836157bf565b604001919050565b60008351615862818460208801615e63565b835190830190615876818360208801615e63565b01949350505050565b86815261588f60208201876157bf565b61589c60608201866157bf565b6158a960a08201856157bf565b6158b660e08201846157bf565b60609190911b6001600160601b0319166101208201526101340195945050505050565b8381526158e960208201846157bf565b606081019190915260800192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039290921682526001600160601b0316602082015260400190565b60408101610f9882846157bf565b6020815260006137b360208301846157e2565b918252602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b6020815260006137b36020830184615812565b6020815260ff82511660208201526020820151604082015260018060a01b0360408301511660608201526000606083015160c06080840152615a0860e084018261577b565b60808501516001600160601b0390811660a0868101919091529095015190941660c0909301929092525090919050565b61ffff93841681529183166020830152909116604082015260600190565b60006060820161ffff86168352602063ffffffff86168185015260606040850152818551808452608086019150828701935060005b81811015615aa757845183529383019391830191600101615a8b565b509098975050505050505050565b9182526001600160a01b0316602082015260400190565b828152606081016137b360208301846157bf565b82815260406020820152600061380160408301846157e2565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a0830152613fc160c0830184615812565b878152602081018790526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c082018190526000906140e590830184615812565b8781526001600160401b03871660208201526040810186905263ffffffff8581166060830152841660808201526001600160a01b03831660a082015260e060c082018190526000906140e590830184615812565b63ffffffff92831681529116602082015260400190565b6001600160401b0391909116815260200190565b6001600160601b038681168252851660208201526001600160401b03841660408201526001600160a01b038316606082015260a060808201819052600090615c4d9083018461577b565b979650505050505050565b6000808335601e19843603018112615c6f57600080fd5b8301803591506001600160401b03821115615c8957600080fd5b6020019150368190038213156150b357600080fd5b604080519081016001600160401b0381118282101715615cc057615cc0615f3d565b60405290565b60405160c081016001600160401b0381118282101715615cc057615cc0615f3d565b60405161012081016001600160401b0381118282101715615cc057615cc0615f3d565b604051601f8201601f191681016001600160401b0381118282101715615d3357615d33615f3d565b604052919050565b60008085851115615d4b57600080fd5b83861115615d5857600080fd5b5050820193919092039150565b60008219821115615d7857615d78615ee5565b500190565b60006001600160401b0382811684821680830382111561587657615876615ee5565b60006001600160601b0382811684821680830382111561587657615876615ee5565b600082615dd057615dd0615efb565b500490565b6000816000190483118215151615615def57615def615ee5565b500290565b600082821015615e0657615e06615ee5565b500390565b60006001600160601b0383811690831681811015615e2b57615e2b615ee5565b039392505050565b6001600160e01b03198135818116916004851015615e5b5780818660040360031b1b83161692505b505092915050565b60005b83811015615e7e578181015183820152602001615e66565b838111156109405750506000910152565b6000600019821415615ea357615ea3615ee5565b5060010190565b60006001600160401b0382811680821415615ec757615ec7615ee5565b6001019392505050565b600082615ee057615ee0615efb565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146123c557600080fd5b80151581146123c557600080fdfe307866666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666a164736f6c6343000806000a", } var VRFCoordinatorV2PlusUpgradedVersionABI = VRFCoordinatorV2PlusUpgradedVersionMetaData.ABI @@ -560,58 +560,6 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionC return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SCurrentSubNonce(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) SFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "s_fallbackWeiPerUnitLink") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) SFallbackWeiPerUnitLink() (*big.Int, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SFallbackWeiPerUnitLink(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCallerSession) SFallbackWeiPerUnitLink() (*big.Int, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SFallbackWeiPerUnitLink(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) SFeeConfig(opts *bind.CallOpts) (SFeeConfig, - - error) { - var out []interface{} - err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "s_feeConfig") - - outstruct := new(SFeeConfig) - if err != nil { - return *outstruct, err - } - - outstruct.FulfillmentFlatFeeLinkPPM = *abi.ConvertType(out[0], new(uint32)).(*uint32) - outstruct.FulfillmentFlatFeeNativePPM = *abi.ConvertType(out[1], new(uint32)).(*uint32) - - return *outstruct, err - -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) SFeeConfig() (SFeeConfig, - - error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SFeeConfig(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCallerSession) SFeeConfig() (SFeeConfig, - - error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SFeeConfig(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts) -} - func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) SProvingKeyHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { var out []interface{} err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "s_provingKeyHashes", arg0) @@ -634,28 +582,6 @@ func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionC return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SProvingKeyHashes(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts, arg0) } -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) SProvingKeys(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { - var out []interface{} - err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "s_provingKeys", arg0) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionSession) SProvingKeys(arg0 [32]byte) (common.Address, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SProvingKeys(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts, arg0) -} - -func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCallerSession) SProvingKeys(arg0 [32]byte) (common.Address, error) { - return _VRFCoordinatorV2PlusUpgradedVersion.Contract.SProvingKeys(&_VRFCoordinatorV2PlusUpgradedVersion.CallOpts, arg0) -} - func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersionCaller) SRequestCommitments(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { var out []interface{} err := _VRFCoordinatorV2PlusUpgradedVersion.contract.Call(opts, &out, "s_requestCommitments", arg0) @@ -3331,10 +3257,6 @@ type SConfig struct { StalenessSeconds uint32 GasAfterPaymentCalculation uint32 } -type SFeeConfig struct { - FulfillmentFlatFeeLinkPPM uint32 - FulfillmentFlatFeeNativePPM uint32 -} func (_VRFCoordinatorV2PlusUpgradedVersion *VRFCoordinatorV2PlusUpgradedVersion) ParseLog(log types.Log) (generated.AbigenLog, error) { switch log.Topics[0] { @@ -3491,16 +3413,8 @@ type VRFCoordinatorV2PlusUpgradedVersionInterface interface { SCurrentSubNonce(opts *bind.CallOpts) (uint64, error) - SFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) - - SFeeConfig(opts *bind.CallOpts) (SFeeConfig, - - error) - SProvingKeyHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) - SProvingKeys(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) - SRequestCommitments(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) STotalBalance(opts *bind.CallOpts) (*big.Int, error) diff --git a/core/gethwrappers/generated/vrfv2_wrapper/vrfv2_wrapper.go b/core/gethwrappers/generated/vrfv2_wrapper/vrfv2_wrapper.go index 9ce091f8a50..61cb52e117d 100644 --- a/core/gethwrappers/generated/vrfv2_wrapper/vrfv2_wrapper.go +++ b/core/gethwrappers/generated/vrfv2_wrapper/vrfv2_wrapper.go @@ -32,7 +32,7 @@ var ( var VRFV2WrapperMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkEthFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COORDINATOR\",\"outputs\":[{\"internalType\":\"contractExtendedVRFCoordinatorV2Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_ETH_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"requestGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"int256\",\"name\":\"requestWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"juelsPaid\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101206040526001805463ffffffff60a01b1916609160a21b1790553480156200002857600080fd5b50604051620025ea380380620025ea8339810160408190526200004b91620002d8565b803380600081620000a35760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d657620000d6816200020f565b5050506001600160601b0319606091821b811660805284821b811660a05283821b811660c0529082901b1660e0526040805163288688f960e21b815290516000916001600160a01b0384169163a21a23e49160048082019260209290919082900301818787803b1580156200014a57600080fd5b505af11580156200015f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000185919062000322565b60c081901b6001600160c01b03191661010052604051631cd0704360e21b81526001600160401b03821660048201523060248201529091506001600160a01b03831690637341c10c90604401600060405180830381600087803b158015620001ec57600080fd5b505af115801562000201573d6000803e3d6000fd5b505050505050505062000354565b6001600160a01b0381163314156200026a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620002d357600080fd5b919050565b600080600060608486031215620002ee57600080fd5b620002f984620002bb565b92506200030960208501620002bb565b91506200031960408501620002bb565b90509250925092565b6000602082840312156200033557600080fd5b81516001600160401b03811681146200034d57600080fd5b9392505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160c01c612203620003e7600039600081816101970152610c5501526000818161028401528181610c1601528181610fec015281816110cd01526111680152600081816103fd015261161c01526000818161021b01528181610a6801526112ba01526000818161055801526105c001526122036000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c80638da5cb5b116100e3578063c15ce4d71161008c578063f2fde38b11610066578063f2fde38b14610511578063f3fef3a314610524578063fc2a88c31461053757600080fd5b8063c15ce4d714610432578063c3f909d414610445578063cdd8d885146104d457600080fd5b8063a608a1e1116100bd578063a608a1e1146103e6578063ad178361146103f8578063bf17e5591461041f57600080fd5b80638da5cb5b146103ad578063a3907d71146103cb578063a4c0ed36146103d357600080fd5b80633b2bcbf11161014557806357a8070a1161011f57806357a8070a1461037557806379ba5097146103925780637fb5d19d1461039a57600080fd5b80633b2bcbf11461027f5780634306d354146102a657806348baa1c5146102c757600080fd5b80631b6b6d23116101765780631b6b6d23146102165780631fe543e3146102625780632f2770db1461027757600080fd5b8063030932bb14610192578063181f5a77146101d7575b600080fd5b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b604080518082018252601281527f56524656325772617070657220312e302e300000000000000000000000000000602082015290516101ce9190611f96565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ce565b610275610270366004611c7b565b610540565b005b610275610600565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b6102b96102b4366004611db4565b610636565b6040519081526020016101ce565b6103316102d5366004611c62565b600860205260009081526040902080546001820154600283015460039093015473ffffffffffffffffffffffffffffffffffffffff8316937401000000000000000000000000000000000000000090930463ffffffff16929085565b6040805173ffffffffffffffffffffffffffffffffffffffff909616865263ffffffff9094166020860152928401919091526060830152608082015260a0016101ce565b6003546103829060ff1681565b60405190151581526020016101ce565b61027561073d565b6102b96103a8366004611e1c565b61083a565b60005473ffffffffffffffffffffffffffffffffffffffff1661023d565b610275610940565b6102756103e1366004611b41565b610972565b60035461038290610100900460ff1681565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b61027561042d366004611db4565b610e50565b610275610440366004611ef0565b610ea7565b6004546005546006546007546040805194855263ffffffff80851660208701526401000000008504811691860191909152680100000000000000008404811660608601526c01000000000000000000000000840416608085015260ff700100000000000000000000000000000000909304831660a085015260c08401919091521660e0820152610100016101ce565b6001546104fc9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016101ce565b61027561051f366004611afc565b611252565b610275610532366004611b17565b611266565b6102b960025481565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105f2576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6105fc828261133b565b5050565b610608611546565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60035460009060ff166106a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff1615610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b60006107216115c9565b90506107348363ffffffff163a8361173d565b9150505b919050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146107be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016105e9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60035460009060ff166108a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff161561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b60006109256115c9565b90506109388463ffffffff16848361173d565b949350505050565b610948611546565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60035460ff166109de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff1615610a50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610aef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b00000000000000000060448201526064016105e9565b60008080610aff84860186611dd1565b9250925092506000610b108461185e565b90506000610b1c6115c9565b90506000610b318663ffffffff163a8461173d565b905080891015610b9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f7700000000000000000000000000000000000000000060448201526064016105e9565b60075460ff1663ffffffff85161115610c12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f206869676800000000000000000000000000000060448201526064016105e9565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635d3b1d306006547f000000000000000000000000000000000000000000000000000000000000000089600560089054906101000a900463ffffffff16898d610c94919061206f565b610c9e919061206f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b168152600481019490945267ffffffffffffffff909216602484015261ffff16604483015263ffffffff90811660648301528816608482015260a401602060405180830381600087803b158015610d1d57600080fd5b505af1158015610d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d559190611bea565b90506040518060a001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018863ffffffff1681526020013a81526020018481526020018b8152506008600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff160217905550604082015181600101556060820151816002015560808201518160030155905050806002819055505050505050505050505050565b610e58611546565b6001805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b610eaf611546565b6005805460ff808616700100000000000000000000000000000000027fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff63ffffffff8981166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff918c166801000000000000000002919091167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff909516949094179390931792909216919091179091556006839055600780549183167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00928316179055600380549091166001179055604080517fc3f909d4000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163c3f909d4916004828101926080929190829003018186803b15801561103257600080fd5b505afa158015611046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106a9190611c03565b50600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f356dac7100000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163356dac71916004808301926020929190829003018186803b15801561112857600080fd5b505afa15801561113c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111609190611bea565b6004819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635fbbc0d26040518163ffffffff1660e01b81526004016101206040518083038186803b1580156111cd57600080fd5b505afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112059190611e3a565b50506005805463ffffffff909816640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909816979097179096555050505050505050505050565b61125a611546565b6112638161187c565b50565b61126e611546565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b1580156112fe57600080fd5b505af1158015611312573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113369190611bc8565b505050565b6000828152600860208181526040808420815160a081018352815473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008304168387015260018401805495840195909552600284018054606085015260038501805460808601528b8a52979096527fffffffffffffffff000000000000000000000000000000000000000000000000909116909255918590559184905592909155815116611458576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016105e9565b600080631fe543e360e01b8585604051602401611476929190612009565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060006114f0846020015163ffffffff16856000015184611972565b90508061153e57835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146115c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016105e9565b565b600554604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009263ffffffff161515918391829173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163feaf968c9160048082019260a092909190829003018186803b15801561166357600080fd5b505afa158015611677573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169b9190611f52565b5094509092508491505080156116c157506116b68242612130565b60055463ffffffff16105b156116cb57506004545b6000811215611736576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b207765692070726963650000000000000000000060448201526064016105e9565b9392505050565b600154600090819061176c9074010000000000000000000000000000000000000000900463ffffffff166119be565b60055463ffffffff6c01000000000000000000000000820481169161179f91680100000000000000009091041688612057565b6117a99190612057565b6117b390866120f3565b6117bd9190612057565b90506000836117d483670de0b6b3a76400006120f3565b6117de91906120bc565b60055490915060009060649061180b90700100000000000000000000000000000000900460ff1682612097565b6118189060ff16846120f3565b61182291906120bc565b60055490915060009061184890640100000000900463ffffffff1664e8d4a510006120f3565b6118529083612057565b98975050505050505050565b600061186b603f836120d0565b61187690600161206f565b92915050565b73ffffffffffffffffffffffffffffffffffffffff81163314156118fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016105e9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561198457600080fd5b61138881039050846040820482031161199c57600080fd5b50823b6119a857600080fd5b60008083516020850160008789f1949350505050565b6000466119ca81611a77565b15611a6e576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b158015611a1857600080fd5b505afa158015611a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a509190611d6a565b5050505091505083608c611a649190612057565b61093890826120f3565b50600092915050565b600061a4b1821480611a8b575062066eed82145b8061187657505062066eee1490565b803573ffffffffffffffffffffffffffffffffffffffff8116811461073857600080fd5b805162ffffff8116811461073857600080fd5b803560ff8116811461073857600080fd5b805169ffffffffffffffffffff8116811461073857600080fd5b600060208284031215611b0e57600080fd5b61173682611a9a565b60008060408385031215611b2a57600080fd5b611b3383611a9a565b946020939093013593505050565b60008060008060608587031215611b5757600080fd5b611b6085611a9a565b935060208501359250604085013567ffffffffffffffff80821115611b8457600080fd5b818701915087601f830112611b9857600080fd5b813581811115611ba757600080fd5b886020828501011115611bb957600080fd5b95989497505060200194505050565b600060208284031215611bda57600080fd5b8151801515811461173657600080fd5b600060208284031215611bfc57600080fd5b5051919050565b60008060008060808587031215611c1957600080fd5b8451611c24816121d4565b6020860151909450611c35816121e4565b6040860151909350611c46816121e4565b6060860151909250611c57816121e4565b939692955090935050565b600060208284031215611c7457600080fd5b5035919050565b60008060408385031215611c8e57600080fd5b8235915060208084013567ffffffffffffffff80821115611cae57600080fd5b818601915086601f830112611cc257600080fd5b813581811115611cd457611cd46121a5565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611d1757611d176121a5565b604052828152858101935084860182860187018b1015611d3657600080fd5b600095505b83861015611d59578035855260019590950194938601938601611d3b565b508096505050505050509250929050565b60008060008060008060c08789031215611d8357600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b600060208284031215611dc657600080fd5b8135611736816121e4565b600080600060608486031215611de657600080fd5b8335611df1816121e4565b92506020840135611e01816121d4565b91506040840135611e11816121e4565b809150509250925092565b60008060408385031215611e2f57600080fd5b8235611b33816121e4565b60008060008060008060008060006101208a8c031215611e5957600080fd5b8951611e64816121e4565b60208b0151909950611e75816121e4565b60408b0151909850611e86816121e4565b60608b0151909750611e97816121e4565b60808b0151909650611ea8816121e4565b9450611eb660a08b01611abe565b9350611ec460c08b01611abe565b9250611ed260e08b01611abe565b9150611ee16101008b01611abe565b90509295985092959850929598565b600080600080600060a08688031215611f0857600080fd5b8535611f13816121e4565b94506020860135611f23816121e4565b9350611f3160408701611ad1565b925060608601359150611f4660808701611ad1565b90509295509295909350565b600080600080600060a08688031215611f6a57600080fd5b611f7386611ae2565b9450602086015193506040860151925060608601519150611f4660808701611ae2565b600060208083528351808285015260005b81811015611fc357858101830151858201604001528201611fa7565b81811115611fd5576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b8181101561204a5784518352938301939183019160010161202e565b5090979650505050505050565b6000821982111561206a5761206a612147565b500190565b600063ffffffff80831681851680830382111561208e5761208e612147565b01949350505050565b600060ff821660ff84168060ff038211156120b4576120b4612147565b019392505050565b6000826120cb576120cb612176565b500490565b600063ffffffff808416806120e7576120e7612176565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561212b5761212b612147565b500290565b60008282101561214257612142612147565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff8116811461126357600080fd5b63ffffffff8116811461126357600080fdfea164736f6c6343000806000a", + Bin: "0x6101206040526001805463ffffffff60a01b1916609160a21b1790553480156200002857600080fd5b5060405162002a3c38038062002a3c8339810160408190526200004b91620002d8565b803380600081620000a35760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d657620000d6816200020f565b5050506001600160601b0319606091821b811660805284821b811660a05283821b811660c0529082901b1660e0526040805163288688f960e21b815290516000916001600160a01b0384169163a21a23e49160048082019260209290919082900301818787803b1580156200014a57600080fd5b505af11580156200015f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000185919062000322565b60c081901b6001600160c01b03191661010052604051631cd0704360e21b81526001600160401b03821660048201523060248201529091506001600160a01b03831690637341c10c90604401600060405180830381600087803b158015620001ec57600080fd5b505af115801562000201573d6000803e3d6000fd5b505050505050505062000354565b6001600160a01b0381163314156200026a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620002d357600080fd5b919050565b600080600060608486031215620002ee57600080fd5b620002f984620002bb565b92506200030960208501620002bb565b91506200031960408501620002bb565b90509250925092565b6000602082840312156200033557600080fd5b81516001600160401b03811681146200034d57600080fd5b9392505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160c01c612655620003e7600039600081816101970152610c5701526000818161028401528181610c1801528181610fee015281816110cf015261116a0152600081816103fd015261161e01526000818161021b01528181610a6a01526112bc01526000818161055801526105c001526126556000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c80638da5cb5b116100e3578063c15ce4d71161008c578063f2fde38b11610066578063f2fde38b14610511578063f3fef3a314610524578063fc2a88c31461053757600080fd5b8063c15ce4d714610432578063c3f909d414610445578063cdd8d885146104d457600080fd5b8063a608a1e1116100bd578063a608a1e1146103e6578063ad178361146103f8578063bf17e5591461041f57600080fd5b80638da5cb5b146103ad578063a3907d71146103cb578063a4c0ed36146103d357600080fd5b80633b2bcbf11161014557806357a8070a1161011f57806357a8070a1461037557806379ba5097146103925780637fb5d19d1461039a57600080fd5b80633b2bcbf11461027f5780634306d354146102a657806348baa1c5146102c757600080fd5b80631b6b6d23116101765780631b6b6d23146102165780631fe543e3146102625780632f2770db1461027757600080fd5b8063030932bb14610192578063181f5a77146101d7575b600080fd5b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b604080518082018252601281527f56524656325772617070657220312e302e300000000000000000000000000000602082015290516101ce91906122c1565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ce565b610275610270366004611fa6565b610540565b005b610275610600565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b6102b96102b43660046120df565b610636565b6040519081526020016101ce565b6103316102d5366004611f8d565b600860205260009081526040902080546001820154600283015460039093015473ffffffffffffffffffffffffffffffffffffffff8316937401000000000000000000000000000000000000000090930463ffffffff16929085565b6040805173ffffffffffffffffffffffffffffffffffffffff909616865263ffffffff9094166020860152928401919091526060830152608082015260a0016101ce565b6003546103829060ff1681565b60405190151581526020016101ce565b61027561073d565b6102b96103a8366004612147565b61083a565b60005473ffffffffffffffffffffffffffffffffffffffff1661023d565b610275610942565b6102756103e1366004611e6c565b610974565b60035461038290610100900460ff1681565b61023d7f000000000000000000000000000000000000000000000000000000000000000081565b61027561042d3660046120df565b610e52565b61027561044036600461221b565b610ea9565b6004546005546006546007546040805194855263ffffffff80851660208701526401000000008504811691860191909152680100000000000000008404811660608601526c01000000000000000000000000840416608085015260ff700100000000000000000000000000000000909304831660a085015260c08401919091521660e0820152610100016101ce565b6001546104fc9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016101ce565b61027561051f366004611e27565b611254565b610275610532366004611e42565b611268565b6102b960025481565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105f2576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6105fc828261133d565b5050565b610608611548565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60035460009060ff166106a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff1615610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b60006107216115cb565b90506107348363ffffffff163a8361173f565b9150505b919050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146107be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016105e9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60035460009060ff166108a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff161561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b60006109256115cb565b90506109388463ffffffff16848361173f565b9150505b92915050565b61094a611548565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60035460ff166109e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e666967757265640000000000000060448201526064016105e9565b600354610100900460ff1615610a52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c65640000000000000000000000000060448201526064016105e9565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610af1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b00000000000000000060448201526064016105e9565b60008080610b01848601866120fc565b9250925092506000610b1284611860565b90506000610b1e6115cb565b90506000610b338663ffffffff163a8461173f565b905080891015610b9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f7700000000000000000000000000000000000000000060448201526064016105e9565b60075460ff1663ffffffff85161115610c14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f206869676800000000000000000000000000000060448201526064016105e9565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635d3b1d306006547f000000000000000000000000000000000000000000000000000000000000000089600560089054906101000a900463ffffffff16898d610c96919061239a565b610ca0919061239a565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b168152600481019490945267ffffffffffffffff909216602484015261ffff16604483015263ffffffff90811660648301528816608482015260a401602060405180830381600087803b158015610d1f57600080fd5b505af1158015610d33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d579190611f15565b90506040518060a001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018863ffffffff1681526020013a81526020018481526020018b8152506008600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff160217905550604082015181600101556060820151816002015560808201518160030155905050806002819055505050505050505050505050565b610e5a611548565b6001805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b610eb1611548565b6005805460ff808616700100000000000000000000000000000000027fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff63ffffffff8981166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff918c166801000000000000000002919091167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff909516949094179390931792909216919091179091556006839055600780549183167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00928316179055600380549091166001179055604080517fc3f909d4000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163c3f909d4916004828101926080929190829003018186803b15801561103457600080fd5b505afa158015611048573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106c9190611f2e565b50600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555050604080517f356dac7100000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169163356dac71916004808301926020929190829003018186803b15801561112a57600080fd5b505afa15801561113e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111629190611f15565b6004819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635fbbc0d26040518163ffffffff1660e01b81526004016101206040518083038186803b1580156111cf57600080fd5b505afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112079190612165565b50506005805463ffffffff909816640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909816979097179096555050505050505050505050565b61125c611548565b61126581611878565b50565b611270611548565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b15801561130057600080fd5b505af1158015611314573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113389190611ef3565b505050565b6000828152600860208181526040808420815160a081018352815473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008304168387015260018401805495840195909552600284018054606085015260038501805460808601528b8a52979096527fffffffffffffffff00000000000000000000000000000000000000000000000090911690925591859055918490559290915581511661145a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e6400000000000000000000000000000060448201526064016105e9565b600080631fe543e360e01b8585604051602401611478929190612334565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060006114f2846020015163ffffffff1685600001518461196e565b90508061154057835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146115c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016105e9565b565b600554604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009263ffffffff161515918391829173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163feaf968c9160048082019260a092909190829003018186803b15801561166557600080fd5b505afa158015611679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169d919061227d565b5094509092508491505080156116c357506116b88242612582565b60055463ffffffff16105b156116cd57506004545b6000811215611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b207765692070726963650000000000000000000060448201526064016105e9565b9392505050565b600154600090819061176e9074010000000000000000000000000000000000000000900463ffffffff166119ba565b60055463ffffffff6c0100000000000000000000000082048116916117a191680100000000000000009091041688612382565b6117ab9190612382565b6117b59086612545565b6117bf9190612382565b90506000836117d683670de0b6b3a7640000612545565b6117e091906123e7565b60055490915060009060649061180d90700100000000000000000000000000000000900460ff16826123c2565b61181a9060ff1684612545565b61182491906123e7565b60055490915060009061184a90640100000000900463ffffffff1664e8d4a51000612545565b6118549083612382565b98975050505050505050565b600061186d603f836123fb565b61093c90600161239a565b73ffffffffffffffffffffffffffffffffffffffff81163314156118f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016105e9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561198057600080fd5b61138881039050846040820482031161199857600080fd5b50823b6119a457600080fd5b60008083516020850160008789f1949350505050565b6000466119c681611a92565b15611a72576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b158015611a1457600080fd5b505afa158015611a28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4c9190612095565b5050505091505083608c611a609190612382565b611a6a9082612545565b949350505050565b611a7b81611ab5565b15611a895761073483611aef565b50600092915050565b600061a4b1821480611aa6575062066eed82145b8061093c57505062066eee1490565b6000600a821480611ac757506101a482145b80611ad4575062aa37dc82145b80611ae0575061210582145b8061093c57505062014a331490565b60008073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663519b4bd36040518163ffffffff1660e01b815260040160206040518083038186803b158015611b4c57600080fd5b505afa158015611b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b849190611f15565b9050600080611b938186612582565b90506000611ba2826010612545565b611bad846004612545565b611bb79190612382565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff16630c18c1626040518163ffffffff1660e01b815260040160206040518083038186803b158015611c1557600080fd5b505afa158015611c29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4d9190611f15565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663f45e65d86040518163ffffffff1660e01b815260040160206040518083038186803b158015611cab57600080fd5b505afa158015611cbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce39190611f15565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015611d4157600080fd5b505afa158015611d55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d799190611f15565b90506000611d8882600a61247f565b905060008184611d988789612382565b611da2908c612545565b611dac9190612545565b611db691906123e7565b9b9a5050505050505050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461073857600080fd5b805162ffffff8116811461073857600080fd5b803560ff8116811461073857600080fd5b805169ffffffffffffffffffff8116811461073857600080fd5b600060208284031215611e3957600080fd5b61173882611dc5565b60008060408385031215611e5557600080fd5b611e5e83611dc5565b946020939093013593505050565b60008060008060608587031215611e8257600080fd5b611e8b85611dc5565b935060208501359250604085013567ffffffffffffffff80821115611eaf57600080fd5b818701915087601f830112611ec357600080fd5b813581811115611ed257600080fd5b886020828501011115611ee457600080fd5b95989497505060200194505050565b600060208284031215611f0557600080fd5b8151801515811461173857600080fd5b600060208284031215611f2757600080fd5b5051919050565b60008060008060808587031215611f4457600080fd5b8451611f4f81612626565b6020860151909450611f6081612636565b6040860151909350611f7181612636565b6060860151909250611f8281612636565b939692955090935050565b600060208284031215611f9f57600080fd5b5035919050565b60008060408385031215611fb957600080fd5b8235915060208084013567ffffffffffffffff80821115611fd957600080fd5b818601915086601f830112611fed57600080fd5b813581811115611fff57611fff6125f7565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715612042576120426125f7565b604052828152858101935084860182860187018b101561206157600080fd5b600095505b83861015612084578035855260019590950194938601938601612066565b508096505050505050509250929050565b60008060008060008060c087890312156120ae57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b6000602082840312156120f157600080fd5b813561173881612636565b60008060006060848603121561211157600080fd5b833561211c81612636565b9250602084013561212c81612626565b9150604084013561213c81612636565b809150509250925092565b6000806040838503121561215a57600080fd5b8235611e5e81612636565b60008060008060008060008060006101208a8c03121561218457600080fd5b895161218f81612636565b60208b01519099506121a081612636565b60408b01519098506121b181612636565b60608b01519097506121c281612636565b60808b01519096506121d381612636565b94506121e160a08b01611de9565b93506121ef60c08b01611de9565b92506121fd60e08b01611de9565b915061220c6101008b01611de9565b90509295985092959850929598565b600080600080600060a0868803121561223357600080fd5b853561223e81612636565b9450602086013561224e81612636565b935061225c60408701611dfc565b92506060860135915061227160808701611dfc565b90509295509295909350565b600080600080600060a0868803121561229557600080fd5b61229e86611e0d565b945060208601519350604086015192506060860151915061227160808701611e0d565b600060208083528351808285015260005b818110156122ee578581018301518582016040015282016122d2565b81811115612300576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b8181101561237557845183529383019391830191600101612359565b5090979650505050505050565b6000821982111561239557612395612599565b500190565b600063ffffffff8083168185168083038211156123b9576123b9612599565b01949350505050565b600060ff821660ff84168060ff038211156123df576123df612599565b019392505050565b6000826123f6576123f66125c8565b500490565b600063ffffffff80841680612412576124126125c8565b92169190910492915050565b600181815b8085111561247757817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561245d5761245d612599565b8085161561246a57918102915b93841c9390800290612423565b509250929050565b600061173883836000826124955750600161093c565b816124a25750600061093c565b81600181146124b857600281146124c2576124de565b600191505061093c565b60ff8411156124d3576124d3612599565b50506001821b61093c565b5060208310610133831016604e8410600b8410161715612501575081810a61093c565b61250b838361241e565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561253d5761253d612599565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561257d5761257d612599565b500290565b60008282101561259457612594612599565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61ffff8116811461126557600080fd5b63ffffffff8116811461126557600080fdfea164736f6c6343000806000a", } var VRFV2WrapperABI = VRFV2WrapperMetaData.ABI diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go index dcb532440f9..7fe1a766a10 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go @@ -32,7 +32,7 @@ var ( var VRFV2PlusWrapperMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"expectedMinimumLength\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"actualLength\",\"type\":\"uint16\"}],\"name\":\"IncorrectExtraArgsLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LINKPaymentInRequestRandomWordsInNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NativePaymentInOnTokenTransfer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isLinkMode\",\"type\":\"bool\"}],\"name\":\"checkPaymentMode\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b5060405162003126380380620031268339810160408190526200004c9162000323565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200025a565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b6002546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e491600480830192602092919082900301818787803b158015620001a957600080fd5b505af1158015620001be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e491906200036d565b6080819052600254604051632fb1302360e21b8152600481018390523060248201529192506001600160a01b03169063bec4c08c90604401600060405180830381600087803b1580156200023757600080fd5b505af11580156200024c573d6000803e3d6000fd5b505050505050505062000387565b6001600160a01b038116331415620002b55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031e57600080fd5b919050565b6000806000606084860312156200033957600080fd5b620003448462000306565b9250620003546020850162000306565b9150620003646040850162000306565b90509250925092565b6000602082840312156200038057600080fd5b5051919050565b608051612d75620003b1600039600081816101ef0152818161123301526118040152612d756000f3fe6080604052600436106101d85760003560e01c80638ea9811711610102578063bf17e55911610095578063f254bdc711610064578063f254bdc7146106f2578063f2fde38b1461072f578063f3fef3a31461074f578063fc2a88c31461076f57600080fd5b8063bf17e559146105d1578063c3f909d4146105f1578063cdd8d8851461067b578063da4f5e6d146106b557600080fd5b8063a3907d71116100d1578063a3907d711461055d578063a4c0ed3614610572578063a608a1e114610592578063bed41a93146105b157600080fd5b80638ea98117146104dd5780639cfc058e146104fd5780639eccacf614610510578063a02e06161461053d57600080fd5b80634306d3541161017a5780636505965411610149578063650596541461043c57806379ba50971461045c5780637fb5d19d146104715780638da5cb5b1461049157600080fd5b80634306d3541461030757806348baa1c5146103275780634b160935146103f257806357a8070a1461041257600080fd5b806318b6f4c8116101b657806318b6f4c8146102925780631fe543e3146102b25780632f2770db146102d25780633255c456146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f366004612608565b610785565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612aa1565b34801561029e57600080fd5b506102446102ad3660046126a9565b610861565b3480156102be57600080fd5b506102446102cd36600461272d565b6109d8565b3480156102de57600080fd5b50610244610a55565b3480156102f357600080fd5b50610211610302366004612930565b610a8b565b34801561031357600080fd5b50610211610322366004612830565b610b83565b34801561033357600080fd5b506103b16103423660046126fb565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161021b565b3480156103fe57600080fd5b5061021161040d366004612830565b610c8a565b34801561041e57600080fd5b5060085461042c9060ff1681565b604051901515815260200161021b565b34801561044857600080fd5b506102446104573660046125ed565b610d81565b34801561046857600080fd5b50610244610dcc565b34801561047d57600080fd5b5061021161048c366004612930565b610ec9565b34801561049d57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b3480156104e957600080fd5b506102446104f83660046125ed565b610fcf565b61021161050b36600461284b565b6110da565b34801561051c57600080fd5b506002546104b89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561054957600080fd5b506102446105583660046125ed565b61146f565b34801561056957600080fd5b5061024461151a565b34801561057e57600080fd5b5061024461058d366004612632565b61154c565b34801561059e57600080fd5b5060085461042c90610100900460ff1681565b3480156105bd57600080fd5b506102446105cc36600461294c565b611a2c565b3480156105dd57600080fd5b506102446105ec366004612830565b611b82565b3480156105fd57600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e08201526101000161021b565b34801561068757600080fd5b506007546106a090640100000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106c157600080fd5b506006546104b8906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106fe57600080fd5b506007546104b8906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561073b57600080fd5b5061024461074a3660046125ed565b611bc9565b34801561075b57600080fd5b5061024461076a366004612608565b611bdd565b34801561077b57600080fd5b5061021160045481565b61078d611cd8565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107e7576040519150601f19603f3d011682016040523d82523d6000602084013e6107ec565b606091505b505090508061085c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b81516108a2578061089e576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b8151602411156108f35781516040517f51200dce0000000000000000000000000000000000000000000000000000000081526108539160249160040161ffff92831681529116602082015260400190565b60008260238151811061090857610908612cfc565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f010000000000000000000000000000000000000000000000000000000000000014905080801561095e5750815b15610995576040517f6048aa6800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b801580156109a1575081155b1561085c576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025473ffffffffffffffffffffffffffffffffffffffff163314610a4b576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610853565b61089e8282611d5b565b610a5d611cd8565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff16610afa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610b6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b610b7c8363ffffffff1683611f43565b9392505050565b60085460009060ff16610bf2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610c64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6000610c6e612019565b9050610c818363ffffffff163a83612179565b9150505b919050565b60085460009060ff16610cf9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610d6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b610d7b8263ffffffff163a611f43565b92915050565b610d89611cd8565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610853565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16610f38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610faa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6000610fb4612019565b9050610fc78463ffffffff168483612179565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331480159061100f575060025473ffffffffffffffffffffffffffffffffffffffff163314155b15611093573361103460005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610853565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600061111b83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250610861915050565b60006111268761226b565b9050600061113a8863ffffffff163a611f43565b9050803410156111a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610853565b6008546301000000900460ff1663ffffffff87161115611222576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610853565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff89169181019190915260075460009190606082019063ffffffff1661127f868d612bc6565b6112899190612bc6565b63ffffffff1681526020018863ffffffff16815260200187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e9061132f908490600401612ab4565b602060405180830381600087803b15801561134957600080fd5b505af115801561135d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113819190612714565b6040805160608101825233815263ffffffff808d16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff91909116171792909216919091179055935050505095945050505050565b611477611cd8565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16156114d7576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611522611cd8565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff166115b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff161561162a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146116bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610853565b60008080806116cc858701876128c1565b93509350935093506116df816001610861565b60006116ea8561226b565b905060006116f6612019565b9050600061170b8763ffffffff163a84612179565b9050808a1015611777576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610853565b6008546301000000900460ff1663ffffffff861611156117f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610853565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff88169181019190915260075460009190606082019063ffffffff16611850878c612bc6565b61185a9190612bc6565b63ffffffff908116825288166020820152604090810187905260025490517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e906118ce908590600401612ab4565b602060405180830381600087803b1580156118e857600080fd5b505af11580156118fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119209190612714565b905060405180606001604052808e73ffffffffffffffffffffffffffffffffffffffff1681526020018a63ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050508060048190555050505050505050505050505050565b611a34611cd8565b6007805463ffffffff9a8b167fffffffffffffffffffffffffffffffffffffffff00000000ffffffff000000009091161768010000000000000000998b168a02179055600880546003979097557fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9096166201000060ff988916027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009590971694909402959095177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117909355600680546005949094557fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff9187167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009094169390931764010000000094871694909402939093179290921691909316909102179055565b611b8a611cd8565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b611bd1611cd8565b611bda81612283565b50565b611be5611cd8565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611c6a57600080fd5b505af1158015611c7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca2919061268c565b61089e576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611d59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610853565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611e55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610853565b600080631fe543e360e01b8585604051602401611e73929190612b11565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611eed846020015163ffffffff16856000015184612379565b905080611f3b57835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6007546000908190611f6290640100000000900463ffffffff166123c5565b60075463ffffffff680100000000000000008204811691611f84911687612bae565b611f8e9190612bae565b611f989085612c4a565b611fa29190612bae565b6008549091508190600090606490611fc39062010000900460ff1682612bee565b611fd09060ff1684612c4a565b611fda9190612c13565b6006549091506000906120049068010000000000000000900463ffffffff1664e8d4a51000612c4a565b61200e9083612bae565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b1580156120a657600080fd5b505afa1580156120ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120de91906129e6565b50945090925084915050801561210457506120f98242612c87565b60065463ffffffff16105b1561210e57506005545b6000811215610b7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610853565b600754600090819061219890640100000000900463ffffffff166123c5565b60075463ffffffff6801000000000000000082048116916121ba911688612bae565b6121c49190612bae565b6121ce9086612c4a565b6121d89190612bae565b90506000836121ef83670de0b6b3a7640000612c4a565b6121f99190612c13565b6008549091506000906064906122189062010000900460ff1682612bee565b6122259060ff1684612c4a565b61222f9190612c13565b60065490915060009061225590640100000000900463ffffffff1664e8d4a51000612c4a565b61225f9083612bae565b98975050505050505050565b6000612278603f83612c27565b610d7b906001612bc6565b73ffffffffffffffffffffffffffffffffffffffff8116331415612303576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610853565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561238b57600080fd5b6113888103905084604082048203116123a357600080fd5b50823b6123af57600080fd5b60008083516020850160008789f1949350505050565b6000466123d18161247e565b15612475576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561241f57600080fd5b505afa158015612433573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245791906127e6565b5050505091505083608c61246b9190612bae565b610fc79082612c4a565b50600092915050565b600061a4b1821480612492575062066eed82145b80610d7b57505062066eee1490565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c8557600080fd5b60008083601f8401126124d757600080fd5b50813567ffffffffffffffff8111156124ef57600080fd5b60208301915083602082850101111561250757600080fd5b9250929050565b600082601f83011261251f57600080fd5b813567ffffffffffffffff81111561253957612539612d2b565b61256a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612b5f565b81815284602083860101111561257f57600080fd5b816020850160208301376000918101602001919091529392505050565b803561ffff81168114610c8557600080fd5b803563ffffffff81168114610c8557600080fd5b803560ff81168114610c8557600080fd5b805169ffffffffffffffffffff81168114610c8557600080fd5b6000602082840312156125ff57600080fd5b610b7c826124a1565b6000806040838503121561261b57600080fd5b612624836124a1565b946020939093013593505050565b6000806000806060858703121561264857600080fd5b612651856124a1565b935060208501359250604085013567ffffffffffffffff81111561267457600080fd5b612680878288016124c5565b95989497509550505050565b60006020828403121561269e57600080fd5b8151610b7c81612d5a565b600080604083850312156126bc57600080fd5b823567ffffffffffffffff8111156126d357600080fd5b6126df8582860161250e565b92505060208301356126f081612d5a565b809150509250929050565b60006020828403121561270d57600080fd5b5035919050565b60006020828403121561272657600080fd5b5051919050565b6000806040838503121561274057600080fd5b8235915060208084013567ffffffffffffffff8082111561276057600080fd5b818601915086601f83011261277457600080fd5b81358181111561278657612786612d2b565b8060051b9150612797848301612b5f565b8181528481019084860184860187018b10156127b257600080fd5b600095505b838610156127d55780358352600195909501949186019186016127b7565b508096505050505050509250929050565b60008060008060008060c087890312156127ff57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561284257600080fd5b610b7c826125ae565b60008060008060006080868803121561286357600080fd5b61286c866125ae565b945061287a6020870161259c565b9350612888604087016125ae565b9250606086013567ffffffffffffffff8111156128a457600080fd5b6128b0888289016124c5565b969995985093965092949392505050565b600080600080608085870312156128d757600080fd5b6128e0856125ae565b93506128ee6020860161259c565b92506128fc604086016125ae565b9150606085013567ffffffffffffffff81111561291857600080fd5b6129248782880161250e565b91505092959194509250565b6000806040838503121561294357600080fd5b612624836125ae565b60008060008060008060008060006101208a8c03121561296b57600080fd5b6129748a6125ae565b985061298260208b016125ae565b975061299060408b016125c2565b965060608a013595506129a560808b016125c2565b94506129b360a08b016125ae565b935060c08a013592506129c860e08b016125ae565b91506129d76101008b016125ae565b90509295985092959850929598565b600080600080600060a086880312156129fe57600080fd5b612a07866125d3565b9450602086015193506040860151925060608601519150612a2a608087016125d3565b90509295509295909350565b6000815180845260005b81811015612a5c57602081850181015186830182015201612a40565b81811115612a6e576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610b7c6020830184612a36565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c080840152610fc760e0840182612a36565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612b5257845183529383019391830191600101612b36565b5090979650505050505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612ba657612ba6612d2b565b604052919050565b60008219821115612bc157612bc1612c9e565b500190565b600063ffffffff808316818516808303821115612be557612be5612c9e565b01949350505050565b600060ff821660ff84168060ff03821115612c0b57612c0b612c9e565b019392505050565b600082612c2257612c22612ccd565b500490565b600063ffffffff80841680612c3e57612c3e612ccd565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c8257612c82612c9e565b500290565b600082821015612c9957612c99612c9e565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114611bda57600080fdfea164736f6c6343000806000a", + Bin: "0x60a06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b5060405162003577380380620035778339810160408190526200004c9162000323565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200025a565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b6002546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e491600480830192602092919082900301818787803b158015620001a957600080fd5b505af1158015620001be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e491906200036d565b6080819052600254604051632fb1302360e21b8152600481018390523060248201529192506001600160a01b03169063bec4c08c90604401600060405180830381600087803b1580156200023757600080fd5b505af11580156200024c573d6000803e3d6000fd5b505050505050505062000387565b6001600160a01b038116331415620002b55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031e57600080fd5b919050565b6000806000606084860312156200033957600080fd5b620003448462000306565b9250620003546020850162000306565b9150620003646040850162000306565b90509250925092565b6000602082840312156200038057600080fd5b5051919050565b6080516131c6620003b1600039600081816101ef0152818161122f015261180001526131c66000f3fe6080604052600436106101d85760003560e01c80638ea9811711610102578063bf17e55911610095578063f254bdc711610064578063f254bdc7146106f2578063f2fde38b1461072f578063f3fef3a31461074f578063fc2a88c31461076f57600080fd5b8063bf17e559146105d1578063c3f909d4146105f1578063cdd8d8851461067b578063da4f5e6d146106b557600080fd5b8063a3907d71116100d1578063a3907d711461055d578063a4c0ed3614610572578063a608a1e114610592578063bed41a93146105b157600080fd5b80638ea98117146104dd5780639cfc058e146104fd5780639eccacf614610510578063a02e06161461053d57600080fd5b80634306d3541161017a5780636505965411610149578063650596541461043c57806379ba50971461045c5780637fb5d19d146104715780638da5cb5b1461049157600080fd5b80634306d3541461030757806348baa1c5146103275780634b160935146103f257806357a8070a1461041257600080fd5b806318b6f4c8116101b657806318b6f4c8146102925780631fe543e3146102b25780632f2770db146102d25780633255c456146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f366004612932565b610785565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612dcb565b34801561029e57600080fd5b506102446102ad3660046129d3565b610861565b3480156102be57600080fd5b506102446102cd366004612a57565b6109d8565b3480156102de57600080fd5b50610244610a55565b3480156102f357600080fd5b50610211610302366004612c5a565b610a8b565b34801561031357600080fd5b50610211610322366004612b5a565b610b85565b34801561033357600080fd5b506103b1610342366004612a25565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161021b565b3480156103fe57600080fd5b5061021161040d366004612b5a565b610c8c565b34801561041e57600080fd5b5060085461042c9060ff1681565b604051901515815260200161021b565b34801561044857600080fd5b50610244610457366004612917565b610d7d565b34801561046857600080fd5b50610244610dc8565b34801561047d57600080fd5b5061021161048c366004612c5a565b610ec5565b34801561049d57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b3480156104e957600080fd5b506102446104f8366004612917565b610fcb565b61021161050b366004612b75565b6110d6565b34801561051c57600080fd5b506002546104b89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561054957600080fd5b50610244610558366004612917565b61146b565b34801561056957600080fd5b50610244611516565b34801561057e57600080fd5b5061024461058d36600461295c565b611548565b34801561059e57600080fd5b5060085461042c90610100900460ff1681565b3480156105bd57600080fd5b506102446105cc366004612c76565b611a28565b3480156105dd57600080fd5b506102446105ec366004612b5a565b611b7e565b3480156105fd57600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e08201526101000161021b565b34801561068757600080fd5b506007546106a090640100000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106c157600080fd5b506006546104b8906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106fe57600080fd5b506007546104b8906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561073b57600080fd5b5061024461074a366004612917565b611bc5565b34801561075b57600080fd5b5061024461076a366004612932565b611bd9565b34801561077b57600080fd5b5061021160045481565b61078d611cd4565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107e7576040519150601f19603f3d011682016040523d82523d6000602084013e6107ec565b606091505b505090508061085c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b81516108a2578061089e576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b8151602411156108f35781516040517f51200dce0000000000000000000000000000000000000000000000000000000081526108539160249160040161ffff92831681529116602082015260400190565b6000826023815181106109085761090861314d565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f010000000000000000000000000000000000000000000000000000000000000014905080801561095e5750815b15610995576040517f6048aa6800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b801580156109a1575081155b1561085c576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025473ffffffffffffffffffffffffffffffffffffffff163314610a4b576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610853565b61089e8282611d57565b610a5d611cd4565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff16610afa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610b6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b610b7c8363ffffffff1683611f3f565b90505b92915050565b60085460009060ff16610bf4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610c66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6000610c70612015565b9050610c838363ffffffff163a8361217c565b9150505b919050565b60085460009060ff16610cfb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610d6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b610b7f8263ffffffff163a611f3f565b610d85611cd4565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610853565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16610f34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610fa6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6000610fb0612015565b9050610fc38463ffffffff16848361217c565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331480159061100b575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561108f573361103060005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610853565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600061111783838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250610861915050565b60006111228761226e565b905060006111368863ffffffff163a611f3f565b9050803410156111a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610853565b6008546301000000900460ff1663ffffffff8716111561121e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610853565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff89169181019190915260075460009190606082019063ffffffff1661127b868d612ef0565b6112859190612ef0565b63ffffffff1681526020018863ffffffff16815260200187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e9061132b908490600401612dde565b602060405180830381600087803b15801561134557600080fd5b505af1158015611359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137d9190612a3e565b6040805160608101825233815263ffffffff808d16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff91909116171792909216919091179055935050505095945050505050565b611473611cd4565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16156114d3576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b61151e611cd4565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff166115b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615611626576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146116b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610853565b60008080806116c885870187612beb565b93509350935093506116db816001610861565b60006116e68561226e565b905060006116f2612015565b905060006117078763ffffffff163a8461217c565b9050808a1015611773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610853565b6008546301000000900460ff1663ffffffff861611156117ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610853565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff88169181019190915260075460009190606082019063ffffffff1661184c878c612ef0565b6118569190612ef0565b63ffffffff908116825288166020820152604090810187905260025490517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e906118ca908590600401612dde565b602060405180830381600087803b1580156118e457600080fd5b505af11580156118f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191c9190612a3e565b905060405180606001604052808e73ffffffffffffffffffffffffffffffffffffffff1681526020018a63ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050508060048190555050505050505050505050505050565b611a30611cd4565b6007805463ffffffff9a8b167fffffffffffffffffffffffffffffffffffffffff00000000ffffffff000000009091161768010000000000000000998b168a02179055600880546003979097557fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9096166201000060ff988916027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009590971694909402959095177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117909355600680546005949094557fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff9187167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009094169390931764010000000094871694909402939093179290921691909316909102179055565b611b86611cd4565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b611bcd611cd4565b611bd681612286565b50565b611be1611cd4565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611c6657600080fd5b505af1158015611c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9e91906129b6565b61089e576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611d55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610853565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611e51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610853565b600080631fe543e360e01b8585604051602401611e6f929190612e3b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611ee9846020015163ffffffff1685600001518461237c565b905080611f3757835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6007546000908190611f5e90640100000000900463ffffffff166123c8565b60075463ffffffff680100000000000000008204811691611f80911687612ed8565b611f8a9190612ed8565b611f94908561309b565b611f9e9190612ed8565b6008549091508190600090606490611fbf9062010000900460ff1682612f18565b611fcc9060ff168461309b565b611fd69190612f3d565b6006549091506000906120009068010000000000000000900463ffffffff1664e8d4a5100061309b565b61200a9083612ed8565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b1580156120a257600080fd5b505afa1580156120b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120da9190612d10565b50945090925084915050801561210057506120f582426130d8565b60065463ffffffff16105b1561210a57506005545b6000811215612175576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610853565b9392505050565b600754600090819061219b90640100000000900463ffffffff166123c8565b60075463ffffffff6801000000000000000082048116916121bd911688612ed8565b6121c79190612ed8565b6121d1908661309b565b6121db9190612ed8565b90506000836121f283670de0b6b3a764000061309b565b6121fc9190612f3d565b60085490915060009060649061221b9062010000900460ff1682612f18565b6122289060ff168461309b565b6122329190612f3d565b60065490915060009061225890640100000000900463ffffffff1664e8d4a5100061309b565b6122629083612ed8565b98975050505050505050565b600061227b603f83612f51565b610b7f906001612ef0565b73ffffffffffffffffffffffffffffffffffffffff8116331415612306576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610853565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561238e57600080fd5b6113888103905084604082048203116123a657600080fd5b50823b6123b257600080fd5b60008083516020850160008789f1949350505050565b6000466123d481612498565b15612478576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561242257600080fd5b505afa158015612436573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245a9190612b10565b5050505091505083608c61246e9190612ed8565b610fc3908261309b565b612481816124bb565b1561248f57610c83836124f5565b50600092915050565b600061a4b18214806124ac575062066eed82145b80610b7f57505062066eee1490565b6000600a8214806124cd57506101a482145b806124da575062aa37dc82145b806124e6575061210582145b80610b7f57505062014a331490565b60008073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663519b4bd36040518163ffffffff1660e01b815260040160206040518083038186803b15801561255257600080fd5b505afa158015612566573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258a9190612a3e565b905060008061259981866130d8565b905060006125a882601061309b565b6125b384600461309b565b6125bd9190612ed8565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff16630c18c1626040518163ffffffff1660e01b815260040160206040518083038186803b15801561261b57600080fd5b505afa15801561262f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126539190612a3e565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663f45e65d86040518163ffffffff1660e01b815260040160206040518083038186803b1580156126b157600080fd5b505afa1580156126c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e99190612a3e565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561274757600080fd5b505afa15801561275b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061277f9190612a3e565b9050600061278e82600a612fd5565b90506000818461279e8789612ed8565b6127a8908c61309b565b6127b2919061309b565b6127bc9190612f3d565b9b9a5050505050505050505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c8757600080fd5b60008083601f84011261280157600080fd5b50813567ffffffffffffffff81111561281957600080fd5b60208301915083602082850101111561283157600080fd5b9250929050565b600082601f83011261284957600080fd5b813567ffffffffffffffff8111156128635761286361317c565b61289460207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612e89565b8181528460208386010111156128a957600080fd5b816020850160208301376000918101602001919091529392505050565b803561ffff81168114610c8757600080fd5b803563ffffffff81168114610c8757600080fd5b803560ff81168114610c8757600080fd5b805169ffffffffffffffffffff81168114610c8757600080fd5b60006020828403121561292957600080fd5b610b7c826127cb565b6000806040838503121561294557600080fd5b61294e836127cb565b946020939093013593505050565b6000806000806060858703121561297257600080fd5b61297b856127cb565b935060208501359250604085013567ffffffffffffffff81111561299e57600080fd5b6129aa878288016127ef565b95989497509550505050565b6000602082840312156129c857600080fd5b8151612175816131ab565b600080604083850312156129e657600080fd5b823567ffffffffffffffff8111156129fd57600080fd5b612a0985828601612838565b9250506020830135612a1a816131ab565b809150509250929050565b600060208284031215612a3757600080fd5b5035919050565b600060208284031215612a5057600080fd5b5051919050565b60008060408385031215612a6a57600080fd5b8235915060208084013567ffffffffffffffff80821115612a8a57600080fd5b818601915086601f830112612a9e57600080fd5b813581811115612ab057612ab061317c565b8060051b9150612ac1848301612e89565b8181528481019084860184860187018b1015612adc57600080fd5b600095505b83861015612aff578035835260019590950194918601918601612ae1565b508096505050505050509250929050565b60008060008060008060c08789031215612b2957600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b600060208284031215612b6c57600080fd5b610b7c826128d8565b600080600080600060808688031215612b8d57600080fd5b612b96866128d8565b9450612ba4602087016128c6565b9350612bb2604087016128d8565b9250606086013567ffffffffffffffff811115612bce57600080fd5b612bda888289016127ef565b969995985093965092949392505050565b60008060008060808587031215612c0157600080fd5b612c0a856128d8565b9350612c18602086016128c6565b9250612c26604086016128d8565b9150606085013567ffffffffffffffff811115612c4257600080fd5b612c4e87828801612838565b91505092959194509250565b60008060408385031215612c6d57600080fd5b61294e836128d8565b60008060008060008060008060006101208a8c031215612c9557600080fd5b612c9e8a6128d8565b9850612cac60208b016128d8565b9750612cba60408b016128ec565b965060608a01359550612ccf60808b016128ec565b9450612cdd60a08b016128d8565b935060c08a01359250612cf260e08b016128d8565b9150612d016101008b016128d8565b90509295985092959850929598565b600080600080600060a08688031215612d2857600080fd5b612d31866128fd565b9450602086015193506040860151925060608601519150612d54608087016128fd565b90509295509295909350565b6000815180845260005b81811015612d8657602081850181015186830182015201612d6a565b81811115612d98576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610b7c6020830184612d60565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c080840152610fc360e0840182612d60565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612e7c57845183529383019391830191600101612e60565b5090979650505050505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612ed057612ed061317c565b604052919050565b60008219821115612eeb57612eeb6130ef565b500190565b600063ffffffff808316818516808303821115612f0f57612f0f6130ef565b01949350505050565b600060ff821660ff84168060ff03821115612f3557612f356130ef565b019392505050565b600082612f4c57612f4c61311e565b500490565b600063ffffffff80841680612f6857612f6861311e565b92169190910492915050565b600181815b80851115612fcd57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612fb357612fb36130ef565b80851615612fc057918102915b93841c9390800290612f79565b509250929050565b6000610b7c8383600082612feb57506001610b7f565b81612ff857506000610b7f565b816001811461300e576002811461301857613034565b6001915050610b7f565b60ff841115613029576130296130ef565b50506001821b610b7f565b5060208310610133831016604e8410600b8410161715613057575081810a610b7f565b6130618383612f74565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613093576130936130ef565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130d3576130d36130ef565b500290565b6000828210156130ea576130ea6130ef565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114611bd657600080fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperABI = VRFV2PlusWrapperMetaData.ABI diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 9a27aba379e..5251d94e70c 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -11,6 +11,7 @@ batch_blockhash_store: ../../contracts/solc/v0.8.6/BatchBlockhashStore.abi ../.. batch_vrf_coordinator_v2: ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2.bin d0a54963260d8c1f1bbd984b758285e6027cfb5a7e42701bcb562ab123219332 batch_vrf_coordinator_v2plus: ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2Plus.abi ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2Plus.bin 7bb76ae241cf1b37b41920830b836cb99f1ad33efd7435ca2398ff6cd2fe5d48 blockhash_store: ../../contracts/solc/v0.6/BlockhashStore.abi ../../contracts/solc/v0.6/BlockhashStore.bin a0dc60bcc4bf071033d23fddf7ae936c6a4d1dd81488434b7e24b7aa1fabc37c +chain_specific_util_helper: ../../contracts/solc/v0.8.6/ChainSpecificUtilHelper.abi ../../contracts/solc/v0.8.6/ChainSpecificUtilHelper.bin 5f10664e31abc768f4a37901cae7a3bef90146180f97303e5a1bde5a08d84595 consumer_wrapper: ../../contracts/solc/v0.7/Consumer.abi ../../contracts/solc/v0.7/Consumer.bin 894d1cbd920dccbd36d92918c1037c6ded34f66f417ccb18ec3f33c64ef83ec5 cron_upkeep_factory_wrapper: ../../contracts/solc/v0.8.6/CronUpkeepFactory.abi - dacb0f8cdf54ae9d2781c5e720fc314b32ed5e58eddccff512c75d6067292cd7 cron_upkeep_wrapper: ../../contracts/solc/v0.8.6/CronUpkeep.abi - 362fcfcf30a6ab3acff83095ea4b2b9056dd5e9dcb94bc5411aae58995d22709 @@ -72,8 +73,8 @@ vrf_consumer_v2: ../../contracts/solc/v0.8.6/VRFConsumerV2.abi ../../contracts/s vrf_consumer_v2_plus_upgradeable_example: ../../contracts/solc/v0.8.6/VRFConsumerV2PlusUpgradeableExample.abi ../../contracts/solc/v0.8.6/VRFConsumerV2PlusUpgradeableExample.bin 3155c611e4d6882e9324b6e975033b31356776ea8b031ca63d63da37589d583b vrf_consumer_v2_upgradeable_example: ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample.abi ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample.bin f1790a9a2f2a04c730593e483459709cb89e897f8a19d7a3ac0cfe6a97265e6e vrf_coordinator_mock: ../../contracts/solc/v0.8.6/VRFCoordinatorMock.abi ../../contracts/solc/v0.8.6/VRFCoordinatorMock.bin 5c495cf8df1f46d8736b9150cdf174cce358cb8352f60f0d5bb9581e23920501 -vrf_coordinator_v2: ../../contracts/solc/v0.8.6/VRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2.bin 6ab95dcdf48951b07698abfc53be56c1b571110fcb2b8f72df1256db091a5f0a -vrf_coordinator_v2_5: ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.bin 37ad0cc55dcc417c62de7b798defc17910dd1eda6738f755572189b8134a8b74 +vrf_coordinator_v2: ../../contracts/solc/v0.8.6/VRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2.bin 295f35ce282060317dfd01f45959f5a2b05ba26913e422fbd4fb6bf90b107006 +vrf_coordinator_v2_5: ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2_5.bin b0e7c42a30b36d9d31fa9a3f26bad7937152e3dddee5bd8dd3d121390c879ab6 vrf_coordinator_v2_plus_v2_example: ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus_V2Example.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus_V2Example.bin 4a5b86701983b1b65f0a8dfa116b3f6d75f8f706fa274004b57bdf5992e4cec3 vrf_coordinator_v2plus: ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2Plus.bin e4409bbe361258273458a5c99408b3d7f0cc57a2560dee91c0596cc6d6f738be vrf_coordinator_v2plus_interface: ../../contracts/solc/v0.8.6/IVRFCoordinatorV2PlusInternal.abi ../../contracts/solc/v0.8.6/IVRFCoordinatorV2PlusInternal.bin 834a2ce0e83276372a0e1446593fd89798f4cf6dc95d4be0113e99fadf61558b @@ -90,17 +91,17 @@ vrf_single_consumer_example: ../../contracts/solc/v0.8.6/VRFSingleConsumerExampl vrf_v2plus_load_test_with_metrics: ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.abi ../../contracts/solc/v0.8.6/VRFV2PlusLoadTestWithMetrics.bin 0a89cb7ed9dfb42f91e559b03dc351ccdbe14d281a7ab71c63bd3f47eeed7711 vrf_v2plus_single_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusSingleConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusSingleConsumerExample.bin e2aa4cfef91b1d1869ec1f517b4d41049884e0e25345384c2fccbe08cda3e603 vrf_v2plus_sub_owner: ../../contracts/solc/v0.8.6/VRFV2PlusExternalSubOwnerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusExternalSubOwnerExample.bin 8bc4a8b74d302b9a7a37556d3746105f487c4d3555643721748533d01b1ae5a4 -vrf_v2plus_upgraded_version: ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.bin cb37587e0979a9a668eed8b388dc1d835c9763f699f6b97a77d1c3d35d4f04b6 +vrf_v2plus_upgraded_version: ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2PlusUpgradedVersion.bin c0793d86fb6e45342c4424184fe241c16da960c0b4de76816364b933344d0756 vrfv2_proxy_admin: ../../contracts/solc/v0.8.6/VRFV2ProxyAdmin.abi ../../contracts/solc/v0.8.6/VRFV2ProxyAdmin.bin 30b6d1af9c4ae05daddda2afdab1877d857ab5321afe3540a01e94d5ded9bcef vrfv2_reverting_example: ../../contracts/solc/v0.8.6/VRFV2RevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2RevertingExample.bin 1ae46f80351d428bd85ba58b9041b2a608a1845300d79a8fed83edf96606de87 vrfv2_transparent_upgradeable_proxy: ../../contracts/solc/v0.8.6/VRFV2TransparentUpgradeableProxy.abi ../../contracts/solc/v0.8.6/VRFV2TransparentUpgradeableProxy.bin 84be44ffac513ef5b009d53846b76d3247ceb9fa0545dec2a0dd11606a915850 -vrfv2_wrapper: ../../contracts/solc/v0.8.6/VRFV2Wrapper.abi ../../contracts/solc/v0.8.6/VRFV2Wrapper.bin 7682891b23b7cae7f79803b662556637c52d295c415fbb0708dbec1e5303c01a +vrfv2_wrapper: ../../contracts/solc/v0.8.6/VRFV2Wrapper.abi ../../contracts/solc/v0.8.6/VRFV2Wrapper.bin d5e9a982325d2d4f517c4f2bc818795f61555408ef4b38fb59b923d144970e38 vrfv2_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample.bin 3c5c9f1c501e697a7e77e959b48767e2a0bb1372393fd7686f7aaef3eb794231 vrfv2_wrapper_interface: ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.abi ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.bin ff8560169de171a68b360b7438d13863682d07040d984fd0fb096b2379421003 vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contracts/solc/v0.8.6/VRFV2PlusClient.bin 3ffbfa4971a7e5f46051a26b1722613f265d89ea1867547ecec58500953a9501 vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 2c480a6d7955d33a00690fdd943486d95802e48a03f3cc243df314448e4ddb2c vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin e5ae923d5fdfa916303cd7150b8474ccd912e14bafe950c6431f6ec94821f642 vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 -vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin abbc47c56be3aef960abb9682f71c7a2e46ee7aab9fbe7d47030f01330329de4 +vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 3e1e3836e8c8bf7a6f83f571f17e258f30e6d02037e53eebf74c2af3fbcf0913 vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin 4b3da45ff177e09b1e731b5b0cf4e050033a600ef8b0d32e79eec97db5c72408 vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 4886b08ff9cf013033b7c08e0317f23130ba8e2be445625fdbe1424eb7c38989 diff --git a/core/gethwrappers/go_generate.go b/core/gethwrappers/go_generate.go index 6b1f952961a..0dc1aaef825 100644 --- a/core/gethwrappers/go_generate.go +++ b/core/gethwrappers/go_generate.go @@ -94,8 +94,7 @@ package gethwrappers //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2TransparentUpgradeableProxy.abi ../../contracts/solc/v0.8.6/VRFV2TransparentUpgradeableProxy.bin VRFV2TransparentUpgradeableProxy vrfv2_transparent_upgradeable_proxy //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2ProxyAdmin.abi ../../contracts/solc/v0.8.6/VRFV2ProxyAdmin.bin VRFV2ProxyAdmin vrfv2_proxy_admin - -// VRF V2 Plus +//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/ChainSpecificUtilHelper.abi ../../contracts/solc/v0.8.6/ChainSpecificUtilHelper.bin ChainSpecificUtilHelper chain_specific_util_helper // VRF V2 Wrapper //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2Wrapper.abi ../../contracts/solc/v0.8.6/VRFV2Wrapper.bin VRFV2Wrapper vrfv2_wrapper diff --git a/core/scripts/vrfv2plus/testnet/main.go b/core/scripts/vrfv2plus/testnet/main.go index 00737fd8272..889350a61dd 100644 --- a/core/scripts/vrfv2plus/testnet/main.go +++ b/core/scripts/vrfv2plus/testnet/main.go @@ -11,6 +11,7 @@ import ( "os" "strings" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/chain_specific_util_helper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" @@ -18,6 +19,7 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/shopspring/decimal" @@ -55,6 +57,50 @@ func main() { e := helpers.SetupEnv(false) switch os.Args[1] { + case "csu-deploy": + addr, tx, _, err := chain_specific_util_helper.DeployChainSpecificUtilHelper(e.Owner, e.Ec) + helpers.PanicErr(err) + helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID, "deploying chain specific util helper") + fmt.Println("deployed chain specific util helper at:", addr) + case "csu-block-number": + cmd := flag.NewFlagSet("csu-block-number", flag.ExitOnError) + csuAddress := cmd.String("csu-address", "", "address of the chain specific util helper contract") + helpers.ParseArgs(cmd, os.Args[2:], "csu-address") + csu, err := chain_specific_util_helper.NewChainSpecificUtilHelper(common.HexToAddress(*csuAddress), e.Ec) + helpers.PanicErr(err) + blockNumber, err := csu.GetBlockNumber(nil) + helpers.PanicErr(err) + fmt.Println("block number:", blockNumber) + case "csu-block-hash": + cmd := flag.NewFlagSet("csu-block-hash", flag.ExitOnError) + csuAddress := cmd.String("csu-address", "", "address of the chain specific util helper contract") + blockNumber := cmd.Uint64("block-number", 0, "block number to get the hash of") + helpers.ParseArgs(cmd, os.Args[2:], "csu-address") + csu, err := chain_specific_util_helper.NewChainSpecificUtilHelper(common.HexToAddress(*csuAddress), e.Ec) + helpers.PanicErr(err) + blockHash, err := csu.GetBlockhash(nil, *blockNumber) + helpers.PanicErr(err) + fmt.Println("block hash:", hexutil.Encode(blockHash[:])) + case "csu-current-tx-l1-gas-fees": + cmd := flag.NewFlagSet("csu-current-tx-l1-gas-fees", flag.ExitOnError) + csuAddress := cmd.String("csu-address", "", "address of the chain specific util helper contract") + calldata := cmd.String("calldata", "", "calldata to estimate gas fees for") + helpers.ParseArgs(cmd, os.Args[2:], "csu-address", "calldata") + csu, err := chain_specific_util_helper.NewChainSpecificUtilHelper(common.HexToAddress(*csuAddress), e.Ec) + helpers.PanicErr(err) + gasFees, err := csu.GetCurrentTxL1GasFees(nil, *calldata) + helpers.PanicErr(err) + fmt.Println("gas fees:", gasFees) + case "csu-l1-calldata-gas-cost": + cmd := flag.NewFlagSet("csu-l1-calldata-gas-cost", flag.ExitOnError) + csuAddress := cmd.String("csu-address", "", "address of the chain specific util helper contract") + calldataSize := cmd.String("calldata-size", "", "size of the calldata to estimate gas fees for") + helpers.ParseArgs(cmd, os.Args[2:], "csu-address", "calldata-size") + csu, err := chain_specific_util_helper.NewChainSpecificUtilHelper(common.HexToAddress(*csuAddress), e.Ec) + helpers.PanicErr(err) + gasCost, err := csu.GetL1CalldataGasCost(nil, decimal.RequireFromString(*calldataSize).BigInt()) + helpers.PanicErr(err) + fmt.Println("gas cost:", gasCost) case "smoke": smokeTestVRF(e) case "smoke-bhs": From 5d088a57e3087ea4bf0438886f23b06ce05d1c1d Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Thu, 5 Oct 2023 07:58:09 -0500 Subject: [PATCH 57/84] simplify HealthReport() implementations (#10867) --- common/headtracker/head_broadcaster.go | 2 +- common/headtracker/head_tracker.go | 4 +--- common/txmgr/broadcaster.go | 2 +- common/txmgr/confirmer.go | 2 +- common/txmgr/txmgr.go | 2 +- core/chains/cosmos/chain.go | 9 ++++----- core/chains/evm/chain.go | 4 +--- core/chains/evm/forwarders/forwarder_manager.go | 2 +- core/chains/evm/gas/arbitrum_estimator.go | 5 ++++- core/chains/evm/gas/block_history_estimator.go | 2 +- core/chains/evm/gas/l2_suggested_estimator.go | 2 +- core/chains/evm/gas/models.go | 3 ++- core/chains/evm/gas/rollups/l1_gas_price_oracle.go | 4 +--- core/chains/evm/log/broadcaster.go | 2 +- core/chains/evm/logpoller/log_poller.go | 2 +- core/chains/evm/monitor/balance.go | 2 +- core/chains/solana/chain.go | 2 +- core/chains/starknet/chain.go | 2 +- core/services/job/spawner.go | 2 +- core/services/relay/evm/mercury/transmitter.go | 4 +--- .../synchronization/telemetry_ingress_batch_client.go | 3 +-- .../services/synchronization/telemetry_ingress_client.go | 2 +- core/utils/mailbox_prom.go | 2 +- 23 files changed, 30 insertions(+), 36 deletions(-) diff --git a/common/headtracker/head_broadcaster.go b/common/headtracker/head_broadcaster.go index 704c71cf79b..17d50ef5628 100644 --- a/common/headtracker/head_broadcaster.go +++ b/common/headtracker/head_broadcaster.go @@ -80,7 +80,7 @@ func (hb *HeadBroadcaster[H, BLOCK_HASH]) Name() string { } func (hb *HeadBroadcaster[H, BLOCK_HASH]) HealthReport() map[string]error { - return map[string]error{hb.Name(): hb.StartStopOnce.Healthy()} + return map[string]error{hb.Name(): hb.Healthy()} } func (hb *HeadBroadcaster[H, BLOCK_HASH]) BroadcastNewLongestChain(head H) { diff --git a/common/headtracker/head_tracker.go b/common/headtracker/head_tracker.go index 94f6db6f116..0a7934b542a 100644 --- a/common/headtracker/head_tracker.go +++ b/common/headtracker/head_tracker.go @@ -154,9 +154,7 @@ func (ht *HeadTracker[HTH, S, ID, BLOCK_HASH]) Name() string { } func (ht *HeadTracker[HTH, S, ID, BLOCK_HASH]) HealthReport() map[string]error { - report := map[string]error{ - ht.Name(): ht.StartStopOnce.Healthy(), - } + report := map[string]error{ht.Name(): ht.Healthy()} services.CopyHealth(report, ht.headListener.HealthReport()) return report } diff --git a/common/txmgr/broadcaster.go b/common/txmgr/broadcaster.go index 9eda64f17d6..4f0e92d0bcd 100644 --- a/common/txmgr/broadcaster.go +++ b/common/txmgr/broadcaster.go @@ -270,7 +270,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name } func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) HealthReport() map[string]error { - return map[string]error{eb.Name(): eb.StartStopOnce.Healthy()} + return map[string]error{eb.Name(): eb.Healthy()} } // Trigger forces the monitor for a particular address to recheck for new txes diff --git a/common/txmgr/confirmer.go b/common/txmgr/confirmer.go index 7d4a3c0ce7d..31bba771410 100644 --- a/common/txmgr/confirmer.go +++ b/common/txmgr/confirmer.go @@ -238,7 +238,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Nam } func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HealthReport() map[string]error { - return map[string]error{ec.Name(): ec.StartStopOnce.Healthy()} + return map[string]error{ec.Name(): ec.Healthy()} } func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) runLoop() { diff --git a/common/txmgr/txmgr.go b/common/txmgr/txmgr.go index dbe9e508359..c6388e2a85c 100644 --- a/common/txmgr/txmgr.go +++ b/common/txmgr/txmgr.go @@ -258,7 +258,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Name() str } func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HealthReport() map[string]error { - report := map[string]error{b.Name(): b.StartStopOnce.Healthy()} + report := map[string]error{b.Name(): b.Healthy()} // only query if txm started properly b.IfStarted(func() { diff --git a/core/chains/cosmos/chain.go b/core/chains/cosmos/chain.go index 6323806cc1f..a25ad82a863 100644 --- a/core/chains/cosmos/chain.go +++ b/core/chains/cosmos/chain.go @@ -18,6 +18,7 @@ import ( cosmosclient "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/client" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/db" + "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink-relay/pkg/logger" "github.com/smartcontractkit/chainlink-relay/pkg/loop" @@ -204,11 +205,9 @@ func (c *chain) Ready() error { } func (c *chain) HealthReport() map[string]error { - return map[string]error{ - c.Name(): multierr.Combine( - c.StartStopOnce.Healthy(), - c.txm.Healthy()), - } + m := map[string]error{c.Name(): c.Healthy()} + services.CopyHealth(m, c.txm.HealthReport()) + return m } // ChainService interface diff --git a/core/chains/evm/chain.go b/core/chains/evm/chain.go index dfa67978ddf..ddd9a38c755 100644 --- a/core/chains/evm/chain.go +++ b/core/chains/evm/chain.go @@ -376,9 +376,7 @@ func (c *chain) Name() string { } func (c *chain) HealthReport() map[string]error { - report := map[string]error{ - c.Name(): c.StartStopOnce.Healthy(), - } + report := map[string]error{c.Name(): c.Healthy()} services.CopyHealth(report, c.txm.HealthReport()) services.CopyHealth(report, c.headBroadcaster.HealthReport()) services.CopyHealth(report, c.headTracker.HealthReport()) diff --git a/core/chains/evm/forwarders/forwarder_manager.go b/core/chains/evm/forwarders/forwarder_manager.go index 0c94f1ed601..0c470e76d8c 100644 --- a/core/chains/evm/forwarders/forwarder_manager.go +++ b/core/chains/evm/forwarders/forwarder_manager.go @@ -322,5 +322,5 @@ func (f *FwdMgr) Close() error { } func (f *FwdMgr) HealthReport() map[string]error { - return map[string]error{f.Name(): f.StartStopOnce.Healthy()} + return map[string]error{f.Name(): f.Healthy()} } diff --git a/core/chains/evm/gas/arbitrum_estimator.go b/core/chains/evm/gas/arbitrum_estimator.go index df0c4b8f8cb..01a0e6d29b3 100644 --- a/core/chains/evm/gas/arbitrum_estimator.go +++ b/core/chains/evm/gas/arbitrum_estimator.go @@ -17,6 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -92,7 +93,9 @@ func (a *arbitrumEstimator) Close() error { func (a *arbitrumEstimator) Ready() error { return a.StartStopOnce.Ready() } func (a *arbitrumEstimator) HealthReport() map[string]error { - return map[string]error{a.Name(): a.StartStopOnce.Healthy()} + hp := map[string]error{a.Name(): a.Healthy()} + services.CopyHealth(hp, a.EvmEstimator.HealthReport()) + return hp } // GetLegacyGas estimates both the gas price and the gas limit. diff --git a/core/chains/evm/gas/block_history_estimator.go b/core/chains/evm/gas/block_history_estimator.go index 556c0b1715c..14b18ad66ba 100644 --- a/core/chains/evm/gas/block_history_estimator.go +++ b/core/chains/evm/gas/block_history_estimator.go @@ -243,7 +243,7 @@ func (b *BlockHistoryEstimator) Name() string { return b.logger.Name() } func (b *BlockHistoryEstimator) HealthReport() map[string]error { - return map[string]error{b.Name(): b.StartStopOnce.Healthy()} + return map[string]error{b.Name(): b.Healthy()} } func (b *BlockHistoryEstimator) GetLegacyGas(_ context.Context, _ []byte, gasLimit uint32, maxGasPriceWei *assets.Wei, _ ...feetypes.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint32, err error) { diff --git a/core/chains/evm/gas/l2_suggested_estimator.go b/core/chains/evm/gas/l2_suggested_estimator.go index e59eca2b064..de3081180bc 100644 --- a/core/chains/evm/gas/l2_suggested_estimator.go +++ b/core/chains/evm/gas/l2_suggested_estimator.go @@ -76,7 +76,7 @@ func (o *l2SuggestedPriceEstimator) Close() error { } func (o *l2SuggestedPriceEstimator) HealthReport() map[string]error { - return map[string]error{o.Name(): o.StartStopOnce.Healthy()} + return map[string]error{o.Name(): o.Healthy()} } func (o *l2SuggestedPriceEstimator) run() { diff --git a/core/chains/evm/gas/models.go b/core/chains/evm/gas/models.go index e3a1154c5b5..8286f77a78b 100644 --- a/core/chains/evm/gas/models.go +++ b/core/chains/evm/gas/models.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" + commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" commontypes "github.com/smartcontractkit/chainlink/v2/common/types" @@ -212,7 +213,7 @@ func (e *WrappedEvmEstimator) Ready() error { } func (e *WrappedEvmEstimator) HealthReport() map[string]error { - report := map[string]error{e.Name(): e.StartStopOnce.Healthy()} + report := map[string]error{e.Name(): e.Healthy()} services.CopyHealth(report, e.EvmEstimator.HealthReport()) if e.l1Oracle != nil { services.CopyHealth(report, e.l1Oracle.HealthReport()) diff --git a/core/chains/evm/gas/rollups/l1_gas_price_oracle.go b/core/chains/evm/gas/rollups/l1_gas_price_oracle.go index 13ec5e29dd8..5b0025333cb 100644 --- a/core/chains/evm/gas/rollups/l1_gas_price_oracle.go +++ b/core/chains/evm/gas/rollups/l1_gas_price_oracle.go @@ -110,10 +110,8 @@ func (o *l1GasPriceOracle) Close() error { }) } -func (o *l1GasPriceOracle) Ready() error { return o.StartStopOnce.Ready() } - func (o *l1GasPriceOracle) HealthReport() map[string]error { - return map[string]error{o.Name(): o.StartStopOnce.Healthy()} + return map[string]error{o.Name(): o.Healthy()} } func (o *l1GasPriceOracle) run() { diff --git a/core/chains/evm/log/broadcaster.go b/core/chains/evm/log/broadcaster.go index c7342de01e6..8ee4018f3c5 100644 --- a/core/chains/evm/log/broadcaster.go +++ b/core/chains/evm/log/broadcaster.go @@ -220,7 +220,7 @@ func (b *broadcaster) Name() string { } func (b *broadcaster) HealthReport() map[string]error { - return map[string]error{b.Name(): b.StartStopOnce.Healthy()} + return map[string]error{b.Name(): b.Healthy()} } func (b *broadcaster) awaitInitialSubscribers() { diff --git a/core/chains/evm/logpoller/log_poller.go b/core/chains/evm/logpoller/log_poller.go index 121f62fb1c5..9ce296e1a0b 100644 --- a/core/chains/evm/logpoller/log_poller.go +++ b/core/chains/evm/logpoller/log_poller.go @@ -403,7 +403,7 @@ func (lp *logPoller) Name() string { } func (lp *logPoller) HealthReport() map[string]error { - return map[string]error{lp.Name(): lp.StartStopOnce.Healthy()} + return map[string]error{lp.Name(): lp.Healthy()} } func (lp *logPoller) GetReplayFromBlock(ctx context.Context, requested int64) (int64, error) { diff --git a/core/chains/evm/monitor/balance.go b/core/chains/evm/monitor/balance.go index 2f0509efd75..94434b733e6 100644 --- a/core/chains/evm/monitor/balance.go +++ b/core/chains/evm/monitor/balance.go @@ -91,7 +91,7 @@ func (bm *balanceMonitor) Name() string { } func (bm *balanceMonitor) HealthReport() map[string]error { - return map[string]error{bm.Name(): bm.StartStopOnce.Healthy()} + return map[string]error{bm.Name(): bm.Healthy()} } // OnNewLongestChain checks the balance for each key diff --git a/core/chains/solana/chain.go b/core/chains/solana/chain.go index e8e05f05b8e..9de4adcb57e 100644 --- a/core/chains/solana/chain.go +++ b/core/chains/solana/chain.go @@ -385,7 +385,7 @@ func (c *chain) Ready() error { } func (c *chain) HealthReport() map[string]error { - report := map[string]error{c.Name(): c.StartStopOnce.Healthy()} + report := map[string]error{c.Name(): c.Healthy()} services.CopyHealth(report, c.txm.HealthReport()) return report } diff --git a/core/chains/starknet/chain.go b/core/chains/starknet/chain.go index 765b54fe78e..b99aa9e2ff6 100644 --- a/core/chains/starknet/chain.go +++ b/core/chains/starknet/chain.go @@ -162,7 +162,7 @@ func (c *chain) Ready() error { } func (c *chain) HealthReport() map[string]error { - report := map[string]error{c.Name(): c.StartStopOnce.Healthy()} + report := map[string]error{c.Name(): c.Healthy()} services.CopyHealth(report, c.txm.HealthReport()) return report } diff --git a/core/services/job/spawner.go b/core/services/job/spawner.go index 504bd70ca48..7fe70124890 100644 --- a/core/services/job/spawner.go +++ b/core/services/job/spawner.go @@ -123,7 +123,7 @@ func (js *spawner) Name() string { } func (js *spawner) HealthReport() map[string]error { - return map[string]error{js.Name(): js.StartStopOnce.Healthy()} + return map[string]error{js.Name(): js.Healthy()} } func (js *spawner) startAllServices(ctx context.Context) { diff --git a/core/services/relay/evm/mercury/transmitter.go b/core/services/relay/evm/mercury/transmitter.go index 508c4a7b481..7346fdf3593 100644 --- a/core/services/relay/evm/mercury/transmitter.go +++ b/core/services/relay/evm/mercury/transmitter.go @@ -183,12 +183,10 @@ func (mt *mercuryTransmitter) Close() error { }) } -func (mt *mercuryTransmitter) Ready() error { return mt.StartStopOnce.Ready() } - func (mt *mercuryTransmitter) Name() string { return mt.lggr.Name() } func (mt *mercuryTransmitter) HealthReport() map[string]error { - report := map[string]error{mt.Name(): mt.StartStopOnce.Healthy()} + report := map[string]error{mt.Name(): mt.Healthy()} services.CopyHealth(report, mt.rpcClient.HealthReport()) services.CopyHealth(report, mt.queue.HealthReport()) return report diff --git a/core/services/synchronization/telemetry_ingress_batch_client.go b/core/services/synchronization/telemetry_ingress_batch_client.go index ccafc32bc3d..e56b75b05d3 100644 --- a/core/services/synchronization/telemetry_ingress_batch_client.go +++ b/core/services/synchronization/telemetry_ingress_batch_client.go @@ -40,7 +40,6 @@ func (NoopTelemetryIngressBatchClient) Close() error { return nil } // Send is a no-op func (NoopTelemetryIngressBatchClient) Send(TelemPayload) {} -// Healthy is a no-op func (NoopTelemetryIngressBatchClient) HealthReport() map[string]error { return map[string]error{} } func (NoopTelemetryIngressBatchClient) Name() string { return "NoopTelemetryIngressBatchClient" } @@ -163,7 +162,7 @@ func (tc *telemetryIngressBatchClient) Name() string { } func (tc *telemetryIngressBatchClient) HealthReport() map[string]error { - return map[string]error{tc.Name(): tc.StartStopOnce.Healthy()} + return map[string]error{tc.Name(): tc.Healthy()} } // getCSAPrivateKey gets the client's CSA private key diff --git a/core/services/synchronization/telemetry_ingress_client.go b/core/services/synchronization/telemetry_ingress_client.go index d5b0ed7d93b..d385dc2d954 100644 --- a/core/services/synchronization/telemetry_ingress_client.go +++ b/core/services/synchronization/telemetry_ingress_client.go @@ -111,7 +111,7 @@ func (tc *telemetryIngressClient) Name() string { } func (tc *telemetryIngressClient) HealthReport() map[string]error { - return map[string]error{tc.Name(): tc.StartStopOnce.Healthy()} + return map[string]error{tc.Name(): tc.Healthy()} } func (tc *telemetryIngressClient) connect(ctx context.Context, clientPrivKey []byte) { diff --git a/core/utils/mailbox_prom.go b/core/utils/mailbox_prom.go index 30bb707a2b8..0291a51d2c4 100644 --- a/core/utils/mailbox_prom.go +++ b/core/utils/mailbox_prom.go @@ -58,7 +58,7 @@ func (m *MailboxMonitor) Close() error { } func (m *MailboxMonitor) HealthReport() map[string]error { - return map[string]error{m.Name(): m.StartStopOnce.Healthy()} + return map[string]error{m.Name(): m.Healthy()} } func (m *MailboxMonitor) monitorLoop(ctx context.Context, c <-chan time.Time) { From efcf9f4166050306fd526bff531f45f12c39b901 Mon Sep 17 00:00:00 2001 From: Anirudh Warrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:37:22 +0400 Subject: [PATCH 58/84] Bump build-test-image base-image version to v0.38.2 (#10870) --- .github/actions/build-test-image/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-test-image/action.yml b/.github/actions/build-test-image/action.yml index 4384fe23e65..c4b39b4d7af 100644 --- a/.github/actions/build-test-image/action.yml +++ b/.github/actions/build-test-image/action.yml @@ -48,7 +48,7 @@ runs: file: ./integration-tests/test.Dockerfile build-args: | BASE_IMAGE=${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/test-base-image - IMAGE_VERSION=v0.32.9 + IMAGE_VERSION=v0.38.2 SUITES="${{ inputs.suites }}" AWS_REGION: ${{ inputs.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} From d030e2cbb8ec6949a34b9304f9dab237e234521a Mon Sep 17 00:00:00 2001 From: Jim W Date: Thu, 5 Oct 2023 10:17:15 -0400 Subject: [PATCH 59/84] switch from exp/slices pkg to the stable (#10852) * switch from using the exp_slices pkg to the stable slices pkg * Update core/services/vrf/v2/listener_v2.go Co-authored-by: Jordan Krage * use compare instead of naive responses * add cmp pkg --------- Co-authored-by: Jordan Krage --- common/txmgr/types/tx.go | 2 +- core/chains/cosmos/config.go | 2 +- core/chains/cosmos/cosmostxm/txm.go | 12 ++++++++---- core/chains/evm/config/toml/config.go | 2 +- core/chains/evm/config/toml/defaults.go | 7 +++---- core/chains/evm/gas/arbitrum_estimator.go | 2 +- core/chains/evm/gas/l2_suggested_estimator.go | 2 +- core/chains/evm/gas/rollups/l1_gas_price_oracle.go | 2 +- core/chains/evm/headtracker/head_tracker_test.go | 2 +- core/chains/solana/config.go | 2 +- core/chains/starknet/config.go | 2 +- core/internal/testutils/evmtest/evmtest.go | 2 +- core/services/gateway/common/utils.go | 3 +-- core/services/job/orm.go | 3 +-- core/services/ocr2/plugins/functions/plugin.go | 2 +- core/services/vrf/v2/listener_v2.go | 7 ++++--- 16 files changed, 28 insertions(+), 26 deletions(-) diff --git a/common/txmgr/types/tx.go b/common/txmgr/types/tx.go index 37834d92e0f..d95f07afabc 100644 --- a/common/txmgr/types/tx.go +++ b/common/txmgr/types/tx.go @@ -5,12 +5,12 @@ import ( "encoding/json" "fmt" "math/big" + "slices" "strings" "time" "github.com/google/uuid" "github.com/pkg/errors" - "golang.org/x/exp/slices" "gopkg.in/guregu/null.v4" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" diff --git a/core/chains/cosmos/config.go b/core/chains/cosmos/config.go index fda791d0dc2..8b4c8c13f32 100644 --- a/core/chains/cosmos/config.go +++ b/core/chains/cosmos/config.go @@ -3,13 +3,13 @@ package cosmos import ( "fmt" "net/url" + "slices" "time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pelletier/go-toml/v2" "github.com/shopspring/decimal" "go.uber.org/multierr" - "golang.org/x/exp/slices" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/db" diff --git a/core/chains/cosmos/cosmostxm/txm.go b/core/chains/cosmos/cosmostxm/txm.go index de741e8934f..48d5c2a13ce 100644 --- a/core/chains/cosmos/cosmostxm/txm.go +++ b/core/chains/cosmos/cosmostxm/txm.go @@ -1,14 +1,15 @@ package cosmostxm import ( + "cmp" "context" "encoding/hex" + "slices" "strings" "time" "github.com/gogo/protobuf/proto" "github.com/pkg/errors" - "golang.org/x/exp/slices" "github.com/smartcontractkit/sqlx" @@ -176,12 +177,15 @@ func (e *msgValidator) add(msg adapters.Msg) { } func (e *msgValidator) sortValid() { - slices.SortFunc(e.valid, func(a, b adapters.Msg) bool { + slices.SortFunc(e.valid, func(a, b adapters.Msg) int { ac, bc := a.CreatedAt, b.CreatedAt if ac.Equal(bc) { - return a.ID < b.ID + return cmp.Compare(a.ID, b.ID) } - return ac.Before(bc) + if ac.After(bc) { + return 1 + } + return -1 // ac.Before(bc) }) } diff --git a/core/chains/evm/config/toml/config.go b/core/chains/evm/config/toml/config.go index 8097f752dc5..cf2cde460e5 100644 --- a/core/chains/evm/config/toml/config.go +++ b/core/chains/evm/config/toml/config.go @@ -3,13 +3,13 @@ package toml import ( "fmt" "net/url" + "slices" "strconv" "github.com/ethereum/go-ethereum/core/txpool" "github.com/pelletier/go-toml/v2" "github.com/shopspring/decimal" "go.uber.org/multierr" - "golang.org/x/exp/slices" "gopkg.in/guregu/null.v4" relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" diff --git a/core/chains/evm/config/toml/defaults.go b/core/chains/evm/config/toml/defaults.go index 239a97f585b..68513383585 100644 --- a/core/chains/evm/config/toml/defaults.go +++ b/core/chains/evm/config/toml/defaults.go @@ -5,10 +5,9 @@ import ( "embed" "log" "path/filepath" + "slices" "strings" - "golang.org/x/exp/slices" - "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/utils" configutils "github.com/smartcontractkit/chainlink/v2/core/utils/config" @@ -62,8 +61,8 @@ func init() { defaults[id] = config.Chain defaultNames[id] = strings.ReplaceAll(strings.TrimSuffix(fe.Name(), ".toml"), "_", " ") } - slices.SortFunc(DefaultIDs, func(a, b *utils.Big) bool { - return a.Cmp(b) < 0 + slices.SortFunc(DefaultIDs, func(a, b *utils.Big) int { + return a.Cmp(b) }) } diff --git a/core/chains/evm/gas/arbitrum_estimator.go b/core/chains/evm/gas/arbitrum_estimator.go index 01a0e6d29b3..9c76b76dbae 100644 --- a/core/chains/evm/gas/arbitrum_estimator.go +++ b/core/chains/evm/gas/arbitrum_estimator.go @@ -5,13 +5,13 @@ import ( "fmt" "math" "math/big" + "slices" "sync" "time" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "golang.org/x/exp/slices" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/core/assets" diff --git a/core/chains/evm/gas/l2_suggested_estimator.go b/core/chains/evm/gas/l2_suggested_estimator.go index de3081180bc..1782e349302 100644 --- a/core/chains/evm/gas/l2_suggested_estimator.go +++ b/core/chains/evm/gas/l2_suggested_estimator.go @@ -2,12 +2,12 @@ package gas import ( "context" + "slices" "sync" "time" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" - "golang.org/x/exp/slices" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/core/assets" diff --git a/core/chains/evm/gas/rollups/l1_gas_price_oracle.go b/core/chains/evm/gas/rollups/l1_gas_price_oracle.go index 5b0025333cb..8cf10325d47 100644 --- a/core/chains/evm/gas/rollups/l1_gas_price_oracle.go +++ b/core/chains/evm/gas/rollups/l1_gas_price_oracle.go @@ -5,12 +5,12 @@ import ( "errors" "fmt" "math/big" + "slices" "sync" "time" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" - "golang.org/x/exp/slices" "github.com/smartcontractkit/chainlink/v2/core/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" diff --git a/core/chains/evm/headtracker/head_tracker_test.go b/core/chains/evm/headtracker/head_tracker_test.go index cb438e4c263..c0f40c2213d 100644 --- a/core/chains/evm/headtracker/head_tracker_test.go +++ b/core/chains/evm/headtracker/head_tracker_test.go @@ -4,6 +4,7 @@ import ( "context" "errors" "math/big" + "slices" "sync" "testing" "time" @@ -17,7 +18,6 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "golang.org/x/exp/maps" - "golang.org/x/exp/slices" commonmocks "github.com/smartcontractkit/chainlink/v2/common/types/mocks" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" diff --git a/core/chains/solana/config.go b/core/chains/solana/config.go index b6e4a077f9e..772d660a164 100644 --- a/core/chains/solana/config.go +++ b/core/chains/solana/config.go @@ -3,12 +3,12 @@ package solana import ( "fmt" "net/url" + "slices" "time" "github.com/gagliardetto/solana-go/rpc" "github.com/pelletier/go-toml/v2" "go.uber.org/multierr" - "golang.org/x/exp/slices" relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" diff --git a/core/chains/starknet/config.go b/core/chains/starknet/config.go index 33b2a8d257a..f659cb7af15 100644 --- a/core/chains/starknet/config.go +++ b/core/chains/starknet/config.go @@ -3,11 +3,11 @@ package starknet import ( "fmt" "net/url" + "slices" "time" "github.com/pelletier/go-toml/v2" "go.uber.org/multierr" - "golang.org/x/exp/slices" "github.com/smartcontractkit/chainlink-relay/pkg/types" diff --git a/core/internal/testutils/evmtest/evmtest.go b/core/internal/testutils/evmtest/evmtest.go index 2a86101d0d8..3a08c815166 100644 --- a/core/internal/testutils/evmtest/evmtest.go +++ b/core/internal/testutils/evmtest/evmtest.go @@ -3,6 +3,7 @@ package evmtest import ( "fmt" "math/big" + "slices" "sync" "sync/atomic" "testing" @@ -12,7 +13,6 @@ import ( "github.com/smartcontractkit/sqlx" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "golang.org/x/exp/slices" "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink-relay/pkg/types" diff --git a/core/services/gateway/common/utils.go b/core/services/gateway/common/utils.go index 2e5033432bb..59c67bdcfa1 100644 --- a/core/services/gateway/common/utils.go +++ b/core/services/gateway/common/utils.go @@ -3,8 +3,7 @@ package common import ( "crypto/ecdsa" "encoding/binary" - - "golang.org/x/exp/slices" + "slices" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/job/orm.go b/core/services/job/orm.go index 369ce039ad4..6fb8a532964 100644 --- a/core/services/job/orm.go +++ b/core/services/job/orm.go @@ -6,10 +6,9 @@ import ( "encoding/json" "fmt" "reflect" + "slices" "time" - "golang.org/x/exp/slices" - "github.com/ethereum/go-ethereum/common" "github.com/google/uuid" "github.com/jackc/pgconn" diff --git a/core/services/ocr2/plugins/functions/plugin.go b/core/services/ocr2/plugins/functions/plugin.go index 6cc7da97d00..750b5ad3960 100644 --- a/core/services/ocr2/plugins/functions/plugin.go +++ b/core/services/ocr2/plugins/functions/plugin.go @@ -3,12 +3,12 @@ package functions import ( "encoding/json" "math/big" + "slices" "time" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/smartcontractkit/sqlx" - "golang.org/x/exp/slices" "github.com/smartcontractkit/libocr/commontypes" libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" diff --git a/core/services/vrf/v2/listener_v2.go b/core/services/vrf/v2/listener_v2.go index 7998de557a6..31e76b48fdb 100644 --- a/core/services/vrf/v2/listener_v2.go +++ b/core/services/vrf/v2/listener_v2.go @@ -1,11 +1,13 @@ package v2 import ( + "cmp" "context" "database/sql" "fmt" "math" "math/big" + "slices" "strings" "sync" "time" @@ -20,7 +22,6 @@ import ( heaps "github.com/theodesp/go-heaps" "github.com/theodesp/go-heaps/pairing" "go.uber.org/multierr" - "golang.org/x/exp/slices" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" @@ -503,8 +504,8 @@ func (lsn *listenerV2) processPendingVRFRequests(ctx context.Context) { // first. This allows us to break out of the processing loop as early as possible // in the event that a subscription is too underfunded to have it's // requests processed. - slices.SortFunc(reqs, func(a, b pendingRequest) bool { - return a.req.CallbackGasLimit() < b.req.CallbackGasLimit() + slices.SortFunc(reqs, func(a, b pendingRequest) int { + return cmp.Compare(a.req.CallbackGasLimit(), b.req.CallbackGasLimit()) }) p := lsn.processRequestsPerSub(ctx, sID, startLinkBalance, startEthBalance, reqs, subIsActive) From a808a954300333a6fbde1bd94ac3a74f11206855 Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Thu, 5 Oct 2023 11:31:22 -0400 Subject: [PATCH 60/84] change warns to debugs in streams lookup (#10863) --- .../ocr2/plugins/ocr2keeper/evm21/streams_lookup.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go index 469ee27484c..4c14efeddb7 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go @@ -99,7 +99,7 @@ func (r *EvmRegistry) streamsLookup(ctx context.Context, checkResults []ocr2keep lggr.Infof("at block %d upkeep %s trying to DecodeStreamsLookupRequest performData=%s", block, upkeepId, hexutil.Encode(checkResults[i].PerformData)) streamsLookupErr, err := r.packer.DecodeStreamsLookupRequest(res.PerformData) if err != nil { - lggr.Warnf("at block %d upkeep %s DecodeStreamsLookupRequest failed: %v", block, upkeepId, err) + lggr.Debugf("at block %d upkeep %s DecodeStreamsLookupRequest failed: %v", block, upkeepId, err) // user contract did not revert with StreamsLookup error continue } @@ -111,7 +111,7 @@ func (r *EvmRegistry) streamsLookup(ctx context.Context, checkResults []ocr2keep if len(l.Feeds) == 0 { checkResults[i].IneligibilityReason = uint8(encoding.UpkeepFailureReasonInvalidRevertDataInput) - lggr.Warnf("at block %s upkeep %s has empty feeds array", block, upkeepId) + lggr.Debugf("at block %s upkeep %s has empty feeds array", block, upkeepId) continue } // mercury permission checking for v0.3 is done by mercury server @@ -128,13 +128,13 @@ func (r *EvmRegistry) streamsLookup(ctx context.Context, checkResults []ocr2keep } if !allowed { - lggr.Warnf("at block %d upkeep %s NOT allowed to query Mercury server", block, upkeepId) + lggr.Debugf("at block %d upkeep %s NOT allowed to query Mercury server", block, upkeepId) checkResults[i].IneligibilityReason = uint8(encoding.UpkeepFailureReasonMercuryAccessNotAllowed) continue } } else if l.FeedParamKey != feedIDs || l.TimeParamKey != timestamp { // if mercury version cannot be determined, set failure reason - lggr.Warnf("at block %d upkeep %s NOT allowed to query Mercury server", block, upkeepId) + lggr.Debugf("at block %d upkeep %s NOT allowed to query Mercury server", block, upkeepId) checkResults[i].IneligibilityReason = uint8(encoding.UpkeepFailureReasonInvalidRevertDataInput) continue } From 09dfcf0512c5029538929a9400b1fda7ce130d4e Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Thu, 5 Oct 2023 11:02:40 -0500 Subject: [PATCH 61/84] .github/workflows: print *.race files (#10868) --- .github/workflows/ci-core.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index bba65b443df..ca95d0c55dc 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -100,11 +100,14 @@ jobs: USE_TEE: false run: ./tools/bin/${{ matrix.cmd }} ./... - name: Print Filtered Test Results - if: failure() + if: ${{ failure() && matrix.cmd == 'go_core_tests' }} uses: smartcontractkit/chainlink-github-actions/go/go-test-results-parsing@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13 with: results-file: ./output.txt output-file: ./output-short.txt + - name: Print Races + if: ${{ failure() && matrix.cmd == 'go_core_race_tests' }} + run: find *.race | xargs cat - name: Store logs artifacts if: always() uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 From 38384ec0c5637032599aac9e54070e1761a7671f Mon Sep 17 00:00:00 2001 From: george-dorin <120329946+george-dorin@users.noreply.github.com> Date: Thu, 5 Oct 2023 19:30:30 +0300 Subject: [PATCH 62/84] Move changelog entry from 2.6.0 to dev (#10871) --- docs/CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 724c95af6da..24c0cb6845b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,7 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [dev] -... +### Added + +- Added new configuration field named `LeaseDuration` for `EVM.NodePool` that will periodically check if internal subscriptions are connected to the "best" (as defined by the `SelectionMode`) node and switch to it if necessary. Setting this value to `0s` will disable this feature. ## 2.6.0 - UNRELEASED @@ -18,7 +20,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Simple password use in production builds is now disallowed - nodes with this configuration will not boot and will not pass config validation. - Helper migrations function for injecting env vars into goose migrations. This was done to inject chainID into evm chain id not null in specs migrations. - OCR2 jobs now support querying the state contract for configurations if it has been deployed. This can help on chains such as BSC which "manage" state bloat by arbitrarily deleting logs older than a certain date. In this case, if logs are missing we will query the contract directly and retrieve the latest config from chain state. Chainlink will perform no extra RPC calls unless the job spec has this feature explicitly enabled. On chains that require this, nops may see an increase in RPC calls. This can be enabled for OCR2 jobs by specifying `ConfigContractAddress` in the relay config TOML. -- Added new configuration field named `LeaseDuration` for `EVM.NodePool` that will periodically check if internal subscriptions are connected to the "best" (as defined by the `SelectionMode`) node and switch to it if necessary. Setting this value to `0s` will disable this feature. ### Removed From 05d7b5a2c4afe49250818d48d4733cdcf835583c Mon Sep 17 00:00:00 2001 From: Ilja Pavlovs Date: Thu, 5 Oct 2023 19:51:24 +0300 Subject: [PATCH 63/84] =?UTF-8?q?VRF-599:=20add=20load=20tests;=20test=20r?= =?UTF-8?q?efactoring=20to=20have=20configurable=20setup;=E2=80=A6=20(#108?= =?UTF-8?q?34)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * VRF-599: add load tests; test refactoring to have configurable setup; adding GH Action workflow * VRF-599: PR comments * VRF-599: PR comments --- .../on-demand-vrfv2plus-load-test.yml | 116 +++++++++++++ .../actions/vrfv2_actions/vrfv2_steps.go | 1 + .../vrfv2plus/vrfv2plus_config/config.go | 35 ++++ .../vrfv2plus_constants/constants.go | 40 ----- .../actions/vrfv2plus/vrfv2plus_steps.go | 95 ++++++----- integration-tests/load/vrfv2/cmd/dashboard.go | 3 +- integration-tests/load/vrfv2plus/README.md | 22 +++ .../load/vrfv2plus/cmd/dashboard.go | 99 +++++++++++ integration-tests/load/vrfv2plus/config.go | 74 ++++++++ integration-tests/load/vrfv2plus/config.toml | 27 +++ integration-tests/load/vrfv2plus/gun.go | 56 ++++++ .../load/vrfv2plus/onchain_monitoring.go | 47 +++++ .../load/vrfv2plus/vrfv2plus_test.go | 161 ++++++++++++++++++ integration-tests/smoke/vrfv2plus_test.go | 57 ++++--- 14 files changed, 732 insertions(+), 101 deletions(-) create mode 100644 .github/workflows/on-demand-vrfv2plus-load-test.yml create mode 100644 integration-tests/actions/vrfv2plus/vrfv2plus_config/config.go delete mode 100644 integration-tests/actions/vrfv2plus/vrfv2plus_constants/constants.go create mode 100644 integration-tests/load/vrfv2plus/README.md create mode 100644 integration-tests/load/vrfv2plus/cmd/dashboard.go create mode 100644 integration-tests/load/vrfv2plus/config.go create mode 100644 integration-tests/load/vrfv2plus/config.toml create mode 100644 integration-tests/load/vrfv2plus/gun.go create mode 100644 integration-tests/load/vrfv2plus/onchain_monitoring.go create mode 100644 integration-tests/load/vrfv2plus/vrfv2plus_test.go diff --git a/.github/workflows/on-demand-vrfv2plus-load-test.yml b/.github/workflows/on-demand-vrfv2plus-load-test.yml new file mode 100644 index 00000000000..dcfd2def52d --- /dev/null +++ b/.github/workflows/on-demand-vrfv2plus-load-test.yml @@ -0,0 +1,116 @@ +name: On Demand VRFV2 Plus Load Test +on: + workflow_dispatch: + inputs: + network: + description: Network to run tests on + type: choice + options: + - "ETHEREUM_MAINNET" + - "SIMULATED" + - "SEPOLIA" + - "OPTIMISM_MAINNET" + - "OPTIMISM_GOERLI" + - "ARBITRUM_MAINNET" + - "ARBITRUM_GOERLI" + - "BSC_MAINNET" + - "BSC_TESTNET" + - "POLYGON_MAINNET" + - "MUMBAI" + - "AVALANCHE_FUJI" + - "AVALANCHE_MAINNET" + fundingPrivateKey: + description: Private funding key (Skip for Simulated) + required: false + type: string + wsURL: + description: WS URL for the network (Skip for Simulated) + required: false + type: string + httpURL: + description: HTTP URL for the network (Skip for Simulated) + required: false + type: string + chainlinkImage: + description: Container image location for the Chainlink nodes + required: true + default: public.ecr.aws/chainlink/chainlink + chainlinkVersion: + description: Container image version for the Chainlink nodes + required: true + default: "2.5.0" + testDuration: + description: Duration of the test (time string) + required: false + default: 1m + chainlinkNodeFunding: + description: How much to fund each Chainlink node (in ETH) + required: false + default: ".1" + rps: + description: Requests Per Second + required: false + default: 1 + rateLimitDuration: + description: How long to wait between requests + required: false + default: 1m + randomnessRequestCountPerRequest: + description: Randomness request Count per one TX request + required: false + default: 1 +jobs: + vrfv2plus_load_test: + name: ${{ inputs.network }} VRFV2 Plus Load Test + environment: integration + runs-on: ubuntu20.04-8cores-32GB + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + env: + SELECTED_NETWORKS: ${{ inputs.network }} + VRFV2PLUS_TEST_DURATION: ${{ inputs.testDuration }} + VRFV2PLUS_CHAINLINK_NODE_FUNDING: ${{ inputs.chainlinkNodeFunding }} + VRFV2PLUS_RATE_LIMIT_UNIT_DURATION: ${{ inputs.rateLimitDuration }} + VRFV2PLUS_RPS: ${{ inputs.rps }} + VRFV2PLUS_RANDOMNESS_REQUEST_COUNT_PER_REQUEST: ${{ inputs.randomnessRequestCountPerRequest }} + + TEST_LOG_LEVEL: debug + REF_NAME: ${{ github.head_ref || github.ref_name }} + ENV_JOB_IMAGE_BASE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests + + WASP_LOG_LEVEL: info + steps: + - name: Collect Metrics + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec + with: + basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} + this-job-name: ${{ inputs.network }} VRFV2 Plus Load Test + continue-on-error: true + - name: Get Inputs + run: | + EVM_URLS=$(jq -r '.inputs.wsURL' $GITHUB_EVENT_PATH) + EVM_HTTP_URLS=$(jq -r '.inputs.httpURL' $GITHUB_EVENT_PATH) + EVM_KEYS=$(jq -r '.inputs.fundingPrivateKey' $GITHUB_EVENT_PATH) + + echo ::add-mask::$EVM_URLS + echo ::add-mask::$EVM_HTTP_URLS + echo ::add-mask::$EVM_KEYS + + echo EVM_URLS=$EVM_URLS >> $GITHUB_ENV + echo EVM_HTTP_URLS=$EVM_HTTP_URLS >> $GITHUB_ENV + echo EVM_KEYS=$EVM_KEYS >> $GITHUB_ENV + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Run E2E soak tests + run: | + cd integration-tests/load/vrfv2plus + go test -v -timeout 8h -run TestVRFV2PlusLoad/vrfv2plus_soak_test + diff --git a/integration-tests/actions/vrfv2_actions/vrfv2_steps.go b/integration-tests/actions/vrfv2_actions/vrfv2_steps.go index 4beb49a23cb..96886eb8493 100644 --- a/integration-tests/actions/vrfv2_actions/vrfv2_steps.go +++ b/integration-tests/actions/vrfv2_actions/vrfv2_steps.go @@ -158,6 +158,7 @@ func SetupLocalLoadTestEnv(nodesFunding *big.Float, subFundingLINK *big.Int) (*t WithMockAdapter(). WithCLNodes(1). WithFunding(nodesFunding). + WithLogWatcher(). Build() if err != nil { return nil, nil, [32]byte{}, err diff --git a/integration-tests/actions/vrfv2plus/vrfv2plus_config/config.go b/integration-tests/actions/vrfv2plus/vrfv2plus_config/config.go new file mode 100644 index 00000000000..3c210786bf8 --- /dev/null +++ b/integration-tests/actions/vrfv2plus/vrfv2plus_config/config.go @@ -0,0 +1,35 @@ +package vrfv2plus_config + +import "time" + +type VRFV2PlusConfig struct { + ChainlinkNodeFunding float64 `envconfig:"CHAINLINK_NODE_FUNDING" default:".1"` // Amount of native currency to fund each chainlink node with + IsNativePayment bool `envconfig:"IS_NATIVE_PAYMENT" default:"false"` // Whether to use native payment or LINK token + LinkNativeFeedResponse int64 `envconfig:"LINK_NATIVE_FEED_RESPONSE" default:"1000000000000000000"` // Response of the LINK/ETH feed + MinimumConfirmations uint16 `envconfig:"MINIMUM_CONFIRMATIONS" default:"3"` // Minimum number of confirmations for the VRF Coordinator + SubscriptionFundingAmountLink int64 `envconfig:"SUBSCRIPTION_FUNDING_AMOUNT_LINK" default:"10"` // Amount of LINK to fund the subscription with + SubscriptionFundingAmountNative int64 `envconfig:"SUBSCRIPTION_FUNDING_AMOUNT_NATIVE" default:"1"` // Amount of native currency to fund the subscription with + NumberOfWords uint32 `envconfig:"NUMBER_OF_WORDS" default:"3"` // Number of words to request + CallbackGasLimit uint32 `envconfig:"CALLBACK_GAS_LIMIT" default:"1000000"` // Gas limit for the callback + MaxGasLimitCoordinatorConfig uint32 `envconfig:"MAX_GAS_LIMIT_COORDINATOR_CONFIG" default:"2500000"` // Max gas limit for the VRF Coordinator config + FallbackWeiPerUnitLink int64 `envconfig:"FALLBACK_WEI_PER_UNIT_LINK" default:"60000000000000000"` // Fallback wei per unit LINK for the VRF Coordinator config + StalenessSeconds uint32 `envconfig:"STALENESS_SECONDS" default:"86400"` // Staleness in seconds for the VRF Coordinator config + GasAfterPaymentCalculation uint32 `envconfig:"GAS_AFTER_PAYMENT_CALCULATION" default:"33825"` // Gas after payment calculation for the VRF Coordinator config + FulfillmentFlatFeeLinkPPM uint32 `envconfig:"FULFILLMENT_FLAT_FEE_LINK_PPM" default:"500"` // Flat fee in ppm for LINK for the VRF Coordinator config + FulfillmentFlatFeeNativePPM uint32 `envconfig:"FULFILLMENT_FLAT_FEE_NATIVE_PPM" default:"500"` // Flat fee in ppm for native currency for the VRF Coordinator config + + RandomnessRequestCountPerRequest uint16 `envconfig:"RANDOMNESS_REQUEST_COUNT_PER_REQUEST" default:"1"` // How many randomness requests to send per request + + //Wrapper Config + WrapperGasOverhead uint32 `envconfig:"WRAPPER_GAS_OVERHEAD" default:"50000"` + CoordinatorGasOverhead uint32 `envconfig:"COORDINATOR_GAS_OVERHEAD" default:"52000"` + WrapperPremiumPercentage uint8 `envconfig:"WRAPPER_PREMIUM_PERCENTAGE" default:"25"` + WrapperMaxNumberOfWords uint8 `envconfig:"WRAPPER_MAX_NUMBER_OF_WORDS" default:"10"` + WrapperConsumerFundingAmountNativeToken float64 `envconfig:"WRAPPER_CONSUMER_FUNDING_AMOUNT_NATIVE_TOKEN" default:"1"` + WrapperConsumerFundingAmountLink int64 `envconfig:"WRAPPER_CONSUMER_FUNDING_AMOUNT_LINK" default:"10"` + + //LOAD/SOAK Test Config + TestDuration time.Duration `envconfig:"TEST_DURATION" default:"3m"` // How long to run the test for + RPS int64 `envconfig:"RPS" default:"1"` // How many requests per second to send + RateLimitUnitDuration time.Duration `envconfig:"RATE_LIMIT_UNIT_DURATION" default:"1m"` +} diff --git a/integration-tests/actions/vrfv2plus/vrfv2plus_constants/constants.go b/integration-tests/actions/vrfv2plus/vrfv2plus_constants/constants.go deleted file mode 100644 index bb266e7c2c5..00000000000 --- a/integration-tests/actions/vrfv2plus/vrfv2plus_constants/constants.go +++ /dev/null @@ -1,40 +0,0 @@ -package vrfv2plus_constants - -import ( - "math/big" - - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" -) - -var ( - LinkNativeFeedResponse = big.NewInt(1e18) - MinimumConfirmations = uint16(3) - RandomnessRequestCountPerRequest = uint16(1) - VRFSubscriptionFundingAmountLink = big.NewInt(10) - VRFSubscriptionFundingAmountNativeToken = big.NewInt(1) - ChainlinkNodeFundingAmountNative = big.NewFloat(0.1) - NumberOfWords = uint32(3) - CallbackGasLimit = uint32(1000000) - MaxGasLimitVRFCoordinatorConfig = uint32(2.5e6) - StalenessSeconds = uint32(86400) - GasAfterPaymentCalculation = uint32(33825) - - VRFCoordinatorV2_5FeeConfig = vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ - FulfillmentFlatFeeLinkPPM: 500, - FulfillmentFlatFeeNativePPM: 500, - } - - VRFCoordinatorV2PlusUpgradedVersionFeeConfig = vrf_v2plus_upgraded_version.VRFCoordinatorV2PlusUpgradedVersionFeeConfig{ - FulfillmentFlatFeeLinkPPM: 500, - FulfillmentFlatFeeNativePPM: 500, - } - - WrapperGasOverhead = uint32(50_000) - CoordinatorGasOverhead = uint32(52_000) - WrapperPremiumPercentage = uint8(25) - WrapperMaxNumberOfWords = uint8(10) - WrapperConsumerFundingAmountNativeToken = big.NewFloat(1) - - WrapperConsumerFundingAmountLink = big.NewInt(10) -) diff --git a/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go b/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go index aa6dba8e1b4..0e68f785237 100644 --- a/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go +++ b/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go @@ -12,12 +12,11 @@ import ( "github.com/rs/zerolog" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink/integration-tests/actions" - "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus/vrfv2plus_constants" + "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus/vrfv2plus_config" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" - "github.com/smartcontractkit/chainlink/v2/core/assets" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" chainlinkutils "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -232,6 +231,7 @@ func FundVRFCoordinatorV2_5Subscription(linkToken contracts.LinkToken, coordinat func SetupVRFV2_5Environment( env *test_env.CLClusterTestEnv, + vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig, linkToken contracts.LinkToken, mockNativeLINKFeed contracts.MockETHLINKFeed, consumerContractsAmount int, @@ -243,12 +243,15 @@ func SetupVRFV2_5Environment( } err = vrfv2_5Contracts.Coordinator.SetConfig( - vrfv2plus_constants.MinimumConfirmations, - vrfv2plus_constants.MaxGasLimitVRFCoordinatorConfig, - vrfv2plus_constants.StalenessSeconds, - vrfv2plus_constants.GasAfterPaymentCalculation, - vrfv2plus_constants.LinkNativeFeedResponse, - vrfv2plus_constants.VRFCoordinatorV2_5FeeConfig, + vrfv2PlusConfig.MinimumConfirmations, + vrfv2PlusConfig.MaxGasLimitCoordinatorConfig, + vrfv2PlusConfig.StalenessSeconds, + vrfv2PlusConfig.GasAfterPaymentCalculation, + big.NewInt(vrfv2PlusConfig.LinkNativeFeedResponse), + vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: vrfv2PlusConfig.FulfillmentFlatFeeLinkPPM, + FulfillmentFlatFeeNativePPM: vrfv2PlusConfig.FulfillmentFlatFeeNativePPM, + }, ) if err != nil { return nil, nil, nil, errors.Wrap(err, ErrSetVRFCoordinatorConfig) @@ -278,7 +281,7 @@ func SetupVRFV2_5Environment( if err != nil { return nil, nil, nil, errors.Wrap(err, ErrWaitTXsComplete) } - err = FundSubscription(env, linkToken, vrfv2_5Contracts.Coordinator, subID) + err = FundSubscription(env, vrfv2PlusConfig, linkToken, vrfv2_5Contracts.Coordinator, subID) if err != nil { return nil, nil, nil, err } @@ -310,7 +313,7 @@ func SetupVRFV2_5Environment( nativeTokenPrimaryKeyAddress, pubKeyCompressed, chainID.String(), - vrfv2plus_constants.MinimumConfirmations, + vrfv2PlusConfig.MinimumConfirmations, ) if err != nil { return nil, nil, nil, errors.Wrap(err, ErrCreateVRFV2PlusJobs) @@ -349,6 +352,7 @@ func SetupVRFV2_5Environment( func SetupVRFV2PlusWrapperEnvironment( env *test_env.CLClusterTestEnv, + vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig, linkToken contracts.LinkToken, mockNativeLINKFeed contracts.MockETHLINKFeed, coordinator contracts.VRFCoordinatorV2_5, @@ -373,17 +377,16 @@ func SetupVRFV2PlusWrapperEnvironment( if err != nil { return nil, nil, errors.Wrap(err, ErrWaitTXsComplete) } - err = wrapperContracts.VRFV2PlusWrapper.SetConfig( - vrfv2plus_constants.WrapperGasOverhead, - vrfv2plus_constants.CoordinatorGasOverhead, - vrfv2plus_constants.WrapperPremiumPercentage, + vrfv2PlusConfig.WrapperGasOverhead, + vrfv2PlusConfig.CoordinatorGasOverhead, + vrfv2PlusConfig.WrapperPremiumPercentage, keyHash, - vrfv2plus_constants.WrapperMaxNumberOfWords, - vrfv2plus_constants.StalenessSeconds, - assets.GWei(50_000_000).ToInt(), - vrfv2plus_constants.VRFCoordinatorV2_5FeeConfig.FulfillmentFlatFeeLinkPPM, - vrfv2plus_constants.VRFCoordinatorV2_5FeeConfig.FulfillmentFlatFeeNativePPM, + vrfv2PlusConfig.WrapperMaxNumberOfWords, + vrfv2PlusConfig.StalenessSeconds, + big.NewInt(vrfv2PlusConfig.FallbackWeiPerUnitLink), + vrfv2PlusConfig.FulfillmentFlatFeeLinkPPM, + vrfv2PlusConfig.FulfillmentFlatFeeNativePPM, ) if err != nil { return nil, nil, err @@ -405,7 +408,7 @@ func SetupVRFV2PlusWrapperEnvironment( return nil, nil, errors.Wrap(err, ErrWaitTXsComplete) } - err = FundSubscription(env, linkToken, coordinator, wrapperSubID) + err = FundSubscription(env, vrfv2PlusConfig, linkToken, coordinator, wrapperSubID) if err != nil { return nil, nil, err } @@ -413,7 +416,7 @@ func SetupVRFV2PlusWrapperEnvironment( //fund consumer with Link err = linkToken.Transfer( wrapperContracts.LoadTestConsumers[0].Address(), - big.NewInt(0).Mul(big.NewInt(1e18), vrfv2plus_constants.WrapperConsumerFundingAmountLink), + big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(vrfv2PlusConfig.WrapperConsumerFundingAmountLink)), ) if err != nil { return nil, nil, err @@ -424,7 +427,7 @@ func SetupVRFV2PlusWrapperEnvironment( } //fund consumer with Eth - err = wrapperContracts.LoadTestConsumers[0].Fund(vrfv2plus_constants.WrapperConsumerFundingAmountNativeToken) + err = wrapperContracts.LoadTestConsumers[0].Fund(big.NewFloat(vrfv2PlusConfig.WrapperConsumerFundingAmountNativeToken)) if err != nil { return nil, nil, err } @@ -474,14 +477,20 @@ func GetCoordinatorTotalBalance(coordinator contracts.VRFCoordinatorV2_5) (linkT return } -func FundSubscription(env *test_env.CLClusterTestEnv, linkAddress contracts.LinkToken, coordinator contracts.VRFCoordinatorV2_5, subID *big.Int) error { +func FundSubscription( + env *test_env.CLClusterTestEnv, + vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig, + linkAddress contracts.LinkToken, + coordinator contracts.VRFCoordinatorV2_5, + subID *big.Int, +) error { //Native Billing - err := coordinator.FundSubscriptionWithNative(subID, big.NewInt(0).Mul(vrfv2plus_constants.VRFSubscriptionFundingAmountNativeToken, big.NewInt(1e18))) + err := coordinator.FundSubscriptionWithNative(subID, big.NewInt(0).Mul(big.NewInt(vrfv2PlusConfig.SubscriptionFundingAmountNative), big.NewInt(1e18))) if err != nil { return errors.Wrap(err, ErrFundSubWithNativeToken) } - err = FundVRFCoordinatorV2_5Subscription(linkAddress, coordinator, env.EVMClient, subID, vrfv2plus_constants.VRFSubscriptionFundingAmountLink) + err = FundVRFCoordinatorV2_5Subscription(linkAddress, coordinator, env.EVMClient, subID, big.NewInt(vrfv2PlusConfig.SubscriptionFundingAmountLink)) if err != nil { return errors.Wrap(err, ErrFundSubWithLinkToken) } @@ -499,16 +508,18 @@ func RequestRandomnessAndWaitForFulfillment( vrfv2PlusData *VRFV2PlusData, subID *big.Int, isNativeBilling bool, + vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig, + //todo - should it be here? l zerolog.Logger, ) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled, error) { _, err := consumer.RequestRandomness( vrfv2PlusData.KeyHash, subID, - vrfv2plus_constants.MinimumConfirmations, - vrfv2plus_constants.CallbackGasLimit, + vrfv2PlusConfig.MinimumConfirmations, + vrfv2PlusConfig.CallbackGasLimit, isNativeBilling, - vrfv2plus_constants.NumberOfWords, - vrfv2plus_constants.RandomnessRequestCountPerRequest, + vrfv2PlusConfig.NumberOfWords, + vrfv2PlusConfig.RandomnessRequestCountPerRequest, ) if err != nil { return nil, errors.Wrap(err, ErrRequestRandomness) @@ -523,16 +534,17 @@ func RequestRandomnessAndWaitForFulfillmentUpgraded( vrfv2PlusData *VRFV2PlusData, subID *big.Int, isNativeBilling bool, + vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig, l zerolog.Logger, ) (*vrf_v2plus_upgraded_version.VRFCoordinatorV2PlusUpgradedVersionRandomWordsFulfilled, error) { _, err := consumer.RequestRandomness( vrfv2PlusData.KeyHash, subID, - vrfv2plus_constants.MinimumConfirmations, - vrfv2plus_constants.CallbackGasLimit, + vrfv2PlusConfig.MinimumConfirmations, + vrfv2PlusConfig.CallbackGasLimit, isNativeBilling, - vrfv2plus_constants.NumberOfWords, - vrfv2plus_constants.RandomnessRequestCountPerRequest, + vrfv2PlusConfig.NumberOfWords, + vrfv2PlusConfig.RandomnessRequestCountPerRequest, ) if err != nil { return nil, errors.Wrap(err, ErrRequestRandomness) @@ -583,24 +595,25 @@ func DirectFundingRequestRandomnessAndWaitForFulfillment( vrfv2PlusData *VRFV2PlusData, subID *big.Int, isNativeBilling bool, + vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig, l zerolog.Logger, ) (*vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled, error) { if isNativeBilling { _, err := consumer.RequestRandomnessNative( - vrfv2plus_constants.MinimumConfirmations, - vrfv2plus_constants.CallbackGasLimit, - vrfv2plus_constants.NumberOfWords, - vrfv2plus_constants.RandomnessRequestCountPerRequest, + vrfv2PlusConfig.MinimumConfirmations, + vrfv2PlusConfig.CallbackGasLimit, + vrfv2PlusConfig.NumberOfWords, + vrfv2PlusConfig.RandomnessRequestCountPerRequest, ) if err != nil { return nil, errors.Wrap(err, ErrRequestRandomnessDirectFundingNativePayment) } } else { _, err := consumer.RequestRandomness( - vrfv2plus_constants.MinimumConfirmations, - vrfv2plus_constants.CallbackGasLimit, - vrfv2plus_constants.NumberOfWords, - vrfv2plus_constants.RandomnessRequestCountPerRequest, + vrfv2PlusConfig.MinimumConfirmations, + vrfv2PlusConfig.CallbackGasLimit, + vrfv2PlusConfig.NumberOfWords, + vrfv2PlusConfig.RandomnessRequestCountPerRequest, ) if err != nil { return nil, errors.Wrap(err, ErrRequestRandomnessDirectFundingLinkPayment) diff --git a/integration-tests/load/vrfv2/cmd/dashboard.go b/integration-tests/load/vrfv2/cmd/dashboard.go index f7e29bd7d75..3035da0422f 100644 --- a/integration-tests/load/vrfv2/cmd/dashboard.go +++ b/integration-tests/load/vrfv2/cmd/dashboard.go @@ -8,10 +8,11 @@ import ( "github.com/K-Phoen/grabana/timeseries" "github.com/K-Phoen/grabana/timeseries/axis" "github.com/smartcontractkit/wasp" + "os" ) func main() { - lokiDS := "grafanacloud-logs" + lokiDS := os.Getenv("DATA_SOURCE_NAME") d, err := wasp.NewDashboard(nil, []dashboard.Option{ dashboard.Row("LoadContractMetrics", diff --git a/integration-tests/load/vrfv2plus/README.md b/integration-tests/load/vrfv2plus/README.md new file mode 100644 index 00000000000..1013a3f4c16 --- /dev/null +++ b/integration-tests/load/vrfv2plus/README.md @@ -0,0 +1,22 @@ +### VRFv2Plus Load tests + +## Usage +``` +export LOKI_TOKEN=... +export LOKI_URL=... + +go test -v -run TestVRFV2PlusLoad/vrfv2plus_soak_test +``` + +### Dashboards + +Deploying dashboard: +``` +export GRAFANA_URL=... +export GRAFANA_TOKEN=... +export DATA_SOURCE_NAME=grafanacloud-logs +export DASHBOARD_FOLDER=LoadTests +export DASHBOARD_NAME=${JobTypeName, for example WaspVRFv2Plus} + +go run dashboard.go +``` \ No newline at end of file diff --git a/integration-tests/load/vrfv2plus/cmd/dashboard.go b/integration-tests/load/vrfv2plus/cmd/dashboard.go new file mode 100644 index 00000000000..9a0ba682a18 --- /dev/null +++ b/integration-tests/load/vrfv2plus/cmd/dashboard.go @@ -0,0 +1,99 @@ +package main + +import ( + "github.com/K-Phoen/grabana/dashboard" + "github.com/K-Phoen/grabana/logs" + "github.com/K-Phoen/grabana/row" + "github.com/K-Phoen/grabana/target/prometheus" + "github.com/K-Phoen/grabana/timeseries" + "github.com/K-Phoen/grabana/timeseries/axis" + "github.com/smartcontractkit/wasp" + "os" +) + +func main() { + lokiDS := os.Getenv("DATA_SOURCE_NAME") + d, err := wasp.NewDashboard(nil, + []dashboard.Option{ + dashboard.Row("LoadContractMetrics", + row.WithTimeSeries( + "RequestCount + FulfilmentCount", + timeseries.Span(12), + timeseries.Height("300px"), + timeseries.DataSource(lokiDS), + timeseries.Axis( + axis.Unit("Requests"), + ), + timeseries.WithPrometheusTarget( + ` + last_over_time({type="vrfv2plus_contracts_load_summary", go_test_name=~"${go_test_name:pipe}", branch=~"${branch:pipe}", commit=~"${commit:pipe}", gen_name=~"${gen_name:pipe}"} + | json + | unwrap RequestCount [$__interval]) by (node_id, go_test_name, gen_name) + `, prometheus.Legend("{{go_test_name}} requests"), + ), + timeseries.WithPrometheusTarget( + ` + last_over_time({type="vrfv2plus_contracts_load_summary", go_test_name=~"${go_test_name:pipe}", branch=~"${branch:pipe}", commit=~"${commit:pipe}", gen_name=~"${gen_name:pipe}"} + | json + | unwrap FulfilmentCount [$__interval]) by (node_id, go_test_name, gen_name) + `, prometheus.Legend("{{go_test_name}} fulfillments"), + ), + ), + row.WithTimeSeries( + "Fulfillment time (blocks)", + timeseries.Span(12), + timeseries.Height("300px"), + timeseries.DataSource(lokiDS), + timeseries.Axis( + axis.Unit("Blocks"), + ), + timeseries.WithPrometheusTarget( + ` + last_over_time({type="vrfv2plus_contracts_load_summary", go_test_name=~"${go_test_name:pipe}", branch=~"${branch:pipe}", commit=~"${commit:pipe}", gen_name=~"${gen_name:pipe}"} + | json + | unwrap AverageFulfillmentInMillions [$__interval]) by (node_id, go_test_name, gen_name) / 1e6 + `, prometheus.Legend("{{go_test_name}} avg"), + ), + timeseries.WithPrometheusTarget( + ` + last_over_time({type="vrfv2plus_contracts_load_summary", go_test_name=~"${go_test_name:pipe}", branch=~"${branch:pipe}", commit=~"${commit:pipe}", gen_name=~"${gen_name:pipe}"} + | json + | unwrap SlowestFulfillment [$__interval]) by (node_id, go_test_name, gen_name) + `, prometheus.Legend("{{go_test_name}} slowest"), + ), + timeseries.WithPrometheusTarget( + ` + last_over_time({type="vrfv2plus_contracts_load_summary", go_test_name=~"${go_test_name:pipe}", branch=~"${branch:pipe}", commit=~"${commit:pipe}", gen_name=~"${gen_name:pipe}"} + | json + | unwrap FastestFulfillment [$__interval]) by (node_id, go_test_name, gen_name) + `, prometheus.Legend("{{go_test_name}} fastest"), + ), + ), + ), + dashboard.Row("CL nodes logs", + row.Collapse(), + row.WithLogs( + "CL nodes logs", + logs.DataSource(lokiDS), + logs.Span(12), + logs.Height("300px"), + logs.Transparent(), + logs.WithLokiTarget(` + {type="log_watch"} + `), + )), + }, + ) + if err != nil { + panic(err) + } + // set env vars + //export GRAFANA_URL=... + //export GRAFANA_TOKEN=... + //export DATA_SOURCE_NAME=Loki + //export DASHBOARD_FOLDER=LoadTests + //export DASHBOARD_NAME=Waspvrfv2plus + if _, err := d.Deploy(); err != nil { + panic(err) + } +} diff --git a/integration-tests/load/vrfv2plus/config.go b/integration-tests/load/vrfv2plus/config.go new file mode 100644 index 00000000000..17178a458e6 --- /dev/null +++ b/integration-tests/load/vrfv2plus/config.go @@ -0,0 +1,74 @@ +package loadvrfv2plus + +import ( + "github.com/pelletier/go-toml/v2" + "github.com/pkg/errors" + "github.com/rs/zerolog/log" + "github.com/smartcontractkit/chainlink/v2/core/store/models" + "math/big" + "os" +) + +const ( + DefaultConfigFilename = "config.toml" + + ErrReadPerfConfig = "failed to read TOML config for performance tests" + ErrUnmarshalPerfConfig = "failed to unmarshal TOML config for performance tests" +) + +type PerformanceConfig struct { + Soak *Soak `toml:"Soak"` + Load *Load `toml:"Load"` + SoakVolume *SoakVolume `toml:"SoakVolume"` + LoadVolume *LoadVolume `toml:"LoadVolume"` + Common *Common `toml:"Common"` +} + +type Common struct { + Funding +} + +type Funding struct { + NodeFunds *big.Float `toml:"node_funds"` + SubFunds *big.Int `toml:"sub_funds"` +} + +type Soak struct { + RPS int64 `toml:"rps"` + Duration *models.Duration `toml:"duration"` +} + +type SoakVolume struct { + Products int64 `toml:"products"` + Pace *models.Duration `toml:"pace"` + Duration *models.Duration `toml:"duration"` +} + +type Load struct { + RPSFrom int64 `toml:"rps_from"` + RPSIncrease int64 `toml:"rps_increase"` + RPSSteps int `toml:"rps_steps"` + Duration *models.Duration `toml:"duration"` +} + +type LoadVolume struct { + ProductsFrom int64 `toml:"products_from"` + ProductsIncrease int64 `toml:"products_increase"` + ProductsSteps int `toml:"products_steps"` + Pace *models.Duration `toml:"pace"` + Duration *models.Duration `toml:"duration"` +} + +func ReadConfig() (*PerformanceConfig, error) { + var cfg *PerformanceConfig + d, err := os.ReadFile(DefaultConfigFilename) + if err != nil { + return nil, errors.Wrap(err, ErrReadPerfConfig) + } + err = toml.Unmarshal(d, &cfg) + if err != nil { + return nil, errors.Wrap(err, ErrUnmarshalPerfConfig) + } + log.Debug().Interface("PerformanceConfig", cfg).Msg("Parsed performance config") + return cfg, nil +} diff --git a/integration-tests/load/vrfv2plus/config.toml b/integration-tests/load/vrfv2plus/config.toml new file mode 100644 index 00000000000..03169b4c9d7 --- /dev/null +++ b/integration-tests/load/vrfv2plus/config.toml @@ -0,0 +1,27 @@ +# testing one product (jobs + contracts) by varying RPS +[Soak] +rps = 1 +duration = "1m" + +[Load] +rps_from = 1 +rps_increase = 1 +rps_steps = 10 +duration = "3m" + +# testing multiple products (jobs + contracts) by varying instances, deploying more of the same type with stable RPS for each product +[SoakVolume] +products = 5 +pace = "1s" +duration = "3m" + +[LoadVolume] +products_from = 1 +products_increase = 1 +products_steps = 10 +pace = "1s" +duration = "3m" + +[Common] +node_funds = 10 +sub_funds = 100 diff --git a/integration-tests/load/vrfv2plus/gun.go b/integration-tests/load/vrfv2plus/gun.go new file mode 100644 index 00000000000..f1b15bb5fef --- /dev/null +++ b/integration-tests/load/vrfv2plus/gun.go @@ -0,0 +1,56 @@ +package loadvrfv2plus + +import ( + "github.com/rs/zerolog" + "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus" + "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus/vrfv2plus_config" + "github.com/smartcontractkit/wasp" + "math/big" +) + +/* SingleHashGun is a gun that constantly requests randomness for one feed */ + +type SingleHashGun struct { + contracts *vrfv2plus.VRFV2_5Contracts + keyHash [32]byte + subID *big.Int + vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig + logger zerolog.Logger +} + +func NewSingleHashGun( + contracts *vrfv2plus.VRFV2_5Contracts, + keyHash [32]byte, + subID *big.Int, + vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig, + logger zerolog.Logger, +) *SingleHashGun { + return &SingleHashGun{ + contracts: contracts, + keyHash: keyHash, + subID: subID, + vrfv2PlusConfig: vrfv2PlusConfig, + logger: logger, + } +} + +// Call implements example gun call, assertions on response bodies should be done here +func (m *SingleHashGun) Call(l *wasp.Generator) *wasp.CallResult { + //todo - should work with multiple consumers and consumers having different keyhashes and wallets + _, err := vrfv2plus.RequestRandomnessAndWaitForFulfillment( + m.contracts.LoadTestConsumers[0], + m.contracts.Coordinator, + &vrfv2plus.VRFV2PlusData{VRFV2PlusKeyData: vrfv2plus.VRFV2PlusKeyData{KeyHash: m.keyHash}}, + m.subID, + //todo - make this configurable + m.vrfv2PlusConfig.IsNativePayment, + m.vrfv2PlusConfig, + m.logger, + ) + + if err != nil { + return &wasp.CallResult{Error: err.Error(), Failed: true} + } + + return &wasp.CallResult{} +} diff --git a/integration-tests/load/vrfv2plus/onchain_monitoring.go b/integration-tests/load/vrfv2plus/onchain_monitoring.go new file mode 100644 index 00000000000..b22bf8259d1 --- /dev/null +++ b/integration-tests/load/vrfv2plus/onchain_monitoring.go @@ -0,0 +1,47 @@ +package loadvrfv2plus + +import ( + "context" + "github.com/rs/zerolog/log" + "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus" + "github.com/smartcontractkit/wasp" + "testing" + "time" +) + +/* Monitors on-chain stats of LoadConsumer and pushes them to Loki every second */ + +const ( + LokiTypeLabel = "vrfv2plus_contracts_load_summary" + ErrMetrics = "failed to get VRFv2Plus load test metrics" + ErrLokiClient = "failed to create Loki client for monitoring" + ErrLokiPush = "failed to push monitoring metrics to Loki" +) + +func MonitorLoadStats(t *testing.T, vrfv2PlusContracts *vrfv2plus.VRFV2_5Contracts, labels map[string]string) { + go func() { + updatedLabels := make(map[string]string) + for k, v := range labels { + updatedLabels[k] = v + } + updatedLabels["type"] = LokiTypeLabel + updatedLabels["go_test_name"] = t.Name() + updatedLabels["gen_name"] = "performance" + lc, err := wasp.NewLokiClient(wasp.NewEnvLokiConfig()) + if err != nil { + log.Error().Err(err).Msg(ErrLokiClient) + return + } + for { + time.Sleep(1 * time.Second) + //todo - should work with multiple consumers and consumers having different keyhashes and wallets + metrics, err := vrfv2PlusContracts.LoadTestConsumers[0].GetLoadTestMetrics(context.Background()) + if err != nil { + log.Error().Err(err).Msg(ErrMetrics) + } + if err := lc.HandleStruct(wasp.LabelsMapToModel(updatedLabels), time.Now(), metrics); err != nil { + log.Error().Err(err).Msg(ErrLokiPush) + } + } + }() +} diff --git a/integration-tests/load/vrfv2plus/vrfv2plus_test.go b/integration-tests/load/vrfv2plus/vrfv2plus_test.go new file mode 100644 index 00000000000..ee8be6bd8a5 --- /dev/null +++ b/integration-tests/load/vrfv2plus/vrfv2plus_test.go @@ -0,0 +1,161 @@ +package loadvrfv2plus + +import ( + "context" + "fmt" + "github.com/kelseyhightower/envconfig" + "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink/integration-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus" + "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus/vrfv2plus_config" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" + "github.com/smartcontractkit/wasp" + "github.com/stretchr/testify/require" + "math/big" + "sync" + "testing" + "time" +) + +func TestVRFV2PlusLoad(t *testing.T) { + + var vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig + err := envconfig.Process("VRFV2PLUS", &vrfv2PlusConfig) + require.NoError(t, err) + + l := logging.GetTestLogger(t) + + env, err := test_env.NewCLTestEnvBuilder(). + WithTestLogger(t). + WithGeth(). + WithCLNodes(1). + WithFunding(big.NewFloat(vrfv2PlusConfig.ChainlinkNodeFunding)). + WithLogWatcher(). + Build() + require.NoError(t, err, "error creating test env") + t.Cleanup(func() { + if err := env.Cleanup(t); err != nil { + l.Error().Err(err).Msg("Error cleaning up test environment") + } + }) + + env.ParallelTransactions(true) + + mockETHLinkFeed, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, big.NewInt(vrfv2PlusConfig.LinkNativeFeedResponse)) + require.NoError(t, err, "error deploying mock ETH/LINK feed") + + linkToken, err := actions.DeployLINKToken(env.ContractDeployer) + require.NoError(t, err, "error deploying LINK contract") + + vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2_5Environment(env, vrfv2PlusConfig, linkToken, mockETHLinkFeed, 1) + require.NoError(t, err, "error setting up VRF v2_5 env") + + subscription, err := vrfv2PlusContracts.Coordinator.GetSubscription(context.Background(), subID) + require.NoError(t, err, "error getting subscription information") + + l.Debug(). + Str("Juels Balance", subscription.Balance.String()). + Str("Native Token Balance", subscription.NativeBalance.String()). + Str("Subscription ID", subID.String()). + Str("Subscription Owner", subscription.Owner.String()). + Interface("Subscription Consumers", subscription.Consumers). + Msg("Subscription Data") + + labels := map[string]string{ + "branch": "vrfv2Plus_healthcheck", + "commit": "vrfv2Plus_healthcheck", + } + + l.Info(). + Str("Test Duration", vrfv2PlusConfig.TestDuration.Truncate(time.Second).String()). + Int64("RPS", vrfv2PlusConfig.RPS). + Uint16("RandomnessRequestCountPerRequest", vrfv2PlusConfig.RandomnessRequestCountPerRequest). + Msg("Load Test Configs") + + singleFeedConfig := &wasp.Config{ + T: t, + LoadType: wasp.RPS, + GenName: "gun", + RateLimitUnitDuration: vrfv2PlusConfig.RateLimitUnitDuration, + Gun: NewSingleHashGun( + vrfv2PlusContracts, + vrfv2PlusData.KeyHash, + subID, + vrfv2PlusConfig, + l), + Labels: labels, + LokiConfig: wasp.NewEnvLokiConfig(), + CallTimeout: 2 * time.Minute, + } + + MonitorLoadStats(t, vrfv2PlusContracts, labels) + + // is our "job" stable at all, no memory leaks, no flaking performance under some RPS? + t.Run("vrfv2plus soak test", func(t *testing.T) { + singleFeedConfig.Schedule = wasp.Plain( + vrfv2PlusConfig.RPS, + vrfv2PlusConfig.TestDuration, + ) + _, err := wasp.NewProfile(). + Add(wasp.NewGenerator(singleFeedConfig)). + Run(true) + require.NoError(t, err) + + var wg sync.WaitGroup + + wg.Add(1) + requestCount, fulfilmentCount, err := WaitForRequestCountEqualToFulfilmentCount(vrfv2PlusContracts.LoadTestConsumers[0], 30*time.Second, &wg) + l.Info(). + Interface("Request Count", requestCount). + Interface("Fulfilment Count", fulfilmentCount). + Msg("Final Request/Fulfilment Stats") + require.NoError(t, err) + + wg.Wait() + }) + +} + +func WaitForRequestCountEqualToFulfilmentCount(consumer contracts.VRFv2PlusLoadTestConsumer, timeout time.Duration, wg *sync.WaitGroup) (*big.Int, *big.Int, error) { + metricsChannel := make(chan *contracts.VRFLoadTestMetrics) + metricsErrorChannel := make(chan error) + + testContext, testCancel := context.WithTimeout(context.Background(), timeout) + defer testCancel() + + ticker := time.NewTicker(time.Second * 1) + var metrics *contracts.VRFLoadTestMetrics + for { + select { + case <-testContext.Done(): + ticker.Stop() + wg.Done() + return metrics.RequestCount, metrics.FulfilmentCount, + fmt.Errorf("timeout waiting for rand request and fulfilments to be equal AFTER performance test was executed. Request Count: %d, Fulfilment Count: %d", + metrics.RequestCount.Uint64(), metrics.FulfilmentCount.Uint64()) + case <-ticker.C: + go getLoadTestMetrics(consumer, metricsChannel, metricsErrorChannel) + case metrics = <-metricsChannel: + if metrics.RequestCount.Cmp(metrics.FulfilmentCount) == 0 { + wg.Done() + return metrics.RequestCount, metrics.FulfilmentCount, nil + } + case err := <-metricsErrorChannel: + wg.Done() + return nil, nil, err + } + } +} + +func getLoadTestMetrics( + consumer contracts.VRFv2PlusLoadTestConsumer, + metricsChannel chan *contracts.VRFLoadTestMetrics, + metricsErrorChannel chan error, +) { + metrics, err := consumer.GetLoadTestMetrics(context.Background()) + if err != nil { + metricsErrorChannel <- err + } + metricsChannel <- metrics +} diff --git a/integration-tests/smoke/vrfv2plus_test.go b/integration-tests/smoke/vrfv2plus_test.go index e26a4ed6b1f..c2b99850811 100644 --- a/integration-tests/smoke/vrfv2plus_test.go +++ b/integration-tests/smoke/vrfv2plus_test.go @@ -2,6 +2,8 @@ package smoke import ( "context" + "github.com/kelseyhightower/envconfig" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" "math/big" "testing" "time" @@ -15,19 +17,23 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus" - "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus/vrfv2plus_constants" + "github.com/smartcontractkit/chainlink/integration-tests/actions/vrfv2plus/vrfv2plus_config" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" ) -func TestVRFv2PlusBilling(t *testing.T) { +func TestVRFv2Plus(t *testing.T) { t.Parallel() l := logging.GetTestLogger(t) + var vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig + err := envconfig.Process("VRFV2PLUS", &vrfv2PlusConfig) + require.NoError(t, err) + env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). WithCLNodes(1). - WithFunding(vrfv2plus_constants.ChainlinkNodeFundingAmountNative). + WithFunding(big.NewFloat(vrfv2PlusConfig.ChainlinkNodeFunding)). Build() require.NoError(t, err, "error creating test env") t.Cleanup(func() { @@ -38,13 +44,13 @@ func TestVRFv2PlusBilling(t *testing.T) { env.ParallelTransactions(true) - mockETHLinkFeed, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, vrfv2plus_constants.LinkNativeFeedResponse) + mockETHLinkFeed, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, big.NewInt(vrfv2PlusConfig.LinkNativeFeedResponse)) require.NoError(t, err, "error deploying mock ETH/LINK feed") linkToken, err := actions.DeployLINKToken(env.ContractDeployer) require.NoError(t, err, "error deploying LINK contract") - vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2_5Environment(env, linkToken, mockETHLinkFeed, 1) + vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2_5Environment(env, vrfv2PlusConfig, linkToken, mockETHLinkFeed, 1) require.NoError(t, err, "error setting up VRF v2_5 env") subscription, err := vrfv2PlusContracts.Coordinator.GetSubscription(context.Background(), subID) @@ -72,6 +78,7 @@ func TestVRFv2PlusBilling(t *testing.T) { vrfv2PlusData, subID, isNativeBilling, + vrfv2PlusConfig, l, ) require.NoError(t, err, "error requesting randomness and waiting for fulfilment") @@ -91,7 +98,7 @@ func TestVRFv2PlusBilling(t *testing.T) { require.True(t, status.Fulfilled) l.Debug().Bool("Fulfilment Status", status.Fulfilled).Msg("Random Words Request Fulfilment Status") - require.Equal(t, vrfv2plus_constants.NumberOfWords, uint32(len(status.RandomWords))) + require.Equal(t, vrfv2PlusConfig.NumberOfWords, uint32(len(status.RandomWords))) for _, w := range status.RandomWords { l.Info().Str("Output", w.String()).Msg("Randomness fulfilled") require.Equal(t, 1, w.Cmp(big.NewInt(0)), "Expected the VRF job give an answer bigger than 0") @@ -112,6 +119,7 @@ func TestVRFv2PlusBilling(t *testing.T) { vrfv2PlusData, subID, isNativeBilling, + vrfv2PlusConfig, l, ) require.NoError(t, err, "error requesting randomness and waiting for fulfilment") @@ -130,7 +138,7 @@ func TestVRFv2PlusBilling(t *testing.T) { require.True(t, status.Fulfilled) l.Debug().Bool("Fulfilment Status", status.Fulfilled).Msg("Random Words Request Fulfilment Status") - require.Equal(t, vrfv2plus_constants.NumberOfWords, uint32(len(status.RandomWords))) + require.Equal(t, vrfv2PlusConfig.NumberOfWords, uint32(len(status.RandomWords))) for _, w := range status.RandomWords { l.Info().Str("Output", w.String()).Msg("Randomness fulfilled") require.Equal(t, 1, w.Cmp(big.NewInt(0)), "Expected the VRF job give an answer bigger than 0") @@ -139,6 +147,7 @@ func TestVRFv2PlusBilling(t *testing.T) { wrapperContracts, wrapperSubID, err := vrfv2plus.SetupVRFV2PlusWrapperEnvironment( env, + vrfv2PlusConfig, linkToken, mockETHLinkFeed, vrfv2PlusContracts.Coordinator, @@ -163,6 +172,7 @@ func TestVRFv2PlusBilling(t *testing.T) { vrfv2PlusData, wrapperSubID, isNativeBilling, + vrfv2PlusConfig, l, ) require.NoError(t, err, "error requesting randomness and waiting for fulfilment") @@ -198,7 +208,7 @@ func TestVRFv2PlusBilling(t *testing.T) { Str("TX Hash", randomWordsFulfilledEvent.Raw.TxHash.String()). Msg("Random Words Request Fulfilment Status") - require.Equal(t, vrfv2plus_constants.NumberOfWords, uint32(len(consumerStatus.RandomWords))) + require.Equal(t, vrfv2PlusConfig.NumberOfWords, uint32(len(consumerStatus.RandomWords))) for _, w := range consumerStatus.RandomWords { l.Info().Str("Output", w.String()).Msg("Randomness fulfilled") require.Equal(t, 1, w.Cmp(big.NewInt(0)), "Expected the VRF job give an answer bigger than 0") @@ -221,6 +231,7 @@ func TestVRFv2PlusBilling(t *testing.T) { vrfv2PlusData, wrapperSubID, isNativeBilling, + vrfv2PlusConfig, l, ) require.NoError(t, err, "error requesting randomness and waiting for fulfilment") @@ -256,7 +267,7 @@ func TestVRFv2PlusBilling(t *testing.T) { Str("TX Hash", randomWordsFulfilledEvent.Raw.TxHash.String()). Msg("Random Words Request Fulfilment Status") - require.Equal(t, vrfv2plus_constants.NumberOfWords, uint32(len(consumerStatus.RandomWords))) + require.Equal(t, vrfv2PlusConfig.NumberOfWords, uint32(len(consumerStatus.RandomWords))) for _, w := range consumerStatus.RandomWords { l.Info().Str("Output", w.String()).Msg("Randomness fulfilled") require.Equal(t, 1, w.Cmp(big.NewInt(0)), "Expected the VRF job give an answer bigger than 0") @@ -267,12 +278,15 @@ func TestVRFv2PlusBilling(t *testing.T) { func TestVRFv2PlusMigration(t *testing.T) { t.Parallel() l := logging.GetTestLogger(t) + var vrfv2PlusConfig vrfv2plus_config.VRFV2PlusConfig + err := envconfig.Process("VRFV2PLUS", &vrfv2PlusConfig) + require.NoError(t, err) env, err := test_env.NewCLTestEnvBuilder(). WithTestLogger(t). WithGeth(). WithCLNodes(1). - WithFunding(vrfv2plus_constants.ChainlinkNodeFundingAmountNative). + WithFunding(big.NewFloat(vrfv2PlusConfig.ChainlinkNodeFunding)). Build() require.NoError(t, err, "error creating test env") t.Cleanup(func() { @@ -283,13 +297,13 @@ func TestVRFv2PlusMigration(t *testing.T) { env.ParallelTransactions(true) - mockETHLinkFeedAddress, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, vrfv2plus_constants.LinkNativeFeedResponse) + mockETHLinkFeedAddress, err := actions.DeployMockETHLinkFeed(env.ContractDeployer, big.NewInt(vrfv2PlusConfig.LinkNativeFeedResponse)) require.NoError(t, err, "error deploying mock ETH/LINK feed") linkAddress, err := actions.DeployLINKToken(env.ContractDeployer) require.NoError(t, err, "error deploying LINK contract") - vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2_5Environment(env, linkAddress, mockETHLinkFeedAddress, 2) + vrfv2PlusContracts, subID, vrfv2PlusData, err := vrfv2plus.SetupVRFV2_5Environment(env, vrfv2PlusConfig, linkAddress, mockETHLinkFeedAddress, 2) require.NoError(t, err, "error setting up VRF v2_5 env") subscription, err := vrfv2PlusContracts.Coordinator.GetSubscription(context.Background(), subID) @@ -322,12 +336,15 @@ func TestVRFv2PlusMigration(t *testing.T) { require.NoError(t, err, errors.Wrap(err, vrfv2plus.ErrRegisteringProvingKey)) err = newCoordinator.SetConfig( - vrfv2plus_constants.MinimumConfirmations, - vrfv2plus_constants.MaxGasLimitVRFCoordinatorConfig, - vrfv2plus_constants.StalenessSeconds, - vrfv2plus_constants.GasAfterPaymentCalculation, - vrfv2plus_constants.LinkNativeFeedResponse, - vrfv2plus_constants.VRFCoordinatorV2PlusUpgradedVersionFeeConfig, + vrfv2PlusConfig.MinimumConfirmations, + vrfv2PlusConfig.MaxGasLimitCoordinatorConfig, + vrfv2PlusConfig.StalenessSeconds, + vrfv2PlusConfig.GasAfterPaymentCalculation, + big.NewInt(vrfv2PlusConfig.LinkNativeFeedResponse), + vrf_v2plus_upgraded_version.VRFCoordinatorV2PlusUpgradedVersionFeeConfig{ + FulfillmentFlatFeeLinkPPM: vrfv2PlusConfig.FulfillmentFlatFeeLinkPPM, + FulfillmentFlatFeeNativePPM: vrfv2PlusConfig.FulfillmentFlatFeeNativePPM, + }, ) err = newCoordinator.SetLINKAndLINKNativeFeed(linkAddress.Address(), mockETHLinkFeedAddress.Address()) @@ -341,7 +358,7 @@ func TestVRFv2PlusMigration(t *testing.T) { vrfv2PlusData.PrimaryEthAddress, vrfv2PlusData.VRFKey.Data.ID, vrfv2PlusData.ChainID.String(), - vrfv2plus_constants.MinimumConfirmations, + vrfv2PlusConfig.MinimumConfirmations, ) require.NoError(t, err, vrfv2plus.ErrCreateVRFV2PlusJobs) @@ -438,6 +455,7 @@ func TestVRFv2PlusMigration(t *testing.T) { vrfv2PlusData, subID, false, + vrfv2PlusConfig, l, ) require.NoError(t, err, "error requesting randomness and waiting for fulfilment") @@ -449,6 +467,7 @@ func TestVRFv2PlusMigration(t *testing.T) { vrfv2PlusData, subID, true, + vrfv2PlusConfig, l, ) require.NoError(t, err, "error requesting randomness and waiting for fulfilment") From 59cb265a920436c6d821b462d8a350df063c64d1 Mon Sep 17 00:00:00 2001 From: Anirudh Warrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Fri, 6 Oct 2023 18:02:37 +0400 Subject: [PATCH 64/84] [AUTO-5283] Fix automation benchmark, on-demands tests (#10640) * Increase DB disk space for benchmark test Signed-off-by: anirudhwarrier * update ondemand tests and benchmark test workflows Signed-off-by: anirudhwarrier * add keepers-team codeowners ondemand tests benchmark test workflows Signed-off-by: anirudhwarrier * update P2Pv2Bootstrapper - service name change in helm chart --------- Signed-off-by: anirudhwarrier Co-authored-by: anirudhwarrier --- .github/workflows/automation-benchmark-tests.yml | 2 +- .github/workflows/automation-ondemand-tests.yml | 15 +++++++++++++-- CODEOWNERS | 2 ++ .../actions/automation_ocr_helpers.go | 3 ++- integration-tests/benchmark/keeper_test.go | 4 ++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/automation-benchmark-tests.yml b/.github/workflows/automation-benchmark-tests.yml index 3eb44ea9c65..dc5f538f4ba 100644 --- a/.github/workflows/automation-benchmark-tests.yml +++ b/.github/workflows/automation-benchmark-tests.yml @@ -6,7 +6,7 @@ on: description: Chainlink image version to use required: true type: string - default: 2.0.0 + default: 2.5.0 chainlinkImage: description: Chainlink image repo to use required: true diff --git a/.github/workflows/automation-ondemand-tests.yml b/.github/workflows/automation-ondemand-tests.yml index 438264e222d..71cd08eaf45 100644 --- a/.github/workflows/automation-ondemand-tests.yml +++ b/.github/workflows/automation-ondemand-tests.yml @@ -10,6 +10,16 @@ on: description: Chainlink image repo to use (Leave empty to build from head/ref) required: false type: string + chainlinkVersionUpdate: + description: Chainlink image version to use initially for upgrade test + default: latest + required: true + type: string + chainlinkImageUpdate: + description: Chainlink image repo to use initially for upgrade test + required: true + default: public.ecr.aws/chainlink/chainlink + type: string env: ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} @@ -156,8 +166,8 @@ jobs: echo "upgrade_version=${{ inputs.chainlinkVersion }}" >>$GITHUB_OUTPUT fi if [[ "${{ matrix.tests.name }}" == "upgrade" ]]; then - echo "image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT - echo "version=develop" >>$GITHUB_OUTPUT + echo "image=${{ inputs.chainlinkImageUpdate }}" >>$GITHUB_OUTPUT + echo "version=${{ inputs.chainlinkVersionUpdate }}" >>$GITHUB_OUTPUT fi - name: Run Tests uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13 @@ -174,6 +184,7 @@ jobs: test_download_vendor_packages_command: cd ./integration-tests && go mod download cl_repo: ${{ steps.determine-build.outputs.image }} cl_image_tag: ${{ steps.determine-build.outputs.version }} + aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} artifacts_location: ./integration-tests/${{ matrix.tests.suite }}/logs publish_check_name: Automation On Demand Results ${{ matrix.tests.name }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CODEOWNERS b/CODEOWNERS index 2b2fb18443a..e922010aefd 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -86,6 +86,8 @@ contracts/test/v0.8/functions @smartcontractkit/functions /.github/workflows/integration-chaos-tests.yml @smartcontractkit/test-tooling-team /.github/workflows/integration-tests-publish.yml @smartcontractkit/test-tooling-team /.github/workflows/performance-tests.yml @smartcontractkit/test-tooling-team +/.github/workflows/automation-ondemand-tests.yml @smartcontractkit/keepers +/.github/workflows/automation-benchmark-tests.yml @smartcontractkit/keepers /core/chainlink.Dockerfile @smartcontractkit/prodsec-public diff --git a/integration-tests/actions/automation_ocr_helpers.go b/integration-tests/actions/automation_ocr_helpers.go index 26bf2ac75ed..473ffc2bfca 100644 --- a/integration-tests/actions/automation_ocr_helpers.go +++ b/integration-tests/actions/automation_ocr_helpers.go @@ -201,7 +201,8 @@ func CreateOCRKeeperJobs( } _, err = bootstrapNode.MustCreateJob(bootstrapSpec) require.NoError(t, err, "Shouldn't fail creating bootstrap job on bootstrap node") - P2Pv2Bootstrapper := fmt.Sprintf("%s@%s:%d", bootstrapP2PId, bootstrapNode.Name(), 6690) + // TODO: Use service name returned by chainlink-env once that is available + P2Pv2Bootstrapper := fmt.Sprintf("%s@%s-node-1:%d", bootstrapP2PId, bootstrapNode.Name(), 6690) for nodeIndex := 1; nodeIndex < len(chainlinkNodes); nodeIndex++ { nodeTransmitterAddress, err := chainlinkNodes[nodeIndex].EthAddresses() diff --git a/integration-tests/benchmark/keeper_test.go b/integration-tests/benchmark/keeper_test.go index e016a72576d..0563cf4e097 100644 --- a/integration-tests/benchmark/keeper_test.go +++ b/integration-tests/benchmark/keeper_test.go @@ -81,7 +81,7 @@ LimitDefault = 5_000_000` }, }, "stateful": true, - "capacity": "1Gi", + "capacity": "10Gi", } soakChainlinkResources = map[string]interface{}{ @@ -108,7 +108,7 @@ LimitDefault = 5_000_000` }, }, "stateful": true, - "capacity": "1Gi", + "capacity": "10Gi", } ) From 961cc04bdae4ab19cd2b13e17e7d10c9bf01506f Mon Sep 17 00:00:00 2001 From: Jim W Date: Fri, 6 Oct 2023 11:09:57 -0400 Subject: [PATCH 65/84] switch some exp pkg usage to stable (#10876) * change maps pkg from exp to stable where applicable * replace exp_rand with crypto_rand --- core/internal/features/ocr2/features_ocr2_test.go | 2 +- core/services/blockhashstore/test_util.go | 2 +- core/services/chainlink/config_general_test.go | 3 +-- core/services/ocr2/plugins/s4/integration_test.go | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index 3883e0319ed..0a6192c99c3 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "maps" "math/big" "net/http" "net/http/httptest" @@ -26,7 +27,6 @@ import ( "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/exp/maps" testoffchainaggregator2 "github.com/smartcontractkit/libocr/gethwrappers2/testocr2aggregator" confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" diff --git a/core/services/blockhashstore/test_util.go b/core/services/blockhashstore/test_util.go index 6b7c3836650..0ab07931295 100644 --- a/core/services/blockhashstore/test_util.go +++ b/core/services/blockhashstore/test_util.go @@ -2,11 +2,11 @@ package blockhashstore import ( "context" + "crypto/rand" "math/big" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "golang.org/x/exp/rand" ) type TestCoordinator struct { diff --git a/core/services/chainlink/config_general_test.go b/core/services/chainlink/config_general_test.go index 8e95e389ffc..46931e53e2b 100644 --- a/core/services/chainlink/config_general_test.go +++ b/core/services/chainlink/config_general_test.go @@ -5,13 +5,12 @@ package chainlink import ( _ "embed" "fmt" + "maps" "net/url" "strings" "testing" "time" - maps "golang.org/x/exp/maps" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/core/services/ocr2/plugins/s4/integration_test.go b/core/services/ocr2/plugins/s4/integration_test.go index 01b269e2c85..98ccd312e4b 100644 --- a/core/services/ocr2/plugins/s4/integration_test.go +++ b/core/services/ocr2/plugins/s4/integration_test.go @@ -4,6 +4,7 @@ import ( "context" "crypto/ecdsa" "fmt" + "maps" "math/rand" "testing" "time" @@ -26,7 +27,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/multierr" - "golang.org/x/exp/maps" ) // Disclaimer: this is not a true integration test, it's more of a S4 feature test, on purpose. From 064503ee4e425398878f8345b8da805b4bd5232c Mon Sep 17 00:00:00 2001 From: Makram Date: Fri, 6 Oct 2023 18:45:43 +0300 Subject: [PATCH 66/84] core/scripts/vrfv2plus: pk not required for deploy (#10874) The compressed vrf public key is not required to deploy the VRF universe. Move the code that parses it only if the associated CLI flag is set. --- .../vrfv2plus/testnet/super_scripts.go | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/core/scripts/vrfv2plus/testnet/super_scripts.go b/core/scripts/vrfv2plus/testnet/super_scripts.go index 3f18e18db9a..24a737be111 100644 --- a/core/scripts/vrfv2plus/testnet/super_scripts.go +++ b/core/scripts/vrfv2plus/testnet/super_scripts.go @@ -508,9 +508,7 @@ func deployUniverse(e helpers.Environment) { flatFeeLinkPPM := deployCmd.Int64("flat-fee-link-ppm", 500, "fulfillment flat fee LINK ppm") flatFeeEthPPM := deployCmd.Int64("flat-fee-eth-ppm", 500, "fulfillment flat fee ETH ppm") - helpers.ParseArgs( - deployCmd, os.Args[2:], "uncompressed-pub-key", "oracle-address", - ) + helpers.ParseArgs(deployCmd, os.Args[2:]) fallbackWeiPerUnitLink := decimal.RequireFromString(*fallbackWeiPerUnitLinkString).BigInt() subscriptionBalance := decimal.RequireFromString(*subscriptionBalanceString).BigInt() @@ -520,24 +518,6 @@ func deployUniverse(e helpers.Environment) { *registerKeyUncompressedPubKey = strings.Replace(*registerKeyUncompressedPubKey, "0x", "04", 1) } - // Generate compressed public key and key hash - pubBytes, err := hex.DecodeString(*registerKeyUncompressedPubKey) - helpers.PanicErr(err) - pk, err := crypto.UnmarshalPubkey(pubBytes) - helpers.PanicErr(err) - var pkBytes []byte - if big.NewInt(0).Mod(pk.Y, big.NewInt(2)).Uint64() != 0 { - pkBytes = append(pk.X.Bytes(), 1) - } else { - pkBytes = append(pk.X.Bytes(), 0) - } - var newPK secp256k1.PublicKey - copy(newPK[:], pkBytes) - - compressedPkHex := hexutil.Encode(pkBytes) - keyHash, err := newPK.Hash() - helpers.PanicErr(err) - if len(*linkAddress) == 0 { fmt.Println("\nDeploying LINK Token...") address := helpers.DeployLinkToken(e).String() @@ -594,7 +574,27 @@ func deployUniverse(e helpers.Environment) { fmt.Println("\nConfig set, getting current config from deployed contract...") printCoordinatorConfig(coordinator) + var compressedPkHex string + var keyHash common.Hash if len(*registerKeyUncompressedPubKey) > 0 && len(*registerKeyOracleAddress) > 0 { + // Generate compressed public key and key hash + pubBytes, err := hex.DecodeString(*registerKeyUncompressedPubKey) + helpers.PanicErr(err) + pk, err := crypto.UnmarshalPubkey(pubBytes) + helpers.PanicErr(err) + var pkBytes []byte + if big.NewInt(0).Mod(pk.Y, big.NewInt(2)).Uint64() != 0 { + pkBytes = append(pk.X.Bytes(), 1) + } else { + pkBytes = append(pk.X.Bytes(), 0) + } + var newPK secp256k1.PublicKey + copy(newPK[:], pkBytes) + + compressedPkHex = hexutil.Encode(pkBytes) + keyHash, err = newPK.Hash() + helpers.PanicErr(err) + fmt.Println("\nRegistering proving key...") registerCoordinatorProvingKey(e, *coordinator, *registerKeyUncompressedPubKey, *registerKeyOracleAddress) From 1e89a63b0eb568f11034c6e357ded1764632b00e Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Fri, 6 Oct 2023 19:33:08 +0200 Subject: [PATCH 67/84] Enable Solhint (#10869) * enable solhint for /shared/ folder add others to ignore file add solhint to CICD * add chainlink-solidity ruleset * reduce ignore scope & fix interface folder issues * rm unused imports * clean /libraries * set no-unused-import to error * allow 968 warnings, the number we currently have * fix second layer imports * contracts/v0.8: fix solhint warnings for vrf contracts (#10875) * rm no-inline-assembly rule --------- Co-authored-by: Makram --- .github/workflows/solidity.yml | 2 + CODEOWNERS | 4 +- contracts/.solhint.json | 39 +++++++++++++++++- contracts/.solhintignore | 33 ++++++++++++++- contracts/package.json | 4 +- contracts/pnpm-lock.yaml | 9 ++++ contracts/scripts/native_solc_compile_all_vrf | 1 + contracts/src/v0.8/automation/KeeperBase.sol | 1 + .../src/v0.8/automation/KeeperCompatible.sol | 3 ++ .../interfaces/KeeperCompatibleInterface.sol | 1 + .../v1_2/KeeperRegistryInterface1_2.sol | 4 ++ .../automation/v1_3/KeeperRegistry1_3.sol | 2 +- .../automation/v1_3/KeeperRegistryBase1_3.sol | 2 +- .../automation/v2_0/KeeperRegistry2_0.sol | 2 +- .../automation/v2_0/KeeperRegistryBase2_0.sol | 1 - .../v2_0/KeeperRegistryLogic2_0.sol | 1 + .../automation/v2_1/AutomationUtils2_1.sol | 2 +- .../automation/v2_1/KeeperRegistry2_1.sol | 1 - .../automation/v2_1/KeeperRegistryBase2_1.sol | 2 +- .../automation/v2_1/UpkeepTranscoder4_0.sol | 1 - contracts/src/v0.8/dev/BlockhashStore.sol | 7 +++- .../v0.8/dev/VRFConsumerBaseV2Upgradeable.sol | 7 +++- .../dev/VRFSubscriptionBalanceMonitor.sol | 14 ++++--- .../dev/interfaces/IVRFCoordinatorV2Plus.sol | 4 +- .../IVRFCoordinatorV2PlusInternal.sol | 5 ++- .../dev/vrf/BatchVRFCoordinatorV2Plus.sol | 7 +++- contracts/src/v0.8/dev/vrf/BlockhashStore.sol | 7 +++- .../src/v0.8/dev/vrf/SubscriptionAPI.sol | 14 ++++--- .../v0.8/dev/vrf/TrustedBlockhashStore.sol | 6 +-- .../v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol | 7 ++-- .../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol | 35 ++++++++++------ .../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol | 41 +++++++++++++------ .../dev/vrf/VRFV2PlusWrapperConsumerBase.sol | 10 ++++- .../testhelpers/ExposedVRFCoordinatorV2_5.sol | 4 +- .../VRFConsumerV2PlusUpgradeableExample.sol | 13 ++++-- .../VRFCoordinatorV2PlusUpgradedVersion.sol | 36 ++++++++++------ .../VRFCoordinatorV2Plus_V2Example.sol | 9 ++-- .../VRFMaliciousConsumerV2Plus.sol | 19 +++++---- .../testhelpers/VRFV2PlusConsumerExample.sol | 16 ++++++-- .../VRFV2PlusExternalSubOwnerExample.sol | 17 +++++--- .../VRFV2PlusLoadTestWithMetrics.sol | 19 +++++---- .../VRFV2PlusMaliciousMigrator.sol | 10 ++--- .../testhelpers/VRFV2PlusRevertingExample.sol | 17 +++++--- .../VRFV2PlusSingleConsumerExample.sol | 17 +++++--- .../VRFV2PlusWrapperConsumerExample.sol | 8 +++- .../VRFV2PlusWrapperLoadTestConsumer.sol | 24 +++++++---- .../dev/v0_0_0/FunctionsBillingRegistry.sol | 1 - .../dev/v1_0_0/FunctionsCoordinator.sol | 1 - .../functions/dev/v1_0_0/FunctionsRouter.sol | 2 - .../dev/v1_0_0/FunctionsSubscriptions.sol | 3 -- .../v1_0_0/libraries/FunctionsResponse.sol | 2 - .../FunctionsBillingRegistryMigration.sol | 2 - .../FunctionsBillingRegistryOriginal.sol | 2 - .../interfaces/AggregatorV2V3Interface.sol | 4 +- .../v0.8/interfaces/FeedRegistryInterface.sol | 2 +- .../src/v0.8/interfaces/OperatorInterface.sol | 4 +- .../arbitrum/ArbitrumSequencerUptimeFeed.sol | 2 - .../optimism/OptimismSequencerUptimeFeed.sol | 1 - contracts/src/v0.8/libraries/ByteUtil.sol | 8 ++-- contracts/src/v0.8/libraries/Common.sol | 2 +- .../v0.8/libraries/test/ByteUtilTest.t.sol | 40 +++++++++--------- .../src/v0.8/llo-feeds/RewardManager.sol | 3 +- contracts/src/v0.8/llo-feeds/Verifier.sol | 2 +- .../test/fee-manager/BaseFeeManager.t.sol | 1 - .../test/fee-manager/FeeManager.general.t.sol | 3 -- .../FeeManager.getFeeAndReward.t.sol | 3 -- .../fee-manager/FeeManager.processFee.t.sol | 2 - .../FeeManager.processFeeBulk.t.sol | 3 -- .../llo-feeds/test/gas/Gas_VerifierTest.t.sol | 1 - .../RewardManager.general.t.sol | 1 - .../RewardManager.payRecipients.t.sol | 1 - .../RewardManager.setRecipients.t.sol | 1 - ...RewardManager.updateRewardRecipients.t.sol | 1 - .../verifier/VerifierActivateConfigTest.t.sol | 1 - .../verifier/VerifierDeactivateFeedTest.t.sol | 1 - .../VerifierProxyConstructorTest.t.sol | 1 - .../VerifierProxyInitializeVerifierTest.t.sol | 2 - .../VerifierProxySetVerifierTest.t.sol | 1 - .../test/verifier/VerifierProxyTest.t.sol | 4 -- .../VerifierProxyUnsetVerifierTest.t.sol | 1 - .../VerifierSetConfigFromSourceTest.t.sol | 2 - .../test/verifier/VerifierSetConfigTest.t.sol | 1 - .../test/verifier/VerifierTest.t.sol | 1 - .../verifier/VerifierTestBillingReport.t.sol | 3 -- .../verifier/VerifierUnsetConfigTest.t.sol | 3 +- .../src/v0.8/shared/access/ConfirmedOwner.sol | 2 +- .../access/ConfirmedOwnerWithProposal.sol | 6 ++- .../access/SimpleReadAccessController.sol | 3 +- .../access/SimpleWriteAccessController.sol | 17 ++++---- .../src/v0.8/shared/interfaces/IWERC20.sol | 2 +- .../src/v0.8/shared/mocks/WERC20Mock.sol | 7 ++-- .../src/v0.8/shared/ocr2/OCR2Abstract.sol | 3 ++ .../test/token/ERC677/BurnMintERC677.t.sol | 1 - .../token/ERC20/IOptimismMintableERC20.sol | 1 + .../shared/token/ERC677/BurnMintERC677.sol | 1 + .../src/v0.8/shared/token/ERC677/ERC677.sol | 2 +- .../src/v0.8/vrf/BatchBlockhashStore.sol | 6 ++- .../src/v0.8/vrf/BatchVRFCoordinatorV2.sol | 7 +++- contracts/src/v0.8/vrf/VRF.sol | 33 ++++++++++++++- contracts/src/v0.8/vrf/VRFConsumerBase.sol | 10 ++++- contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol | 2 + contracts/src/v0.8/vrf/VRFCoordinatorV2.sol | 30 +++++++++----- contracts/src/v0.8/vrf/VRFOwner.sol | 7 +++- contracts/src/v0.8/vrf/VRFRequestIDBase.sol | 2 + contracts/src/v0.8/vrf/VRFV2Wrapper.sol | 40 ++++++++++++------ .../src/v0.8/vrf/VRFV2WrapperConsumerBase.sol | 9 +++- .../vrfv2plus_malicious_migrator.go | 16 ++++---- ...rapper-dependency-versions-do-not-edit.txt | 2 +- 108 files changed, 531 insertions(+), 285 deletions(-) diff --git a/.github/workflows/solidity.yml b/.github/workflows/solidity.yml index 0e7ff30545d..6e0233962ef 100644 --- a/.github/workflows/solidity.yml +++ b/.github/workflows/solidity.yml @@ -106,6 +106,8 @@ jobs: uses: ./.github/actions/setup-nodejs - name: Run pnpm lint run: pnpm lint + - name: Run solhint + run: pnpm solhint - name: Collect Metrics id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec diff --git a/CODEOWNERS b/CODEOWNERS index e922010aefd..c49affb8aab 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -67,12 +67,12 @@ core/scripts/gateway @bolekk @pinebit /operator-ui/ @DeividasK @jkongie # Contracts -/contracts/ @se3000 @connorwstein +/contracts/ @se3000 @connorwstein @RensR /contracts/**/*Keeper* @smartcontractkit/keepers /contracts/**/*Upkeep* @smartcontractkit/keepers /contracts/**/*Functions* @smartcontractkit/functions /contracts/src/v0.8/functions @smartcontractkit/functions -contracts/test/v0.8/functions @smartcontractkit/functions +/contracts/test/v0.8/functions @smartcontractkit/functions /contracts/src/v0.8/llo-feeds @austinborn @Fletch153 # Tests diff --git a/contracts/.solhint.json b/contracts/.solhint.json index ad3ab97846d..3b69ca6a7f2 100644 --- a/contracts/.solhint.json +++ b/contracts/.solhint.json @@ -1,7 +1,42 @@ { "extends": "solhint:recommended", - "plugins": ["prettier"], + "plugins": ["prettier", "chainlink-solidity"], "rules": { - "prettier/prettier": "error" + "compiler-version": ["off", "^0.8.0"], + "const-name-snakecase": "off", + "constructor-syntax": "error", + "var-name-mixedcase": "off", + "func-named-parameters": "off", + "immutable-vars-naming": "off", + "no-inline-assembly": "off", + "no-unused-import": "error", + "func-visibility": [ + "error", + { + "ignoreConstructors": true + } + ], + "not-rely-on-time": "off", + "prettier/prettier": [ + "off", + { + "endOfLine": "auto" + } + ], + "no-empty-blocks": "off", + "quotes": ["error", "double"], + "reason-string": [ + "warn", + { + "maxLength": 64 + } + ], + "chainlink-solidity/prefix-internal-functions-with-underscore": "warn", + "chainlink-solidity/prefix-private-functions-with-underscore": "warn", + "chainlink-solidity/prefix-storage-variables-with-s-underscore": "warn", + "chainlink-solidity/prefix-immutable-variables-with-i": "warn", + "chainlink-solidity/all-caps-constant-storage-variables": "warn", + "chainlink-solidity/no-hardhat-imports": "warn", + "chainlink-solidity/inherited-constructor-args-not-in-contract-definition": "warn" } } diff --git a/contracts/.solhintignore b/contracts/.solhintignore index c2658d7d1b3..88ad92c6b87 100644 --- a/contracts/.solhintignore +++ b/contracts/.solhintignore @@ -1 +1,32 @@ -node_modules/ +# 368 warnings +#./src/v0.8/automation +# 302 warnings +#./src/v0.8/dev +# 91 warnings +#./src/v0.8/functions +# 91 warnings +#./src/v0.8/l2ep/dev +# 116 warnings +#./src/v0.8/vrf + +# Temp ignore the following files as they contain issues. +./src/v0.8/ChainlinkClient.sol +./src/v0.8/Flags.sol +./src/v0.8/KeepersVRFConsumer.sol +./src/v0.8/PermissionedForwardProxy.sol +./src/v0.8/ValidatorProxy.sol +./src/v0.8/Chainlink.sol +./src/v0.8/ChainSpecificUtil.sol + + +# Ignore tests, this should not be the long term plan but is OK in the short term +./src/v0.8/**/*.t.sol +./src/v0.8/mocks +./src/v0.8/tests +./src/v0.8/llo-feeds/test +./src/v0.8/vrf/testhelpers +./src/v0.8/functions/tests + +# Always ignore vendor +./src/v0.8/vendor +./node_modules/ \ No newline at end of file diff --git a/contracts/package.json b/contracts/package.json index dbe47be5221..65cc873f34f 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -17,7 +17,8 @@ "coverage": "hardhat coverage", "prepublishOnly": "pnpm compile && ./scripts/prepublish_generate_abi_folder", "publish-beta": "pnpm publish --tag beta", - "publish-prod": "npm dist-tag add @chainlink/contracts@0.8.0 latest" + "publish-prod": "npm dist-tag add @chainlink/contracts@0.8.0 latest", + "solhint": "solhint --max-warnings 593 \"./src/v0.8/**/*.sol\"" }, "files": [ "src/", @@ -73,6 +74,7 @@ "prettier-plugin-solidity": "1.1.3", "rlp": "^2.2.7", "solhint": "^3.6.2", + "solhint-plugin-chainlink-solidity": "git+https://github.com/smartcontractkit/chainlink-solhint-rules.git", "solhint-plugin-prettier": "^0.0.5", "solidity-coverage": "^0.8.4", "ts-node": "^10.9.1", diff --git a/contracts/pnpm-lock.yaml b/contracts/pnpm-lock.yaml index b7179be4c60..33b8099a86d 100644 --- a/contracts/pnpm-lock.yaml +++ b/contracts/pnpm-lock.yaml @@ -148,6 +148,9 @@ devDependencies: solhint: specifier: ^3.6.2 version: 3.6.2 + solhint-plugin-chainlink-solidity: + specifier: git+https://github.com/smartcontractkit/chainlink-solhint-rules.git + version: github.com/smartcontractkit/chainlink-solhint-rules/6229ce5d3cc3e4a2454411bebc887c5ca240dcf2 solhint-plugin-prettier: specifier: ^0.0.5 version: 0.0.5(prettier-plugin-solidity@1.1.3)(prettier@3.0.3) @@ -12600,3 +12603,9 @@ packages: bn.js: 4.12.0 ethereumjs-util: 6.2.1 dev: true + + github.com/smartcontractkit/chainlink-solhint-rules/6229ce5d3cc3e4a2454411bebc887c5ca240dcf2: + resolution: {tarball: https://codeload.github.com/smartcontractkit/chainlink-solhint-rules/tar.gz/6229ce5d3cc3e4a2454411bebc887c5ca240dcf2} + name: '@chainlink/solhint-plugin-chainlink-solidity' + version: 1.0.1 + dev: true diff --git a/contracts/scripts/native_solc_compile_all_vrf b/contracts/scripts/native_solc_compile_all_vrf index 49666bde7f6..fd9f1b91539 100755 --- a/contracts/scripts/native_solc_compile_all_vrf +++ b/contracts/scripts/native_solc_compile_all_vrf @@ -54,6 +54,7 @@ compileContract vrf/testhelpers/VRFCoordinatorV2TestHelper.sol compileContractAltOpts vrf/VRFCoordinatorV2.sol 10000 compileContract mocks/VRFCoordinatorV2Mock.sol compileContract vrf/VRFOwner.sol +compileContract dev/VRFSubscriptionBalanceMonitor.sol # VRF V2Plus compileContract dev/interfaces/IVRFCoordinatorV2PlusInternal.sol diff --git a/contracts/src/v0.8/automation/KeeperBase.sol b/contracts/src/v0.8/automation/KeeperBase.sol index 448d4deacea..0e050d4aff3 100644 --- a/contracts/src/v0.8/automation/KeeperBase.sol +++ b/contracts/src/v0.8/automation/KeeperBase.sol @@ -3,4 +3,5 @@ * @notice This is a deprecated interface. Please use AutomationBase directly. */ pragma solidity ^0.8.0; +// solhint-disable-next-line no-unused-import import {AutomationBase as KeeperBase} from "./AutomationBase.sol"; diff --git a/contracts/src/v0.8/automation/KeeperCompatible.sol b/contracts/src/v0.8/automation/KeeperCompatible.sol index f5263eda7b9..6379fe526be 100644 --- a/contracts/src/v0.8/automation/KeeperCompatible.sol +++ b/contracts/src/v0.8/automation/KeeperCompatible.sol @@ -3,6 +3,9 @@ * @notice This is a deprecated interface. Please use AutomationCompatible directly. */ pragma solidity ^0.8.0; +// solhint-disable-next-line no-unused-import import {AutomationCompatible as KeeperCompatible} from "./AutomationCompatible.sol"; +// solhint-disable-next-line no-unused-import import {AutomationBase as KeeperBase} from "./AutomationBase.sol"; +// solhint-disable-next-line no-unused-import import {AutomationCompatibleInterface as KeeperCompatibleInterface} from "./interfaces/AutomationCompatibleInterface.sol"; diff --git a/contracts/src/v0.8/automation/interfaces/KeeperCompatibleInterface.sol b/contracts/src/v0.8/automation/interfaces/KeeperCompatibleInterface.sol index d316722313e..b5ba8196c74 100644 --- a/contracts/src/v0.8/automation/interfaces/KeeperCompatibleInterface.sol +++ b/contracts/src/v0.8/automation/interfaces/KeeperCompatibleInterface.sol @@ -3,4 +3,5 @@ * @notice This is a deprecated interface. Please use AutomationCompatibleInterface directly. */ pragma solidity ^0.8.0; +// solhint-disable-next-line no-unused-import import {AutomationCompatibleInterface as KeeperCompatibleInterface} from "./AutomationCompatibleInterface.sol"; diff --git a/contracts/src/v0.8/automation/interfaces/v1_2/KeeperRegistryInterface1_2.sol b/contracts/src/v0.8/automation/interfaces/v1_2/KeeperRegistryInterface1_2.sol index 124e279ab40..01f70ae9c7d 100644 --- a/contracts/src/v0.8/automation/interfaces/v1_2/KeeperRegistryInterface1_2.sol +++ b/contracts/src/v0.8/automation/interfaces/v1_2/KeeperRegistryInterface1_2.sol @@ -3,7 +3,11 @@ * @notice This is a deprecated interface. Please use AutomationRegistryInterface1_2 directly. */ pragma solidity ^0.8.0; +// solhint-disable-next-line no-unused-import import {Config, State} from "./AutomationRegistryInterface1_2.sol"; +// solhint-disable-next-line no-unused-import import {AutomationRegistryBaseInterface as KeeperRegistryBaseInterface} from "./AutomationRegistryInterface1_2.sol"; +// solhint-disable-next-line no-unused-import import {AutomationRegistryInterface as KeeperRegistryInterface} from "./AutomationRegistryInterface1_2.sol"; +// solhint-disable-next-line no-unused-import import {AutomationRegistryExecutableInterface as KeeperRegistryExecutableInterface} from "./AutomationRegistryInterface1_2.sol"; diff --git a/contracts/src/v0.8/automation/v1_3/KeeperRegistry1_3.sol b/contracts/src/v0.8/automation/v1_3/KeeperRegistry1_3.sol index c40f79f85b4..dbef8d77d19 100644 --- a/contracts/src/v0.8/automation/v1_3/KeeperRegistry1_3.sol +++ b/contracts/src/v0.8/automation/v1_3/KeeperRegistry1_3.sol @@ -6,7 +6,7 @@ import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./KeeperRegistryBase1_3.sol"; import "./KeeperRegistryLogic1_3.sol"; -import {AutomationRegistryExecutableInterface} from "../interfaces/v1_3/AutomationRegistryInterface1_3.sol"; +import {AutomationRegistryExecutableInterface, State} from "../interfaces/v1_3/AutomationRegistryInterface1_3.sol"; import "../interfaces/MigratableKeeperRegistryInterface.sol"; import "../../interfaces/TypeAndVersionInterface.sol"; import "../../shared/interfaces/IERC677Receiver.sol"; diff --git a/contracts/src/v0.8/automation/v1_3/KeeperRegistryBase1_3.sol b/contracts/src/v0.8/automation/v1_3/KeeperRegistryBase1_3.sol index d63f6f40e88..6328b651671 100644 --- a/contracts/src/v0.8/automation/v1_3/KeeperRegistryBase1_3.sol +++ b/contracts/src/v0.8/automation/v1_3/KeeperRegistryBase1_3.sol @@ -6,7 +6,7 @@ import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; import "../../vendor/@eth-optimism/contracts/v0.8.6/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; import "../ExecutionPrevention.sol"; -import {Config, State, Upkeep} from "../interfaces/v1_3/AutomationRegistryInterface1_3.sol"; +import {Config, Upkeep} from "../interfaces/v1_3/AutomationRegistryInterface1_3.sol"; import "../../shared/access/ConfirmedOwner.sol"; import "../../interfaces/AggregatorV3Interface.sol"; import "../../shared/interfaces/LinkTokenInterface.sol"; diff --git a/contracts/src/v0.8/automation/v2_0/KeeperRegistry2_0.sol b/contracts/src/v0.8/automation/v2_0/KeeperRegistry2_0.sol index 34781f18258..7db02e72e73 100644 --- a/contracts/src/v0.8/automation/v2_0/KeeperRegistry2_0.sol +++ b/contracts/src/v0.8/automation/v2_0/KeeperRegistry2_0.sol @@ -5,7 +5,7 @@ import "../../vendor/openzeppelin-solidity/v4.7.3/contracts/proxy/Proxy.sol"; import "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; import "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol"; import "./KeeperRegistryBase2_0.sol"; -import {AutomationRegistryExecutableInterface, UpkeepInfo} from "../interfaces/v2_0/AutomationRegistryInterface2_0.sol"; +import {AutomationRegistryExecutableInterface, UpkeepInfo, State, OnchainConfig, UpkeepFailureReason} from "../interfaces/v2_0/AutomationRegistryInterface2_0.sol"; import "../interfaces/MigratableKeeperRegistryInterface.sol"; import "../interfaces/MigratableKeeperRegistryInterfaceV2.sol"; import "../../shared/interfaces/IERC677Receiver.sol"; diff --git a/contracts/src/v0.8/automation/v2_0/KeeperRegistryBase2_0.sol b/contracts/src/v0.8/automation/v2_0/KeeperRegistryBase2_0.sol index c1e9a279f84..14e9b204475 100644 --- a/contracts/src/v0.8/automation/v2_0/KeeperRegistryBase2_0.sol +++ b/contracts/src/v0.8/automation/v2_0/KeeperRegistryBase2_0.sol @@ -6,7 +6,6 @@ import "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; import "../../vendor/@eth-optimism/contracts/v0.8.6/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; import {ArbSys} from "../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; import "../ExecutionPrevention.sol"; -import {OnchainConfig, State, UpkeepFailureReason} from "../interfaces/v2_0/AutomationRegistryInterface2_0.sol"; import "../../shared/access/ConfirmedOwner.sol"; import "../../interfaces/AggregatorV3Interface.sol"; import "../../shared/interfaces/LinkTokenInterface.sol"; diff --git a/contracts/src/v0.8/automation/v2_0/KeeperRegistryLogic2_0.sol b/contracts/src/v0.8/automation/v2_0/KeeperRegistryLogic2_0.sol index 7e6134a178f..7eacc3cb61e 100644 --- a/contracts/src/v0.8/automation/v2_0/KeeperRegistryLogic2_0.sol +++ b/contracts/src/v0.8/automation/v2_0/KeeperRegistryLogic2_0.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.6; import "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; import "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol"; import "./KeeperRegistryBase2_0.sol"; +import {UpkeepFailureReason} from "../interfaces/v2_0/AutomationRegistryInterface2_0.sol"; import "../interfaces/MigratableKeeperRegistryInterfaceV2.sol"; import "../interfaces/UpkeepTranscoderInterfaceV2.sol"; diff --git a/contracts/src/v0.8/automation/v2_1/AutomationUtils2_1.sol b/contracts/src/v0.8/automation/v2_1/AutomationUtils2_1.sol index ed19b450d8b..f6ba913b2fb 100644 --- a/contracts/src/v0.8/automation/v2_1/AutomationUtils2_1.sol +++ b/contracts/src/v0.8/automation/v2_1/AutomationUtils2_1.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.16; import {KeeperRegistryBase2_1} from "./KeeperRegistryBase2_1.sol"; -import {ILogAutomation, Log} from "../interfaces/ILogAutomation.sol"; +import {Log} from "../interfaces/ILogAutomation.sol"; /** * @notice this file exposes structs that are otherwise internal to the automation registry diff --git a/contracts/src/v0.8/automation/v2_1/KeeperRegistry2_1.sol b/contracts/src/v0.8/automation/v2_1/KeeperRegistry2_1.sol index bb287c3c731..2f96df6d572 100644 --- a/contracts/src/v0.8/automation/v2_1/KeeperRegistry2_1.sol +++ b/contracts/src/v0.8/automation/v2_1/KeeperRegistry2_1.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.16; import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; import {Address} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol"; -import {Proxy} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/proxy/Proxy.sol"; import {KeeperRegistryBase2_1} from "./KeeperRegistryBase2_1.sol"; import {KeeperRegistryLogicB2_1} from "./KeeperRegistryLogicB2_1.sol"; import {Chainable} from "../Chainable.sol"; diff --git a/contracts/src/v0.8/automation/v2_1/KeeperRegistryBase2_1.sol b/contracts/src/v0.8/automation/v2_1/KeeperRegistryBase2_1.sol index 86942f3108d..f5d89de5467 100644 --- a/contracts/src/v0.8/automation/v2_1/KeeperRegistryBase2_1.sol +++ b/contracts/src/v0.8/automation/v2_1/KeeperRegistryBase2_1.sol @@ -14,7 +14,7 @@ import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {AggregatorV3Interface} from "../../interfaces/AggregatorV3Interface.sol"; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; import {KeeperCompatibleInterface} from "../interfaces/KeeperCompatibleInterface.sol"; -import {UpkeepTranscoderInterface, UpkeepFormat} from "../interfaces/UpkeepTranscoderInterface.sol"; +import {UpkeepFormat} from "../interfaces/UpkeepTranscoderInterface.sol"; /** * @notice Base Keeper Registry contract, contains shared logic between diff --git a/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol b/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol index 727a3dd33ad..53b681d4cc1 100644 --- a/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol +++ b/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol @@ -6,7 +6,6 @@ import {UpkeepTranscoderInterfaceV2} from "../interfaces/UpkeepTranscoderInterfa import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; import {KeeperRegistryBase2_1 as R21} from "./KeeperRegistryBase2_1.sol"; import {IAutomationForwarder} from "../interfaces/IAutomationForwarder.sol"; -import {AutomationRegistryBaseInterface, UpkeepInfo} from "../interfaces/v2_0/AutomationRegistryInterface2_0.sol"; enum RegistryVersion { V12, diff --git a/contracts/src/v0.8/dev/BlockhashStore.sol b/contracts/src/v0.8/dev/BlockhashStore.sol index 74a4fc0ce47..4104be77ed7 100644 --- a/contracts/src/v0.8/dev/BlockhashStore.sol +++ b/contracts/src/v0.8/dev/BlockhashStore.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.6; -import "../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil.sol"; /** * @title BlockhashStore @@ -14,7 +14,7 @@ import "../ChainSpecificUtil.sol"; * would have to be deployed. */ contract BlockhashStore { - mapping(uint => bytes32) internal s_blockhashes; + mapping(uint256 => bytes32) internal s_blockhashes; /** * @notice stores blockhash of a given block, assuming it is available through BLOCKHASH @@ -22,6 +22,7 @@ contract BlockhashStore { */ function store(uint256 n) public { bytes32 h = ChainSpecificUtil.getBlockhash(uint64(n)); + // solhint-disable-next-line custom-errors require(h != 0x0, "blockhash(n) failed"); s_blockhashes[n] = h; } @@ -40,6 +41,7 @@ contract BlockhashStore { * that it hashes to a stored blockhash, and then extract parentHash to get the n-th blockhash. */ function storeVerifyHeader(uint256 n, bytes memory header) public { + // solhint-disable-next-line custom-errors require(keccak256(header) == s_blockhashes[n + 1], "header has unknown blockhash"); // At this point, we know that header is the correct blockheader for block n+1. @@ -72,6 +74,7 @@ contract BlockhashStore { */ function getBlockhash(uint256 n) external view returns (bytes32) { bytes32 h = s_blockhashes[n]; + // solhint-disable-next-line custom-errors require(h != 0x0, "blockhash not found in store"); return h; } diff --git a/contracts/src/v0.8/dev/VRFConsumerBaseV2Upgradeable.sol b/contracts/src/v0.8/dev/VRFConsumerBaseV2Upgradeable.sol index b9666eb6a14..81840d26a3e 100644 --- a/contracts/src/v0.8/dev/VRFConsumerBaseV2Upgradeable.sol +++ b/contracts/src/v0.8/dev/VRFConsumerBaseV2Upgradeable.sol @@ -96,7 +96,7 @@ pragma solidity ^0.8.4; * @dev and so remains effective only in the case of unmodified oracle software). */ -import "@openzeppelin/contracts-upgradeable-4.7.3/proxy/utils/Initializable.sol"; +import {Initializable} from "@openzeppelin/contracts-upgradeable-4.7.3/proxy/utils/Initializable.sol"; /** * @dev The VRFConsumerBaseV2Upgradable is an upgradable variant of VRFConsumerBaseV2 @@ -106,10 +106,12 @@ import "@openzeppelin/contracts-upgradeable-4.7.3/proxy/utils/Initializable.sol" */ abstract contract VRFConsumerBaseV2Upgradeable is Initializable { error OnlyCoordinatorCanFulfill(address have, address want); + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore address private vrfCoordinator; // See https://github.com/OpenZeppelin/openzeppelin-sdk/issues/37. // Each uint256 covers a single storage slot, see https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html. + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore uint256[49] private __gap; /** @@ -117,8 +119,10 @@ abstract contract VRFConsumerBaseV2Upgradeable is Initializable { * @dev See https://docs.chain.link/docs/vrf/v2/supported-networks/ for coordinator * @dev addresses on your preferred network. */ + // solhint-disable-next-line func-name-mixedcase function __VRFConsumerBaseV2_init(address _vrfCoordinator) internal onlyInitializing { if (_vrfCoordinator == address(0)) { + // solhint-disable-next-line custom-errors revert("must give valid coordinator address"); } @@ -139,6 +143,7 @@ abstract contract VRFConsumerBaseV2Upgradeable is Initializable { * @param requestId The Id initially returned by requestRandomness * @param randomWords the VRF output expanded to the requested number of words */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual; // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF diff --git a/contracts/src/v0.8/dev/VRFSubscriptionBalanceMonitor.sol b/contracts/src/v0.8/dev/VRFSubscriptionBalanceMonitor.sol index 91124709742..958ecdc1bad 100644 --- a/contracts/src/v0.8/dev/VRFSubscriptionBalanceMonitor.sol +++ b/contracts/src/v0.8/dev/VRFSubscriptionBalanceMonitor.sol @@ -2,11 +2,11 @@ pragma solidity 0.8.6; -import "../shared/access/ConfirmedOwner.sol"; -import "../automation/interfaces/KeeperCompatibleInterface.sol"; -import "../interfaces/VRFCoordinatorV2Interface.sol"; -import "../shared/interfaces/LinkTokenInterface.sol"; -import "@openzeppelin/contracts/security/Pausable.sol"; +import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; +import {AutomationCompatibleInterface as KeeperCompatibleInterface} from "../automation/interfaces/AutomationCompatibleInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; +import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol"; /** * @title The VRFSubscriptionBalanceMonitor contract. @@ -197,6 +197,7 @@ contract VRFSubscriptionBalanceMonitor is ConfirmedOwner, Pausable, KeeperCompat * @param payee the address to pay */ function withdraw(uint256 amount, address payable payee) external onlyOwner { + // solhint-disable-next-line custom-errors, reason-string require(payee != address(0)); emit FundsWithdrawn(amount, payee); LINKTOKEN.transfer(payee, amount); @@ -206,6 +207,7 @@ contract VRFSubscriptionBalanceMonitor is ConfirmedOwner, Pausable, KeeperCompat * @notice Sets the LINK token address. */ function setLinkTokenAddress(address linkTokenAddress) public onlyOwner { + // solhint-disable-next-line custom-errors, reason-string require(linkTokenAddress != address(0)); emit LinkTokenAddressUpdated(address(LINKTOKEN), linkTokenAddress); LINKTOKEN = LinkTokenInterface(linkTokenAddress); @@ -215,6 +217,7 @@ contract VRFSubscriptionBalanceMonitor is ConfirmedOwner, Pausable, KeeperCompat * @notice Sets the VRF coordinator address. */ function setVRFCoordinatorV2Address(address coordinatorAddress) public onlyOwner { + // solhint-disable-next-line custom-errors, reason-string require(coordinatorAddress != address(0)); emit VRFCoordinatorV2AddressUpdated(address(COORDINATOR), coordinatorAddress); COORDINATOR = VRFCoordinatorV2Interface(coordinatorAddress); @@ -224,6 +227,7 @@ contract VRFSubscriptionBalanceMonitor is ConfirmedOwner, Pausable, KeeperCompat * @notice Sets the keeper registry address. */ function setKeeperRegistryAddress(address keeperRegistryAddress) public onlyOwner { + // solhint-disable-next-line custom-errors, reason-string require(keeperRegistryAddress != address(0)); emit KeeperRegistryAddressUpdated(s_keeperRegistryAddress, keeperRegistryAddress); s_keeperRegistryAddress = keeperRegistryAddress; diff --git a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol b/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol index 0608340e674..20c60b593da 100644 --- a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol +++ b/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../vrf/libraries/VRFV2PlusClient.sol"; -import "./IVRFSubscriptionV2Plus.sol"; +import {VRFV2PlusClient} from "../vrf/libraries/VRFV2PlusClient.sol"; +import {IVRFSubscriptionV2Plus} from "./IVRFSubscriptionV2Plus.sol"; // Interface that enables consumers of VRFCoordinatorV2Plus to be future-proof for upgrades // This interface is supported by subsequent versions of VRFCoordinatorV2Plus diff --git a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol b/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol index 9892b88e691..e8fba69fc45 100644 --- a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol +++ b/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "./IVRFCoordinatorV2Plus.sol"; + +import {IVRFCoordinatorV2Plus} from "./IVRFCoordinatorV2Plus.sol"; // IVRFCoordinatorV2PlusInternal is the interface used by chainlink core and should // not be used by consumer conracts @@ -51,9 +52,11 @@ interface IVRFCoordinatorV2PlusInternal is IVRFCoordinatorV2Plus { uint256 zInv; } + // solhint-disable-next-line func-name-mixedcase function s_requestCommitments(uint256 requestID) external view returns (bytes32); function fulfillRandomWords(Proof memory proof, RequestCommitment memory rc) external returns (uint96); + // solhint-disable-next-line func-name-mixedcase function LINK_NATIVE_FEED() external view returns (address); } diff --git a/contracts/src/v0.8/dev/vrf/BatchVRFCoordinatorV2Plus.sol b/contracts/src/v0.8/dev/vrf/BatchVRFCoordinatorV2Plus.sol index c08ac5dd0a4..9247cc21dd5 100644 --- a/contracts/src/v0.8/dev/vrf/BatchVRFCoordinatorV2Plus.sol +++ b/contracts/src/v0.8/dev/vrf/BatchVRFCoordinatorV2Plus.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: MIT +// solhint-disable-next-line one-contract-per-file pragma solidity 0.8.6; -import "../../vrf/VRFTypes.sol"; +import {VRFTypes} from "../../vrf/VRFTypes.sol"; /** * @title BatchVRFCoordinatorV2Plus @@ -9,6 +10,7 @@ import "../../vrf/VRFTypes.sol"; * @notice provided VRFCoordinatorV2Plus contract efficiently in a single transaction. */ contract BatchVRFCoordinatorV2Plus { + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i IVRFCoordinatorV2Plus public immutable COORDINATOR; event ErrorReturned(uint256 indexed requestId, string reason); @@ -24,6 +26,7 @@ contract BatchVRFCoordinatorV2Plus { * @param rcs the request commitments corresponding to the randomness proofs. */ function fulfillRandomWords(VRFTypes.Proof[] memory proofs, VRFTypes.RequestCommitmentV2Plus[] memory rcs) external { + // solhint-disable-next-line custom-errors require(proofs.length == rcs.length, "input array arg lengths mismatch"); for (uint256 i = 0; i < proofs.length; i++) { try COORDINATOR.fulfillRandomWords(proofs[i], rcs[i]) returns (uint96 /* payment */) { @@ -42,6 +45,7 @@ contract BatchVRFCoordinatorV2Plus { * @notice Returns the proving key hash associated with this public key. * @param publicKey the key to return the hash of. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function hashOfKey(uint256[2] memory publicKey) internal pure returns (bytes32) { return keccak256(abi.encode(publicKey)); } @@ -50,6 +54,7 @@ contract BatchVRFCoordinatorV2Plus { * @notice Returns the request ID of the request associated with the given proof. * @param proof the VRF proof provided by the VRF oracle. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function getRequestIdFromProof(VRFTypes.Proof memory proof) internal pure returns (uint256) { bytes32 keyHash = hashOfKey(proof.pk); return uint256(keccak256(abi.encode(keyHash, proof.seed))); diff --git a/contracts/src/v0.8/dev/vrf/BlockhashStore.sol b/contracts/src/v0.8/dev/vrf/BlockhashStore.sol index 107746f8019..ad445595ff8 100644 --- a/contracts/src/v0.8/dev/vrf/BlockhashStore.sol +++ b/contracts/src/v0.8/dev/vrf/BlockhashStore.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.6; -import "../../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; /** * @title BlockhashStore @@ -14,7 +14,7 @@ import "../../ChainSpecificUtil.sol"; * would have to be deployed. */ contract BlockhashStore { - mapping(uint => bytes32) internal s_blockhashes; + mapping(uint256 => bytes32) internal s_blockhashes; /** * @notice stores blockhash of a given block, assuming it is available through BLOCKHASH @@ -22,6 +22,7 @@ contract BlockhashStore { */ function store(uint256 n) public { bytes32 h = ChainSpecificUtil.getBlockhash(uint64(n)); + // solhint-disable-next-line custom-errors require(h != 0x0, "blockhash(n) failed"); s_blockhashes[n] = h; } @@ -40,6 +41,7 @@ contract BlockhashStore { * that it hashes to a stored blockhash, and then extract parentHash to get the n-th blockhash. */ function storeVerifyHeader(uint256 n, bytes memory header) public { + // solhint-disable-next-line custom-errors require(keccak256(header) == s_blockhashes[n + 1], "header has unknown blockhash"); // At this point, we know that header is the correct blockheader for block n+1. @@ -72,6 +74,7 @@ contract BlockhashStore { */ function getBlockhash(uint256 n) external view returns (bytes32) { bytes32 h = s_blockhashes[n]; + // solhint-disable-next-line custom-errors require(h != 0x0, "blockhash not found in store"); return h; } diff --git a/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol b/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol index c4781cbde8c..d79b6daf844 100644 --- a/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol +++ b/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../shared/access/ConfirmedOwner.sol"; -import "../../interfaces/AggregatorV3Interface.sol"; -import "../../shared/interfaces/IERC677Receiver.sol"; -import "../interfaces/IVRFSubscriptionV2Plus.sol"; +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {AggregatorV3Interface} from "../../interfaces/AggregatorV3Interface.sol"; +import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; +import {IVRFSubscriptionV2Plus} from "../interfaces/IVRFSubscriptionV2Plus.sol"; abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscriptionV2Plus { using EnumerableSet for EnumerableSet.UintSet; @@ -392,6 +392,7 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr emit SubscriptionConsumerAdded(subId, consumer); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function deleteSubscription(uint256 subId) internal returns (uint96 balance, uint96 nativeBalance) { SubscriptionConfig memory subConfig = s_subscriptionConfigs[subId]; Subscription memory sub = s_subscriptions[subId]; @@ -410,6 +411,7 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr return (balance, nativeBalance); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function cancelSubscriptionHelper(uint256 subId, address to) internal { (uint96 balance, uint96 nativeBalance) = deleteSubscription(subId); diff --git a/contracts/src/v0.8/dev/vrf/TrustedBlockhashStore.sol b/contracts/src/v0.8/dev/vrf/TrustedBlockhashStore.sol index bbbc08f3a22..d084ea5c8eb 100644 --- a/contracts/src/v0.8/dev/vrf/TrustedBlockhashStore.sol +++ b/contracts/src/v0.8/dev/vrf/TrustedBlockhashStore.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.6; -import "../../ChainSpecificUtil.sol"; -import "../../shared/access/ConfirmedOwner.sol"; -import "./BlockhashStore.sol"; +import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {BlockhashStore} from "./BlockhashStore.sol"; contract TrustedBlockhashStore is ConfirmedOwner, BlockhashStore { error NotInWhitelist(); diff --git a/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol b/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol index 0e6e2b22016..c256630f7c6 100644 --- a/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol +++ b/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import "../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../interfaces/IVRFMigratableConsumerV2Plus.sol"; -import "../../shared/access/ConfirmedOwner.sol"; +import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFMigratableConsumerV2Plus} from "../interfaces/IVRFMigratableConsumerV2Plus.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; /** **************************************************************************** * @notice Interface for contracts using VRF randomness @@ -126,6 +126,7 @@ abstract contract VRFConsumerBaseV2Plus is IVRFMigratableConsumerV2Plus, Confirm * @param requestId The Id initially returned by requestRandomness * @param randomWords the VRF output expanded to the requested number of words */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual; // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF diff --git a/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol b/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol index 3cd5d05e6e8..d69fa38c096 100644 --- a/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol +++ b/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol @@ -1,19 +1,20 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/BlockhashStoreInterface.sol"; -import "../../interfaces/TypeAndVersionInterface.sol"; -import "../../vrf/VRF.sol"; -import "./VRFConsumerBaseV2Plus.sol"; -import "../../ChainSpecificUtil.sol"; -import "./SubscriptionAPI.sol"; -import "./libraries/VRFV2PlusClient.sol"; -import "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; -import "../interfaces/IVRFCoordinatorV2Plus.sol"; - +import {BlockhashStoreInterface} from "../../interfaces/BlockhashStoreInterface.sol"; +import {VRF} from "../../vrf/VRF.sol"; +import {VRFConsumerBaseV2Plus, IVRFMigratableConsumerV2Plus} from "./VRFConsumerBaseV2Plus.sol"; +import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; +import {SubscriptionAPI} from "./SubscriptionAPI.sol"; +import {VRFV2PlusClient} from "./libraries/VRFV2PlusClient.sol"; +import {IVRFCoordinatorV2PlusMigration} from "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; +// solhint-disable-next-line no-unused-import +import {IVRFCoordinatorV2Plus, IVRFSubscriptionV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; + +// solhint-disable-next-line contract-name-camelcase contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { /// @dev should always be available + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i BlockhashStoreInterface public immutable BLOCKHASH_STORE; // Set this maximum to 200 to give us a 56 block window to fulfill @@ -299,6 +300,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { return requestId; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function computeRequestId( bytes32 keyHash, address sender, @@ -313,8 +315,8 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { * @dev calls target address with exactly gasAmount gas and data as calldata * or reverts if at least gasAmount gas is not available. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // Compute g -= GAS_FOR_CALL_EXACT_CHECK and check for underflow @@ -349,6 +351,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { uint256 randomness; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function getRandomnessFromProof( Proof memory proof, RequestCommitment memory rc @@ -452,6 +455,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { } } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculatePaymentAmount( uint256 startGas, uint256 gasAfterPaymentCalculation, @@ -476,6 +480,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { ); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculatePaymentAmountNative( uint256 startGas, uint256 gasAfterPaymentCalculation, @@ -493,6 +498,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { } // Get the amount of gas used for fulfillment + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculatePaymentAmountLink( uint256 startGas, uint256 gasAfterPaymentCalculation, @@ -516,6 +522,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { return uint96(paymentNoFee + fee); } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getFeedData() private view returns (int256) { uint32 stalenessSeconds = s_config.stalenessSeconds; bool staleFallback = stalenessSeconds > 0; @@ -620,6 +627,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { uint96 nativeBalance; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function isTargetRegistered(address target) internal view returns (bool) { for (uint256 i = 0; i < s_migrationTargets.length; i++) { if (s_migrationTargets[i] == target) { @@ -656,7 +664,9 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { revert CoordinatorNotRegistered(newCoordinator); } (uint96 balance, uint96 nativeBalance, , address owner, address[] memory consumers) = getSubscription(subId); + // solhint-disable-next-line custom-errors require(owner == msg.sender, "Not subscription owner"); + // solhint-disable-next-line custom-errors require(!pendingRequestExists(subId), "Pending request exists"); V1MigrationData memory migrationData = V1MigrationData({ @@ -673,6 +683,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { // Only transfer LINK if the token is active and there is a balance. if (address(LINK) != address(0) && balance != 0) { + // solhint-disable-next-line custom-errors require(LINK.transfer(address(newCoordinator), balance), "insufficient funds"); } diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol index fb6d9ee0243..8021f048989 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol @@ -1,20 +1,21 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; -import "../../shared/access/ConfirmedOwner.sol"; -import "../../interfaces/TypeAndVersionInterface.sol"; -import "./VRFConsumerBaseV2Plus.sol"; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/AggregatorV3Interface.sol"; -import "../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../interfaces/IVRFV2PlusWrapper.sol"; -import "./VRFV2PlusWrapperConsumerBase.sol"; -import "../../ChainSpecificUtil.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {VRFConsumerBaseV2Plus} from "./VRFConsumerBaseV2Plus.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {AggregatorV3Interface} from "../../interfaces/AggregatorV3Interface.sol"; +import {VRFV2PlusClient} from "./libraries/VRFV2PlusClient.sol"; +import {IVRFV2PlusWrapper} from "../interfaces/IVRFV2PlusWrapper.sol"; +import {VRFV2PlusWrapperConsumerBase} from "./VRFV2PlusWrapperConsumerBase.sol"; +import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; /** * @notice A wrapper for VRFCoordinatorV2 that provides an interface better suited to one-off * @notice requests for randomness. */ +// solhint-disable-next-line max-states-count contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBaseV2Plus, IVRFV2PlusWrapper { event WrapperFulfillmentFailed(uint256 indexed requestId, address indexed consumer); @@ -27,10 +28,11 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume /* Storage Slot 1: BEGIN */ // s_keyHash is the key hash to use when requesting randomness. Fees are paid based on current gas // fees, so this should be set to the highest gas lane on the network. - bytes32 s_keyHash; + bytes32 internal s_keyHash; /* Storage Slot 1: END */ /* Storage Slot 2: BEGIN */ + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i uint256 public immutable SUBSCRIPTION_ID; /* Storage Slot 2: END */ @@ -106,7 +108,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume uint8 private s_wrapperPremiumPercentage; // s_maxNumWords is the max number of words that can be requested in a single wrapped VRF request. - uint8 s_maxNumWords; + uint8 internal s_maxNumWords; uint16 private constant EXPECTED_MIN_LENGTH = 36; /* Storage Slot 8: END */ @@ -307,6 +309,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume return calculateRequestPriceNativeInternal(_callbackGasLimit, _requestGasPriceWei); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculateRequestPriceNativeInternal(uint256 _gas, uint256 _requestGasPrice) internal view returns (uint256) { // costWei is the base fee denominated in wei (native) // costWei takes into account the L1 posting costs of the VRF fulfillment @@ -325,6 +328,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume return feeWithFlatFee; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculateRequestPriceInternal( uint256 _gas, uint256 _requestGasPrice, @@ -361,6 +365,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume * uint16 requestConfirmations, and uint32 numWords. */ function onTokenTransfer(address _sender, uint256 _amount, bytes calldata _data) external onlyConfiguredNotDisabled { + // solhint-disable-next-line custom-errors require(msg.sender == address(s_link), "only callable from LINK"); (uint32 callbackGasLimit, uint16 requestConfirmations, uint32 numWords, bytes memory extraArgs) = abi.decode( @@ -371,7 +376,9 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume uint32 eip150Overhead = getEIP150Overhead(callbackGasLimit); int256 weiPerUnitLink = getFeedData(); uint256 price = calculateRequestPriceInternal(callbackGasLimit, tx.gasprice, weiPerUnitLink); + // solhint-disable-next-line custom-errors require(_amount >= price, "fee too low"); + // solhint-disable-next-line custom-errors require(numWords <= s_maxNumWords, "numWords too high"); VRFV2PlusClient.RandomWordsRequest memory req = VRFV2PlusClient.RandomWordsRequest({ keyHash: s_keyHash, @@ -424,7 +431,9 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume uint32 eip150Overhead = getEIP150Overhead(_callbackGasLimit); uint256 price = calculateRequestPriceNativeInternal(_callbackGasLimit, tx.gasprice); + // solhint-disable-next-line custom-errors require(msg.value >= price, "fee too low"); + // solhint-disable-next-line custom-errors require(_numWords <= s_maxNumWords, "numWords too high"); VRFV2PlusClient.RandomWordsRequest memory req = VRFV2PlusClient.RandomWordsRequest({ keyHash: s_keyHash, @@ -466,6 +475,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume */ function withdrawNative(address _recipient, uint256 _amount) external onlyOwner { (bool success, ) = payable(_recipient).call{value: _amount}(""); + // solhint-disable-next-line custom-errors require(success, "failed to withdraw native"); } @@ -484,9 +494,11 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume s_disabled = true; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal override { Callback memory callback = s_callbacks[_requestId]; delete s_callbacks[_requestId]; + // solhint-disable-next-line custom-errors require(callback.callbackAddress != address(0), "request not found"); // This should never happen VRFV2PlusWrapperConsumerBase c; @@ -498,6 +510,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume } } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getFeedData() private view returns (int256) { bool staleFallback = s_stalenessSeconds > 0; uint256 timestamp; @@ -507,6 +520,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume if (staleFallback && s_stalenessSeconds < block.timestamp - timestamp) { weiPerUnitLink = s_fallbackWeiPerUnitLink; } + // solhint-disable-next-line custom-errors require(weiPerUnitLink >= 0, "Invalid LINK wei price"); return weiPerUnitLink; } @@ -514,6 +528,7 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume /** * @dev Calculates extra amount of gas required for running an assembly call() post-EIP150. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getEIP150Overhead(uint32 gas) private pure returns (uint32) { return gas / 63 + 1; } @@ -522,8 +537,8 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume * @dev calls target address with exactly gasAmount gas and data as calldata * or reverts if at least gasAmount gas is not available. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // Compute g -= GAS_FOR_CALL_EXACT_CHECK and check for underflow @@ -557,7 +572,9 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume } modifier onlyConfiguredNotDisabled() { + // solhint-disable-next-line custom-errors require(s_configured, "wrapper is not configured"); + // solhint-disable-next-line custom-errors require(!s_disabled, "wrapper is disabled"); _; } diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol index c96623d28ef..e800753af2b 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../interfaces/IVRFV2PlusWrapper.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {IVRFV2PlusWrapper} from "../interfaces/IVRFV2PlusWrapper.sol"; /** * @@ -31,7 +31,9 @@ import "../interfaces/IVRFV2PlusWrapper.sol"; abstract contract VRFV2PlusWrapperConsumerBase { error LINKAlreadySet(); + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore LinkTokenInterface internal LINK; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore IVRFV2PlusWrapper internal VRF_V2_PLUS_WRAPPER; /** @@ -70,6 +72,7 @@ abstract contract VRFV2PlusWrapperConsumerBase { * * @return requestId is the VRF V2+ request ID of the newly created randomness request. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function requestRandomness( uint32 _callbackGasLimit, uint16 _requestConfirmations, @@ -84,6 +87,7 @@ abstract contract VRFV2PlusWrapperConsumerBase { return VRF_V2_PLUS_WRAPPER.lastRequestId(); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function requestRandomnessPayInNative( uint32 _callbackGasLimit, uint16 _requestConfirmations, @@ -107,9 +111,11 @@ abstract contract VRFV2PlusWrapperConsumerBase { * @param _requestId is the VRF V2 request ID. * @param _randomWords is the randomness result. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal virtual; function rawFulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) external { + // solhint-disable-next-line custom-errors require(msg.sender == address(VRF_V2_PLUS_WRAPPER), "only VRF V2 Plus wrapper can fulfill"); fulfillRandomWords(_requestId, _randomWords); } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol b/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol index 5e54636bb17..f9c34b2b611 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import "../../../vrf/VRF.sol"; import {VRFCoordinatorV2_5} from "../VRFCoordinatorV2_5.sol"; -import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +// solhint-disable-next-line contract-name-camelcase contract ExposedVRFCoordinatorV2_5 is VRFCoordinatorV2_5 { using EnumerableSet for EnumerableSet.UintSet; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol index 7b34f96e376..1211014cd2f 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol @@ -1,10 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../../VRFConsumerBaseV2Upgradeable.sol"; -import "@openzeppelin/contracts-upgradeable-4.7.3/proxy/utils/Initializable.sol"; +import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; +import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Upgradeable} from "../../VRFConsumerBaseV2Upgradeable.sol"; +import {Initializable} from "@openzeppelin/contracts-upgradeable-4.7.3/proxy/utils/Initializable.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; contract VRFConsumerV2PlusUpgradeableExample is Initializable, VRFConsumerBaseV2Upgradeable { uint256[] public s_randomWords; @@ -20,7 +21,9 @@ contract VRFConsumerV2PlusUpgradeableExample is Initializable, VRFConsumerBaseV2 LINKTOKEN = LinkTokenInterface(_link); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { + // solhint-disable-next-line custom-errors require(requestId == s_requestId, "request ID is incorrect"); s_gasAvailable = gasleft(); @@ -37,12 +40,14 @@ contract VRFConsumerV2PlusUpgradeableExample is Initializable, VRFConsumerBaseV2 } function topUpSubscription(uint96 amount) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "sub not set"); // Approve the link transfer. LINKTOKEN.transferAndCall(address(COORDINATOR), amount, abi.encode(s_subId)); } function updateSubscription(address[] memory consumers) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "subID not set"); for (uint256 i = 0; i < consumers.length; i++) { COORDINATOR.addConsumer(s_subId, consumers[i]); diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol index 94017adde73..07b55388e10 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol @@ -1,17 +1,16 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import "../../../shared/interfaces/LinkTokenInterface.sol"; -import "../../../interfaces/BlockhashStoreInterface.sol"; -import "../../../interfaces/TypeAndVersionInterface.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../../../vrf/VRF.sol"; -import "../VRFConsumerBaseV2Plus.sol"; -import "../../../ChainSpecificUtil.sol"; -import "../SubscriptionAPI.sol"; -import "../libraries/VRFV2PlusClient.sol"; -import "../../interfaces/IVRFCoordinatorV2PlusMigration.sol"; -import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {BlockhashStoreInterface} from "../../../interfaces/BlockhashStoreInterface.sol"; +// solhint-disable-next-line no-unused-import +import {IVRFCoordinatorV2Plus, IVRFSubscriptionV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRF} from "../../../vrf/VRF.sol"; +import {VRFConsumerBaseV2Plus, IVRFMigratableConsumerV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; +import {SubscriptionAPI} from "../SubscriptionAPI.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; +import {IVRFCoordinatorV2PlusMigration} from "../../interfaces/IVRFCoordinatorV2PlusMigration.sol"; +import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; contract VRFCoordinatorV2PlusUpgradedVersion is VRF, @@ -21,6 +20,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is { using EnumerableSet for EnumerableSet.UintSet; /// @dev should always be available + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i BlockhashStoreInterface public immutable BLOCKHASH_STORE; // Set this maximum to 200 to give us a 56 block window to fulfill @@ -291,6 +291,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is return requestId; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function computeRequestId( bytes32 keyHash, address sender, @@ -305,8 +306,8 @@ contract VRFCoordinatorV2PlusUpgradedVersion is * @dev calls target address with exactly gasAmount gas and data as calldata * or reverts if at least gasAmount gas is not available. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // Compute g -= GAS_FOR_CALL_EXACT_CHECK and check for underflow @@ -341,6 +342,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is uint256 randomness; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function getRandomnessFromProof( Proof memory proof, RequestCommitment memory rc @@ -444,6 +446,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is } } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculatePaymentAmount( uint256 startGas, uint256 gasAfterPaymentCalculation, @@ -468,6 +471,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is ); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculatePaymentAmountNative( uint256 startGas, uint256 gasAfterPaymentCalculation, @@ -485,6 +489,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is } // Get the amount of gas used for fulfillment + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculatePaymentAmountLink( uint256 startGas, uint256 gasAfterPaymentCalculation, @@ -508,6 +513,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is return uint96(paymentNoFee + fee); } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getFeedData() private view returns (int256) { uint32 stalenessSeconds = s_config.stalenessSeconds; bool staleFallback = stalenessSeconds > 0; @@ -615,6 +621,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is uint96 nativeBalance; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function isTargetRegistered(address target) internal view returns (bool) { for (uint256 i = 0; i < s_migrationTargets.length; i++) { if (s_migrationTargets[i] == target) { @@ -637,7 +644,9 @@ contract VRFCoordinatorV2PlusUpgradedVersion is revert CoordinatorNotRegistered(newCoordinator); } (uint96 balance, uint96 nativeBalance, , address owner, address[] memory consumers) = getSubscription(subId); + // solhint-disable-next-line custom-errors require(owner == msg.sender, "Not subscription owner"); + // solhint-disable-next-line custom-errors require(!pendingRequestExists(subId), "Pending request exists"); V1MigrationData memory migrationData = V1MigrationData({ @@ -654,6 +663,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is // Only transfer LINK if the token is active and there is a balance. if (address(LINK) != address(0) && balance != 0) { + // solhint-disable-next-line custom-errors require(LINK.transfer(address(newCoordinator), balance), "insufficient funds"); } @@ -698,7 +708,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is revert SubscriptionIDCollisionFound(); } - for (uint i = 0; i < migrationData.consumers.length; i++) { + for (uint256 i = 0; i < migrationData.consumers.length; i++) { s_consumers[migrationData.consumers[i]][migrationData.subId] = 1; } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol index 52a5b864c6b..7306931570a 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import "../../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/IVRFCoordinatorV2PlusMigration.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../VRFConsumerBaseV2Plus.sol"; +import {IVRFCoordinatorV2PlusMigration} from "../../interfaces/IVRFCoordinatorV2PlusMigration.sol"; +import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; /// @dev this contract is only meant for testing migration /// @dev it is a simplified example of future version (V2) of VRFCoordinatorV2Plus +// solhint-disable-next-line contract-name-camelcase contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration { error SubscriptionIDCollisionFound(); @@ -138,6 +138,7 @@ contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration { return handleRequest(msg.sender); } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function handleRequest(address requester) private returns (uint256) { s_requestId = s_requestId + 1; uint256 requestId = s_requestId; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFMaliciousConsumerV2Plus.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFMaliciousConsumerV2Plus.sol index 11e899ae659..cc3e465bc0c 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFMaliciousConsumerV2Plus.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFMaliciousConsumerV2Plus.sol @@ -1,24 +1,28 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../VRFConsumerBaseV2Plus.sol"; +import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; +import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; contract VRFMaliciousConsumerV2Plus is VRFConsumerBaseV2Plus { uint256[] public s_randomWords; uint256 public s_requestId; - IVRFCoordinatorV2Plus COORDINATOR; - LinkTokenInterface LINKTOKEN; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + IVRFCoordinatorV2Plus internal COORDINATOR; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + LinkTokenInterface internal LINKTOKEN; uint256 public s_gasAvailable; - uint256 s_subId; - bytes32 s_keyHash; + uint256 internal s_subId; + bytes32 internal s_keyHash; constructor(address vrfCoordinator, address link) VRFConsumerBaseV2Plus(vrfCoordinator) { COORDINATOR = IVRFCoordinatorV2Plus(vrfCoordinator); LINKTOKEN = LinkTokenInterface(link); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { s_gasAvailable = gasleft(); s_randomWords = randomWords; @@ -45,6 +49,7 @@ contract VRFMaliciousConsumerV2Plus is VRFConsumerBaseV2Plus { } function updateSubscription(address[] memory consumers) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "subID not set"); for (uint256 i = 0; i < consumers.length; i++) { COORDINATOR.addConsumer(s_subId, consumers[i]); diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol index 948cc17b3f3..8acc0ce6d0b 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol @@ -1,10 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../VRFConsumerBaseV2Plus.sol"; -import "../../../shared/access/ConfirmedOwner.sol"; +import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; +import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; /// @notice This contract is used for testing only and should not be used for production. contract VRFV2PlusConsumerExample is ConfirmedOwner, VRFConsumerBaseV2Plus { @@ -28,10 +29,12 @@ contract VRFV2PlusConsumerExample is ConfirmedOwner, VRFConsumerBaseV2Plus { function getRandomness(uint256 requestId, uint256 idx) public view returns (uint256 randomWord) { Response memory resp = s_requests[requestId]; + // solhint-disable-next-line custom-errors require(resp.requestId != 0, "request ID is incorrect"); return resp.randomWords[idx]; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function subscribe() internal returns (uint256) { if (s_subId == 0) { s_subId = s_vrfCoordinatorApiV1.createSubscription(); @@ -52,16 +55,20 @@ contract VRFV2PlusConsumerExample is ConfirmedOwner, VRFConsumerBaseV2Plus { } function topUpSubscription(uint96 amount) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "sub not set"); s_linkToken.transferAndCall(address(s_vrfCoordinator), amount, abi.encode(s_subId)); } function topUpSubscriptionNative() external payable { + // solhint-disable-next-line custom-errors require(s_subId != 0, "sub not set"); s_vrfCoordinatorApiV1.fundSubscriptionWithNative{value: msg.value}(s_subId); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { + // solhint-disable-next-line custom-errors require(requestId == s_recentRequestId, "request ID is incorrect"); s_requests[requestId].randomWords = randomWords; s_requests[requestId].fulfilled = true; @@ -94,6 +101,7 @@ contract VRFV2PlusConsumerExample is ConfirmedOwner, VRFConsumerBaseV2Plus { } function updateSubscription(address[] memory consumers) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "subID not set"); for (uint256 i = 0; i < consumers.length; i++) { s_vrfCoordinatorApiV1.addConsumer(s_subId, consumers[i]); diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusExternalSubOwnerExample.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusExternalSubOwnerExample.sol index 2b9ac5713cc..384a5890018 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusExternalSubOwnerExample.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusExternalSubOwnerExample.sol @@ -1,18 +1,21 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../VRFConsumerBaseV2Plus.sol"; +import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; +import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; /// @notice This contract is used for testing only and should not be used for production. contract VRFV2PlusExternalSubOwnerExample is VRFConsumerBaseV2Plus { - IVRFCoordinatorV2Plus COORDINATOR; - LinkTokenInterface LINKTOKEN; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + IVRFCoordinatorV2Plus internal COORDINATOR; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + LinkTokenInterface internal LINKTOKEN; uint256[] public s_randomWords; uint256 public s_requestId; - address s_owner; + address internal s_owner; constructor(address vrfCoordinator, address link) VRFConsumerBaseV2Plus(vrfCoordinator) { COORDINATOR = IVRFCoordinatorV2Plus(vrfCoordinator); @@ -20,7 +23,9 @@ contract VRFV2PlusExternalSubOwnerExample is VRFConsumerBaseV2Plus { s_owner = msg.sender; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { + // solhint-disable-next-line custom-errors require(requestId == s_requestId, "request ID is incorrect"); s_randomWords = randomWords; } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusLoadTestWithMetrics.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusLoadTestWithMetrics.sol index 42296ae6bf4..ad09f88fd2f 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusLoadTestWithMetrics.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusLoadTestWithMetrics.sol @@ -1,10 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../../ChainSpecificUtil.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../VRFConsumerBaseV2Plus.sol"; -import "../../../shared/access/ConfirmedOwner.sol"; +import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; +import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; /** * @title The VRFLoadTestExternalSubOwner contract. @@ -17,13 +16,14 @@ contract VRFV2PlusLoadTestWithMetrics is VRFConsumerBaseV2Plus { uint256 public s_slowestFulfillment = 0; uint256 public s_fastestFulfillment = 999; uint256 public s_lastRequestId; - mapping(uint256 => uint256) requestHeights; // requestIds to block number when rand request was made + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + mapping(uint256 => uint256) internal requestHeights; // requestIds to block number when rand request was made struct RequestStatus { bool fulfilled; uint256[] randomWords; - uint requestTimestamp; - uint fulfilmentTimestamp; + uint256 requestTimestamp; + uint256 fulfilmentTimestamp; uint256 requestBlockNumber; uint256 fulfilmentBlockNumber; } @@ -32,6 +32,7 @@ contract VRFV2PlusLoadTestWithMetrics is VRFConsumerBaseV2Plus { constructor(address _vrfCoordinator) VRFConsumerBaseV2Plus(_vrfCoordinator) {} + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal override { uint256 fulfilmentBlockNumber = ChainSpecificUtil.getBlockNumber(); uint256 requestDelay = fulfilmentBlockNumber - requestHeights[_requestId]; @@ -105,8 +106,8 @@ contract VRFV2PlusLoadTestWithMetrics is VRFConsumerBaseV2Plus { returns ( bool fulfilled, uint256[] memory randomWords, - uint requestTimestamp, - uint fulfilmentTimestamp, + uint256 requestTimestamp, + uint256 fulfilmentTimestamp, uint256 requestBlockNumber, uint256 fulfilmentBlockNumber ) diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol index b1dca81ebdf..2be0024ae71 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; -import "../../interfaces/IVRFMigratableConsumerV2Plus.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../libraries/VRFV2PlusClient.sol"; +import {IVRFMigratableConsumerV2Plus} from "../../interfaces/IVRFMigratableConsumerV2Plus.sol"; +import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; contract VRFV2PlusMaliciousMigrator is IVRFMigratableConsumerV2Plus { - IVRFCoordinatorV2Plus s_vrfCoordinator; + IVRFCoordinatorV2Plus internal s_vrfCoordinator; constructor(address _vrfCoordinator) { s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator); @@ -15,7 +15,7 @@ contract VRFV2PlusMaliciousMigrator is IVRFMigratableConsumerV2Plus { /** * @inheritdoc IVRFMigratableConsumerV2Plus */ - function setCoordinator(address _vrfCoordinator) public override { + function setCoordinator(address /* _vrfCoordinator */) public override { // try to re-enter, should revert // args don't really matter s_vrfCoordinator.requestRandomWords( diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusRevertingExample.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusRevertingExample.sol index 36063533586..170ff9dd6e9 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusRevertingExample.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusRevertingExample.sol @@ -1,16 +1,19 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../VRFConsumerBaseV2Plus.sol"; +import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; +import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; // VRFV2RevertingExample will always revert. Used for testing only, useless in prod. contract VRFV2PlusRevertingExample is VRFConsumerBaseV2Plus { uint256[] public s_randomWords; uint256 public s_requestId; - IVRFCoordinatorV2Plus COORDINATOR; - LinkTokenInterface LINKTOKEN; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + IVRFCoordinatorV2Plus internal COORDINATOR; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + LinkTokenInterface internal LINKTOKEN; uint256 public s_subId; uint256 public s_gasAvailable; @@ -19,7 +22,9 @@ contract VRFV2PlusRevertingExample is VRFConsumerBaseV2Plus { LINKTOKEN = LinkTokenInterface(link); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256, uint256[] memory) internal pure override { + // solhint-disable-next-line custom-errors, reason-string revert(); } @@ -33,12 +38,14 @@ contract VRFV2PlusRevertingExample is VRFConsumerBaseV2Plus { } function topUpSubscription(uint96 amount) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "sub not set"); // Approve the link transfer. LINKTOKEN.transferAndCall(address(COORDINATOR), amount, abi.encode(s_subId)); } function updateSubscription(address[] memory consumers) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "subID not set"); for (uint256 i = 0; i < consumers.length; i++) { COORDINATOR.addConsumer(s_subId, consumers[i]); diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusSingleConsumerExample.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusSingleConsumerExample.sol index e4cd9ae29ad..b190ebc8715 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusSingleConsumerExample.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusSingleConsumerExample.sol @@ -2,14 +2,17 @@ // Example of a single consumer contract which owns the subscription. pragma solidity ^0.8.0; -import "../../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import "../VRFConsumerBaseV2Plus.sol"; +import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; +import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; /// @notice This contract is used for testing only and should not be used for production. contract VRFV2PlusSingleConsumerExample is VRFConsumerBaseV2Plus { - IVRFCoordinatorV2Plus COORDINATOR; - LinkTokenInterface LINKTOKEN; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + IVRFCoordinatorV2Plus internal COORDINATOR; + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + LinkTokenInterface internal LINKTOKEN; struct RequestConfig { uint256 subId; @@ -22,7 +25,7 @@ contract VRFV2PlusSingleConsumerExample is VRFConsumerBaseV2Plus { RequestConfig public s_requestConfig; uint256[] public s_randomWords; uint256 public s_requestId; - address s_owner; + address internal s_owner; constructor( address vrfCoordinator, @@ -47,7 +50,9 @@ contract VRFV2PlusSingleConsumerExample is VRFConsumerBaseV2Plus { subscribe(); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { + // solhint-disable-next-line custom-errors require(requestId == s_requestId, "request ID is incorrect"); s_randomWords = randomWords; } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol index 206d56ea321..5285eee9463 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; -import "../VRFV2PlusWrapperConsumerBase.sol"; -import "../../../shared/access/ConfirmedOwner.sol"; +import {VRFV2PlusWrapperConsumerBase} from "../VRFV2PlusWrapperConsumerBase.sol"; +import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; contract VRFV2PlusWrapperConsumerExample is VRFV2PlusWrapperConsumerBase, ConfirmedOwner { @@ -49,7 +49,9 @@ contract VRFV2PlusWrapperConsumerExample is VRFV2PlusWrapperConsumerBase, Confir return requestId; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal override { + // solhint-disable-next-line custom-errors require(s_requests[_requestId].paid > 0, "request not found"); s_requests[_requestId].fulfilled = true; s_requests[_requestId].randomWords = _randomWords; @@ -59,6 +61,7 @@ contract VRFV2PlusWrapperConsumerExample is VRFV2PlusWrapperConsumerBase, Confir function getRequestStatus( uint256 _requestId ) external view returns (uint256 paid, bool fulfilled, uint256[] memory randomWords) { + // solhint-disable-next-line custom-errors require(s_requests[_requestId].paid > 0, "request not found"); RequestStatus memory request = s_requests[_requestId]; return (request.paid, request.fulfilled, request.randomWords); @@ -74,6 +77,7 @@ contract VRFV2PlusWrapperConsumerExample is VRFV2PlusWrapperConsumerBase, Confir /// @param amount the amount to withdraw, in wei function withdrawNative(uint256 amount) external onlyOwner { (bool success, ) = payable(owner()).call{value: amount}(""); + // solhint-disable-next-line custom-errors require(success, "withdrawNative failed"); } } diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol index 0656f621799..7b6df2c563e 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol +++ b/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol @@ -1,10 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; -import "../VRFV2PlusWrapperConsumerBase.sol"; -import "../../../shared/access/ConfirmedOwner.sol"; -import "../../../ChainSpecificUtil.sol"; +import {VRFV2PlusWrapperConsumerBase} from "../VRFV2PlusWrapperConsumerBase.sol"; +import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; +import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; +import {IVRFV2PlusWrapper} from "../../interfaces/IVRFV2PlusWrapper.sol"; contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, ConfirmedOwner { uint256 public s_responseCount; @@ -13,7 +14,8 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi uint256 public s_slowestFulfillment = 0; uint256 public s_fastestFulfillment = 999; uint256 public s_lastRequestId; - mapping(uint256 => uint256) requestHeights; // requestIds to block number when rand request was made + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore + mapping(uint256 => uint256) internal requestHeights; // requestIds to block number when rand request was made event WrappedRequestFulfilled(uint256 requestId, uint256[] randomWords, uint256 payment); event WrapperRequestMade(uint256 indexed requestId, uint256 paid); @@ -22,8 +24,8 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi uint256 paid; bool fulfilled; uint256[] randomWords; - uint requestTimestamp; - uint fulfilmentTimestamp; + uint256 requestTimestamp; + uint256 fulfilmentTimestamp; uint256 requestBlockNumber; uint256 fulfilmentBlockNumber; bool native; @@ -94,7 +96,9 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi } } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal override { + // solhint-disable-next-line custom-errors require(s_requests[_requestId].paid > 0, "request not found"); uint256 fulfilmentBlockNumber = ChainSpecificUtil.getBlockNumber(); uint256 requestDelay = fulfilmentBlockNumber - requestHeights[_requestId]; @@ -126,12 +130,13 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi uint256 paid, bool fulfilled, uint256[] memory randomWords, - uint requestTimestamp, - uint fulfilmentTimestamp, + uint256 requestTimestamp, + uint256 fulfilmentTimestamp, uint256 requestBlockNumber, uint256 fulfilmentBlockNumber ) { + // solhint-disable-next-line custom-errors require(s_requests[_requestId].paid > 0, "request not found"); RequestStatus memory request = s_requests[_requestId]; return ( @@ -163,6 +168,7 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi /// @param amount the amount to withdraw, in wei function withdrawNative(uint256 amount) external onlyOwner { (bool success, ) = payable(owner()).call{value: amount}(""); + // solhint-disable-next-line custom-errors require(success, "withdrawNative failed"); } @@ -172,7 +178,7 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi receive() external payable {} - function getBalance() public view returns (uint) { + function getBalance() public view returns (uint256) { return address(this).balance; } } diff --git a/contracts/src/v0.8/functions/dev/v0_0_0/FunctionsBillingRegistry.sol b/contracts/src/v0.8/functions/dev/v0_0_0/FunctionsBillingRegistry.sol index 3488af55cca..19dba693671 100644 --- a/contracts/src/v0.8/functions/dev/v0_0_0/FunctionsBillingRegistry.sol +++ b/contracts/src/v0.8/functions/dev/v0_0_0/FunctionsBillingRegistry.sol @@ -377,7 +377,6 @@ contract FunctionsBillingRegistry is * or reverts if at least gasAmount gas is not available. */ function callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // GAS_FOR_CALL_EXACT_CHECK = 5000 diff --git a/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsCoordinator.sol b/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsCoordinator.sol index 540b382d652..daafe593a7b 100644 --- a/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsCoordinator.sol +++ b/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsCoordinator.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.19; import {IFunctionsCoordinator} from "./interfaces/IFunctionsCoordinator.sol"; -import {IFunctionsBilling} from "./interfaces/IFunctionsBilling.sol"; import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; import {FunctionsBilling} from "./FunctionsBilling.sol"; diff --git a/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsRouter.sol b/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsRouter.sol index 41cd90341f3..9051fd26d44 100644 --- a/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsRouter.sol +++ b/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsRouter.sol @@ -402,7 +402,6 @@ contract FunctionsRouter is IFunctionsRouter, FunctionsSubscriptions, Pausable, address client ) private returns (CallbackResult memory) { bool destinationNoLongerExists; - // solhint-disable-next-line no-inline-assembly assembly { // solidity calls check that a contract actually exists at the destination, so we do the same destinationNoLongerExists := iszero(extcodesize(client)) @@ -432,7 +431,6 @@ contract FunctionsRouter is IFunctionsRouter, FunctionsSubscriptions, Pausable, // allocate return data memory ahead of time bytes memory returnData = new bytes(MAX_CALLBACK_RETURN_BYTES); - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // Compute g -= gasForCallExactCheck and check for underflow diff --git a/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsSubscriptions.sol b/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsSubscriptions.sol index 864225fd38c..9a390a93fce 100644 --- a/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsSubscriptions.sol +++ b/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsSubscriptions.sol @@ -3,15 +3,12 @@ pragma solidity ^0.8.19; import {IFunctionsSubscriptions} from "./interfaces/IFunctionsSubscriptions.sol"; import {IERC677Receiver} from "../../../shared/interfaces/IERC677Receiver.sol"; -import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; import {IFunctionsBilling} from "./interfaces/IFunctionsBilling.sol"; -import {IFunctionsRouter} from "./interfaces/IFunctionsRouter.sol"; import {FunctionsResponse} from "./libraries/FunctionsResponse.sol"; import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.0/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "../../../vendor/openzeppelin-solidity/v4.8.0/contracts/token/ERC20/utils/SafeERC20.sol"; -import {SafeCast} from "../../../vendor/openzeppelin-solidity/v4.8.0/contracts/utils/math/SafeCast.sol"; /// @title Functions Subscriptions contract /// @notice Contract that coordinates payment from users to the nodes of the Decentralized Oracle Network (DON). diff --git a/contracts/src/v0.8/functions/dev/v1_0_0/libraries/FunctionsResponse.sol b/contracts/src/v0.8/functions/dev/v1_0_0/libraries/FunctionsResponse.sol index 31a33169226..65fad665d69 100644 --- a/contracts/src/v0.8/functions/dev/v1_0_0/libraries/FunctionsResponse.sol +++ b/contracts/src/v0.8/functions/dev/v1_0_0/libraries/FunctionsResponse.sol @@ -1,8 +1,6 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {IFunctionsSubscriptions} from "../interfaces/IFunctionsSubscriptions.sol"; - /// @title Library of types that are used for fulfillment of a Functions request library FunctionsResponse { // Used to send request information from the Router to the Coordinator diff --git a/contracts/src/v0.8/functions/tests/v0_0_0/testhelpers/mocks/FunctionsBillingRegistryMigration.sol b/contracts/src/v0.8/functions/tests/v0_0_0/testhelpers/mocks/FunctionsBillingRegistryMigration.sol index f9e6649d026..d70fd3645e9 100644 --- a/contracts/src/v0.8/functions/tests/v0_0_0/testhelpers/mocks/FunctionsBillingRegistryMigration.sol +++ b/contracts/src/v0.8/functions/tests/v0_0_0/testhelpers/mocks/FunctionsBillingRegistryMigration.sol @@ -6,7 +6,6 @@ import {AggregatorV3Interface} from "../../../../../interfaces/AggregatorV3Inter import {FunctionsBillingRegistryInterface} from "./FunctionsBillingRegistryInterface.sol"; import {FunctionsOracleInterface} from "./FunctionsOracleInterface.sol"; import {FunctionsClientInterface} from "./FunctionsClientInterface.sol"; -import {TypeAndVersionInterface} from "../../../../../interfaces/TypeAndVersionInterface.sol"; import {IERC677Receiver} from "../../../../../shared/interfaces/IERC677Receiver.sol"; import {AuthorizedOriginReceiverInterface} from "./AuthorizedOriginReceiverInterface.sol"; import {ConfirmedOwnerUpgradeable} from "./ConfirmedOwnerUpgradeable.sol"; @@ -372,7 +371,6 @@ contract FunctionsBillingRegistryMigration is * or reverts if at least gasAmount gas is not available. */ function callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // GAS_FOR_CALL_EXACT_CHECK = 5000 diff --git a/contracts/src/v0.8/functions/tests/v0_0_0/testhelpers/mocks/FunctionsBillingRegistryOriginal.sol b/contracts/src/v0.8/functions/tests/v0_0_0/testhelpers/mocks/FunctionsBillingRegistryOriginal.sol index 39bff270401..a11d57f90e2 100644 --- a/contracts/src/v0.8/functions/tests/v0_0_0/testhelpers/mocks/FunctionsBillingRegistryOriginal.sol +++ b/contracts/src/v0.8/functions/tests/v0_0_0/testhelpers/mocks/FunctionsBillingRegistryOriginal.sol @@ -6,7 +6,6 @@ import {AggregatorV3Interface} from "../../../../../interfaces/AggregatorV3Inter import {FunctionsOracleInterface} from "./FunctionsOracleInterface.sol"; import {FunctionsBillingRegistryInterface} from "./FunctionsBillingRegistryInterface.sol"; import {FunctionsClientInterface} from "./FunctionsClientInterface.sol"; -import {TypeAndVersionInterface} from "../../../../../interfaces/TypeAndVersionInterface.sol"; import {IERC677Receiver} from "../../../../../shared/interfaces/IERC677Receiver.sol"; import {AuthorizedOriginReceiverInterface} from "./AuthorizedOriginReceiverInterface.sol"; import {ConfirmedOwnerUpgradeable} from "./ConfirmedOwnerUpgradeable.sol"; @@ -372,7 +371,6 @@ contract FunctionsBillingRegistryOriginal is * or reverts if at least gasAmount gas is not available. */ function callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // GAS_FOR_CALL_EXACT_CHECK = 5000 diff --git a/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol b/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol index 4cb40c104e1..c023e3d2f90 100644 --- a/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol +++ b/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "./AggregatorInterface.sol"; -import "./AggregatorV3Interface.sol"; +import {AggregatorInterface} from "./AggregatorInterface.sol"; +import {AggregatorV3Interface} from "./AggregatorV3Interface.sol"; interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface {} diff --git a/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol b/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol index 512939b38fe..1d2367d82a8 100644 --- a/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol +++ b/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; pragma abicoder v2; -import "./AggregatorV2V3Interface.sol"; +import {AggregatorV2V3Interface} from "./AggregatorV2V3Interface.sol"; interface FeedRegistryInterface { struct Phase { diff --git a/contracts/src/v0.8/interfaces/OperatorInterface.sol b/contracts/src/v0.8/interfaces/OperatorInterface.sol index 14922649159..668c167cf4b 100644 --- a/contracts/src/v0.8/interfaces/OperatorInterface.sol +++ b/contracts/src/v0.8/interfaces/OperatorInterface.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "./OracleInterface.sol"; -import "./ChainlinkRequestInterface.sol"; +import {OracleInterface} from "./OracleInterface.sol"; +import {ChainlinkRequestInterface} from "./ChainlinkRequestInterface.sol"; interface OperatorInterface is OracleInterface, ChainlinkRequestInterface { function operatorRequest( diff --git a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol index 3c09fb9acad..5c9b3268c7f 100644 --- a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol +++ b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.4; import {AddressAliasHelper} from "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol"; -import {ForwarderInterface} from "./../interfaces/ForwarderInterface.sol"; import {AggregatorInterface} from "../../../interfaces/AggregatorInterface.sol"; import {AggregatorV3Interface} from "../../../interfaces/AggregatorV3Interface.sol"; import {AggregatorV2V3Interface} from "../../../interfaces/AggregatorV2V3Interface.sol"; @@ -10,7 +9,6 @@ import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterfa import {FlagsInterface} from "./../../../dev/interfaces/FlagsInterface.sol"; import {ArbitrumSequencerUptimeFeedInterface} from "../interfaces/ArbitrumSequencerUptimeFeedInterface.sol"; import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAccessController.sol"; -import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; /** * @title ArbitrumSequencerUptimeFeed - L2 sequencer uptime status aggregator diff --git a/contracts/src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol b/contracts/src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol index a4ef57505b5..af7ccc90574 100644 --- a/contracts/src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol +++ b/contracts/src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol @@ -7,7 +7,6 @@ import {AggregatorV2V3Interface} from "../../../interfaces/AggregatorV2V3Interfa import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; import {OptimismSequencerUptimeFeedInterface} from "./../interfaces/OptimismSequencerUptimeFeedInterface.sol"; import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAccessController.sol"; -import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; import {IL2CrossDomainMessenger} from "@eth-optimism/contracts/L2/messaging/IL2CrossDomainMessenger.sol"; /** diff --git a/contracts/src/v0.8/libraries/ByteUtil.sol b/contracts/src/v0.8/libraries/ByteUtil.sol index 906fef3fa77..9691cfb7fea 100644 --- a/contracts/src/v0.8/libraries/ByteUtil.sol +++ b/contracts/src/v0.8/libraries/ByteUtil.sol @@ -16,7 +16,7 @@ library ByteUtil { * @param offset Position to start reading from. * @return result The uint256 read from the byte array. */ - function readUint256(bytes memory data, uint256 offset) internal pure returns (uint256 result) { + function _readUint256(bytes memory data, uint256 offset) internal pure returns (uint256 result) { //bounds check if (offset + 32 > data.length) revert MalformedData(); @@ -32,7 +32,7 @@ library ByteUtil { * @param offset Position to start reading from. * @return result The uint192 read from the byte array. */ - function readUint192(bytes memory data, uint256 offset) internal pure returns (uint256 result) { + function _readUint192(bytes memory data, uint256 offset) internal pure returns (uint256 result) { //bounds check if (offset + 24 > data.length) revert MalformedData(); @@ -50,7 +50,7 @@ library ByteUtil { * @param offset Position to start reading from. * @return result The uint32 read from the byte array. */ - function readUint32(bytes memory data, uint256 offset) internal pure returns (uint256 result) { + function _readUint32(bytes memory data, uint256 offset) internal pure returns (uint256 result) { //bounds check if (offset + 4 > data.length) revert MalformedData(); @@ -68,7 +68,7 @@ library ByteUtil { * @param offset Position to start reading from. * @return result The uint32 read from the byte array. */ - function readAddress(bytes memory data, uint256 offset) internal pure returns (address result) { + function _readAddress(bytes memory data, uint256 offset) internal pure returns (address result) { //bounds check if (offset + 20 > data.length) revert MalformedData(); diff --git a/contracts/src/v0.8/libraries/Common.sol b/contracts/src/v0.8/libraries/Common.sol index 5bb8275c72e..fe04a9af71b 100644 --- a/contracts/src/v0.8/libraries/Common.sol +++ b/contracts/src/v0.8/libraries/Common.sol @@ -24,7 +24,7 @@ library Common { * @param recipients The array of AddressAndWeight to check * @return bool True if there are duplicates, false otherwise */ - function hasDuplicateAddresses(Common.AddressAndWeight[] memory recipients) internal pure returns (bool) { + function _hasDuplicateAddresses(Common.AddressAndWeight[] memory recipients) internal pure returns (bool) { for (uint256 i = 0; i < recipients.length; ) { for (uint256 j = i + 1; j < recipients.length; ) { if (recipients[i].addr == recipients[j].addr) { diff --git a/contracts/src/v0.8/libraries/test/ByteUtilTest.t.sol b/contracts/src/v0.8/libraries/test/ByteUtilTest.t.sol index eabae4f5729..0629d0235ee 100644 --- a/contracts/src/v0.8/libraries/test/ByteUtilTest.t.sol +++ b/contracts/src/v0.8/libraries/test/ByteUtilTest.t.sol @@ -17,7 +17,7 @@ contract ByteUtilTest is Test { function test_readUint256Max() public { //read the first 32 bytes - uint256 result = B_512.readUint256(0); + uint256 result = B_512._readUint256(0); //the result should be the max value of a uint256 assertEq(result, type(uint256).max); @@ -25,7 +25,7 @@ contract ByteUtilTest is Test { function test_readUint192Max() public { //read the first 24 bytes - uint256 result = B_512.readUint192(0); + uint256 result = B_512._readUint192(0); //the result should be the max value of a uint192 assertEq(result, type(uint192).max); @@ -33,7 +33,7 @@ contract ByteUtilTest is Test { function test_readUint32Max() public { //read the first 4 bytes - uint256 result = B_512.readUint32(0); + uint256 result = B_512._readUint32(0); //the result should be the max value of a uint32 assertEq(result, type(uint32).max); @@ -41,7 +41,7 @@ contract ByteUtilTest is Test { function test_readUint256Min() public { //read the second 32 bytes - uint256 result = B_512.readUint256(32); + uint256 result = B_512._readUint256(32); //the result should be the min value of a uint256 assertEq(result, type(uint256).min); @@ -49,7 +49,7 @@ contract ByteUtilTest is Test { function test_readUint192Min() public { //read the second 24 bytes - uint256 result = B_512.readUint192(32); + uint256 result = B_512._readUint192(32); //the result should be the min value of a uint192 assertEq(result, type(uint192).min); @@ -57,7 +57,7 @@ contract ByteUtilTest is Test { function test_readUint32Min() public { //read the second 4 bytes - uint256 result = B_512.readUint32(32); + uint256 result = B_512._readUint32(32); //the result should be the min value of a uint32 assertEq(result, type(uint32).min); @@ -65,7 +65,7 @@ contract ByteUtilTest is Test { function test_readUint256MultiWord() public { //read the first 32 bytes - uint256 result = B_512.readUint256(31); + uint256 result = B_512._readUint256(31); //the result should be the last byte from the first word (ff), and 31 bytes from the second word (0000) (0xFF...0000) assertEq(result, type(uint256).max << 248); @@ -73,7 +73,7 @@ contract ByteUtilTest is Test { function test_readUint192MultiWord() public { //read the first 24 bytes - uint256 result = B_512.readUint192(31); + uint256 result = B_512._readUint192(31); //the result should be the last byte from the first word (ff), and 23 bytes from the second word (0000) (0xFF...0000) assertEq(result, type(uint192).max << 184); @@ -81,7 +81,7 @@ contract ByteUtilTest is Test { function test_readUint32MultiWord() public { //read the first 4 bytes - uint256 result = B_512.readUint32(31); + uint256 result = B_512._readUint32(31); //the result should be the last byte from the first word (ff), and 3 bytes from the second word (0000) (0xFF...0000) assertEq(result, type(uint32).max << 24); @@ -92,7 +92,7 @@ contract ByteUtilTest is Test { vm.expectRevert(MALFORMED_ERROR_SELECTOR); //try and read 32 bytes from a 16 byte number - B_128.readUint256(0); + B_128._readUint256(0); } function test_readUint192WithNotEnoughBytes() public { @@ -100,7 +100,7 @@ contract ByteUtilTest is Test { vm.expectRevert(MALFORMED_ERROR_SELECTOR); //try and read 24 bytes from a 16 byte number - B_128.readUint192(0); + B_128._readUint192(0); } function test_readUint32WithNotEnoughBytes() public { @@ -108,7 +108,7 @@ contract ByteUtilTest is Test { vm.expectRevert(MALFORMED_ERROR_SELECTOR); //try and read 4 bytes from a 2 byte number - B_16.readUint32(0); + B_16._readUint32(0); } function test_readUint256WithEmptyArray() public { @@ -116,7 +116,7 @@ contract ByteUtilTest is Test { vm.expectRevert(MALFORMED_ERROR_SELECTOR); //read 20 bytes from an empty array - B_EMPTY.readUint256(0); + B_EMPTY._readUint256(0); } function test_readUint192WithEmptyArray() public { @@ -124,7 +124,7 @@ contract ByteUtilTest is Test { vm.expectRevert(MALFORMED_ERROR_SELECTOR); //read 20 bytes from an empty array - B_EMPTY.readUint192(0); + B_EMPTY._readUint192(0); } function test_readUint32WithEmptyArray() public { @@ -132,12 +132,12 @@ contract ByteUtilTest is Test { vm.expectRevert(MALFORMED_ERROR_SELECTOR); //read 20 bytes from an empty array - B_EMPTY.readUint32(0); + B_EMPTY._readUint32(0); } function test_readAddress() public { //read the first 20 bytes - address result = B_512.readAddress(0); + address result = B_512._readAddress(0); //the result should be the max value of a uint256 assertEq(result, address(type(uint160).max)); @@ -145,7 +145,7 @@ contract ByteUtilTest is Test { function test_readZeroAddress() public { //read the first 32 bytes after the first word - address result = B_512.readAddress(32); + address result = B_512._readAddress(32); //the result should be 0x00...0 assertEq(result, address(type(uint160).min)); @@ -153,7 +153,7 @@ contract ByteUtilTest is Test { function test_readAddressMultiWord() public { //read the first 20 bytes after byte 13 - address result = B_512.readAddress(13); + address result = B_512._readAddress(13); //the result should be the value last 19 bytes of the first word (ffff..) and the first byte of the second word (00) (0xFFFF..00) assertEq(result, address(type(uint160).max << 8)); @@ -164,7 +164,7 @@ contract ByteUtilTest is Test { vm.expectRevert(MALFORMED_ERROR_SELECTOR); //read 20 bytes from a 16 byte array - B_128.readAddress(0); + B_128._readAddress(0); } function test_readAddressWithEmptyArray() public { @@ -172,6 +172,6 @@ contract ByteUtilTest is Test { vm.expectRevert(MALFORMED_ERROR_SELECTOR); //read the first 20 bytes of an empty array - B_EMPTY.readAddress(0); + B_EMPTY._readAddress(0); } } diff --git a/contracts/src/v0.8/llo-feeds/RewardManager.sol b/contracts/src/v0.8/llo-feeds/RewardManager.sol index f4bd835c256..e064bff8b67 100644 --- a/contracts/src/v0.8/llo-feeds/RewardManager.sol +++ b/contracts/src/v0.8/llo-feeds/RewardManager.sol @@ -5,7 +5,6 @@ import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; import {IRewardManager} from "./interfaces/IRewardManager.sol"; import {IERC20} from "../vendor/openzeppelin-solidity/v4.8.0/contracts/interfaces/IERC20.sol"; import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; -import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.0/contracts/interfaces/IERC165.sol"; import {Common} from "../libraries/Common.sol"; import {SafeERC20} from "../vendor/openzeppelin-solidity/v4.8.0/contracts/token/ERC20/utils/SafeERC20.sol"; @@ -200,7 +199,7 @@ contract RewardManager is IRewardManager, ConfirmedOwner, TypeAndVersionInterfac uint256 expectedWeight ) internal { //we can't update the weights if it contains duplicates - if (Common.hasDuplicateAddresses(rewardRecipientAndWeights)) revert InvalidAddress(); + if (Common._hasDuplicateAddresses(rewardRecipientAndWeights)) revert InvalidAddress(); //loop all the reward recipients and validate the weight and address uint256 totalWeight; diff --git a/contracts/src/v0.8/llo-feeds/Verifier.sol b/contracts/src/v0.8/llo-feeds/Verifier.sol index dbd5fc73abc..cd7e3d2bad6 100644 --- a/contracts/src/v0.8/llo-feeds/Verifier.sol +++ b/contracts/src/v0.8/llo-feeds/Verifier.sol @@ -173,7 +173,7 @@ contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface { address private immutable i_verifierProxyAddr; /// @notice Verifier states keyed on Feed ID - mapping(bytes32 => VerifierState) s_feedVerifierStates; + mapping(bytes32 => VerifierState) internal s_feedVerifierStates; /// @param verifierProxyAddr The address of the VerifierProxy contract constructor(address verifierProxyAddr) ConfirmedOwner(msg.sender) { diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol index ef46ad37853..c446150406e 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.16; import {Test} from "forge-std/Test.sol"; import {FeeManager} from "../../FeeManager.sol"; -import {IFeeManager} from "../../interfaces/IFeeManager.sol"; import {RewardManager} from "../../RewardManager.sol"; import {Common} from "../../../libraries/Common.sol"; import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.0/contracts/mocks/ERC20Mock.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol index 105c140b73a..e2c9916f663 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol @@ -1,9 +1,6 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.16; -import {Test} from "forge-std/Test.sol"; -import {FeeManager} from "../../FeeManager.sol"; -import {Common} from "../../../libraries/Common.sol"; import "./BaseFeeManager.t.sol"; /** diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol index dcabe6e5f9d..801a1e39925 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol @@ -1,9 +1,6 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.16; -import {Test} from "forge-std/Test.sol"; -import {FeeManager} from "../../FeeManager.sol"; -import {IFeeManager} from "../../interfaces/IFeeManager.sol"; import {Common} from "../../../libraries/Common.sol"; import "./BaseFeeManager.t.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol index 91fb42a500f..9c2bd711ed5 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol @@ -1,8 +1,6 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.16; -import {Test} from "forge-std/Test.sol"; -import {FeeManager} from "../../FeeManager.sol"; import {Common} from "../../../libraries/Common.sol"; import "./BaseFeeManager.t.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol index 25fb804630d..3570b8824a8 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol @@ -1,9 +1,6 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.16; -import {Test} from "forge-std/Test.sol"; -import {FeeManager} from "../../FeeManager.sol"; -import {Common} from "../../../libraries/Common.sol"; import "./BaseFeeManager.t.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol index 5e601034bb8..3198576e8aa 100644 --- a/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol @@ -2,7 +2,6 @@ pragma solidity 0.8.16; import {BaseTest, BaseTestWithConfiguredVerifierAndFeeManager} from "../verifier/BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; import {SimpleWriteAccessController} from "../../../shared/access/SimpleWriteAccessController.sol"; import {Common} from "../../../libraries/Common.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.general.t.sol b/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.general.t.sol index befe6bfce93..9cee5b05c57 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.general.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.general.t.sol @@ -2,7 +2,6 @@ pragma solidity 0.8.16; import {BaseRewardManagerTest} from "./BaseRewardManager.t.sol"; -import {Common} from "../../../libraries/Common.sol"; import {RewardManager} from "../../RewardManager.sol"; import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.0/contracts/mocks/ERC20Mock.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.payRecipients.t.sol b/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.payRecipients.t.sol index 5dcf1eeae4f..0f94805da69 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.payRecipients.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.payRecipients.t.sol @@ -2,7 +2,6 @@ pragma solidity 0.8.16; import {BaseRewardManagerTest} from "./BaseRewardManager.t.sol"; -import {Common} from "../../../libraries/Common.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; /** diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.setRecipients.t.sol b/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.setRecipients.t.sol index 58cce9a9154..0e45ba00da4 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.setRecipients.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.setRecipients.t.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.16; import {BaseRewardManagerTest} from "./BaseRewardManager.t.sol"; import {Common} from "../../../libraries/Common.sol"; -import {RewardManager} from "../../RewardManager.sol"; /** * @title BaseRewardManagerTest diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.updateRewardRecipients.t.sol b/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.updateRewardRecipients.t.sol index e6f964f9f9f..4b3063ac016 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.updateRewardRecipients.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.updateRewardRecipients.t.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.16; import {BaseRewardManagerTest} from "./BaseRewardManager.t.sol"; import {Common} from "../../../libraries/Common.sol"; -import {RewardManager} from "../../RewardManager.sol"; /** * @title BaseRewardManagerTest diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol index 641d2772595..8838beded9d 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.16; import {BaseTestWithConfiguredVerifierAndFeeManager, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; import {Verifier} from "../../Verifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; contract VerifierActivateConfigTest is BaseTestWithConfiguredVerifierAndFeeManager { function test_revertsIfNotOwner() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol index fc6814d3bfe..70e65a60300 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.16; import {BaseTestWithConfiguredVerifierAndFeeManager, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; import {Verifier} from "../../Verifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; contract VerifierActivateFeedTest is BaseTestWithConfiguredVerifierAndFeeManager { function test_revertsIfNotOwnerActivateFeed() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyConstructorTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyConstructorTest.t.sol index 7de7dea03d1..8410d655897 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyConstructorTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyConstructorTest.t.sol @@ -2,7 +2,6 @@ pragma solidity 0.8.16; import {BaseTest} from "./BaseVerifierTest.t.sol"; -import {IVerifier} from "../../interfaces/IVerifier.sol"; import {VerifierProxy} from "../../VerifierProxy.sol"; import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyInitializeVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyInitializeVerifierTest.t.sol index 66ddb4bf3c3..f73d93af18c 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyInitializeVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyInitializeVerifierTest.t.sol @@ -2,9 +2,7 @@ pragma solidity 0.8.16; import {BaseTest} from "./BaseVerifierTest.t.sol"; -import {IVerifier} from "../../interfaces/IVerifier.sol"; import {VerifierProxy} from "../../VerifierProxy.sol"; -import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; contract VerifierProxyInitializeVerifierTest is BaseTest { bytes32 latestDigest; diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetVerifierTest.t.sol index 9fa2f16d900..3699aaf420d 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetVerifierTest.t.sol @@ -4,7 +4,6 @@ pragma solidity 0.8.16; import {BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; import {IVerifier} from "../../interfaces/IVerifier.sol"; import {VerifierProxy} from "../../VerifierProxy.sol"; -import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.0/contracts/interfaces/IERC165.sol"; import {Common} from "../../../libraries/Common.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyTest.t.sol index 5aa3e791ed8..9b5f94acd4b 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyTest.t.sol @@ -2,11 +2,7 @@ pragma solidity 0.8.16; import {BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; -import {IVerifier} from "../../interfaces/IVerifier.sol"; import {VerifierProxy} from "../../VerifierProxy.sol"; -import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; -import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.0/contracts/interfaces/IERC165.sol"; -import {Common} from "../../../libraries/Common.sol"; import {FeeManager} from "../../FeeManager.sol"; contract VerifierProxyInitializeVerifierTest is BaseTestWithConfiguredVerifierAndFeeManager { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyUnsetVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyUnsetVerifierTest.t.sol index a64d6ee0f78..95a42e52edc 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyUnsetVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyUnsetVerifierTest.t.sol @@ -2,7 +2,6 @@ pragma solidity 0.8.16; import {BaseTest, BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; -import {IVerifier} from "../../interfaces/IVerifier.sol"; import {VerifierProxy} from "../../VerifierProxy.sol"; contract VerifierProxyUnsetVerifierTest is BaseTest { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigFromSourceTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigFromSourceTest.t.sol index 57c98622f5b..6c5eac9b6dd 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigFromSourceTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigFromSourceTest.t.sol @@ -2,8 +2,6 @@ pragma solidity 0.8.16; import {BaseTest, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; import {Common} from "../../../libraries/Common.sol"; contract VerifierSetConfigFromSourceTest is BaseTest { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigTest.t.sol index faa1f98bc30..f0b045e7f30 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigTest.t.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.16; import {BaseTest, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; import {Verifier} from "../../Verifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; import {Common} from "../../../libraries/Common.sol"; contract VerifierSetConfigTest is BaseTest { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTest.t.sol index 1b4340495fc..290eaa1d568 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTest.t.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.16; import {BaseTest} from "./BaseVerifierTest.t.sol"; import {Verifier} from "../../Verifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; contract VerifierConstructorTest is BaseTest { function test_revertsIfInitializedWithEmptyVerifierProxy() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol index fffa291b0d8..52281298d48 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol @@ -2,9 +2,6 @@ pragma solidity 0.8.16; import {BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; -import {Common} from "../../../libraries/Common.sol"; contract VerifierTestWithConfiguredVerifierAndFeeManager is BaseTestWithConfiguredVerifierAndFeeManager { uint256 internal constant DEFAULT_LINK_MINT_QUANTITY = 100 ether; diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierUnsetConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierUnsetConfigTest.t.sol index 467c5072d55..41c484a8787 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierUnsetConfigTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/test/verifier/VerifierUnsetConfigTest.t.sol @@ -1,9 +1,8 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.16; -import {BaseTestWithConfiguredVerifierAndFeeManager, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; +import {BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; import {Verifier} from "../../Verifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; contract VerificationdeactivateConfigWhenThereAreMultipleDigestsTest is BaseTestWithMultipleConfiguredDigests { function test_revertsIfCalledByNonOwner() public { diff --git a/contracts/src/v0.8/shared/access/ConfirmedOwner.sol b/contracts/src/v0.8/shared/access/ConfirmedOwner.sol index a33cff10bc9..a25d92ffd67 100644 --- a/contracts/src/v0.8/shared/access/ConfirmedOwner.sol +++ b/contracts/src/v0.8/shared/access/ConfirmedOwner.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "./ConfirmedOwnerWithProposal.sol"; +import {ConfirmedOwnerWithProposal} from "./ConfirmedOwnerWithProposal.sol"; /** * @title The ConfirmedOwner contract diff --git a/contracts/src/v0.8/shared/access/ConfirmedOwnerWithProposal.sol b/contracts/src/v0.8/shared/access/ConfirmedOwnerWithProposal.sol index c2a01cfca18..a6757c38869 100644 --- a/contracts/src/v0.8/shared/access/ConfirmedOwnerWithProposal.sol +++ b/contracts/src/v0.8/shared/access/ConfirmedOwnerWithProposal.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../interfaces/IOwnable.sol"; +import {IOwnable} from "../interfaces/IOwnable.sol"; /** * @title The ConfirmedOwner contract @@ -15,6 +15,7 @@ contract ConfirmedOwnerWithProposal is IOwnable { event OwnershipTransferred(address indexed from, address indexed to); constructor(address newOwner, address pendingOwner) { + // solhint-disable-next-line custom-errors require(newOwner != address(0), "Cannot set owner to zero"); s_owner = newOwner; @@ -35,6 +36,7 @@ contract ConfirmedOwnerWithProposal is IOwnable { * @notice Allows an ownership transfer to be completed by the recipient. */ function acceptOwnership() external override { + // solhint-disable-next-line custom-errors require(msg.sender == s_pendingOwner, "Must be proposed owner"); address oldOwner = s_owner; @@ -55,6 +57,7 @@ contract ConfirmedOwnerWithProposal is IOwnable { * @notice validate, transfer ownership, and emit relevant events */ function _transferOwnership(address to) private { + // solhint-disable-next-line custom-errors require(to != msg.sender, "Cannot transfer to self"); s_pendingOwner = to; @@ -66,6 +69,7 @@ contract ConfirmedOwnerWithProposal is IOwnable { * @notice validate access */ function _validateOwnership() internal view { + // solhint-disable-next-line custom-errors require(msg.sender == s_owner, "Only callable by owner"); } diff --git a/contracts/src/v0.8/shared/access/SimpleReadAccessController.sol b/contracts/src/v0.8/shared/access/SimpleReadAccessController.sol index ade1c15c86b..b36fa4e4b60 100644 --- a/contracts/src/v0.8/shared/access/SimpleReadAccessController.sol +++ b/contracts/src/v0.8/shared/access/SimpleReadAccessController.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "./SimpleWriteAccessController.sol"; +import {SimpleWriteAccessController} from "./SimpleWriteAccessController.sol"; /** * @title SimpleReadAccessController @@ -20,6 +20,7 @@ contract SimpleReadAccessController is SimpleWriteAccessController { * @param _user The address to query */ function hasAccess(address _user, bytes memory _calldata) public view virtual override returns (bool) { + // solhint-disable-next-line avoid-tx-origin return super.hasAccess(_user, _calldata) || _user == tx.origin; } } diff --git a/contracts/src/v0.8/shared/access/SimpleWriteAccessController.sol b/contracts/src/v0.8/shared/access/SimpleWriteAccessController.sol index c73dec470b2..117d2e77dd6 100644 --- a/contracts/src/v0.8/shared/access/SimpleWriteAccessController.sol +++ b/contracts/src/v0.8/shared/access/SimpleWriteAccessController.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "./ConfirmedOwner.sol"; -import "../interfaces/AccessControllerInterface.sol"; +import {ConfirmedOwner} from "./ConfirmedOwner.sol"; +import {AccessControllerInterface} from "../interfaces/AccessControllerInterface.sol"; /** * @title SimpleWriteAccessController @@ -13,7 +13,7 @@ import "../interfaces/AccessControllerInterface.sol"; */ contract SimpleWriteAccessController is AccessControllerInterface, ConfirmedOwner { bool public checkEnabled; - mapping(address => bool) internal accessList; + mapping(address => bool) internal s_accessList; event AddedAccess(address user); event RemovedAccess(address user); @@ -29,7 +29,7 @@ contract SimpleWriteAccessController is AccessControllerInterface, ConfirmedOwne * @param _user The address to query */ function hasAccess(address _user, bytes memory) public view virtual override returns (bool) { - return accessList[_user] || !checkEnabled; + return s_accessList[_user] || !checkEnabled; } /** @@ -37,8 +37,8 @@ contract SimpleWriteAccessController is AccessControllerInterface, ConfirmedOwne * @param _user The address to add */ function addAccess(address _user) external onlyOwner { - if (!accessList[_user]) { - accessList[_user] = true; + if (!s_accessList[_user]) { + s_accessList[_user] = true; emit AddedAccess(_user); } @@ -49,8 +49,8 @@ contract SimpleWriteAccessController is AccessControllerInterface, ConfirmedOwne * @param _user The address to remove */ function removeAccess(address _user) external onlyOwner { - if (accessList[_user]) { - accessList[_user] = false; + if (s_accessList[_user]) { + s_accessList[_user] = false; emit RemovedAccess(_user); } @@ -82,6 +82,7 @@ contract SimpleWriteAccessController is AccessControllerInterface, ConfirmedOwne * @dev reverts if the caller does not have access */ modifier checkAccess() { + // solhint-disable-next-line custom-errors require(hasAccess(msg.sender, msg.data), "No access"); _; } diff --git a/contracts/src/v0.8/shared/interfaces/IWERC20.sol b/contracts/src/v0.8/shared/interfaces/IWERC20.sol index e79712a593d..96073530482 100644 --- a/contracts/src/v0.8/shared/interfaces/IWERC20.sol +++ b/contracts/src/v0.8/shared/interfaces/IWERC20.sol @@ -4,5 +4,5 @@ pragma solidity ^0.8.0; interface IWERC20 { function deposit() external payable; - function withdraw(uint) external; + function withdraw(uint256) external; } diff --git a/contracts/src/v0.8/shared/mocks/WERC20Mock.sol b/contracts/src/v0.8/shared/mocks/WERC20Mock.sol index 11bdb790c02..02c13be9937 100644 --- a/contracts/src/v0.8/shared/mocks/WERC20Mock.sol +++ b/contracts/src/v0.8/shared/mocks/WERC20Mock.sol @@ -6,8 +6,8 @@ import {ERC20} from "../../vendor/openzeppelin-solidity/v4.8.0/contracts/token/E contract WERC20Mock is ERC20 { constructor() ERC20("WERC20Mock", "WERC") {} - event Deposit(address indexed dst, uint wad); - event Withdrawal(address indexed src, uint wad); + event Deposit(address indexed dst, uint256 wad); + event Withdrawal(address indexed src, uint256 wad); receive() external payable { deposit(); @@ -18,7 +18,8 @@ contract WERC20Mock is ERC20 { emit Deposit(msg.sender, msg.value); } - function withdraw(uint wad) public { + function withdraw(uint256 wad) public { + // solhint-disable-next-line custom-errors, reason-string require(balanceOf(msg.sender) >= wad); _burn(msg.sender, wad); payable(msg.sender).transfer(wad); diff --git a/contracts/src/v0.8/shared/ocr2/OCR2Abstract.sol b/contracts/src/v0.8/shared/ocr2/OCR2Abstract.sol index 5031a528b3d..1f19d0de54e 100644 --- a/contracts/src/v0.8/shared/ocr2/OCR2Abstract.sol +++ b/contracts/src/v0.8/shared/ocr2/OCR2Abstract.sol @@ -5,8 +5,11 @@ import {ITypeAndVersion} from "../interfaces/ITypeAndVersion.sol"; abstract contract OCR2Abstract is ITypeAndVersion { // Maximum number of oracles the offchain reporting protocol is designed for + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables uint256 internal constant maxNumOracles = 31; + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables uint256 private constant prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables uint256 private constant prefix = 0x0001 << (256 - 16); // 0x000100..00 /** diff --git a/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol b/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol index 6b223f51236..6b13f390009 100644 --- a/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol +++ b/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol @@ -8,7 +8,6 @@ import {BaseTest} from "../../BaseTest.t.sol"; import {BurnMintERC677} from "../../../token/ERC677/BurnMintERC677.sol"; import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.0/contracts/token/ERC20/IERC20.sol"; -import {Strings} from "../../../../vendor/openzeppelin-solidity/v4.8.0/contracts/utils/Strings.sol"; import {IERC165} from "../../../../vendor/openzeppelin-solidity/v4.8.0/contracts/utils/introspection/IERC165.sol"; contract BurnMintERC677Setup is BaseTest { diff --git a/contracts/src/v0.8/shared/token/ERC20/IOptimismMintableERC20.sol b/contracts/src/v0.8/shared/token/ERC20/IOptimismMintableERC20.sol index 79441cf89f7..6362d9e78ac 100644 --- a/contracts/src/v0.8/shared/token/ERC20/IOptimismMintableERC20.sol +++ b/contracts/src/v0.8/shared/token/ERC20/IOptimismMintableERC20.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// solhint-disable one-contract-per-file pragma solidity ^0.8.0; import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.0/contracts/utils/introspection/IERC165.sol"; diff --git a/contracts/src/v0.8/shared/token/ERC677/BurnMintERC677.sol b/contracts/src/v0.8/shared/token/ERC677/BurnMintERC677.sol index 0d78581b13c..775d5fb3d94 100644 --- a/contracts/src/v0.8/shared/token/ERC677/BurnMintERC677.sol +++ b/contracts/src/v0.8/shared/token/ERC677/BurnMintERC677.sol @@ -91,6 +91,7 @@ contract BurnMintERC677 is IBurnMintERC20, ERC677, IERC165, ERC20Burnable, Owner /// @dev Reverts with an empty revert to be compatible with the existing link token when /// the recipient is this contract address. modifier validAddress(address recipient) virtual { + // solhint-disable-next-line reason-string, custom-errors if (recipient == address(this)) revert(); _; } diff --git a/contracts/src/v0.8/shared/token/ERC677/ERC677.sol b/contracts/src/v0.8/shared/token/ERC677/ERC677.sol index de124d53c55..c9a2996e8e9 100644 --- a/contracts/src/v0.8/shared/token/ERC677/ERC677.sol +++ b/contracts/src/v0.8/shared/token/ERC677/ERC677.sol @@ -13,7 +13,7 @@ contract ERC677 is IERC677, ERC20 { constructor(string memory name, string memory symbol) ERC20(name, symbol) {} /// @inheritdoc IERC677 - function transferAndCall(address to, uint amount, bytes memory data) public returns (bool success) { + function transferAndCall(address to, uint256 amount, bytes memory data) public returns (bool success) { super.transfer(to, amount); emit Transfer(msg.sender, to, amount, data); if (to.isContract()) { diff --git a/contracts/src/v0.8/vrf/BatchBlockhashStore.sol b/contracts/src/v0.8/vrf/BatchBlockhashStore.sol index c6c3a888289..bdd906897fa 100644 --- a/contracts/src/v0.8/vrf/BatchBlockhashStore.sol +++ b/contracts/src/v0.8/vrf/BatchBlockhashStore.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: MIT +// solhint-disable-next-line one-contract-per-file pragma solidity 0.8.6; -import "../ChainSpecificUtil.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil.sol"; /** * @title BatchBlockhashStore @@ -11,6 +12,7 @@ import "../ChainSpecificUtil.sol"; * in times of high network congestion. */ contract BatchBlockhashStore { + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i BlockhashStore public immutable BHS; constructor(address blockhashStoreAddr) { @@ -40,6 +42,7 @@ contract BatchBlockhashStore { * @param headers the rlp-encoded block headers of blockNumbers[i] + 1. */ function storeVerifyHeader(uint256[] memory blockNumbers, bytes[] memory headers) public { + // solhint-disable-next-line custom-errors require(blockNumbers.length == headers.length, "input array arg lengths mismatch"); for (uint256 i = 0; i < blockNumbers.length; i++) { BHS.storeVerifyHeader(blockNumbers[i], headers[i]); @@ -70,6 +73,7 @@ contract BatchBlockhashStore { * using the blockhash() instruction. * @param blockNumber the block number to check if it's storeable with blockhash() */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function storeableBlock(uint256 blockNumber) private view returns (bool) { // handle edge case on simulated chains which possibly have < 256 blocks total. return ChainSpecificUtil.getBlockNumber() <= 256 ? true : blockNumber >= (ChainSpecificUtil.getBlockNumber() - 256); diff --git a/contracts/src/v0.8/vrf/BatchVRFCoordinatorV2.sol b/contracts/src/v0.8/vrf/BatchVRFCoordinatorV2.sol index 83f0a78359d..1072289e88e 100644 --- a/contracts/src/v0.8/vrf/BatchVRFCoordinatorV2.sol +++ b/contracts/src/v0.8/vrf/BatchVRFCoordinatorV2.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: MIT +// solhint-disable-next-line one-contract-per-file pragma solidity 0.8.6; -import "./VRFTypes.sol"; +import {VRFTypes} from "./VRFTypes.sol"; /** * @title BatchVRFCoordinatorV2 @@ -9,6 +10,7 @@ import "./VRFTypes.sol"; * provided VRFCoordinatorV2 contract efficiently in a single transaction. */ contract BatchVRFCoordinatorV2 { + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i VRFCoordinatorV2 public immutable COORDINATOR; event ErrorReturned(uint256 indexed requestId, string reason); @@ -24,6 +26,7 @@ contract BatchVRFCoordinatorV2 { * @param rcs the request commitments corresponding to the randomness proofs. */ function fulfillRandomWords(VRFTypes.Proof[] memory proofs, VRFTypes.RequestCommitment[] memory rcs) external { + // solhint-disable-next-line custom-errors require(proofs.length == rcs.length, "input array arg lengths mismatch"); for (uint256 i = 0; i < proofs.length; i++) { try COORDINATOR.fulfillRandomWords(proofs[i], rcs[i]) returns (uint96 /* payment */) { @@ -42,6 +45,7 @@ contract BatchVRFCoordinatorV2 { * @notice Returns the proving key hash associated with this public key. * @param publicKey the key to return the hash of. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function hashOfKey(uint256[2] memory publicKey) internal pure returns (bytes32) { return keccak256(abi.encode(publicKey)); } @@ -50,6 +54,7 @@ contract BatchVRFCoordinatorV2 { * @notice Returns the request ID of the request associated with the given proof. * @param proof the VRF proof provided by the VRF oracle. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function getRequestIdFromProof(VRFTypes.Proof memory proof) internal pure returns (uint256) { bytes32 keyHash = hashOfKey(proof.pk); return uint256(keccak256(abi.encode(keyHash, proof.seed))); diff --git a/contracts/src/v0.8/vrf/VRF.sol b/contracts/src/v0.8/vrf/VRF.sol index a6c35c79043..7ec5f2d5a60 100644 --- a/contracts/src/v0.8/vrf/VRF.sol +++ b/contracts/src/v0.8/vrf/VRF.sol @@ -142,6 +142,7 @@ contract VRF { // (base^exponent) % FIELD_SIZE // Cribbed from https://medium.com/@rbkhmrcr/precompiles-solidity-e5d29bd428c4 + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function bigModExp(uint256 base, uint256 exponent) internal view returns (uint256 exponentiation) { uint256 callResult; uint256[6] memory bigModExpContractInputs; @@ -153,7 +154,6 @@ contract VRF { bigModExpContractInputs[5] = FIELD_SIZE; uint256[1] memory output; assembly { - // solhint-disable-line no-inline-assembly callResult := staticcall( not(0), // Gas cost: no limit 0x05, // Bigmodexp contract address @@ -164,6 +164,7 @@ contract VRF { ) } if (callResult == 0) { + // solhint-disable-next-line custom-errors revert("bigModExp failure!"); } return output[0]; @@ -174,11 +175,13 @@ contract VRF { uint256 private constant SQRT_POWER = (FIELD_SIZE + 1) >> 2; // Computes a s.t. a^2 = x in the field. Assumes a exists + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function squareRoot(uint256 x) internal view returns (uint256) { return bigModExp(x, SQRT_POWER); } // The value of y^2 given that (x,y) is on secp256k1. + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function ySquared(uint256 x) internal pure returns (uint256) { // Curve is y^2=x^3+7. See section 2.4.1 of https://www.secg.org/sec2-v2.pdf uint256 xCubed = mulmod(x, mulmod(x, x, FIELD_SIZE), FIELD_SIZE); @@ -186,15 +189,19 @@ contract VRF { } // True iff p is on secp256k1 + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function isOnCurve(uint256[2] memory p) internal pure returns (bool) { // Section 2.3.6. in https://www.secg.org/sec1-v2.pdf // requires each ordinate to be in [0, ..., FIELD_SIZE-1] + // solhint-disable-next-line custom-errors require(p[0] < FIELD_SIZE, "invalid x-ordinate"); + // solhint-disable-next-line custom-errors require(p[1] < FIELD_SIZE, "invalid y-ordinate"); return ySquared(p[0]) == mulmod(p[1], p[1], FIELD_SIZE); } // Hash x uniformly into {0, ..., FIELD_SIZE-1}. + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fieldHash(bytes memory b) internal pure returns (uint256 x_) { x_ = uint256(keccak256(b)); // Rejecting if x >= FIELD_SIZE corresponds to step 2.1 in section 2.3.4 of @@ -211,6 +218,7 @@ contract VRF { // step 5.C, which references arbitrary_string_to_point, defined in // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.5 as // returning the point with given x ordinate, and even y ordinate. + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function newCandidateSecp256k1Point(bytes memory b) internal view returns (uint256[2] memory p) { unchecked { p[0] = fieldHash(b); @@ -241,6 +249,7 @@ contract VRF { // // This would greatly simplify the analysis in "OTHER SECURITY CONSIDERATIONS" // https://www.pivotaltracker.com/story/show/171120900 + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function hashToCurve(uint256[2] memory pk, uint256 input) internal view returns (uint256[2] memory rv) { rv = newCandidateSecp256k1Point(abi.encodePacked(HASH_TO_CURVE_HASH_PREFIX, pk, input)); while (!isOnCurve(rv)) { @@ -258,11 +267,13 @@ contract VRF { * @param product: secp256k1 expected to be multiplier * multiplicand * @return verifies true iff product==scalar*multiplicand, with cryptographically high probability */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function ecmulVerify( uint256[2] memory multiplicand, uint256 scalar, uint256[2] memory product ) internal pure returns (bool verifies) { + // solhint-disable-next-line custom-errors require(scalar != 0, "zero scalar"); // Rules out an ecrecover failure case uint256 x = multiplicand[0]; // x ordinate of multiplicand uint8 v = multiplicand[1] % 2 == 0 ? 27 : 28; // parity of y ordinate @@ -278,6 +289,7 @@ contract VRF { } // Returns x1/z1-x2/z2=(x1z2-x2z1)/(z1z2) in projective coordinates on P¹(𝔽ₙ) + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function projectiveSub( uint256 x1, uint256 z1, @@ -294,6 +306,7 @@ contract VRF { } // Returns x1/z1*x2/z2=(x1x2)/(z1z2), in projective coordinates on P¹(𝔽ₙ) + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function projectiveMul( uint256 x1, uint256 z1, @@ -335,6 +348,7 @@ contract VRF { @return sy @return sz */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function projectiveECAdd( uint256 px, uint256 py, @@ -391,6 +405,7 @@ contract VRF { // // p1 and p2 must be distinct, because projectiveECAdd doesn't handle // point doubling. + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function affineECAdd( uint256[2] memory p1, uint256[2] memory p2, @@ -400,6 +415,7 @@ contract VRF { uint256 y; uint256 z; (x, y, z) = projectiveECAdd(p1[0], p1[1], p2[0], p2[1]); + // solhint-disable-next-line custom-errors require(mulmod(z, invZ, FIELD_SIZE) == 1, "invZ must be inverse of z"); // Clear the z ordinate of the projective representation by dividing through // by it, to obtain the affine representation @@ -408,6 +424,7 @@ contract VRF { // True iff address(c*p+s*g) == lcWitness, where g is generator. (With // cryptographically high probability.) + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function verifyLinearCombinationWithGenerator( uint256 c, uint256[2] memory p, @@ -416,6 +433,7 @@ contract VRF { ) internal pure returns (bool) { // Rule out ecrecover failure modes which return address 0. unchecked { + // solhint-disable-next-line custom-errors require(lcWitness != address(0), "bad witness"); uint8 v = (p[1] % 2 == 0) ? 27 : 28; // parity of y-ordinate of p // Note this cannot wrap (X - Y % X), but we use unchecked to save @@ -440,6 +458,7 @@ contract VRF { // a proof with equal c*p1 and s*p2, they should retry with a different // proof nonce.) Assumes that all points are on secp256k1 // (which is checked in verifyVRFProof below.) + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function linearCombination( uint256 c, uint256[2] memory p1, @@ -451,8 +470,11 @@ contract VRF { ) internal pure returns (uint256[2] memory) { unchecked { // Note we are relying on the wrap around here + // solhint-disable-next-line custom-errors require((cp1Witness[0] % FIELD_SIZE) != (sp2Witness[0] % FIELD_SIZE), "points in sum must be distinct"); + // solhint-disable-next-line custom-errors require(ecmulVerify(p1, c, cp1Witness), "First mul check failed"); + // solhint-disable-next-line custom-errors require(ecmulVerify(p2, s, sp2Witness), "Second mul check failed"); return affineECAdd(cp1Witness, sp2Witness, zInv); } @@ -473,6 +495,7 @@ contract VRF { // using the compressed representation of the points, if we collated the y // parities into a single bytes32. // https://www.pivotaltracker.com/story/show/171120588 + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function scalarFromCurvePoints( uint256[2] memory hash, uint256[2] memory pk, @@ -492,6 +515,7 @@ contract VRF { // the x ordinate, and the parity of the y ordinate in the top bit of uWitness // (which I could make a uint256 without using any extra space.) Would save // about 2000 gas. https://www.pivotaltracker.com/story/show/170828567 + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function verifyVRFProof( uint256[2] memory pk, uint256[2] memory gamma, @@ -504,15 +528,20 @@ contract VRF { uint256 zInv ) internal view { unchecked { + // solhint-disable-next-line custom-errors require(isOnCurve(pk), "public key is not on curve"); + // solhint-disable-next-line custom-errors require(isOnCurve(gamma), "gamma is not on curve"); + // solhint-disable-next-line custom-errors require(isOnCurve(cGammaWitness), "cGammaWitness is not on curve"); + // solhint-disable-next-line custom-errors require(isOnCurve(sHashWitness), "sHashWitness is not on curve"); // Step 5. of IETF draft section 5.3 (pk corresponds to 5.3's Y, and here // we use the address of u instead of u itself. Also, here we add the // terms instead of taking the difference, and in the proof construction in // vrf.GenerateProof, we correspondingly take the difference instead of // taking the sum as they do in step 7 of section 5.1.) + // solhint-disable-next-line custom-errors require(verifyLinearCombinationWithGenerator(c, pk, s, uWitness), "addr(c*pk+s*g)!=_uWitness"); // Step 4. of IETF draft section 5.3 (pk corresponds to Y, seed to alpha_string) uint256[2] memory hash = hashToCurve(pk, seed); @@ -520,6 +549,7 @@ contract VRF { uint256[2] memory v = linearCombination(c, gamma, cGammaWitness, s, hash, sHashWitness, zInv); // Steps 7. and 8. of IETF draft section 5.3 uint256 derivedC = scalarFromCurvePoints(hash, pk, gamma, uWitness, v); + // solhint-disable-next-line custom-errors require(c == derivedC, "invalid proof"); } } @@ -550,6 +580,7 @@ contract VRF { * @return output i.e., the random output implied by the proof * *************************************************************************** */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function randomValueFromVRFProof(Proof memory proof, uint256 seed) internal view returns (uint256 output) { verifyVRFProof( proof.pk, diff --git a/contracts/src/v0.8/vrf/VRFConsumerBase.sol b/contracts/src/v0.8/vrf/VRFConsumerBase.sol index 983a5b23cb7..7661ad40a30 100644 --- a/contracts/src/v0.8/vrf/VRFConsumerBase.sol +++ b/contracts/src/v0.8/vrf/VRFConsumerBase.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../shared/interfaces/LinkTokenInterface.sol"; +import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; -import "./VRFRequestIDBase.sol"; +import {VRFRequestIDBase} from "./VRFRequestIDBase.sol"; /** **************************************************************************** * @notice Interface for contracts using VRF randomness @@ -113,6 +113,7 @@ abstract contract VRFConsumerBase is VRFRequestIDBase { * @param requestId The Id initially returned by requestRandomness * @param randomness the VRF output */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual; /** @@ -149,6 +150,7 @@ abstract contract VRFConsumerBase is VRFRequestIDBase { * @dev concurrent requests. It is passed as the first argument to * @dev fulfillRandomness. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function requestRandomness(bytes32 _keyHash, uint256 _fee) internal returns (bytes32 requestId) { LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER)); // This is the seed passed to VRFCoordinator. The oracle will mix this with @@ -165,12 +167,15 @@ abstract contract VRFConsumerBase is VRFRequestIDBase { return makeRequestId(_keyHash, vRFSeed); } + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i LinkTokenInterface internal immutable LINK; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i address private immutable vrfCoordinator; // Nonces for each VRF key from which randomness has been requested. // // Must stay in sync with VRFCoordinator[_keyHash][this] + // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore mapping(bytes32 => uint256) /* keyHash */ /* nonce */ private nonces; /** @@ -188,6 +193,7 @@ abstract contract VRFConsumerBase is VRFRequestIDBase { // proof. rawFulfillRandomness then calls fulfillRandomness, after validating // the origin of the call function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external { + // solhint-disable-next-line custom-errors require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill"); fulfillRandomness(requestId, randomness); } diff --git a/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol b/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol index e023373ab0f..ad7025fc980 100644 --- a/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol +++ b/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol @@ -96,6 +96,7 @@ pragma solidity ^0.8.4; */ abstract contract VRFConsumerBaseV2 { error OnlyCoordinatorCanFulfill(address have, address want); + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i address private immutable vrfCoordinator; /** @@ -119,6 +120,7 @@ abstract contract VRFConsumerBaseV2 { * @param requestId The Id initially returned by requestRandomness * @param randomWords the VRF output expanded to the requested number of words */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual; // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF diff --git a/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol b/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol index bed0d361b35..92cb0cdb324 100644 --- a/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol +++ b/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol @@ -1,20 +1,23 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import "../shared/interfaces/LinkTokenInterface.sol"; -import "../interfaces/BlockhashStoreInterface.sol"; -import "../interfaces/AggregatorV3Interface.sol"; -import "../interfaces/VRFCoordinatorV2Interface.sol"; -import "../interfaces/TypeAndVersionInterface.sol"; -import "../shared/interfaces/IERC677Receiver.sol"; -import "./VRF.sol"; -import "../shared/access/ConfirmedOwner.sol"; -import "./VRFConsumerBaseV2.sol"; -import "../ChainSpecificUtil.sol"; +import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; +import {BlockhashStoreInterface} from "../interfaces/BlockhashStoreInterface.sol"; +import {AggregatorV3Interface} from "../interfaces/AggregatorV3Interface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; +import {IERC677Receiver} from "../shared/interfaces/IERC677Receiver.sol"; +import {VRF} from "./VRF.sol"; +import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; +import {VRFConsumerBaseV2} from "./VRFConsumerBaseV2.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil.sol"; contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCoordinatorV2Interface, IERC677Receiver { + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i LinkTokenInterface public immutable LINK; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i AggregatorV3Interface public immutable LINK_ETH_FEED; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i BlockhashStoreInterface public immutable BLOCKHASH_STORE; // We need to maintain a list of consuming addresses. @@ -413,6 +416,7 @@ contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCo return s_requestCommitments[requestId]; } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function computeRequestId( bytes32 keyHash, address sender, @@ -427,8 +431,8 @@ contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCo * @dev calls target address with exactly gasAmount gas and data as calldata * or reverts if at least gasAmount gas is not available. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // Compute g -= GAS_FOR_CALL_EXACT_CHECK and check for underflow @@ -457,6 +461,7 @@ contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCo return success; } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getRandomnessFromProof( Proof memory proof, RequestCommitment memory rc @@ -569,6 +574,7 @@ contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCo } // Get the amount of gas used for fulfillment + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculatePaymentAmount( uint256 startGas, uint256 gasAfterPaymentCalculation, @@ -592,6 +598,7 @@ contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCo return uint96(paymentNoFee + fee); } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getFeedData() private view returns (int256) { uint32 stalenessSeconds = s_config.stalenessSeconds; bool staleFallback = stalenessSeconds > 0; @@ -766,6 +773,7 @@ contract VRFCoordinatorV2 is VRF, ConfirmedOwner, TypeAndVersionInterface, VRFCo cancelSubscriptionHelper(subId, to); } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function cancelSubscriptionHelper(uint64 subId, address to) private nonReentrant { SubscriptionConfig memory subConfig = s_subscriptionConfigs[subId]; Subscription memory sub = s_subscriptions[subId]; diff --git a/contracts/src/v0.8/vrf/VRFOwner.sol b/contracts/src/v0.8/vrf/VRFOwner.sol index 2c4adf36e8c..055308cac42 100644 --- a/contracts/src/v0.8/vrf/VRFOwner.sol +++ b/contracts/src/v0.8/vrf/VRFOwner.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: MIT +// solhint-disable-next-line one-contract-per-file pragma solidity ^0.8.6; import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; import {AuthorizedReceiver} from "./AuthorizedReceiver.sol"; -import "./VRFTypes.sol"; +import {VRFTypes} from "./VRFTypes.sol"; // Taken from VRFCoordinatorV2.sol // Must be abi-compatible with what's there @@ -109,6 +110,7 @@ contract VRFOwner is ConfirmedOwner, AuthorizedReceiver { event RandomWordsForced(uint256 indexed requestId, uint64 indexed subId, address indexed sender); constructor(address _vrfCoordinator) ConfirmedOwner(msg.sender) { + // solhint-disable-next-line custom-errors require(_vrfCoordinator != address(0), "vrf coordinator address must be non-zero"); s_vrfCoordinator = IVRFCoordinatorV2(_vrfCoordinator); } @@ -192,6 +194,7 @@ contract VRFOwner is ConfirmedOwner, AuthorizedReceiver { * @param fallbackWeiPerUnitLink fallback eth/link price in the case of a stale feed * @param feeConfig fee tier configuration */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function setConfigPrivate( uint16 minimumRequestConfirmations, uint32 maxGasLimit, @@ -233,6 +236,7 @@ contract VRFOwner is ConfirmedOwner, AuthorizedReceiver { * @dev when too many local variables are in the same scope. * @return Config struct containing all relevant configs from the VRF coordinator. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getConfigs() private view returns (Config memory) { ( uint16 minimumRequestConfirmations, @@ -338,6 +342,7 @@ contract VRFOwner is ConfirmedOwner, AuthorizedReceiver { * @param proofSeed the proof seed * @dev Refer to VRFCoordinatorV2.getRandomnessFromProof for original implementation. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function requestIdFromProof(uint256[2] memory publicKey, uint256 proofSeed) private view returns (uint256) { bytes32 keyHash = s_vrfCoordinator.hashOfKey(publicKey); uint256 requestId = uint256(keccak256(abi.encode(keyHash, proofSeed))); diff --git a/contracts/src/v0.8/vrf/VRFRequestIDBase.sol b/contracts/src/v0.8/vrf/VRFRequestIDBase.sol index 7770640550e..ce0f6b1547a 100644 --- a/contracts/src/v0.8/vrf/VRFRequestIDBase.sol +++ b/contracts/src/v0.8/vrf/VRFRequestIDBase.sol @@ -16,6 +16,7 @@ contract VRFRequestIDBase { * @param _requester Address of the requesting contract * @param _nonce User-specific nonce at the time of the request */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function makeVRFInputSeed( bytes32 _keyHash, uint256 _userSeed, @@ -34,6 +35,7 @@ contract VRFRequestIDBase { * @dev Note that _vRFInputSeed is not the seed passed by the consuming * @dev contract, but the one generated by makeVRFInputSeed */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function makeRequestId(bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed)); } diff --git a/contracts/src/v0.8/vrf/VRFV2Wrapper.sol b/contracts/src/v0.8/vrf/VRFV2Wrapper.sol index 101e1bdfe20..3573b972276 100644 --- a/contracts/src/v0.8/vrf/VRFV2Wrapper.sol +++ b/contracts/src/v0.8/vrf/VRFV2Wrapper.sol @@ -1,15 +1,16 @@ // SPDX-License-Identifier: MIT +// solhint-disable-next-line one-contract-per-file pragma solidity ^0.8.6; -import "../shared/access/ConfirmedOwner.sol"; -import "../interfaces/TypeAndVersionInterface.sol"; -import "./VRFConsumerBaseV2.sol"; -import "../shared/interfaces/LinkTokenInterface.sol"; -import "../interfaces/AggregatorV3Interface.sol"; -import "../interfaces/VRFCoordinatorV2Interface.sol"; -import "../interfaces/VRFV2WrapperInterface.sol"; -import "./VRFV2WrapperConsumerBase.sol"; -import "../ChainSpecificUtil.sol"; +import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; +import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; +import {VRFConsumerBaseV2} from "./VRFConsumerBaseV2.sol"; +import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; +import {AggregatorV3Interface} from "../interfaces/AggregatorV3Interface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFV2WrapperInterface} from "../interfaces/VRFV2WrapperInterface.sol"; +import {VRFV2WrapperConsumerBase} from "./VRFV2WrapperConsumerBase.sol"; +import {ChainSpecificUtil} from "../ChainSpecificUtil.sol"; /** * @notice A wrapper for VRFCoordinatorV2 that provides an interface better suited to one-off @@ -18,9 +19,13 @@ import "../ChainSpecificUtil.sol"; contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBaseV2, VRFV2WrapperInterface { event WrapperFulfillmentFailed(uint256 indexed requestId, address indexed consumer); + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i LinkTokenInterface public immutable LINK; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i AggregatorV3Interface public immutable LINK_ETH_FEED; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i ExtendedVRFCoordinatorV2Interface public immutable COORDINATOR; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i uint64 public immutable SUBSCRIPTION_ID; /// @dev this is the size of a VRF v2 fulfillment's calldata abi-encoded in bytes. /// @dev proofSize = 13 words = 13 * 256 = 3328 bits @@ -78,10 +83,10 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas // s_keyHash is the key hash to use when requesting randomness. Fees are paid based on current gas // fees, so this should be set to the highest gas lane on the network. - bytes32 s_keyHash; + bytes32 internal s_keyHash; // s_maxNumWords is the max number of words that can be requested in a single wrapped VRF request. - uint8 s_maxNumWords; + uint8 internal s_maxNumWords; struct Callback { address callbackAddress; @@ -237,6 +242,7 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas return calculateRequestPriceInternal(_callbackGasLimit, _requestGasPriceWei, weiPerUnitLink); } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function calculateRequestPriceInternal( uint256 _gas, uint256 _requestGasPrice, @@ -273,6 +279,7 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas * uint16 requestConfirmations, and uint32 numWords. */ function onTokenTransfer(address _sender, uint256 _amount, bytes calldata _data) external onlyConfiguredNotDisabled { + // solhint-disable-next-line custom-errors require(msg.sender == address(LINK), "only callable from LINK"); (uint32 callbackGasLimit, uint16 requestConfirmations, uint32 numWords) = abi.decode( @@ -282,7 +289,9 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas uint32 eip150Overhead = getEIP150Overhead(callbackGasLimit); int256 weiPerUnitLink = getFeedData(); uint256 price = calculateRequestPriceInternal(callbackGasLimit, tx.gasprice, weiPerUnitLink); + // solhint-disable-next-line custom-errors require(_amount >= price, "fee too low"); + // solhint-disable-next-line custom-errors require(numWords <= s_maxNumWords, "numWords too high"); uint256 requestId = COORDINATOR.requestRandomWords( @@ -328,9 +337,11 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas s_disabled = true; } + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal override { Callback memory callback = s_callbacks[_requestId]; delete s_callbacks[_requestId]; + // solhint-disable-next-line custom-errors require(callback.callbackAddress != address(0), "request not found"); // This should never happen VRFV2WrapperConsumerBase c; @@ -342,6 +353,7 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas } } + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getFeedData() private view returns (int256) { bool staleFallback = s_stalenessSeconds > 0; uint256 timestamp; @@ -351,6 +363,7 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas if (staleFallback && s_stalenessSeconds < block.timestamp - timestamp) { weiPerUnitLink = s_fallbackWeiPerUnitLink; } + // solhint-disable-next-line custom-errors require(weiPerUnitLink >= 0, "Invalid LINK wei price"); return weiPerUnitLink; } @@ -358,6 +371,7 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas /** * @dev Calculates extra amount of gas required for running an assembly call() post-EIP150. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function getEIP150Overhead(uint32 gas) private pure returns (uint32) { return gas / 63 + 1; } @@ -366,8 +380,8 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas * @dev calls target address with exactly gasAmount gas and data as calldata * or reverts if at least gasAmount gas is not available. */ + // solhint-disable-next-line chainlink-solidity/prefix-private-functions-with-underscore function callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { - // solhint-disable-next-line no-inline-assembly assembly { let g := gas() // Compute g -= GAS_FOR_CALL_EXACT_CHECK and check for underflow @@ -401,7 +415,9 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas } modifier onlyConfiguredNotDisabled() { + // solhint-disable-next-line custom-errors require(s_configured, "wrapper is not configured"); + // solhint-disable-next-line custom-errors require(!s_disabled, "wrapper is disabled"); _; } diff --git a/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol b/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol index 4c7918e8b7a..a9c8e5568a9 100644 --- a/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol +++ b/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../shared/interfaces/LinkTokenInterface.sol"; -import "../interfaces/VRFV2WrapperInterface.sol"; +import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; +import {VRFV2WrapperInterface} from "../interfaces/VRFV2WrapperInterface.sol"; /** ******************************************************************************* * @notice Interface for contracts using VRF randomness through the VRF V2 wrapper @@ -28,7 +28,9 @@ import "../interfaces/VRFV2WrapperInterface.sol"; * @dev fulfillment with the randomness result. */ abstract contract VRFV2WrapperConsumerBase { + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i LinkTokenInterface internal immutable LINK; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i VRFV2WrapperInterface internal immutable VRF_V2_WRAPPER; /** @@ -52,6 +54,7 @@ abstract contract VRFV2WrapperConsumerBase { * * @return requestId is the VRF V2 request ID of the newly created randomness request. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function requestRandomness( uint32 _callbackGasLimit, uint16 _requestConfirmations, @@ -72,9 +75,11 @@ abstract contract VRFV2WrapperConsumerBase { * @param _requestId is the VRF V2 request ID. * @param _randomWords is the randomness result. */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal virtual; function rawFulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) external { + // solhint-disable-next-line custom-errors require(msg.sender == address(VRF_V2_WRAPPER), "only VRF V2 wrapper can fulfill"); fulfillRandomWords(_requestId, _randomWords); } diff --git a/core/gethwrappers/generated/vrfv2plus_malicious_migrator/vrfv2plus_malicious_migrator.go b/core/gethwrappers/generated/vrfv2plus_malicious_migrator/vrfv2plus_malicious_migrator.go index 043ee6e303f..c0c19a1134c 100644 --- a/core/gethwrappers/generated/vrfv2plus_malicious_migrator/vrfv2plus_malicious_migrator.go +++ b/core/gethwrappers/generated/vrfv2plus_malicious_migrator/vrfv2plus_malicious_migrator.go @@ -29,7 +29,7 @@ var ( ) var VRFV2PlusMaliciousMigratorMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", Bin: "0x608060405234801561001057600080fd5b506040516102e03803806102e083398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b61024d806100936000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80638ea9811714610030575b600080fd5b61004361003e36600461012a565b610045565b005b600080546040805160c081018252838152602080820185905281830185905260608201859052608082018590528251908101835293845260a0810193909352517f9b1c385e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911691639b1c385e916100d49190600401610180565b602060405180830381600087803b1580156100ee57600080fd5b505af1158015610102573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101269190610167565b5050565b60006020828403121561013c57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461016057600080fd5b9392505050565b60006020828403121561017957600080fd5b5051919050565b6000602080835283518184015280840151604084015261ffff6040850151166060840152606084015163ffffffff80821660808601528060808701511660a0860152505060a084015160c08085015280518060e086015260005b818110156101f757828101840151868201610100015283016101da565b8181111561020a57600061010083880101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016939093016101000194935050505056fea164736f6c6343000806000a", } @@ -169,16 +169,16 @@ func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigratorTransactorRaw) Tran return _VRFV2PlusMaliciousMigrator.Contract.contract.Transact(opts, method, params...) } -func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigratorTransactor) SetCoordinator(opts *bind.TransactOpts, _vrfCoordinator common.Address) (*types.Transaction, error) { - return _VRFV2PlusMaliciousMigrator.contract.Transact(opts, "setCoordinator", _vrfCoordinator) +func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigratorTransactor) SetCoordinator(opts *bind.TransactOpts, arg0 common.Address) (*types.Transaction, error) { + return _VRFV2PlusMaliciousMigrator.contract.Transact(opts, "setCoordinator", arg0) } -func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigratorSession) SetCoordinator(_vrfCoordinator common.Address) (*types.Transaction, error) { - return _VRFV2PlusMaliciousMigrator.Contract.SetCoordinator(&_VRFV2PlusMaliciousMigrator.TransactOpts, _vrfCoordinator) +func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigratorSession) SetCoordinator(arg0 common.Address) (*types.Transaction, error) { + return _VRFV2PlusMaliciousMigrator.Contract.SetCoordinator(&_VRFV2PlusMaliciousMigrator.TransactOpts, arg0) } -func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigratorTransactorSession) SetCoordinator(_vrfCoordinator common.Address) (*types.Transaction, error) { - return _VRFV2PlusMaliciousMigrator.Contract.SetCoordinator(&_VRFV2PlusMaliciousMigrator.TransactOpts, _vrfCoordinator) +func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigratorTransactorSession) SetCoordinator(arg0 common.Address) (*types.Transaction, error) { + return _VRFV2PlusMaliciousMigrator.Contract.SetCoordinator(&_VRFV2PlusMaliciousMigrator.TransactOpts, arg0) } func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigrator) Address() common.Address { @@ -186,7 +186,7 @@ func (_VRFV2PlusMaliciousMigrator *VRFV2PlusMaliciousMigrator) Address() common. } type VRFV2PlusMaliciousMigratorInterface interface { - SetCoordinator(opts *bind.TransactOpts, _vrfCoordinator common.Address) (*types.Transaction, error) + SetCoordinator(opts *bind.TransactOpts, arg0 common.Address) (*types.Transaction, error) Address() common.Address } diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 5251d94e70c..ac0786a8bb5 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -100,7 +100,7 @@ vrfv2_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2WrapperConsumer vrfv2_wrapper_interface: ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.abi ../../contracts/solc/v0.8.6/VRFV2WrapperInterface.bin ff8560169de171a68b360b7438d13863682d07040d984fd0fb096b2379421003 vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contracts/solc/v0.8.6/VRFV2PlusClient.bin 3ffbfa4971a7e5f46051a26b1722613f265d89ea1867547ecec58500953a9501 vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 2c480a6d7955d33a00690fdd943486d95802e48a03f3cc243df314448e4ddb2c -vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin e5ae923d5fdfa916303cd7150b8474ccd912e14bafe950c6431f6ec94821f642 +vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin 80dbc98be5e42246960c889d29488f978d3db0127e95e9b295352c481d8c9b07 vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 3e1e3836e8c8bf7a6f83f571f17e258f30e6d02037e53eebf74c2af3fbcf0913 vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin 4b3da45ff177e09b1e731b5b0cf4e050033a600ef8b0d32e79eec97db5c72408 From bcb2c3ca1f1fd8726543d5adb30da9babc50e64e Mon Sep 17 00:00:00 2001 From: Sri Kidambi <1702865+kidambisrinivas@users.noreply.github.com> Date: Fri, 6 Oct 2023 23:10:39 +0300 Subject: [PATCH 68/84] Add migration support to VRFV2PlusWrapper (#10859) * Add migration support to VRFV2PlusWrapper * Add VRFV2PlusWrapper as consumer to new migrated coordinator * Add VRFV2PlusWrapper as consumer to new migrated coordinator * Add tests for migrate * Re-generate go wrappers after merge * Prettier * Move interface to separate file * Add comments and fund subscription before migration to check if funds are transferred correctly to sub in newCoordinator * Prettier * Minor fix --------- Co-authored-by: Sri Kidambi --- .../v0.8/dev/interfaces/IVRFV2PlusMigrate.sol | 15 + .../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol | 9 + .../foundry/vrf/VRFV2Wrapper_Migration.t.sol | 357 ++++++++++++++++++ .../vrfv2plus_wrapper/vrfv2plus_wrapper.go | 18 +- ...rapper-dependency-versions-do-not-edit.txt | 2 +- 5 files changed, 398 insertions(+), 3 deletions(-) create mode 100644 contracts/src/v0.8/dev/interfaces/IVRFV2PlusMigrate.sol create mode 100644 contracts/test/v0.8/foundry/vrf/VRFV2Wrapper_Migration.t.sol diff --git a/contracts/src/v0.8/dev/interfaces/IVRFV2PlusMigrate.sol b/contracts/src/v0.8/dev/interfaces/IVRFV2PlusMigrate.sol new file mode 100644 index 00000000000..e1a755ff574 --- /dev/null +++ b/contracts/src/v0.8/dev/interfaces/IVRFV2PlusMigrate.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @notice This interface is implemented by all VRF V2+ coordinators that can +/// @notice migrate subscription data to new coordinators. +interface IVRFV2PlusMigrate { + /** + * @notice migrate the provided subscription ID to the provided VRF coordinator + * @notice msg.sender must be the subscription owner and newCoordinator must + * @notice implement IVRFCoordinatorV2PlusMigration. + * @param subId the subscription ID to migrate + * @param newCoordinator the vrf coordinator to migrate to + */ + function migrate(uint256 subId, address newCoordinator) external; +} diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol index 8021f048989..29573aa2363 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.6; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {IVRFV2PlusMigrate} from "../interfaces/IVRFV2PlusMigrate.sol"; import {VRFConsumerBaseV2Plus} from "./VRFConsumerBaseV2Plus.sol"; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; import {AggregatorV3Interface} from "../../interfaces/AggregatorV3Interface.sol"; @@ -578,4 +579,12 @@ contract VRFV2PlusWrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsume require(!s_disabled, "wrapper is disabled"); _; } + + /*************************************************************************** + * Section: Migration of VRFV2PlusWrapper to latest VRFV2PlusCoordinator + ***************************************************************************/ + + function migrate(address newCoordinator) external onlyOwner { + IVRFV2PlusMigrate(address(s_vrfCoordinator)).migrate(SUBSCRIPTION_ID, newCoordinator); + } } diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper_Migration.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper_Migration.t.sol new file mode 100644 index 00000000000..e4c8a40172f --- /dev/null +++ b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper_Migration.t.sol @@ -0,0 +1,357 @@ +pragma solidity 0.8.6; + +import "../BaseTest.t.sol"; +import {VRF} from "../../../../src/v0.8/vrf/VRF.sol"; +import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; +import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; +import {VRFCoordinatorV2Plus_V2Example} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol"; +import {VRFV2PlusWrapperConsumerBase} from "../../../../src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol"; +import {VRFV2PlusWrapperConsumerExample} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol"; +import {SubscriptionAPI} from "../../../../src/v0.8/dev/vrf/SubscriptionAPI.sol"; +import {VRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol"; +import {VRFV2PlusWrapper} from "../../../../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol"; +import {VRFV2PlusClient} from "../../../../src/v0.8/dev/vrf/libraries/VRFV2PlusClient.sol"; + +contract VRFV2PlusWrapperTest is BaseTest { + address internal constant LINK_WHALE = 0xD883a6A1C22fC4AbFE938a5aDF9B2Cc31b1BF18B; + uint256 internal constant DEFAULT_NATIVE_FUNDING = 7 ether; // 7 ETH + uint256 internal constant DEFAULT_LINK_FUNDING = 10 ether; // 10 ETH + bytes32 vrfKeyHash = hex"9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528"; + uint32 wrapperGasOverhead = 10_000; + uint32 coordinatorGasOverhead = 20_000; + + ExposedVRFCoordinatorV2_5 s_testCoordinator; + MockLinkToken s_linkToken; + MockV3Aggregator s_linkNativeFeed; + VRFV2PlusWrapper s_wrapper; + VRFV2PlusWrapperConsumerExample s_consumer; + + VRFCoordinatorV2Plus_V2Example s_newCoordinator; + + VRFCoordinatorV2_5.FeeConfig basicFeeConfig = + VRFCoordinatorV2_5.FeeConfig({fulfillmentFlatFeeLinkPPM: 0, fulfillmentFlatFeeNativePPM: 0}); + + event CoordinatorRegistered(address coordinatorAddress); + event MigrationCompleted(address newCoordinator, uint256 subId); + event WrapperRequestMade(uint256 indexed requestId, uint256 paid); + + function setUp() public override { + BaseTest.setUp(); + + // Fund our users. + vm.roll(1); + vm.deal(LINK_WHALE, 10_000 ether); + changePrank(LINK_WHALE); + + // Deploy link token and link/native feed. + s_linkToken = new MockLinkToken(); + s_linkNativeFeed = new MockV3Aggregator(18, 500000000000000000); // .5 ETH (good for testing) + + // Deploy coordinator and consumer. + s_testCoordinator = new ExposedVRFCoordinatorV2_5(address(0)); + s_wrapper = new VRFV2PlusWrapper(address(s_linkToken), address(s_linkNativeFeed), address(s_testCoordinator)); + s_consumer = new VRFV2PlusWrapperConsumerExample(address(s_linkToken), address(s_wrapper)); + + // Configure the coordinator. + s_testCoordinator.setLINKAndLINKNativeFeed(address(s_linkToken), address(s_linkNativeFeed)); + setConfigCoordinator(basicFeeConfig); + setConfigWrapper(); + + s_testCoordinator.s_config(); + + // Data structures for Migrateable Wrapper + s_newCoordinator = new VRFCoordinatorV2Plus_V2Example(address(0), address(s_testCoordinator)); + vm.expectEmit( + false, // no first indexed topic + false, // no second indexed topic + false, // no third indexed topic + true // check data (target coordinator address) + ); + address newCoordinatorAddr = address(s_newCoordinator); + emit CoordinatorRegistered(newCoordinatorAddr); + s_testCoordinator.registerMigratableCoordinator(newCoordinatorAddr); + assertTrue(s_testCoordinator.isTargetRegisteredExternal(newCoordinatorAddr)); + } + + function setConfigCoordinator(VRFCoordinatorV2_5.FeeConfig memory feeConfig) internal { + s_testCoordinator.setConfig( + 0, // minRequestConfirmations + 2_500_000, // maxGasLimit + 1, // stalenessSeconds + 50_000, // gasAfterPaymentCalculation + 50000000000000000, // fallbackWeiPerUnitLink + feeConfig + ); + } + + function setConfigWrapper() internal { + s_wrapper.setConfig( + wrapperGasOverhead, // wrapper gas overhead + coordinatorGasOverhead, // coordinator gas overhead + 0, // premium percentage + vrfKeyHash, // keyHash + 10, // max number of words, + 1, // stalenessSeconds + 50000000000000000, // fallbackWeiPerUnitLink + 0, // fulfillmentFlatFeeLinkPPM + 0 // fulfillmentFlatFeeNativePPM + ); + ( + , + , + , + uint32 _wrapperGasOverhead, + uint32 _coordinatorGasOverhead, + uint8 _wrapperPremiumPercentage, + bytes32 _keyHash, + uint8 _maxNumWords + ) = s_wrapper.getConfig(); + assertEq(_wrapperGasOverhead, wrapperGasOverhead); + assertEq(_coordinatorGasOverhead, coordinatorGasOverhead); + assertEq(0, _wrapperPremiumPercentage); + assertEq(vrfKeyHash, _keyHash); + assertEq(10, _maxNumWords); + } + + event RandomWordsRequested( + bytes32 indexed keyHash, + uint256 requestId, + uint256 preSeed, + uint256 indexed subId, + uint16 minimumRequestConfirmations, + uint32 callbackGasLimit, + uint32 numWords, + bytes extraArgs, + address indexed sender + ); + + function testMigrateWrapperLINKPayment() public { + s_linkToken.transfer(address(s_consumer), DEFAULT_LINK_FUNDING); + + uint256 subID = s_wrapper.SUBSCRIPTION_ID(); + address oldCoordinatorAddr = address(s_testCoordinator); + + // Fund subscription with native and LINK payment to check + // if funds are transferred to new subscription after call + // migration to new coordinator + s_linkToken.transferAndCall(oldCoordinatorAddr, DEFAULT_LINK_FUNDING, abi.encode(subID)); + s_testCoordinator.fundSubscriptionWithNative{value: DEFAULT_NATIVE_FUNDING}(subID); + + // Get type and version. + assertEq(s_wrapper.typeAndVersion(), "VRFV2Wrapper 1.0.0"); + + // subscription exists in V1 coordinator before migration + + ( + uint96 balance, + uint96 nativeBalance, + uint64 reqCount, + address owner, + address[] memory consumers + ) = s_testCoordinator.getSubscription(subID); + assertEq(reqCount, 0); + assertEq(balance, DEFAULT_LINK_FUNDING); + assertEq(nativeBalance, DEFAULT_NATIVE_FUNDING); + assertEq(owner, address(s_wrapper)); + assertEq(consumers.length, 1); + assertEq(consumers[0], address(s_wrapper)); + + vm.startPrank(LINK_WHALE); + + // Update wrapper to point to the new coordinator + vm.expectEmit( + false, // no first indexed field + false, // no second indexed field + false, // no third indexed field + true // check data fields + ); + address newCoordinatorAddr = address(s_newCoordinator); + emit MigrationCompleted(newCoordinatorAddr, subID); + + s_wrapper.migrate(newCoordinatorAddr); + + // subscription no longer exists in v1 coordinator after migration + vm.expectRevert(SubscriptionAPI.InvalidSubscription.selector); + s_testCoordinator.getSubscription(subID); + assertEq(s_testCoordinator.s_totalBalance(), 0); + assertEq(s_testCoordinator.s_totalNativeBalance(), 0); + assertEq(s_linkToken.balanceOf(oldCoordinatorAddr), 0); + assertEq(oldCoordinatorAddr.balance, 0); + + // subscription exists in v2 coordinator + (balance, nativeBalance, reqCount, owner, consumers) = s_newCoordinator.getSubscription(subID); + assertEq(owner, address(s_wrapper)); + assertEq(consumers.length, 1); + assertEq(consumers[0], address(s_wrapper)); + assertEq(reqCount, 0); + assertEq(balance, DEFAULT_LINK_FUNDING); + assertEq(nativeBalance, DEFAULT_NATIVE_FUNDING); + assertEq(s_newCoordinator.s_totalLinkBalance(), DEFAULT_LINK_FUNDING); + assertEq(s_newCoordinator.s_totalNativeBalance(), DEFAULT_NATIVE_FUNDING); + assertEq(s_linkToken.balanceOf(newCoordinatorAddr), DEFAULT_LINK_FUNDING); + assertEq(newCoordinatorAddr.balance, DEFAULT_NATIVE_FUNDING); + + // calling migrate again on V1 coordinator should fail + vm.expectRevert(); + s_wrapper.migrate(newCoordinatorAddr); + + // Request randomness from wrapper. + uint32 callbackGasLimit = 1_000_000; + vm.expectEmit(true, true, true, true); + uint256 wrapperCost = s_wrapper.calculateRequestPrice(callbackGasLimit); + emit WrapperRequestMade(1, wrapperCost); + uint256 requestId = s_consumer.makeRequest(callbackGasLimit, 0, 1); + assertEq(requestId, 1); + + (uint256 paid, bool fulfilled, bool native) = s_consumer.s_requests(requestId); + uint32 expectedPaid = (callbackGasLimit + wrapperGasOverhead + coordinatorGasOverhead) * 2; + uint256 wrapperCostEstimate = s_wrapper.estimateRequestPrice(callbackGasLimit, tx.gasprice); + uint256 wrapperCostCalculation = s_wrapper.calculateRequestPrice(callbackGasLimit); + assertEq(paid, expectedPaid); // 1_030_000 * 2 for link/native ratio + assertEq(uint256(paid), wrapperCostEstimate); + assertEq(wrapperCostEstimate, wrapperCostCalculation); + assertEq(fulfilled, false); + assertEq(native, false); + assertEq(s_linkToken.balanceOf(address(s_consumer)), DEFAULT_LINK_FUNDING - expectedPaid); + + (, uint256 gasLimit, ) = s_wrapper.s_callbacks(requestId); + assertEq(gasLimit, callbackGasLimit); + + vm.stopPrank(); + + vm.startPrank(newCoordinatorAddr); + + uint256[] memory words = new uint256[](1); + words[0] = 123; + s_wrapper.rawFulfillRandomWords(requestId, words); + (, bool nowFulfilled, uint256[] memory storedWords) = s_consumer.getRequestStatus(requestId); + assertEq(nowFulfilled, true); + assertEq(storedWords[0], 123); + + vm.stopPrank(); + + /// Withdraw funds from wrapper. + vm.startPrank(LINK_WHALE); + uint256 priorWhaleBalance = s_linkToken.balanceOf(LINK_WHALE); + s_wrapper.withdraw(LINK_WHALE, paid); + assertEq(s_linkToken.balanceOf(LINK_WHALE), priorWhaleBalance + paid); + assertEq(s_linkToken.balanceOf(address(s_wrapper)), 0); + + vm.stopPrank(); + } + + function testMigrateWrapperNativePayment() public { + vm.deal(address(s_consumer), DEFAULT_NATIVE_FUNDING); + + uint256 subID = s_wrapper.SUBSCRIPTION_ID(); + address oldCoordinatorAddr = address(s_testCoordinator); + + // Fund subscription with native and LINK payment to check + // if funds are transferred to new subscription after call + // migration to new coordinator + s_linkToken.transferAndCall(oldCoordinatorAddr, DEFAULT_LINK_FUNDING, abi.encode(subID)); + s_testCoordinator.fundSubscriptionWithNative{value: DEFAULT_NATIVE_FUNDING}(subID); + + // Get type and version. + assertEq(s_wrapper.typeAndVersion(), "VRFV2Wrapper 1.0.0"); + + // subscription exists in V1 coordinator before migration + ( + uint96 balance, + uint96 nativeBalance, + uint64 reqCount, + address owner, + address[] memory consumers + ) = s_testCoordinator.getSubscription(subID); + assertEq(reqCount, 0); + assertEq(balance, DEFAULT_LINK_FUNDING); + assertEq(nativeBalance, DEFAULT_NATIVE_FUNDING); + assertEq(owner, address(s_wrapper)); + assertEq(consumers.length, 1); + assertEq(consumers[0], address(s_wrapper)); + + vm.startPrank(LINK_WHALE); + + // Update wrapper to point to the new coordinator + vm.expectEmit( + false, // no first indexed field + false, // no second indexed field + false, // no third indexed field + true // check data fields + ); + address newCoordinatorAddr = address(s_newCoordinator); + emit MigrationCompleted(newCoordinatorAddr, subID); + + s_wrapper.migrate(newCoordinatorAddr); + + // subscription no longer exists in v1 coordinator after migration + vm.expectRevert(SubscriptionAPI.InvalidSubscription.selector); + s_testCoordinator.getSubscription(subID); + assertEq(s_testCoordinator.s_totalBalance(), 0); + assertEq(s_testCoordinator.s_totalNativeBalance(), 0); + assertEq(s_linkToken.balanceOf(oldCoordinatorAddr), 0); + assertEq(oldCoordinatorAddr.balance, 0); + + // subscription exists in v2 coordinator + (balance, nativeBalance, reqCount, owner, consumers) = s_newCoordinator.getSubscription(subID); + assertEq(owner, address(s_wrapper)); + assertEq(consumers.length, 1); + assertEq(consumers[0], address(s_wrapper)); + assertEq(reqCount, 0); + assertEq(balance, DEFAULT_LINK_FUNDING); + assertEq(nativeBalance, DEFAULT_NATIVE_FUNDING); + assertEq(s_newCoordinator.s_totalLinkBalance(), DEFAULT_LINK_FUNDING); + assertEq(s_newCoordinator.s_totalNativeBalance(), DEFAULT_NATIVE_FUNDING); + assertEq(s_linkToken.balanceOf(newCoordinatorAddr), DEFAULT_LINK_FUNDING); + assertEq(newCoordinatorAddr.balance, DEFAULT_NATIVE_FUNDING); + + // calling migrate again on V1 coordinator should fail + vm.expectRevert(); + s_wrapper.migrate(newCoordinatorAddr); + + // Request randomness from wrapper. + uint32 callbackGasLimit = 1_000_000; + vm.expectEmit(true, true, true, true); + uint256 wrapperCost = s_wrapper.calculateRequestPriceNative(callbackGasLimit); + emit WrapperRequestMade(1, wrapperCost); + uint256 requestId = s_consumer.makeRequestNative(callbackGasLimit, 0, 1); + assertEq(requestId, 1); + + (uint256 paid, bool fulfilled, bool native) = s_consumer.s_requests(requestId); + uint32 expectedPaid = callbackGasLimit + wrapperGasOverhead + coordinatorGasOverhead; + uint256 wrapperNativeCostEstimate = s_wrapper.estimateRequestPriceNative(callbackGasLimit, tx.gasprice); + uint256 wrapperCostCalculation = s_wrapper.calculateRequestPriceNative(callbackGasLimit); + assertEq(paid, expectedPaid); + assertEq(uint256(paid), wrapperNativeCostEstimate); + assertEq(wrapperNativeCostEstimate, wrapperCostCalculation); + assertEq(fulfilled, false); + assertEq(native, true); + assertEq(address(s_consumer).balance, DEFAULT_NATIVE_FUNDING - expectedPaid); + + (, uint256 gasLimit, ) = s_wrapper.s_callbacks(requestId); + assertEq(gasLimit, callbackGasLimit); + + vm.stopPrank(); + + vm.startPrank(newCoordinatorAddr); + + uint256[] memory words = new uint256[](1); + words[0] = 123; + s_wrapper.rawFulfillRandomWords(requestId, words); + (, bool nowFulfilled, uint256[] memory storedWords) = s_consumer.getRequestStatus(requestId); + assertEq(nowFulfilled, true); + assertEq(storedWords[0], 123); + + vm.stopPrank(); + + // Withdraw funds from wrapper. + vm.startPrank(LINK_WHALE); + uint256 priorWhaleBalance = LINK_WHALE.balance; + s_wrapper.withdrawNative(LINK_WHALE, paid); + assertEq(LINK_WHALE.balance, priorWhaleBalance + paid); + assertEq(address(s_wrapper).balance, 0); + + vm.stopPrank(); + } +} diff --git a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go index 7fe1a766a10..b94cb71c7b8 100644 --- a/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go +++ b/core/gethwrappers/generated/vrfv2plus_wrapper/vrfv2plus_wrapper.go @@ -31,8 +31,8 @@ var ( ) var VRFV2PlusWrapperMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"expectedMinimumLength\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"actualLength\",\"type\":\"uint16\"}],\"name\":\"IncorrectExtraArgsLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LINKPaymentInRequestRandomWordsInNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NativePaymentInOnTokenTransfer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isLinkMode\",\"type\":\"bool\"}],\"name\":\"checkPaymentMode\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b5060405162003577380380620035778339810160408190526200004c9162000323565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200025a565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b6002546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e491600480830192602092919082900301818787803b158015620001a957600080fd5b505af1158015620001be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e491906200036d565b6080819052600254604051632fb1302360e21b8152600481018390523060248201529192506001600160a01b03169063bec4c08c90604401600060405180830381600087803b1580156200023757600080fd5b505af11580156200024c573d6000803e3d6000fd5b505050505050505062000387565b6001600160a01b038116331415620002b55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031e57600080fd5b919050565b6000806000606084860312156200033957600080fd5b620003448462000306565b9250620003546020850162000306565b9150620003646040850162000306565b90509250925092565b6000602082840312156200038057600080fd5b5051919050565b6080516131c6620003b1600039600081816101ef0152818161122f015261180001526131c66000f3fe6080604052600436106101d85760003560e01c80638ea9811711610102578063bf17e55911610095578063f254bdc711610064578063f254bdc7146106f2578063f2fde38b1461072f578063f3fef3a31461074f578063fc2a88c31461076f57600080fd5b8063bf17e559146105d1578063c3f909d4146105f1578063cdd8d8851461067b578063da4f5e6d146106b557600080fd5b8063a3907d71116100d1578063a3907d711461055d578063a4c0ed3614610572578063a608a1e114610592578063bed41a93146105b157600080fd5b80638ea98117146104dd5780639cfc058e146104fd5780639eccacf614610510578063a02e06161461053d57600080fd5b80634306d3541161017a5780636505965411610149578063650596541461043c57806379ba50971461045c5780637fb5d19d146104715780638da5cb5b1461049157600080fd5b80634306d3541461030757806348baa1c5146103275780634b160935146103f257806357a8070a1461041257600080fd5b806318b6f4c8116101b657806318b6f4c8146102925780631fe543e3146102b25780632f2770db146102d25780633255c456146102e757600080fd5b8063030932bb146101dd57806307b18bde14610224578063181f5a7714610246575b600080fd5b3480156101e957600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023057600080fd5b5061024461023f366004612932565b610785565b005b34801561025257600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e3000000000000000000000000000006020820152905161021b9190612dcb565b34801561029e57600080fd5b506102446102ad3660046129d3565b610861565b3480156102be57600080fd5b506102446102cd366004612a57565b6109d8565b3480156102de57600080fd5b50610244610a55565b3480156102f357600080fd5b50610211610302366004612c5a565b610a8b565b34801561031357600080fd5b50610211610322366004612b5a565b610b85565b34801561033357600080fd5b506103b1610342366004612a25565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161021b565b3480156103fe57600080fd5b5061021161040d366004612b5a565b610c8c565b34801561041e57600080fd5b5060085461042c9060ff1681565b604051901515815260200161021b565b34801561044857600080fd5b50610244610457366004612917565b610d7d565b34801561046857600080fd5b50610244610dc8565b34801561047d57600080fd5b5061021161048c366004612c5a565b610ec5565b34801561049d57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021b565b3480156104e957600080fd5b506102446104f8366004612917565b610fcb565b61021161050b366004612b75565b6110d6565b34801561051c57600080fd5b506002546104b89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561054957600080fd5b50610244610558366004612917565b61146b565b34801561056957600080fd5b50610244611516565b34801561057e57600080fd5b5061024461058d36600461295c565b611548565b34801561059e57600080fd5b5060085461042c90610100900460ff1681565b3480156105bd57600080fd5b506102446105cc366004612c76565b611a28565b3480156105dd57600080fd5b506102446105ec366004612b5a565b611b7e565b3480156105fd57600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e08201526101000161021b565b34801561068757600080fd5b506007546106a090640100000000900463ffffffff1681565b60405163ffffffff909116815260200161021b565b3480156106c157600080fd5b506006546104b8906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106fe57600080fd5b506007546104b8906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561073b57600080fd5b5061024461074a366004612917565b611bc5565b34801561075b57600080fd5b5061024461076a366004612932565b611bd9565b34801561077b57600080fd5b5061021160045481565b61078d611cd4565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146107e7576040519150601f19603f3d011682016040523d82523d6000602084013e6107ec565b606091505b505090508061085c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b81516108a2578061089e576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b8151602411156108f35781516040517f51200dce0000000000000000000000000000000000000000000000000000000081526108539160249160040161ffff92831681529116602082015260400190565b6000826023815181106109085761090861314d565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f010000000000000000000000000000000000000000000000000000000000000014905080801561095e5750815b15610995576040517f6048aa6800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b801580156109a1575081155b1561085c576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025473ffffffffffffffffffffffffffffffffffffffff163314610a4b576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610853565b61089e8282611d57565b610a5d611cd4565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff16610afa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610b6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b610b7c8363ffffffff1683611f3f565b90505b92915050565b60085460009060ff16610bf4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610c66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6000610c70612015565b9050610c838363ffffffff163a8361217c565b9150505b919050565b60085460009060ff16610cfb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610d6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b610b7f8263ffffffff163a611f3f565b610d85611cd4565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610853565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16610f34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615610fa6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6000610fb0612015565b9050610fc38463ffffffff16848361217c565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331480159061100b575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561108f573361103060005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152919091166044820152606401610853565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600061111783838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250610861915050565b60006111228761226e565b905060006111368863ffffffff163a611f3f565b9050803410156111a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610853565b6008546301000000900460ff1663ffffffff8716111561121e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610853565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff89169181019190915260075460009190606082019063ffffffff1661127b868d612ef0565b6112859190612ef0565b63ffffffff1681526020018863ffffffff16815260200187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e9061132b908490600401612dde565b602060405180830381600087803b15801561134557600080fd5b505af1158015611359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137d9190612a3e565b6040805160608101825233815263ffffffff808d16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff91909116171792909216919091179055935050505095945050505050565b611473611cd4565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16156114d3576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b61151e611cd4565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff166115b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e66696775726564000000000000006044820152606401610853565b600854610100900460ff1615611626576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c6564000000000000000000000000006044820152606401610853565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146116b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b0000000000000000006044820152606401610853565b60008080806116c885870187612beb565b93509350935093506116db816001610861565b60006116e68561226e565b905060006116f2612015565b905060006117078763ffffffff163a8461217c565b9050808a1015611773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f770000000000000000000000000000000000000000006044820152606401610853565b6008546301000000900460ff1663ffffffff861611156117ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f20686967680000000000000000000000000000006044820152606401610853565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff88169181019190915260075460009190606082019063ffffffff1661184c878c612ef0565b6118569190612ef0565b63ffffffff908116825288166020820152604090810187905260025490517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e906118ca908590600401612dde565b602060405180830381600087803b1580156118e457600080fd5b505af11580156118f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191c9190612a3e565b905060405180606001604052808e73ffffffffffffffffffffffffffffffffffffffff1681526020018a63ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050508060048190555050505050505050505050505050565b611a30611cd4565b6007805463ffffffff9a8b167fffffffffffffffffffffffffffffffffffffffff00000000ffffffff000000009091161768010000000000000000998b168a02179055600880546003979097557fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9096166201000060ff988916027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009590971694909402959095177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117909355600680546005949094557fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff9187167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009094169390931764010000000094871694909402939093179290921691909316909102179055565b611b86611cd4565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b611bcd611cd4565b611bd681612286565b50565b611be1611cd4565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611c6657600080fd5b505af1158015611c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9e91906129b6565b61089e576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611d55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610853565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611e51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e640000000000000000000000000000006044820152606401610853565b600080631fe543e360e01b8585604051602401611e6f929190612e3b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611ee9846020015163ffffffff1685600001518461237c565b905080611f3757835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b6007546000908190611f5e90640100000000900463ffffffff166123c8565b60075463ffffffff680100000000000000008204811691611f80911687612ed8565b611f8a9190612ed8565b611f94908561309b565b611f9e9190612ed8565b6008549091508190600090606490611fbf9062010000900460ff1682612f18565b611fcc9060ff168461309b565b611fd69190612f3d565b6006549091506000906120009068010000000000000000900463ffffffff1664e8d4a5100061309b565b61200a9083612ed8565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b1580156120a257600080fd5b505afa1580156120b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120da9190612d10565b50945090925084915050801561210057506120f582426130d8565b60065463ffffffff16105b1561210a57506005545b6000811215612175576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b20776569207072696365000000000000000000006044820152606401610853565b9392505050565b600754600090819061219b90640100000000900463ffffffff166123c8565b60075463ffffffff6801000000000000000082048116916121bd911688612ed8565b6121c79190612ed8565b6121d1908661309b565b6121db9190612ed8565b90506000836121f283670de0b6b3a764000061309b565b6121fc9190612f3d565b60085490915060009060649061221b9062010000900460ff1682612f18565b6122289060ff168461309b565b6122329190612f3d565b60065490915060009061225890640100000000900463ffffffff1664e8d4a5100061309b565b6122629083612ed8565b98975050505050505050565b600061227b603f83612f51565b610b7f906001612ef0565b73ffffffffffffffffffffffffffffffffffffffff8116331415612306576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610853565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561238e57600080fd5b6113888103905084604082048203116123a657600080fd5b50823b6123b257600080fd5b60008083516020850160008789f1949350505050565b6000466123d481612498565b15612478576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561242257600080fd5b505afa158015612436573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245a9190612b10565b5050505091505083608c61246e9190612ed8565b610fc3908261309b565b612481816124bb565b1561248f57610c83836124f5565b50600092915050565b600061a4b18214806124ac575062066eed82145b80610b7f57505062066eee1490565b6000600a8214806124cd57506101a482145b806124da575062aa37dc82145b806124e6575061210582145b80610b7f57505062014a331490565b60008073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663519b4bd36040518163ffffffff1660e01b815260040160206040518083038186803b15801561255257600080fd5b505afa158015612566573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258a9190612a3e565b905060008061259981866130d8565b905060006125a882601061309b565b6125b384600461309b565b6125bd9190612ed8565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff16630c18c1626040518163ffffffff1660e01b815260040160206040518083038186803b15801561261b57600080fd5b505afa15801561262f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126539190612a3e565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663f45e65d86040518163ffffffff1660e01b815260040160206040518083038186803b1580156126b157600080fd5b505afa1580156126c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e99190612a3e565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561274757600080fd5b505afa15801561275b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061277f9190612a3e565b9050600061278e82600a612fd5565b90506000818461279e8789612ed8565b6127a8908c61309b565b6127b2919061309b565b6127bc9190612f3d565b9b9a5050505050505050505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c8757600080fd5b60008083601f84011261280157600080fd5b50813567ffffffffffffffff81111561281957600080fd5b60208301915083602082850101111561283157600080fd5b9250929050565b600082601f83011261284957600080fd5b813567ffffffffffffffff8111156128635761286361317c565b61289460207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612e89565b8181528460208386010111156128a957600080fd5b816020850160208301376000918101602001919091529392505050565b803561ffff81168114610c8757600080fd5b803563ffffffff81168114610c8757600080fd5b803560ff81168114610c8757600080fd5b805169ffffffffffffffffffff81168114610c8757600080fd5b60006020828403121561292957600080fd5b610b7c826127cb565b6000806040838503121561294557600080fd5b61294e836127cb565b946020939093013593505050565b6000806000806060858703121561297257600080fd5b61297b856127cb565b935060208501359250604085013567ffffffffffffffff81111561299e57600080fd5b6129aa878288016127ef565b95989497509550505050565b6000602082840312156129c857600080fd5b8151612175816131ab565b600080604083850312156129e657600080fd5b823567ffffffffffffffff8111156129fd57600080fd5b612a0985828601612838565b9250506020830135612a1a816131ab565b809150509250929050565b600060208284031215612a3757600080fd5b5035919050565b600060208284031215612a5057600080fd5b5051919050565b60008060408385031215612a6a57600080fd5b8235915060208084013567ffffffffffffffff80821115612a8a57600080fd5b818601915086601f830112612a9e57600080fd5b813581811115612ab057612ab061317c565b8060051b9150612ac1848301612e89565b8181528481019084860184860187018b1015612adc57600080fd5b600095505b83861015612aff578035835260019590950194918601918601612ae1565b508096505050505050509250929050565b60008060008060008060c08789031215612b2957600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b600060208284031215612b6c57600080fd5b610b7c826128d8565b600080600080600060808688031215612b8d57600080fd5b612b96866128d8565b9450612ba4602087016128c6565b9350612bb2604087016128d8565b9250606086013567ffffffffffffffff811115612bce57600080fd5b612bda888289016127ef565b969995985093965092949392505050565b60008060008060808587031215612c0157600080fd5b612c0a856128d8565b9350612c18602086016128c6565b9250612c26604086016128d8565b9150606085013567ffffffffffffffff811115612c4257600080fd5b612c4e87828801612838565b91505092959194509250565b60008060408385031215612c6d57600080fd5b61294e836128d8565b60008060008060008060008060006101208a8c031215612c9557600080fd5b612c9e8a6128d8565b9850612cac60208b016128d8565b9750612cba60408b016128ec565b965060608a01359550612ccf60808b016128ec565b9450612cdd60a08b016128d8565b935060c08a01359250612cf260e08b016128d8565b9150612d016101008b016128d8565b90509295985092959850929598565b600080600080600060a08688031215612d2857600080fd5b612d31866128fd565b9450602086015193506040860151925060608601519150612d54608087016128fd565b90509295509295909350565b6000815180845260005b81811015612d8657602081850181015186830182015201612d6a565b81811115612d98576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610b7c6020830184612d60565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c080840152610fc360e0840182612d60565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612e7c57845183529383019391830191600101612e60565b5090979650505050505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612ed057612ed061317c565b604052919050565b60008219821115612eeb57612eeb6130ef565b500190565b600063ffffffff808316818516808303821115612f0f57612f0f6130ef565b01949350505050565b600060ff821660ff84168060ff03821115612f3557612f356130ef565b019392505050565b600082612f4c57612f4c61311e565b500490565b600063ffffffff80841680612f6857612f6861311e565b92169190910492915050565b600181815b80851115612fcd57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612fb357612fb36130ef565b80851615612fc057918102915b93841c9390800290612f79565b509250929050565b6000610b7c8383600082612feb57506001610b7f565b81612ff857506000610b7f565b816001811461300e576002811461301857613034565b6001915050610b7f565b60ff841115613029576130296130ef565b50506001821b610b7f565b5060208310610133831016604e8410600b8410161715613057575081810a610b7f565b6130618383612f74565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613093576130936130ef565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130d3576130d36130ef565b500290565b6000828210156130ea576130ea6130ef565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114611bd657600080fdfea164736f6c6343000806000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_linkNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_coordinator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"expectedMinimumLength\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"actualLength\",\"type\":\"uint16\"}],\"name\":\"IncorrectExtraArgsLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LINKPaymentInRequestRandomWordsInNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NativePaymentInOnTokenTransfer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"WrapperFulfillmentFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SUBSCRIPTION_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"calculateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isLinkMode\",\"type\":\"bool\"}],\"name\":\"checkPaymentMode\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_requestGasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateRequestPriceNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"maxNumWords\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastRequestId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"name\":\"requestRandomWordsInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_callbacks\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"requestGasPrice\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_configured\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_disabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fulfillmentTxSizeBytes\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_link\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_linkNativeFeed\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contractIVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_wrapperGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_coordinatorGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"_wrapperPremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_maxNumWords\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"size\",\"type\":\"uint32\"}],\"name\":\"setFulfillmentTxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"}],\"name\":\"setLINK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLinkNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040526007805463ffffffff60201b1916650244000000001790553480156200002957600080fd5b506040516200365f3803806200365f8339810160408190526200004c9162000323565b803380600081620000a45760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d757620000d7816200025a565b5050600280546001600160a01b0319166001600160a01b03938416179055508316156200012857600680546001600160601b03166c010000000000000000000000006001600160a01b038616021790555b6001600160a01b038216156200016257600780546001600160601b03166c010000000000000000000000006001600160a01b038516021790555b6002546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e491600480830192602092919082900301818787803b158015620001a957600080fd5b505af1158015620001be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e491906200036d565b6080819052600254604051632fb1302360e21b8152600481018390523060248201529192506001600160a01b03169063bec4c08c90604401600060405180830381600087803b1580156200023757600080fd5b505af11580156200024c573d6000803e3d6000fd5b505050505050505062000387565b6001600160a01b038116331415620002b55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200031e57600080fd5b919050565b6000806000606084860312156200033957600080fd5b620003448462000306565b9250620003546020850162000306565b9150620003646040850162000306565b90509250925092565b6000602082840312156200038057600080fd5b5051919050565b6080516132a7620003b8600039600081816101fa0152818161125a0152818161182b0152611c2301526132a76000f3fe6080604052600436106101e35760003560e01c80639cfc058e11610102578063c3f909d411610095578063f254bdc711610064578063f254bdc71461071d578063f2fde38b1461075a578063f3fef3a31461077a578063fc2a88c31461079a57600080fd5b8063c3f909d4146105fc578063cdd8d88514610686578063ce5494bb146106c0578063da4f5e6d146106e057600080fd5b8063a4c0ed36116100d1578063a4c0ed361461057d578063a608a1e11461059d578063bed41a93146105bc578063bf17e559146105dc57600080fd5b80639cfc058e146105085780639eccacf61461051b578063a02e061614610548578063a3907d711461056857600080fd5b806348baa1c51161017a57806379ba50971161014957806379ba5097146104675780637fb5d19d1461047c5780638da5cb5b1461049c5780638ea98117146104e857600080fd5b806348baa1c5146103325780634b160935146103fd57806357a8070a1461041d578063650596541461044757600080fd5b80631fe543e3116101b65780631fe543e3146102bd5780632f2770db146102dd5780633255c456146102f25780634306d3541461031257600080fd5b8063030932bb146101e857806307b18bde1461022f578063181f5a771461025157806318b6f4c81461029d575b600080fd5b3480156101f457600080fd5b5061021c7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561023b57600080fd5b5061024f61024a366004612a13565b6107b0565b005b34801561025d57600080fd5b50604080518082018252601281527f56524656325772617070657220312e302e300000000000000000000000000000602082015290516102269190612eac565b3480156102a957600080fd5b5061024f6102b8366004612ab4565b61088c565b3480156102c957600080fd5b5061024f6102d8366004612b38565b610a03565b3480156102e957600080fd5b5061024f610a80565b3480156102fe57600080fd5b5061021c61030d366004612d3b565b610ab6565b34801561031e57600080fd5b5061021c61032d366004612c3b565b610bb0565b34801561033e57600080fd5b506103bc61034d366004612b06565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000810463ffffffff16907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845263ffffffff909216602084015267ffffffffffffffff1690820152606001610226565b34801561040957600080fd5b5061021c610418366004612c3b565b610cb7565b34801561042957600080fd5b506008546104379060ff1681565b6040519015158152602001610226565b34801561045357600080fd5b5061024f6104623660046129f8565b610da8565b34801561047357600080fd5b5061024f610df3565b34801561048857600080fd5b5061021c610497366004612d3b565b610ef0565b3480156104a857600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610226565b3480156104f457600080fd5b5061024f6105033660046129f8565b610ff6565b61021c610516366004612c56565b611101565b34801561052757600080fd5b506002546104c39073ffffffffffffffffffffffffffffffffffffffff1681565b34801561055457600080fd5b5061024f6105633660046129f8565b611496565b34801561057457600080fd5b5061024f611541565b34801561058957600080fd5b5061024f610598366004612a3d565b611573565b3480156105a957600080fd5b5060085461043790610100900460ff1681565b3480156105c857600080fd5b5061024f6105d7366004612d57565b611a53565b3480156105e857600080fd5b5061024f6105f7366004612c3b565b611ba9565b34801561060857600080fd5b506005546006546007546008546003546040805195865263ffffffff8086166020880152640100000000909504851690860152838316606086015268010000000000000000909204909216608084015260ff620100008304811660a085015260c084019190915263010000009091041660e082015261010001610226565b34801561069257600080fd5b506007546106ab90640100000000900463ffffffff1681565b60405163ffffffff9091168152602001610226565b3480156106cc57600080fd5b5061024f6106db3660046129f8565b611bf0565b3480156106ec57600080fd5b506006546104c3906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561072957600080fd5b506007546104c3906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561076657600080fd5b5061024f6107753660046129f8565b611ca6565b34801561078657600080fd5b5061024f610795366004612a13565b611cba565b3480156107a657600080fd5b5061021c60045481565b6107b8611db5565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610812576040519150601f19603f3d011682016040523d82523d6000602084013e610817565b606091505b5050905080610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6661696c656420746f207769746864726177206e61746976650000000000000060448201526064015b60405180910390fd5b505050565b81516108cd57806108c9576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b81516024111561091e5781516040517f51200dce00000000000000000000000000000000000000000000000000000000815261087e9160249160040161ffff92831681529116602082015260400190565b6000826023815181106109335761093361322e565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f01000000000000000000000000000000000000000000000000000000000000001490508080156109895750815b156109c0576040517f6048aa6800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b801580156109cc575081155b15610887576040517f6b81746e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025473ffffffffffffffffffffffffffffffffffffffff163314610a76576002546040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440161087e565b6108c98282611e38565b610a88611db5565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b60085460009060ff16610b25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161087e565b600854610100900460ff1615610b97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161087e565b610ba78363ffffffff1683612020565b90505b92915050565b60085460009060ff16610c1f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161087e565b600854610100900460ff1615610c91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161087e565b6000610c9b6120f6565b9050610cae8363ffffffff163a8361225d565b9150505b919050565b60085460009060ff16610d26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161087e565b600854610100900460ff1615610d98576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161087e565b610baa8263ffffffff163a612020565b610db0611db5565b6007805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161087e565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60085460009060ff16610f5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161087e565b600854610100900460ff1615610fd1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161087e565b6000610fdb6120f6565b9050610fee8463ffffffff16848361225d565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590611036575060025473ffffffffffffffffffffffffffffffffffffffff163314155b156110ba573361105b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6002546040517f061db9c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015291909116604482015260640161087e565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600061114283838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250925061088c915050565b600061114d8761234f565b905060006111618863ffffffff163a612020565b9050803410156111cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161087e565b6008546301000000900460ff1663ffffffff87161115611249576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161087e565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff89169181019190915260075460009190606082019063ffffffff166112a6868d612fd1565b6112b09190612fd1565b63ffffffff1681526020018863ffffffff16815260200187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506002546040517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff1690639b1c385e90611356908490600401612ebf565b602060405180830381600087803b15801561137057600080fd5b505af1158015611384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a89190612b1f565b6040805160608101825233815263ffffffff808d16602080840191825267ffffffffffffffff3a81168587019081526000888152600990935295909120935184549251955190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff9590931674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff91909116171792909216919091179055935050505095945050505050565b61149e611db5565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16156114fe576040517f2d118a6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9092166c01000000000000000000000000026bffffffffffffffffffffffff909216919091179055565b611549611db5565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60085460ff166115df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f77726170706572206973206e6f7420636f6e6669677572656400000000000000604482015260640161087e565b600854610100900460ff1615611651576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f777261707065722069732064697361626c656400000000000000000000000000604482015260640161087e565b6006546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146116e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6f6e6c792063616c6c61626c652066726f6d204c494e4b000000000000000000604482015260640161087e565b60008080806116f385870187612ccc565b935093509350935061170681600161088c565b60006117118561234f565b9050600061171d6120f6565b905060006117328763ffffffff163a8461225d565b9050808a101561179e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f66656520746f6f206c6f77000000000000000000000000000000000000000000604482015260640161087e565b6008546301000000900460ff1663ffffffff8616111561181a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e756d576f72647320746f6f2068696768000000000000000000000000000000604482015260640161087e565b6040805160c08101825260035481527f0000000000000000000000000000000000000000000000000000000000000000602082015261ffff88169181019190915260075460009190606082019063ffffffff16611877878c612fd1565b6118819190612fd1565b63ffffffff908116825288166020820152604090810187905260025490517f9b1c385e00000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690639b1c385e906118f5908590600401612ebf565b602060405180830381600087803b15801561190f57600080fd5b505af1158015611923573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119479190612b1f565b905060405180606001604052808e73ffffffffffffffffffffffffffffffffffffffff1681526020018a63ffffffff1681526020013a67ffffffffffffffff168152506009600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050508060048190555050505050505050505050505050565b611a5b611db5565b6007805463ffffffff9a8b167fffffffffffffffffffffffffffffffffffffffff00000000ffffffff000000009091161768010000000000000000998b168a02179055600880546003979097557fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9096166201000060ff988916027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009590971694909402959095177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117909355600680546005949094557fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff9187167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009094169390931764010000000094871694909402939093179290921691909316909102179055565b611bb1611db5565b6007805463ffffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff909216919091179055565b611bf8611db5565b6002546040517f405b84fa0000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301529091169063405b84fa90604401600060405180830381600087803b158015611c8b57600080fd5b505af1158015611c9f573d6000803e3d6000fd5b5050505050565b611cae611db5565b611cb781612367565b50565b611cc2611db5565b6006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526c010000000000000000000000009092049091169063a9059cbb90604401602060405180830381600087803b158015611d4757600080fd5b505af1158015611d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7f9190612a97565b6108c9576040517f7c07fc4c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314611e36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161087e565b565b60008281526009602081815260408084208151606081018352815473ffffffffffffffffffffffffffffffffffffffff808216835274010000000000000000000000000000000000000000820463ffffffff1683870152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff1693820193909352878652939092529290558051909116611f32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f72657175657374206e6f7420666f756e64000000000000000000000000000000604482015260640161087e565b600080631fe543e360e01b8585604051602401611f50929190612f1c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000611fca846020015163ffffffff1685600001518461245d565b90508061201857835160405173ffffffffffffffffffffffffffffffffffffffff9091169087907fc551b83c151f2d1c7eeb938ac59008e0409f1c1dc1e2f112449d4d79b458902290600090a35b505050505050565b600754600090819061203f90640100000000900463ffffffff166124a9565b60075463ffffffff680100000000000000008204811691612061911687612fb9565b61206b9190612fb9565b612075908561317c565b61207f9190612fb9565b60085490915081906000906064906120a09062010000900460ff1682612ff9565b6120ad9060ff168461317c565b6120b7919061301e565b6006549091506000906120e19068010000000000000000900463ffffffff1664e8d4a5100061317c565b6120eb9083612fb9565b979650505050505050565b600654600754604080517ffeaf968c000000000000000000000000000000000000000000000000000000008152905160009363ffffffff16151592849283926c0100000000000000000000000090920473ffffffffffffffffffffffffffffffffffffffff169163feaf968c9160048082019260a092909190829003018186803b15801561218357600080fd5b505afa158015612197573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121bb9190612df1565b5094509092508491505080156121e157506121d682426131b9565b60065463ffffffff16105b156121eb57506005545b6000811215612256576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c6964204c494e4b2077656920707269636500000000000000000000604482015260640161087e565b9392505050565b600754600090819061227c90640100000000900463ffffffff166124a9565b60075463ffffffff68010000000000000000820481169161229e911688612fb9565b6122a89190612fb9565b6122b2908661317c565b6122bc9190612fb9565b90506000836122d383670de0b6b3a764000061317c565b6122dd919061301e565b6008549091506000906064906122fc9062010000900460ff1682612ff9565b6123099060ff168461317c565b612313919061301e565b60065490915060009061233990640100000000900463ffffffff1664e8d4a5100061317c565b6123439083612fb9565b98975050505050505050565b600061235c603f83613032565b610baa906001612fd1565b73ffffffffffffffffffffffffffffffffffffffff81163314156123e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161087e565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005a61138881101561246f57600080fd5b61138881039050846040820482031161248757600080fd5b50823b61249357600080fd5b60008083516020850160008789f1949350505050565b6000466124b581612579565b15612559576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c06040518083038186803b15801561250357600080fd5b505afa158015612517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253b9190612bf1565b5050505091505083608c61254f9190612fb9565b610fee908261317c565b6125628161259c565b1561257057610cae836125d6565b50600092915050565b600061a4b182148061258d575062066eed82145b80610baa57505062066eee1490565b6000600a8214806125ae57506101a482145b806125bb575062aa37dc82145b806125c7575061210582145b80610baa57505062014a331490565b60008073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663519b4bd36040518163ffffffff1660e01b815260040160206040518083038186803b15801561263357600080fd5b505afa158015612647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266b9190612b1f565b905060008061267a81866131b9565b9050600061268982601061317c565b61269484600461317c565b61269e9190612fb9565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff16630c18c1626040518163ffffffff1660e01b815260040160206040518083038186803b1580156126fc57600080fd5b505afa158015612710573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127349190612b1f565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663f45e65d86040518163ffffffff1660e01b815260040160206040518083038186803b15801561279257600080fd5b505afa1580156127a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ca9190612b1f565b9050600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561282857600080fd5b505afa15801561283c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128609190612b1f565b9050600061286f82600a6130b6565b90506000818461287f8789612fb9565b612889908c61317c565b612893919061317c565b61289d919061301e565b9b9a5050505050505050505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610cb257600080fd5b60008083601f8401126128e257600080fd5b50813567ffffffffffffffff8111156128fa57600080fd5b60208301915083602082850101111561291257600080fd5b9250929050565b600082601f83011261292a57600080fd5b813567ffffffffffffffff8111156129445761294461325d565b61297560207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612f6a565b81815284602083860101111561298a57600080fd5b816020850160208301376000918101602001919091529392505050565b803561ffff81168114610cb257600080fd5b803563ffffffff81168114610cb257600080fd5b803560ff81168114610cb257600080fd5b805169ffffffffffffffffffff81168114610cb257600080fd5b600060208284031215612a0a57600080fd5b610ba7826128ac565b60008060408385031215612a2657600080fd5b612a2f836128ac565b946020939093013593505050565b60008060008060608587031215612a5357600080fd5b612a5c856128ac565b935060208501359250604085013567ffffffffffffffff811115612a7f57600080fd5b612a8b878288016128d0565b95989497509550505050565b600060208284031215612aa957600080fd5b81516122568161328c565b60008060408385031215612ac757600080fd5b823567ffffffffffffffff811115612ade57600080fd5b612aea85828601612919565b9250506020830135612afb8161328c565b809150509250929050565b600060208284031215612b1857600080fd5b5035919050565b600060208284031215612b3157600080fd5b5051919050565b60008060408385031215612b4b57600080fd5b8235915060208084013567ffffffffffffffff80821115612b6b57600080fd5b818601915086601f830112612b7f57600080fd5b813581811115612b9157612b9161325d565b8060051b9150612ba2848301612f6a565b8181528481019084860184860187018b1015612bbd57600080fd5b600095505b83861015612be0578035835260019590950194918601918601612bc2565b508096505050505050509250929050565b60008060008060008060c08789031215612c0a57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b600060208284031215612c4d57600080fd5b610ba7826129b9565b600080600080600060808688031215612c6e57600080fd5b612c77866129b9565b9450612c85602087016129a7565b9350612c93604087016129b9565b9250606086013567ffffffffffffffff811115612caf57600080fd5b612cbb888289016128d0565b969995985093965092949392505050565b60008060008060808587031215612ce257600080fd5b612ceb856129b9565b9350612cf9602086016129a7565b9250612d07604086016129b9565b9150606085013567ffffffffffffffff811115612d2357600080fd5b612d2f87828801612919565b91505092959194509250565b60008060408385031215612d4e57600080fd5b612a2f836129b9565b60008060008060008060008060006101208a8c031215612d7657600080fd5b612d7f8a6129b9565b9850612d8d60208b016129b9565b9750612d9b60408b016129cd565b965060608a01359550612db060808b016129cd565b9450612dbe60a08b016129b9565b935060c08a01359250612dd360e08b016129b9565b9150612de26101008b016129b9565b90509295985092959850929598565b600080600080600060a08688031215612e0957600080fd5b612e12866129de565b9450602086015193506040860151925060608601519150612e35608087016129de565b90509295509295909350565b6000815180845260005b81811015612e6757602081850181015186830182015201612e4b565b81811115612e79576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ba76020830184612e41565b60208152815160208201526020820151604082015261ffff60408301511660608201526000606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c080840152610fee60e0840182612e41565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612f5d57845183529383019391830191600101612f41565b5090979650505050505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612fb157612fb161325d565b604052919050565b60008219821115612fcc57612fcc6131d0565b500190565b600063ffffffff808316818516808303821115612ff057612ff06131d0565b01949350505050565b600060ff821660ff84168060ff03821115613016576130166131d0565b019392505050565b60008261302d5761302d6131ff565b500490565b600063ffffffff80841680613049576130496131ff565b92169190910492915050565b600181815b808511156130ae57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613094576130946131d0565b808516156130a157918102915b93841c939080029061305a565b509250929050565b6000610ba783836000826130cc57506001610baa565b816130d957506000610baa565b81600181146130ef57600281146130f957613115565b6001915050610baa565b60ff84111561310a5761310a6131d0565b50506001821b610baa565b5060208310610133831016604e8410600b8410161715613138575081810a610baa565b6131428383613055565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613174576131746131d0565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131b4576131b46131d0565b500290565b6000828210156131cb576131cb6131d0565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114611cb757600080fdfea164736f6c6343000806000a", } var VRFV2PlusWrapperABI = VRFV2PlusWrapperMetaData.ABI @@ -602,6 +602,18 @@ func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) Enable() (*types.Tra return _VRFV2PlusWrapper.Contract.Enable(&_VRFV2PlusWrapper.TransactOpts) } +func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) Migrate(opts *bind.TransactOpts, newCoordinator common.Address) (*types.Transaction, error) { + return _VRFV2PlusWrapper.contract.Transact(opts, "migrate", newCoordinator) +} + +func (_VRFV2PlusWrapper *VRFV2PlusWrapperSession) Migrate(newCoordinator common.Address) (*types.Transaction, error) { + return _VRFV2PlusWrapper.Contract.Migrate(&_VRFV2PlusWrapper.TransactOpts, newCoordinator) +} + +func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactorSession) Migrate(newCoordinator common.Address) (*types.Transaction, error) { + return _VRFV2PlusWrapper.Contract.Migrate(&_VRFV2PlusWrapper.TransactOpts, newCoordinator) +} + func (_VRFV2PlusWrapper *VRFV2PlusWrapperTransactor) OnTokenTransfer(opts *bind.TransactOpts, _sender common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { return _VRFV2PlusWrapper.contract.Transact(opts, "onTokenTransfer", _sender, _amount, _data) } @@ -1233,6 +1245,8 @@ type VRFV2PlusWrapperInterface interface { Enable(opts *bind.TransactOpts) (*types.Transaction, error) + Migrate(opts *bind.TransactOpts, newCoordinator common.Address) (*types.Transaction, error) + OnTokenTransfer(opts *bind.TransactOpts, _sender common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) RawFulfillRandomWords(opts *bind.TransactOpts, requestId *big.Int, randomWords []*big.Int) (*types.Transaction, error) diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index ac0786a8bb5..bd3bb50c496 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -102,6 +102,6 @@ vrfv2plus_client: ../../contracts/solc/v0.8.6/VRFV2PlusClient.abi ../../contract vrfv2plus_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusConsumerExample.bin 2c480a6d7955d33a00690fdd943486d95802e48a03f3cc243df314448e4ddb2c vrfv2plus_malicious_migrator: ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.abi ../../contracts/solc/v0.8.6/VRFV2PlusMaliciousMigrator.bin 80dbc98be5e42246960c889d29488f978d3db0127e95e9b295352c481d8c9b07 vrfv2plus_reverting_example: ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusRevertingExample.bin 34743ac1dd5e2c9d210b2bd721ebd4dff3c29c548f05582538690dde07773589 -vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin 3e1e3836e8c8bf7a6f83f571f17e258f30e6d02037e53eebf74c2af3fbcf0913 +vrfv2plus_wrapper: ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapper.bin bd5f9c8972cb12af4e76bfdc85caf67ef3d824276468b10d6e6e82df2925982f vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperConsumerExample.bin 4b3da45ff177e09b1e731b5b0cf4e050033a600ef8b0d32e79eec97db5c72408 vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2PlusWrapperLoadTestConsumer.bin 4886b08ff9cf013033b7c08e0317f23130ba8e2be445625fdbe1424eb7c38989 From c89f9c30166d2b320eeefe9bb050ea0243635a7e Mon Sep 17 00:00:00 2001 From: Tate Date: Fri, 6 Oct 2023 20:17:18 -0600 Subject: [PATCH 69/84] Fix the upgrade test ci (#10880) --- .github/workflows/integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index aee2fb2edee..884da09f4cb 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -449,8 +449,8 @@ jobs: CHAINLINK_COMMIT_SHA: ${{ github.sha }} CHAINLINK_ENV_USER: ${{ github.actor }} CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink - TEST_UPGRADE_VERSION: ${{ github.sha }} - TEST_UPGRADE_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink + UPGRADE_VERSION: ${{ github.sha }} + UPGRADE_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink TEST_LOG_LEVEL: debug TEST_SUITE: migration steps: From 7dbb38bb5283f54dfa4a788c91d9b3963f6ae271 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Mon, 9 Oct 2023 04:55:59 -0500 Subject: [PATCH 70/84] core: randomize p2p ports; consolidate GetFreePort implementations (#10884) --- core/internal/features/features_test.go | 24 +++++++++---------- .../features/ocr2/features_ocr2_test.go | 13 ++++------ core/internal/testutils/testutils.go | 17 ++++++++++++- .../v0/internal/testutils.go | 22 ++++------------- .../v1/internal/testutils.go | 22 ++++------------- .../internal/ocr2vrf_integration_test.go | 22 ++++------------- 6 files changed, 48 insertions(+), 72 deletions(-) diff --git a/core/internal/features/features_test.go b/core/internal/features/features_test.go index 39eee3f7b43..489f744cdef 100644 --- a/core/internal/features/features_test.go +++ b/core/internal/features/features_test.go @@ -670,12 +670,12 @@ func setupOCRContracts(t *testing.T) (*bind.TransactOpts, *backends.SimulatedBac return owner, b, ocrContractAddress, ocrContract, flagsContract, flagsContractAddress } -func setupNode(t *testing.T, owner *bind.TransactOpts, portV1, portV2 int, dbName string, +func setupNode(t *testing.T, owner *bind.TransactOpts, portV1, portV2 uint16, dbName string, b *backends.SimulatedBackend, ns ocrnetworking.NetworkingStack, overrides func(c *chainlink.Config, s *chainlink.Secrets), ) (*cltest.TestApplication, string, common.Address, ocrkey.KeyV2) { p2pKey, err := p2pkey.NewV2() require.NoError(t, err) - config, _ := heavyweight.FullTestDBV2(t, fmt.Sprintf("%s%d", dbName, portV1), func(c *chainlink.Config, s *chainlink.Secrets) { + config, _ := heavyweight.FullTestDBV2(t, dbName, func(c *chainlink.Config, s *chainlink.Secrets) { c.Insecure.OCRDevelopmentMode = ptr(true) // Disables ocr spec validation so we can have fast polling for the test. c.OCR.Enabled = ptr(true) @@ -743,7 +743,7 @@ func setupForwarderEnabledNode( t *testing.T, owner *bind.TransactOpts, portV1, - portV2 int, + portV2 uint16, dbName string, b *backends.SimulatedBackend, ns ocrnetworking.NetworkingStack, @@ -757,7 +757,7 @@ func setupForwarderEnabledNode( ) { p2pKey, err := p2pkey.NewV2() require.NoError(t, err) - config, _ := heavyweight.FullTestDBV2(t, fmt.Sprintf("%s%d", dbName, portV1), func(c *chainlink.Config, s *chainlink.Secrets) { + config, _ := heavyweight.FullTestDBV2(t, dbName, func(c *chainlink.Config, s *chainlink.Secrets) { c.Insecure.OCRDevelopmentMode = ptr(true) // Disables ocr spec validation so we can have fast polling for the test. c.OCR.Enabled = ptr(true) @@ -856,8 +856,8 @@ func TestIntegration_OCR(t *testing.T) { for _, tt := range tests { test := tt t.Run(test.name, func(t *testing.T) { - bootstrapNodePortV1 := test.portStart - bootstrapNodePortV2 := test.portStart + numOracles + 1 + bootstrapNodePortV1 := testutils.GetFreePort(t) + bootstrapNodePortV2 := testutils.GetFreePort(t) g := gomega.NewWithT(t) owner, b, ocrContractAddress, ocrContract, flagsContract, flagsContractAddress := setupOCRContracts(t) @@ -871,8 +871,8 @@ func TestIntegration_OCR(t *testing.T) { apps []*cltest.TestApplication ) for i := 0; i < numOracles; i++ { - portV1 := bootstrapNodePortV1 + i + 1 - portV2 := bootstrapNodePortV2 + i + 1 + portV1 := testutils.GetFreePort(t) + portV2 := testutils.GetFreePort(t) app, peerID, transmitter, key := setupNode(t, owner, portV1, portV2, fmt.Sprintf("o%d_%d", i, test.id), b, test.ns, func(c *chainlink.Config, s *chainlink.Secrets) { c.EVM[0].FlagsContractAddress = ptr(ethkey.EIP55AddressFromAddress(flagsContractAddress)) c.EVM[0].GasEstimator.EIP1559DynamicFees = ptr(test.eip1559) @@ -1080,8 +1080,8 @@ func TestIntegration_OCR_ForwarderFlow(t *testing.T) { t.Parallel() numOracles := 4 t.Run("ocr_forwarder_flow", func(t *testing.T) { - bootstrapNodePortV1 := 20000 - bootstrapNodePortV2 := 20000 + numOracles + 1 + bootstrapNodePortV1 := testutils.GetFreePort(t) + bootstrapNodePortV2 := testutils.GetFreePort(t) g := gomega.NewWithT(t) owner, b, ocrContractAddress, ocrContract, flagsContract, flagsContractAddress := setupOCRContracts(t) @@ -1097,8 +1097,8 @@ func TestIntegration_OCR_ForwarderFlow(t *testing.T) { apps []*cltest.TestApplication ) for i := 0; i < numOracles; i++ { - portV1 := bootstrapNodePortV1 + i + 1 - portV2 := bootstrapNodePortV2 + i + 1 + portV1 := testutils.GetFreePort(t) + portV2 := testutils.GetFreePort(t) app, peerID, transmitter, forwarder, key := setupForwarderEnabledNode(t, owner, portV1, portV2, fmt.Sprintf("o%d_%d", i, 1), b, ocrnetworking.NetworkingStackV2, func(c *chainlink.Config, s *chainlink.Secrets) { c.Feature.LogPoller = ptr(true) c.EVM[0].FlagsContractAddress = ptr(ethkey.EIP55AddressFromAddress(flagsContractAddress)) diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index 0a6192c99c3..f31f19a4f2d 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -23,11 +23,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/onsi/gomega" - "github.com/smartcontractkit/libocr/commontypes" - "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" + testoffchainaggregator2 "github.com/smartcontractkit/libocr/gethwrappers2/testocr2aggregator" confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -191,9 +192,7 @@ func TestIntegration_OCR2(t *testing.T) { owner, b, ocrContractAddress, ocrContract := setupOCR2Contracts(t) lggr := logger.TestLogger(t) - // Note it's plausible these ports could be occupied on a CI machine. - // May need a port randomize + retry approach if we observe collisions. - bootstrapNodePort := uint16(29999) + bootstrapNodePort := testutils.GetFreePort(t) bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, "bootstrap", false /* useForwarders */, b, nil) var ( @@ -462,9 +461,7 @@ func TestIntegration_OCR2_ForwarderFlow(t *testing.T) { owner, b, ocrContractAddress, ocrContract := setupOCR2Contracts(t) lggr := logger.TestLogger(t) - // Note it's plausible these ports could be occupied on a CI machine. - // May need a port randomize + retry approach if we observe collisions. - bootstrapNodePort := uint16(29898) + bootstrapNodePort := testutils.GetFreePort(t) bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, "bootstrap", true /* useForwarders */, b, nil) var ( diff --git a/core/internal/testutils/testutils.go b/core/internal/testutils/testutils.go index d50efcc799a..0d4e710b497 100644 --- a/core/internal/testutils/testutils.go +++ b/core/internal/testutils/testutils.go @@ -10,6 +10,7 @@ import ( "math" "math/big" mrand "math/rand" + "net" "net/http" "net/http/httptest" "net/url" @@ -24,10 +25,11 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/google/uuid" "github.com/gorilla/websocket" - "github.com/smartcontractkit/sqlx" "github.com/tidwall/gjson" "go.uber.org/zap/zaptest/observer" + "github.com/smartcontractkit/sqlx" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" // NOTE: To avoid circular dependencies, this package MUST NOT import @@ -450,3 +452,16 @@ func MustDecodeBase64(s string) (b []byte) { } return } + +// GetFreePort returns a free port. +// NOTE: This approach is technically incorrect because the returned port +// can still be taken by the time the caller attempts to bind to it. +// Unfortunately, we can't specify zero port in P2P.V2.ListenAddresses at the moment. +func GetFreePort(t *testing.T) uint16 { + addr, err := net.ResolveTCPAddr("tcp", "localhost:0") + require.NoError(t, err) + listener, err := net.ListenTCP("tcp", addr) + require.NoError(t, err) + require.NoError(t, listener.Close()) + return uint16(listener.Addr().(*net.TCPAddr).Port) +} diff --git a/core/services/ocr2/plugins/functions/integration_tests/v0/internal/testutils.go b/core/services/ocr2/plugins/functions/integration_tests/v0/internal/testutils.go index 9013620e1e6..a36b3cd3ea7 100644 --- a/core/services/ocr2/plugins/functions/integration_tests/v0/internal/testutils.go +++ b/core/services/ocr2/plugins/functions/integration_tests/v0/internal/testutils.go @@ -7,7 +7,6 @@ import ( "io" "math/big" "math/rand" - "net" "net/http" "net/http/httptest" "net/url" @@ -22,11 +21,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/onsi/gomega" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/smartcontractkit/libocr/commontypes" confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/v2/core/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" @@ -469,7 +469,7 @@ func CreateFunctionsNodes( require.Fail(t, "ocr2Keystores and thresholdKeyShares must have the same length") } - bootstrapPort := getFreePort(t) + bootstrapPort := testutils.GetFreePort(t) bootstrapNode = StartNewNode(t, owner, bootstrapPort, "bootstrap", b, uint32(maxGas), nil, nil, "") AddBootstrapJob(t, bootstrapNode.App, oracleContractAddress) @@ -487,7 +487,7 @@ func CreateFunctionsNodes( } else { ocr2Keystore = ocr2Keystores[i] } - nodePort := getFreePort(t) + nodePort := testutils.GetFreePort(t) oracleNode := StartNewNode(t, owner, nodePort, fmt.Sprintf("oracle%d", i), b, uint32(maxGas), []commontypes.BootstrapperLocator{ {PeerID: bootstrapNode.PeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapPort)}}, }, ocr2Keystore, thresholdKeyShare) @@ -503,18 +503,6 @@ func CreateFunctionsNodes( return bootstrapNode, oracleNodes, oracleIdentites } -// NOTE: This approach is technically incorrect because the returned port -// can still be taken by the time the caller attempts to bind to it. -// Unfortunately, we can't specify zero port in P2P.V2.ListenAddresses at the moment. -func getFreePort(t *testing.T) uint16 { - addr, err := net.ResolveTCPAddr("tcp", "localhost:0") - require.NoError(t, err) - listener, err := net.ListenTCP("tcp", addr) - require.NoError(t, err) - require.NoError(t, listener.Close()) - return uint16(listener.Addr().(*net.TCPAddr).Port) -} - func ClientTestRequests( t *testing.T, owner *bind.TransactOpts, diff --git a/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go b/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go index c376213ed13..0970ea7c482 100644 --- a/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go +++ b/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go @@ -7,7 +7,6 @@ import ( "io" "math/big" "math/rand" - "net" "net/http" "net/http/httptest" "net/url" @@ -23,11 +22,12 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/onsi/gomega" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/smartcontractkit/libocr/commontypes" confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/v2/core/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" @@ -549,7 +549,7 @@ func CreateFunctionsNodes( require.Fail(t, "ocr2Keystores and thresholdKeyShares must have the same length") } - bootstrapPort := getFreePort(t) + bootstrapPort := testutils.GetFreePort(t) bootstrapNode = StartNewNode(t, owner, bootstrapPort, "bootstrap", b, uint32(maxGas), nil, nil, "") AddBootstrapJob(t, bootstrapNode.App, routerAddress) @@ -567,7 +567,7 @@ func CreateFunctionsNodes( } else { ocr2Keystore = ocr2Keystores[i] } - nodePort := getFreePort(t) + nodePort := testutils.GetFreePort(t) oracleNode := StartNewNode(t, owner, nodePort, fmt.Sprintf("oracle%d", i), b, uint32(maxGas), []commontypes.BootstrapperLocator{ {PeerID: bootstrapNode.PeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapPort)}}, }, ocr2Keystore, thresholdKeyShare) @@ -583,18 +583,6 @@ func CreateFunctionsNodes( return bootstrapNode, oracleNodes, oracleIdentites } -// NOTE: This approach is technically incorrect because the returned port -// can still be taken by the time the caller attempts to bind to it. -// Unfortunately, we can't specify zero port in P2P.V2.ListenAddresses at the moment. -func getFreePort(t *testing.T) uint16 { - addr, err := net.ResolveTCPAddr("tcp", "localhost:0") - require.NoError(t, err) - listener, err := net.ListenTCP("tcp", addr) - require.NoError(t, err) - require.NoError(t, listener.Close()) - return uint16(listener.Addr().(*net.TCPAddr).Port) -} - func ClientTestRequests( t *testing.T, owner *bind.TransactOpts, diff --git a/core/services/ocr2/plugins/ocr2vrf/internal/ocr2vrf_integration_test.go b/core/services/ocr2/plugins/ocr2vrf/internal/ocr2vrf_integration_test.go index c6a4552683a..852017dffa9 100644 --- a/core/services/ocr2/plugins/ocr2vrf/internal/ocr2vrf_integration_test.go +++ b/core/services/ocr2/plugins/ocr2vrf/internal/ocr2vrf_integration_test.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "math/big" - "net" "testing" "time" @@ -20,6 +19,9 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/onsi/gomega" + "github.com/stretchr/testify/require" + "go.dedis.ch/kyber/v3" + "github.com/smartcontractkit/libocr/commontypes" confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -27,9 +29,6 @@ import ( ocr2dkg "github.com/smartcontractkit/ocr2vrf/dkg" "github.com/smartcontractkit/ocr2vrf/ocr2vrf" ocr2vrftypes "github.com/smartcontractkit/ocr2vrf/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.dedis.ch/kyber/v3" "github.com/smartcontractkit/chainlink/v2/core/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders" @@ -337,7 +336,7 @@ func runOCR2VRFTest(t *testing.T, useForwarders bool) { t.Log("Creating bootstrap node") - bootstrapNodePort := getFreePort(t) + bootstrapNodePort := testutils.GetFreePort(t) bootstrapNode := setupNodeOCR2(t, uni.owner, bootstrapNodePort, "bootstrap", uni.backend, false, nil) numNodes := 5 @@ -362,7 +361,7 @@ func runOCR2VRFTest(t *testing.T, useForwarders bool) { fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort), }}, } - node := setupNodeOCR2(t, uni.owner, getFreePort(t), fmt.Sprintf("ocr2vrforacle%d", i), uni.backend, useForwarders, bootstrappers) + node := setupNodeOCR2(t, uni.owner, testutils.GetFreePort(t), fmt.Sprintf("ocr2vrforacle%d", i), uni.backend, useForwarders, bootstrappers) sendingKeys = append(sendingKeys, node.sendingKeys) dkgSignKey, err := node.app.GetKeyStore().DKGSign().Create() @@ -875,15 +874,4 @@ func randomKeyID(t *testing.T) (r [32]byte) { return } -func getFreePort(t *testing.T) uint16 { - addr, err := net.ResolveTCPAddr("tcp", "localhost:0") - require.NoError(t, err) - - l, err := net.ListenTCP("tcp", addr) - require.NoError(t, err) - defer func() { assert.NoError(t, l.Close()) }() - - return uint16(l.Addr().(*net.TCPAddr).Port) -} - func ptr[T any](v T) *T { return &v } From 5a0197bb6cb3e576339be0a0f8f768ce24259e58 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Mon, 9 Oct 2023 05:47:33 -0500 Subject: [PATCH 71/84] golangci-lint (#10882) * x is unused (unused) * error-return: error should be the last type when returning multiple items (revive) * var-declaration: should omit type X from declaration of Y; it will be inferred from the right-hand side (revive) * defer: prefer not to defer inside loops (revive) * error-strings: error strings should not be capitalized or end with punctuation or a newline (revive) * File is not 'goimports'-ed with -local github.com/smartcontractkit/chainlink (goimports) * SA1012: do not pass a nil Context, even if a function permits it; pass context. * ineffectual assignment to err (ineffassign) --- core/chains/evm/chain.go | 1 - core/chains/evm/gas/fixed_price_estimator.go | 1 + core/chains/evm/txmgr/strategies_test.go | 2 +- core/chains/evm/txmgr/transmitchecker_test.go | 2 +- core/cmd/cosmos_node_commands_test.go | 5 ++-- core/gethwrappers/versions.go | 4 +-- core/services/chainlink/config_general.go | 6 +---- core/services/functions/listener_test.go | 26 +++++++++---------- core/services/keystore/eth.go | 18 ------------- .../ocr2/plugins/ocr2keeper/evm21/registry.go | 5 ++-- core/services/pipeline/task.bridge_test.go | 2 +- core/services/vrf/v2/integration_v2_test.go | 6 ++--- .../vrf/v2/listener_v2_helpers_test.go | 2 +- .../vrf/vrftesthelpers/consumer_v2.go | 1 + core/web/bridge_types_controller_test.go | 2 +- core/web/nodes_controller.go | 4 +-- core/web/resolver/chain.go | 1 + tools/flakeytests/runner_test.go | 6 ----- 18 files changed, 33 insertions(+), 61 deletions(-) diff --git a/core/chains/evm/chain.go b/core/chains/evm/chain.go index ddd9a38c755..58c793cc646 100644 --- a/core/chains/evm/chain.go +++ b/core/chains/evm/chain.go @@ -64,7 +64,6 @@ var ( // LegacyChains implements [LegacyChainContainer] type LegacyChains struct { *chains.ChainsKV[Chain] - dflt Chain cfgs toml.EVMConfigs } diff --git a/core/chains/evm/gas/fixed_price_estimator.go b/core/chains/evm/gas/fixed_price_estimator.go index 733dd179fec..a45df741a27 100644 --- a/core/chains/evm/gas/fixed_price_estimator.go +++ b/core/chains/evm/gas/fixed_price_estimator.go @@ -4,6 +4,7 @@ import ( "context" "github.com/pkg/errors" + commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/core/assets" diff --git a/core/chains/evm/txmgr/strategies_test.go b/core/chains/evm/txmgr/strategies_test.go index 3d9fed8fce1..9c5a1be37f1 100644 --- a/core/chains/evm/txmgr/strategies_test.go +++ b/core/chains/evm/txmgr/strategies_test.go @@ -21,7 +21,7 @@ func Test_SendEveryStrategy(t *testing.T) { assert.Equal(t, uuid.NullUUID{}, s.Subject()) - n, err := s.PruneQueue(nil, nil) + n, err := s.PruneQueue(testutils.Context(t), nil) assert.NoError(t, err) assert.Equal(t, int64(0), n) } diff --git a/core/chains/evm/txmgr/transmitchecker_test.go b/core/chains/evm/txmgr/transmitchecker_test.go index f8a80990d31..d536eaf40b6 100644 --- a/core/chains/evm/txmgr/transmitchecker_test.go +++ b/core/chains/evm/txmgr/transmitchecker_test.go @@ -164,7 +164,7 @@ func TestTransmitCheckers(t *testing.T) { mock.AnythingOfType("*hexutil.Bytes"), "eth_call", mock.MatchedBy(func(callarg map[string]interface{}) bool { return fmt.Sprintf("%s", callarg["value"]) == "0x282" // 642 - }), "latest").Return(errors.New("error!")).Once() + }), "latest").Return(errors.New("error")).Once() // Non-revert errors are logged but should not prevent transmission, and do not need // to be passed to the caller diff --git a/core/cmd/cosmos_node_commands_test.go b/core/cmd/cosmos_node_commands_test.go index 93364b74e0b..c19749ecd12 100644 --- a/core/cmd/cosmos_node_commands_test.go +++ b/core/cmd/cosmos_node_commands_test.go @@ -6,11 +6,12 @@ import ( "testing" "github.com/pelletier/go-toml/v2" - coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" + "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/chains/cosmos" diff --git a/core/gethwrappers/versions.go b/core/gethwrappers/versions.go index 5b65e2f411a..acdefd06a59 100644 --- a/core/gethwrappers/versions.go +++ b/core/gethwrappers/versions.go @@ -54,7 +54,7 @@ func versionsDBLineReader() (*bufio.Scanner, error) { } -// readVersionsDB populates an IntegratedVersion with all the info in the +// ReadVersionsDB populates an IntegratedVersion with all the info in the // versions DB func ReadVersionsDB() (*IntegratedVersion, error) { rv := IntegratedVersion{} @@ -87,7 +87,7 @@ func ReadVersionsDB() (*IntegratedVersion, error) { } _, alreadyExists := rv.ContractVersions[topic] if alreadyExists { - return nil, errors.Errorf(`topic "%s" already mentioned!`, topic) + return nil, errors.Errorf(`topic "%s" already mentioned`, topic) } rv.ContractVersions[topic] = ContractVersion{ AbiPath: line[1], BinaryPath: line[2], Hash: line[3], diff --git a/core/services/chainlink/config_general.go b/core/services/chainlink/config_general.go index 688215c6978..33be81add5d 100644 --- a/core/services/chainlink/config_general.go +++ b/core/services/chainlink/config_general.go @@ -3,7 +3,6 @@ package chainlink import ( _ "embed" "fmt" - "net/url" "os" "path/filepath" "strings" @@ -506,7 +505,4 @@ func (g *generalConfig) Threshold() coreconfig.Threshold { return &thresholdConfig{s: g.secrets.Threshold} } -var ( - zeroURL = url.URL{} - zeroSha256Hash = models.Sha256Hash{} -) +var zeroSha256Hash = models.Sha256Hash{} diff --git a/core/services/functions/listener_test.go b/core/services/functions/listener_test.go index a06fcf3e3b2..2bcf2542638 100644 --- a/core/services/functions/listener_test.go +++ b/core/services/functions/listener_test.go @@ -63,19 +63,19 @@ type FunctionsListenerUniverse struct { func ptr[T any](t T) *T { return &t } var ( - RequestID functions_service.RequestID = newRequestID() - RequestIDStr = fmt.Sprintf("0x%x", [32]byte(RequestID)) - SubscriptionOwner common.Address = common.BigToAddress(big.NewInt(42069)) - SubscriptionID = uint64(5) - ResultBytes = []byte{0xab, 0xcd} - ErrorBytes = []byte{0xff, 0x11} - Domains = []string{"github.com", "google.com"} - EncryptedSecretsUrls []byte = []byte{0x11, 0x22} - EncryptedSecrets []byte = []byte(`{"TDH2Ctxt":"eyJHcm","SymCtxt":"+yHR","Nonce":"kgjHyT3Jar0M155E"}`) - DecryptedSecrets []byte = []byte(`{"0x0":"lhcK"}`) - SignedCBORRequestHex = "a666736f75726365782172657475726e2046756e6374696f6e732e656e636f646555696e743235362831296773656372657473421234686c616e6775616765006c636f64654c6f636174696f6e006f736563726574734c6f636174696f6e0170726571756573745369676e617475726558416fb6d10871aa3865b6620dc5f4594d2a9ad9166ba6b1dbc3f508362fd27aa0461babada48979092a11ecadec9c663a2ea99da4e368408b36a3fb414acfefdd2a1c" - SubOwnerAddr common.Address = common.HexToAddress("0x2334dE553AB93c69b0ccbe278B6f5E8350Db6204") - NonSubOwnerAddr common.Address = common.HexToAddress("0x60C9CF55b9de9A956d921A97575108149b758131") + RequestID = newRequestID() + RequestIDStr = fmt.Sprintf("0x%x", [32]byte(RequestID)) + SubscriptionOwner = common.BigToAddress(big.NewInt(42069)) + SubscriptionID = uint64(5) + ResultBytes = []byte{0xab, 0xcd} + ErrorBytes = []byte{0xff, 0x11} + Domains = []string{"github.com", "google.com"} + EncryptedSecretsUrls = []byte{0x11, 0x22} + EncryptedSecrets = []byte(`{"TDH2Ctxt":"eyJHcm","SymCtxt":"+yHR","Nonce":"kgjHyT3Jar0M155E"}`) + DecryptedSecrets = []byte(`{"0x0":"lhcK"}`) + SignedCBORRequestHex = "a666736f75726365782172657475726e2046756e6374696f6e732e656e636f646555696e743235362831296773656372657473421234686c616e6775616765006c636f64654c6f636174696f6e006f736563726574734c6f636174696f6e0170726571756573745369676e617475726558416fb6d10871aa3865b6620dc5f4594d2a9ad9166ba6b1dbc3f508362fd27aa0461babada48979092a11ecadec9c663a2ea99da4e368408b36a3fb414acfefdd2a1c" + SubOwnerAddr = common.HexToAddress("0x2334dE553AB93c69b0ccbe278B6f5E8350Db6204") + NonSubOwnerAddr = common.HexToAddress("0x60C9CF55b9de9A956d921A97575108149b758131") ) func NewFunctionsListenerUniverse(t *testing.T, timeoutSec int, pruneFrequencySec int, setTiers bool, version uint32) *FunctionsListenerUniverse { diff --git a/core/services/keystore/eth.go b/core/services/keystore/eth.go index 9909f398bf4..362baed6afc 100644 --- a/core/services/keystore/eth.go +++ b/core/services/keystore/eth.go @@ -664,24 +664,6 @@ func (ks *eth) add(key ethkey.KeyV2, chainIDs ...*big.Int) (err error) { return err } -func (ks *eth) addWithNonce(key ethkey.KeyV2, chainID *big.Int, nonce int64, isDisabled bool) (err error) { - ks.lock.Lock() - defer ks.lock.Unlock() - err = ks.safeAddKey(key, func(tx pg.Queryer) (merr error) { - state := new(ethkey.State) - sql := `INSERT INTO evm.key_states (address, next_nonce, disabled, evm_chain_id, created_at, updated_at) -VALUES ($1, $2, $3, $4, NOW(), NOW()) RETURNING *;` - if err = ks.orm.q.Get(state, sql, key.Address, nonce, isDisabled, chainID); err != nil { - return errors.Wrap(err, "failed to insert evm_key_state") - } - - ks.keyStates.add(state) - return nil - }) - ks.notify() - return err -} - // notify notifies subscribers that eth keys have changed func (ks *eth) notify() { ks.subscribersMu.RLock() diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go index d7cd5f26250..1cad587e635 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go @@ -15,9 +15,10 @@ import ( coreTypes "github.com/ethereum/go-ethereum/core/types" "github.com/patrickmn/go-cache" "github.com/pkg/errors" - ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" "go.uber.org/multierr" + ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" @@ -144,8 +145,6 @@ type EvmRegistry struct { lastPollBlock int64 ctx context.Context headFunc func(ocr2keepers.BlockKey) - runState int - runError error mercury *MercuryConfig hc HttpClient bs *BlockSubscriber diff --git a/core/services/pipeline/task.bridge_test.go b/core/services/pipeline/task.bridge_test.go index e37b2095236..6f542d485e0 100644 --- a/core/services/pipeline/task.bridge_test.go +++ b/core/services/pipeline/task.bridge_test.go @@ -138,7 +138,7 @@ func fakeIntermittentlyFailingPriceResponder(t *testing.T, requestData map[strin if reqBody.Meta["shouldFail"].(bool) { w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusBadGateway) - require.NoError(t, json.NewEncoder(w).Encode(errors.New("EA failure!"))) + require.NoError(t, json.NewEncoder(w).Encode(errors.New("EA failure"))) return } w.Header().Set("Content-Type", "application/json") diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index 531c7ebb663..b26bdf750ba 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -222,9 +222,8 @@ func newVRFCoordinatorV2Universe(t *testing.T, key ethkey.KeyV2, numConsumers in backend.Commit() // Deploy old VRF v2 coordinator from bytecode - err, oldRootContractAddress, oldRootContract := deployOldCoordinator( + oldRootContractAddress, oldRootContract := deployOldCoordinator( t, linkAddress, bhsAddress, linkEthFeed, backend, neil) - require.NoError(t, err) // Deploy the VRFOwner contract, which will own the VRF coordinator // in some tests. @@ -423,7 +422,6 @@ func deployOldCoordinator( backend *backends.SimulatedBackend, neil *bind.TransactOpts, ) ( - error, common.Address, *vrf_coordinator_v2.VRFCoordinatorV2, ) { @@ -447,7 +445,7 @@ func deployOldCoordinator( require.NotEqual(t, common.HexToAddress("0x0"), oldRootContractAddress, "old vrf coordinator address equal to zero address, deployment failed") oldRootContract, err := vrf_coordinator_v2.NewVRFCoordinatorV2(oldRootContractAddress, backend) require.NoError(t, err, "could not create wrapper object for old vrf coordinator v2") - return err, oldRootContractAddress, oldRootContract + return oldRootContractAddress, oldRootContract } // Send eth from prefunded account. diff --git a/core/services/vrf/v2/listener_v2_helpers_test.go b/core/services/vrf/v2/listener_v2_helpers_test.go index 204d1e1fcab..8ba900bdc3a 100644 --- a/core/services/vrf/v2/listener_v2_helpers_test.go +++ b/core/services/vrf/v2/listener_v2_helpers_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/v2/core/assets" - "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2" + v2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2" ) func TestListener_EstimateFeeJuels(t *testing.T) { diff --git a/core/services/vrf/vrftesthelpers/consumer_v2.go b/core/services/vrf/vrftesthelpers/consumer_v2.go index ec3d727f7ab..abaf97b828b 100644 --- a/core/services/vrf/vrftesthelpers/consumer_v2.go +++ b/core/services/vrf/vrftesthelpers/consumer_v2.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" gethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_consumer_v2" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_consumer_v2_plus_upgradeable_example" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_consumer_v2_upgradeable_example" diff --git a/core/web/bridge_types_controller_test.go b/core/web/bridge_types_controller_test.go index 7184b05f5e0..e0048cc64d4 100644 --- a/core/web/bridge_types_controller_test.go +++ b/core/web/bridge_types_controller_test.go @@ -140,7 +140,7 @@ func BenchmarkBridgeTypesController_Index(b *testing.B) { b.ResetTimer() for n := 0; n < b.N; n++ { resp, cleanup := client.Get("/v2/bridge_types") - defer cleanup() + b.Cleanup(cleanup) assert.Equal(b, http.StatusOK, resp.StatusCode, "Response should be successful") } } diff --git a/core/web/nodes_controller.go b/core/web/nodes_controller.go index 1eddc67c364..3547b150bc7 100644 --- a/core/web/nodes_controller.go +++ b/core/web/nodes_controller.go @@ -76,9 +76,9 @@ func (n *nodesController[R]) Index(c *gin.Context, size, page, offset int) { // fetch nodes for chain ID // backward compatibility var rid relay.ID - err := rid.UnmarshalString(id) + err = rid.UnmarshalString(id) if err != nil { - rid.ChainID = relay.ChainID(id) + rid.ChainID = id rid.Network = n.nodeSet.network } nodes, count, err = n.nodeSet.NodeStatuses(c, offset, size, rid) diff --git a/core/web/resolver/chain.go b/core/web/resolver/chain.go index 02573f423a4..53f1016d72b 100644 --- a/core/web/resolver/chain.go +++ b/core/web/resolver/chain.go @@ -2,6 +2,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" + "github.com/smartcontractkit/chainlink-relay/pkg/types" ) diff --git a/tools/flakeytests/runner_test.go b/tools/flakeytests/runner_test.go index 8fa81db5ba0..c4509ff2cc9 100644 --- a/tools/flakeytests/runner_test.go +++ b/tools/flakeytests/runner_test.go @@ -232,12 +232,6 @@ func TestRunner_RootLevelTest(t *testing.T) { assert.True(t, ok) } -type exitError struct{} - -func (e *exitError) ExitCode() int { return 1 } - -func (e *exitError) Error() string { return "exit code: 1" } - func TestRunner_RerunFailsWithNonzeroExitCode(t *testing.T) { output := `{"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink/v2/core/assets","Test":"TestLink","Elapsed":0}` From e3929ddd6e6dc99ce24bea319eb6fd143f84e650 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Mon, 9 Oct 2023 11:38:56 -0500 Subject: [PATCH 72/84] .github/workflows: fix race file match (#10885) --- .github/workflows/ci-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index ca95d0c55dc..09d805a116e 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -107,7 +107,7 @@ jobs: output-file: ./output-short.txt - name: Print Races if: ${{ failure() && matrix.cmd == 'go_core_race_tests' }} - run: find *.race | xargs cat + run: find race.* | xargs cat - name: Store logs artifacts if: always() uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 From a40a6a8deb66f779773d34ef5e4cf321937333ba Mon Sep 17 00:00:00 2001 From: Makram Date: Mon, 9 Oct 2023 21:42:51 +0300 Subject: [PATCH 73/84] chore: update codeowners (#10888) Update CODEOWNERS to specify more fine-grained ownership over specific contracts in the contracts/ directory, as well as some other misc code ownership in various vrf-related directories and files. --- CODEOWNERS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index c49affb8aab..0c7e4dc7e7b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,5 +1,5 @@ # CODEOWNERS Best Practices -# 1. Per Github docs: "Order is important; the last matching pattern takes the most precedence." +# 1. Per Github docs: "Order is important; the last matching pattern takes the most precedence." # Please define less specific codeowner paths before more specific codeowner paths in order for the more specific rule to have priority # Misc @@ -37,6 +37,10 @@ # VRF-related services /core/services/vrf @smartcontractkit/vrf-team /core/services/blockhashstore @smartcontractkit/vrf-team +/core/services/blockheaderfeeder @smartcontractkit/vrf-team +/core/services/pipeline/task.vrf.go @smartcontractkit/vrf-team +/core/services/pipeline/task.vrfv2.go @smartcontractkit/vrf-team +/core/services/pipeline/task.vrfv2plus.go @smartcontractkit/vrf-team /core/services/ocr2/plugins/dkg @smartcontractkit/vrf-team /core/services/ocr2/plugins/ocr2vrf @smartcontractkit/vrf-team @@ -74,6 +78,10 @@ core/scripts/gateway @bolekk @pinebit /contracts/src/v0.8/functions @smartcontractkit/functions /contracts/test/v0.8/functions @smartcontractkit/functions /contracts/src/v0.8/llo-feeds @austinborn @Fletch153 +/contracts/src/v0.8/vrf @smartcontractkit/vrf-team +/contracts/src/v0.8/dev/vrf @smartcontractkit/vrf-team +/contracts/src/v0.8/dev/BlockhashStore.sol @smartcontractkit/vrf-team +/contracts/src/v0.8/dev/VRFConsumerBaseV2Upgradeable.sol @smartcontractkit/vrf-team # Tests /integration-tests/ @smartcontractkit/test-tooling-team From dfb97e55d23e6225347383b562477e494a9bf20d Mon Sep 17 00:00:00 2001 From: Morgan Kuphal <87319522+KuphJr@users.noreply.github.com> Date: Mon, 9 Oct 2023 14:58:00 -0500 Subject: [PATCH 74/84] remove request signatures (#10864) --- core/services/functions/listener.go | 9 ---- core/services/functions/listener_test.go | 32 ------------ core/services/functions/request.go | 62 +++--------------------- 3 files changed, 7 insertions(+), 96 deletions(-) diff --git a/core/services/functions/listener.go b/core/services/functions/listener.go index 084d1530a76..b07a4f302f3 100644 --- a/core/services/functions/listener.go +++ b/core/services/functions/listener.go @@ -490,15 +490,6 @@ func (l *FunctionsListener) handleRequest(ctx context.Context, requestID Request requestIDStr := formatRequestId(requestID) l.logger.Infow("processing request", "requestID", requestIDStr) - if l.pluginConfig.ContractVersion == 1 && l.pluginConfig.EnableRequestSignatureCheck { - err := VerifyRequestSignature(subscriptionOwner, requestData) - if err != nil { - l.logger.Errorw("invalid request signature", "requestID", requestIDStr, "err", err) - l.setError(ctx, requestID, USER_ERROR, []byte(err.Error())) - return - } - } - eaClient, err := l.bridgeAccessor.NewExternalAdapterClient() if err != nil { l.logger.Errorw("failed to create ExternalAdapterClient", "requestID", requestIDStr, "err", err) diff --git a/core/services/functions/listener_test.go b/core/services/functions/listener_test.go index 2bcf2542638..6e2d2bc9f6a 100644 --- a/core/services/functions/listener_test.go +++ b/core/services/functions/listener_test.go @@ -1,7 +1,6 @@ package functions_test import ( - "encoding/hex" "encoding/json" "fmt" "math/big" @@ -19,7 +18,6 @@ import ( decryptionPlugin "github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin" - cl_cbor "github.com/smartcontractkit/chainlink/v2/core/cbor" log_mocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log/mocks" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/ocr2dr_oracle" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" @@ -469,36 +467,6 @@ func TestFunctionsListener_PruneRequests(t *testing.T) { uni.service.Close() } -func TestFunctionsListener_RequestSignatureVerification(t *testing.T) { - testutils.SkipShortDB(t) - t.Parallel() - - cborBytes, err := hex.DecodeString(SignedCBORRequestHex) - require.NoError(t, err) - - var requestData functions_service.RequestData - err = cl_cbor.ParseDietCBORToStruct(cborBytes, &requestData) - require.NoError(t, err) - - err = functions_service.VerifyRequestSignature(SubOwnerAddr, &requestData) - assert.NoError(t, err) -} - -func TestFunctionsListener_RequestSignatureVerificationFailure(t *testing.T) { - testutils.SkipShortDB(t) - t.Parallel() - - cborBytes, err := hex.DecodeString(SignedCBORRequestHex) - require.NoError(t, err) - - var requestData functions_service.RequestData - err = cl_cbor.ParseDietCBORToStruct(cborBytes, &requestData) - require.NoError(t, err) - - err = functions_service.VerifyRequestSignature(NonSubOwnerAddr, &requestData) - assert.EqualError(t, err, "invalid request signature: signer's address does not match subscription owner") -} - func getFlags(requestSizeTier int, secretSizeTier int) [32]byte { var flags [32]byte flags[1] = byte(requestSizeTier) diff --git a/core/services/functions/request.go b/core/services/functions/request.go index a6715e0a87f..1a1d16a51dc 100644 --- a/core/services/functions/request.go +++ b/core/services/functions/request.go @@ -1,14 +1,5 @@ package functions -import ( - "encoding/json" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - - "github.com/smartcontractkit/chainlink/v2/core/utils" -) - const ( LocationInline = 0 LocationRemote = 1 @@ -19,14 +10,13 @@ const ( type RequestFlags [32]byte type RequestData struct { - Source string `json:"source" cbor:"source"` - Language int `json:"language" cbor:"language"` - CodeLocation int `json:"codeLocation" cbor:"codeLocation"` - Secrets []byte `json:"secrets" cbor:"secrets"` - SecretsLocation int `json:"secretsLocation" cbor:"secretsLocation"` - RequestSignature []byte `json:"requestSignature,omitempty" cbor:"requestSignature"` - Args []string `json:"args,omitempty" cbor:"args"` - BytesArgs [][]byte `json:"bytesArgs,omitempty" cbor:"bytesArgs"` + Source string `json:"source" cbor:"source"` + Language int `json:"language" cbor:"language"` + CodeLocation int `json:"codeLocation" cbor:"codeLocation"` + Secrets []byte `json:"secrets" cbor:"secrets"` + SecretsLocation int `json:"secretsLocation" cbor:"secretsLocation"` + Args []string `json:"args,omitempty" cbor:"args"` + BytesArgs [][]byte `json:"bytesArgs,omitempty" cbor:"bytesArgs"` } type DONHostedSecrets struct { @@ -41,41 +31,3 @@ type SignedRequestData struct { SecretsLocation int `json:"secretsLocation" cbor:"secretsLocation"` Source string `json:"source" cbor:"source"` } - -// The request signature should sign the keccak256 hash of the following JSON string (without extra whitespace) -// with the corresponding Request fields in the order that they appear below: -// { -// "codeLocation": number, (0 for Location.Inline) -// "language": number, (0 for CodeLanguage.JavaScript) -// "secrets": string, (encryptedSecretsReference as base64 string, must be `null` if there are no secrets) -// "secretsLocation": number, (must be `null` if there are no secrets) (1 for Location.Remote, 2 for Location.DONHosted) -// "source": string, -// } - -func VerifyRequestSignature(subscriptionOwner common.Address, requestData *RequestData) error { - if requestData.RequestSignature == nil { - return errors.New("missing signature") - } - signedRequestData := SignedRequestData{ - CodeLocation: requestData.CodeLocation, - Language: requestData.Language, - Secrets: requestData.Secrets, - SecretsLocation: requestData.SecretsLocation, - Source: requestData.Source, - } - js, err := json.Marshal(signedRequestData) - if err != nil { - return errors.New("unable to marshal request data") - } - - signerAddr, err := utils.GetSignersEthAddress(js, requestData.RequestSignature) - if err != nil { - return errors.New("invalid request signature: unable to recover signer's address") - } - - if signerAddr != subscriptionOwner { - return errors.New("invalid request signature: signer's address does not match subscription owner") - } - - return nil -} From e499700c67cd352b0456f33f4e917766da1cd15a Mon Sep 17 00:00:00 2001 From: Ilja Pavlovs Date: Tue, 10 Oct 2023 13:12:22 +0300 Subject: [PATCH 75/84] VRF-586: add env setup script for VRF V2 Plus (#10892) * VRF-586: add env setup script for VRF V2 Plus * VRF-586: deleting debug logs --- .../scripts/common/vrf/constants/constants.go | 34 ++ .../docker/db/create-multiple-databases.sh | 0 .../vrf}/docker/docker-compose.yml | 4 +- .../testnet => common/vrf}/docker/sample.env | 0 .../vrf}/docker/secrets/apicredentials | 0 .../vrf}/docker/secrets/password.txt | 0 .../vrf}/docker/toml-config/base.toml | 0 .../vrf}/docker/toml-config/bhf.toml | 0 .../vrf}/docker/toml-config/bhs.toml | 0 .../vrf}/docker/toml-config/rpc-nodes.toml | 0 .../vrf}/docker/toml-config/secrets.toml | 0 .../toml-config/vrf-backup-other-chains.toml | 2 +- .../vrf}/docker/toml-config/vrf-backup.toml | 0 .../vrf}/docker/toml-config/vrf-primary.toml | 2 +- .../wait-for-others/docker-wait-for-it.sh | 0 .../wait-for-others/docker-wait-for-others.sh | 0 .../testnet => common/vrf}/jobs/jobs.go | 42 +- core/scripts/common/vrf/model/model.go | 46 ++ .../vrf}/setup-envs/README.md | 22 +- .../testnet => common/vrf}/setup-envs/main.go | 187 +++++--- core/scripts/common/vrf/util/util.go | 22 + .../vrfv2/testnet/constants/constants.go | 28 -- core/scripts/vrfv2/testnet/main.go | 38 +- .../{scripts => v2scripts}/super_scripts.go | 121 ++--- .../testnet/{scripts => v2scripts}/util.go | 4 +- core/scripts/vrfv2plus/testnet/main.go | 45 +- .../{ => v2plusscripts}/super_scripts.go | 432 +++++++++++------- .../testnet/{ => v2plusscripts}/util.go | 66 ++- 28 files changed, 665 insertions(+), 430 deletions(-) create mode 100644 core/scripts/common/vrf/constants/constants.go rename core/scripts/{vrfv2/testnet => common/vrf}/docker/db/create-multiple-databases.sh (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/docker-compose.yml (98%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/sample.env (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/secrets/apicredentials (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/secrets/password.txt (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/toml-config/base.toml (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/toml-config/bhf.toml (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/toml-config/bhs.toml (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/toml-config/rpc-nodes.toml (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/toml-config/secrets.toml (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/toml-config/vrf-backup-other-chains.toml (81%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/toml-config/vrf-backup.toml (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/toml-config/vrf-primary.toml (76%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/wait-for-others/docker-wait-for-it.sh (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/docker/wait-for-others/docker-wait-for-others.sh (100%) rename core/scripts/{vrfv2/testnet => common/vrf}/jobs/jobs.go (55%) create mode 100644 core/scripts/common/vrf/model/model.go rename core/scripts/{vrfv2/testnet => common/vrf}/setup-envs/README.md (72%) rename core/scripts/{vrfv2/testnet => common/vrf}/setup-envs/main.go (72%) create mode 100644 core/scripts/common/vrf/util/util.go delete mode 100644 core/scripts/vrfv2/testnet/constants/constants.go rename core/scripts/vrfv2/testnet/{scripts => v2scripts}/super_scripts.go (83%) rename core/scripts/vrfv2/testnet/{scripts => v2scripts}/util.go (99%) rename core/scripts/vrfv2plus/testnet/{ => v2plusscripts}/super_scripts.go (61%) rename core/scripts/vrfv2plus/testnet/{ => v2plusscripts}/util.go (79%) diff --git a/core/scripts/common/vrf/constants/constants.go b/core/scripts/common/vrf/constants/constants.go new file mode 100644 index 00000000000..b21f6b0b323 --- /dev/null +++ b/core/scripts/common/vrf/constants/constants.go @@ -0,0 +1,34 @@ +package constants + +import ( + "math/big" +) + +var ( + SubscriptionBalanceJuels = "1e19" + SubscriptionBalanceNativeWei = "1e18" + + // optional flags + FallbackWeiPerUnitLink = big.NewInt(6e16) + BatchFulfillmentEnabled = true + MinConfs = 3 + NodeSendingKeyFundingAmount = "1e17" + MaxGasLimit = int64(2.5e6) + StalenessSeconds = int64(86400) + GasAfterPayment = int64(33285) + + //vrfv2 + FlatFeeTier1 = int64(500) + FlatFeeTier2 = int64(500) + FlatFeeTier3 = int64(500) + FlatFeeTier4 = int64(500) + FlatFeeTier5 = int64(500) + ReqsForTier2 = int64(0) + ReqsForTier3 = int64(0) + ReqsForTier4 = int64(0) + ReqsForTier5 = int64(0) + + //vrfv2plus + FlatFeeLinkPPM = int64(500) + FlatFeeNativePPM = int64(500) +) diff --git a/core/scripts/vrfv2/testnet/docker/db/create-multiple-databases.sh b/core/scripts/common/vrf/docker/db/create-multiple-databases.sh similarity index 100% rename from core/scripts/vrfv2/testnet/docker/db/create-multiple-databases.sh rename to core/scripts/common/vrf/docker/db/create-multiple-databases.sh diff --git a/core/scripts/vrfv2/testnet/docker/docker-compose.yml b/core/scripts/common/vrf/docker/docker-compose.yml similarity index 98% rename from core/scripts/vrfv2/testnet/docker/docker-compose.yml rename to core/scripts/common/vrf/docker/docker-compose.yml index d31c50f3463..5c14c4670d8 100644 --- a/core/scripts/vrfv2/testnet/docker/docker-compose.yml +++ b/core/scripts/common/vrf/docker/docker-compose.yml @@ -132,9 +132,9 @@ services: secrets: node_password: - file: ./secrets/password.txt + file: secrets/password.txt apicredentials: - file: ./secrets/apicredentials + file: secrets/apicredentials volumes: docker-compose-db: diff --git a/core/scripts/vrfv2/testnet/docker/sample.env b/core/scripts/common/vrf/docker/sample.env similarity index 100% rename from core/scripts/vrfv2/testnet/docker/sample.env rename to core/scripts/common/vrf/docker/sample.env diff --git a/core/scripts/vrfv2/testnet/docker/secrets/apicredentials b/core/scripts/common/vrf/docker/secrets/apicredentials similarity index 100% rename from core/scripts/vrfv2/testnet/docker/secrets/apicredentials rename to core/scripts/common/vrf/docker/secrets/apicredentials diff --git a/core/scripts/vrfv2/testnet/docker/secrets/password.txt b/core/scripts/common/vrf/docker/secrets/password.txt similarity index 100% rename from core/scripts/vrfv2/testnet/docker/secrets/password.txt rename to core/scripts/common/vrf/docker/secrets/password.txt diff --git a/core/scripts/vrfv2/testnet/docker/toml-config/base.toml b/core/scripts/common/vrf/docker/toml-config/base.toml similarity index 100% rename from core/scripts/vrfv2/testnet/docker/toml-config/base.toml rename to core/scripts/common/vrf/docker/toml-config/base.toml diff --git a/core/scripts/vrfv2/testnet/docker/toml-config/bhf.toml b/core/scripts/common/vrf/docker/toml-config/bhf.toml similarity index 100% rename from core/scripts/vrfv2/testnet/docker/toml-config/bhf.toml rename to core/scripts/common/vrf/docker/toml-config/bhf.toml diff --git a/core/scripts/vrfv2/testnet/docker/toml-config/bhs.toml b/core/scripts/common/vrf/docker/toml-config/bhs.toml similarity index 100% rename from core/scripts/vrfv2/testnet/docker/toml-config/bhs.toml rename to core/scripts/common/vrf/docker/toml-config/bhs.toml diff --git a/core/scripts/vrfv2/testnet/docker/toml-config/rpc-nodes.toml b/core/scripts/common/vrf/docker/toml-config/rpc-nodes.toml similarity index 100% rename from core/scripts/vrfv2/testnet/docker/toml-config/rpc-nodes.toml rename to core/scripts/common/vrf/docker/toml-config/rpc-nodes.toml diff --git a/core/scripts/vrfv2/testnet/docker/toml-config/secrets.toml b/core/scripts/common/vrf/docker/toml-config/secrets.toml similarity index 100% rename from core/scripts/vrfv2/testnet/docker/toml-config/secrets.toml rename to core/scripts/common/vrf/docker/toml-config/secrets.toml diff --git a/core/scripts/vrfv2/testnet/docker/toml-config/vrf-backup-other-chains.toml b/core/scripts/common/vrf/docker/toml-config/vrf-backup-other-chains.toml similarity index 81% rename from core/scripts/vrfv2/testnet/docker/toml-config/vrf-backup-other-chains.toml rename to core/scripts/common/vrf/docker/toml-config/vrf-backup-other-chains.toml index a39c6b15c57..ba71abe92fc 100644 --- a/core/scripts/vrfv2/testnet/docker/toml-config/vrf-backup-other-chains.toml +++ b/core/scripts/common/vrf/docker/toml-config/vrf-backup-other-chains.toml @@ -1,5 +1,5 @@ [Feature] -LogPoller = false #VRF V2 uses Log Broadcast3er instead of Log poller +LogPoller = false #VRF V2 uses Log Broadcaster instead of Log poller [[EVM]] ChainID = '11155111' diff --git a/core/scripts/vrfv2/testnet/docker/toml-config/vrf-backup.toml b/core/scripts/common/vrf/docker/toml-config/vrf-backup.toml similarity index 100% rename from core/scripts/vrfv2/testnet/docker/toml-config/vrf-backup.toml rename to core/scripts/common/vrf/docker/toml-config/vrf-backup.toml diff --git a/core/scripts/vrfv2/testnet/docker/toml-config/vrf-primary.toml b/core/scripts/common/vrf/docker/toml-config/vrf-primary.toml similarity index 76% rename from core/scripts/vrfv2/testnet/docker/toml-config/vrf-primary.toml rename to core/scripts/common/vrf/docker/toml-config/vrf-primary.toml index 67cd33659fb..6cb78789b23 100644 --- a/core/scripts/vrfv2/testnet/docker/toml-config/vrf-primary.toml +++ b/core/scripts/common/vrf/docker/toml-config/vrf-primary.toml @@ -1,5 +1,5 @@ [Feature] -LogPoller = false #VRF V2 uses Log Broadcast3er instead of Log poller +LogPoller = false #VRF V2 uses Log Broadcaster instead of Log poller [[EVM]] ChainID = '11155111' diff --git a/core/scripts/vrfv2/testnet/docker/wait-for-others/docker-wait-for-it.sh b/core/scripts/common/vrf/docker/wait-for-others/docker-wait-for-it.sh similarity index 100% rename from core/scripts/vrfv2/testnet/docker/wait-for-others/docker-wait-for-it.sh rename to core/scripts/common/vrf/docker/wait-for-others/docker-wait-for-it.sh diff --git a/core/scripts/vrfv2/testnet/docker/wait-for-others/docker-wait-for-others.sh b/core/scripts/common/vrf/docker/wait-for-others/docker-wait-for-others.sh similarity index 100% rename from core/scripts/vrfv2/testnet/docker/wait-for-others/docker-wait-for-others.sh rename to core/scripts/common/vrf/docker/wait-for-others/docker-wait-for-others.sh diff --git a/core/scripts/vrfv2/testnet/jobs/jobs.go b/core/scripts/common/vrf/jobs/jobs.go similarity index 55% rename from core/scripts/vrfv2/testnet/jobs/jobs.go rename to core/scripts/common/vrf/jobs/jobs.go index 8ff0195bfa8..674cca175c8 100644 --- a/core/scripts/vrfv2/testnet/jobs/jobs.go +++ b/core/scripts/common/vrf/jobs/jobs.go @@ -1,7 +1,7 @@ package jobs var ( - VRFJobFormatted = `type = "vrf" + VRFV2JobFormatted = `type = "vrf" name = "vrf_v2" schemaVersion = 1 coordinatorAddress = "%s" @@ -38,6 +38,46 @@ simulate [type=ethcall decode_log->vrf->estimate_gas->simulate """` + VRFV2PlusJobFormatted = ` +type = "vrf" +name = "vrf_v2_plus" +schemaVersion = 1 +coordinatorAddress = "%s" +batchCoordinatorAddress = "%s" +batchFulfillmentEnabled = %t +batchFulfillmentGasMultiplier = 1.1 +publicKey = "%s" +minIncomingConfirmations = %d +evmChainID = "%d" +fromAddresses = ["%s"] +pollPeriod = "300ms" +requestTimeout = "30m0s" +observationSource = """ +decode_log [type=ethabidecodelog + abi="RandomWordsRequested(bytes32 indexed keyHash,uint256 requestId,uint256 preSeed,uint256 indexed subId,uint16 minimumRequestConfirmations,uint32 callbackGasLimit,uint32 numWords,bytes extraArgs,address indexed sender)" + data="$(jobRun.logData)" + topics="$(jobRun.logTopics)"] +generate_proof [type=vrfv2plus + publicKey="$(jobSpec.publicKey)" + requestBlockHash="$(jobRun.logBlockHash)" + requestBlockNumber="$(jobRun.logBlockNumber)" + topics="$(jobRun.logTopics)"] +estimate_gas [type=estimategaslimit + to="%s" + multiplier="1.1" + data="$(generate_proof.output)"] +simulate_fulfillment [type=ethcall + from="%s" + to="%s" + gas="$(estimate_gas)" + gasPrice="$(jobSpec.maxGasPrice)" + extractRevertReason=true + contract="%s" + data="$(generate_proof.output)"] +decode_log->generate_proof->estimate_gas->simulate_fulfillment +""" +` + BHSJobFormatted = `type = "blockhashstore" schemaVersion = 1 name = "blockhashstore" diff --git a/core/scripts/common/vrf/model/model.go b/core/scripts/common/vrf/model/model.go new file mode 100644 index 00000000000..bd0e3bbe364 --- /dev/null +++ b/core/scripts/common/vrf/model/model.go @@ -0,0 +1,46 @@ +package model + +import ( + "github.com/ethereum/go-ethereum/common" + "math/big" +) + +var ( + VRFPrimaryNodeName = "vrf-primary-node" + VRFBackupNodeName = "vrf-backup-node" + BHSNodeName = "bhs-node" + BHSBackupNodeName = "bhs-backup-node" + BHFNodeName = "bhf-node" +) + +type Node struct { + URL string + CredsFile string + SendingKeys []SendingKey + NumberOfSendingKeysToCreate int + SendingKeyFundingAmount *big.Int + VrfKeys []string + jobSpec string +} + +type SendingKey struct { + Address string + BalanceEth *big.Int +} + +type JobSpecs struct { + VRFPrimaryNode string + VRFBackupyNode string + BHSNode string + BHSBackupNode string + BHFNode string +} + +type ContractAddresses struct { + LinkAddress string + LinkEthAddress string + BhsContractAddress common.Address + BatchBHSAddress common.Address + CoordinatorAddress common.Address + BatchCoordinatorAddress common.Address +} diff --git a/core/scripts/vrfv2/testnet/setup-envs/README.md b/core/scripts/common/vrf/setup-envs/README.md similarity index 72% rename from core/scripts/vrfv2/testnet/setup-envs/README.md rename to core/scripts/common/vrf/setup-envs/README.md index a36e3829c43..33515338a24 100644 --- a/core/scripts/vrfv2/testnet/setup-envs/README.md +++ b/core/scripts/common/vrf/setup-envs/README.md @@ -4,8 +4,8 @@ * Currently possible to fund all nodes with one amount of native tokens ## Commands: 1. If using Docker Compose - 1. create `.env` file in `core/scripts/vrfv2/testnet/docker` (can use `sample.env` file as an example) - 2. go to `core/scripts/vrfv2/testnet/docker` folder and start containers - `docker compose up` + 1. create `.env` file in `core/scripts/common/vrf/docker` (can use `sample.env` file as an example) + 2. go to `core/scripts/common/vrf/docker` folder and start containers - `docker compose up` 2. Update [rpc-nodes.toml](..%2Fdocker%2Ftoml-config%2Frpc-nodes.toml) with relevant RPC nodes 3. Create files with credentials desirably outside `chainlink` repo (just not to push creds accidentally). Populate the files with relevant credentials for the nodes 4. Ensure that following env variables are set @@ -14,9 +14,10 @@ export ETH_URL= export ETH_CHAIN_ID= export ACCOUNT_KEY= ``` -5. execute from `core/scripts/vrfv2/testnet/setup-envs` folder +5. execute from `core/scripts/common/vrf/setup-envs` folder ``` go run . \ +--vrf-version="v2plus" \ --vrf-primary-node-url=http://localhost:6610 \ --vrf-primary-creds-file \ --vrf-backup-node-url=http://localhost:6611 \ @@ -27,13 +28,14 @@ go run . \ --bhs-bk-creds-file \ --bhf-node-url=http://localhost:6614 \ --bhf-creds-file \ ---deploy-contracts true \ ---batch-fulfillment-enabled true \ ---min-confs 1 \ ---num-eth-keys 5 \ ---num-vrf-keys 1 \ ---sending-key-funding-amount 100000000000000000 - +--deploy-contracts-and-create-jobs="true" \ +--subscription-balance="1e19" \ +--subscription-balance-native="1e18" \ +--batch-fulfillment-enabled="true" \ +--min-confs=3 \ +--num-eth-keys=1 \ +--num-vrf-keys=1 \ +--sending-key-funding-amount="1e17" ``` Optional parameters - will not be deployed if specified (NOT WORKING YET) diff --git a/core/scripts/vrfv2/testnet/setup-envs/main.go b/core/scripts/common/vrf/setup-envs/main.go similarity index 72% rename from core/scripts/vrfv2/testnet/setup-envs/main.go rename to core/scripts/common/vrf/setup-envs/main.go index 9e6edf725e5..8a7b1c8b439 100644 --- a/core/scripts/vrfv2/testnet/setup-envs/main.go +++ b/core/scripts/common/vrf/setup-envs/main.go @@ -6,11 +6,15 @@ import ( "flag" "fmt" "github.com/ethereum/go-ethereum/common" + "github.com/shopspring/decimal" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/core/scripts/vrfv2/testnet/constants" - "github.com/smartcontractkit/chainlink/core/scripts/vrfv2/testnet/scripts" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/constants" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/model" + "github.com/smartcontractkit/chainlink/core/scripts/vrfv2/testnet/v2scripts" + "github.com/smartcontractkit/chainlink/core/scripts/vrfv2plus/testnet/v2plusscripts" clcmd "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" "github.com/urfave/cli" "io" @@ -54,7 +58,7 @@ func main() { bhsNodeURL := flag.String("bhs-node-url", "", "remote node URL") bhsBackupNodeURL := flag.String("bhs-backup-node-url", "", "remote node URL") bhfNodeURL := flag.String("bhf-node-url", "", "remote node URL") - nodeSendingKeyFundingAmount := flag.Int64("sending-key-funding-amount", constants.NodeSendingKeyFundingAmountGwei, "remote node URL") + nodeSendingKeyFundingAmount := flag.String("sending-key-funding-amount", constants.NodeSendingKeyFundingAmount, "sending key funding amount") vrfPrimaryCredsFile := flag.String("vrf-primary-creds-file", "", "Creds to authenticate to the node") vrfBackupCredsFile := flag.String("vrf-bk-creds-file", "", "Creds to authenticate to the node") @@ -65,12 +69,15 @@ func main() { numEthKeys := flag.Int("num-eth-keys", 5, "Number of eth keys to create") maxGasPriceGwei := flag.Int("max-gas-price-gwei", -1, "Max gas price gwei of the eth keys") numVRFKeys := flag.Int("num-vrf-keys", 1, "Number of vrf keys to create") + batchFulfillmentEnabled := flag.Bool("batch-fulfillment-enabled", constants.BatchFulfillmentEnabled, "whether to enable batch fulfillment on Cl node") - deployContracts := flag.Bool("deploy-contracts", true, "whether to deploy contracts and create jobs") + vrfVersion := flag.String("vrf-version", "v2", "VRF version to use") + deployContractsAndCreateJobs := flag.Bool("deploy-contracts-and-create-jobs", false, "whether to deploy contracts and create jobs") - batchFulfillmentEnabled := flag.Bool("batch-fulfillment-enabled", constants.BatchFulfillmentEnabled, "whether to enable batch fulfillment on Cl node") - minConfs := flag.Int("min-confs", constants.MinConfs, "minimum confirmations") + subscriptionBalanceJuelsString := flag.String("subscription-balance", constants.SubscriptionBalanceJuels, "amount to fund subscription with Link token (Juels)") + subscriptionBalanceNativeWeiString := flag.String("subscription-balance-native", constants.SubscriptionBalanceNativeWei, "amount to fund subscription with native token (Wei)") + minConfs := flag.Int("min-confs", constants.MinConfs, "minimum confirmations") linkAddress := flag.String("link-address", "", "address of link token") linkEthAddress := flag.String("link-eth-feed", "", "address of link eth feed") bhsContractAddressString := flag.String("bhs-address", "", "address of BHS contract") @@ -80,41 +87,50 @@ func main() { e := helpers.SetupEnv(false) flag.Parse() - nodesMap := make(map[string]scripts.Node) + nodesMap := make(map[string]model.Node) + + if *vrfVersion != "v2" && *vrfVersion != "v2plus" { + panic(fmt.Sprintf("Invalid VRF Version `%s`. Only `v2` and `v2plus` are supported", *vrfVersion)) + } + fmt.Println("Using VRF Version:", *vrfVersion) + + fundingAmount := decimal.RequireFromString(*nodeSendingKeyFundingAmount).BigInt() + subscriptionBalanceJuels := decimal.RequireFromString(*subscriptionBalanceJuelsString).BigInt() + subscriptionBalanceNativeWei := decimal.RequireFromString(*subscriptionBalanceNativeWeiString).BigInt() if *vrfPrimaryNodeURL != "" { - nodesMap[scripts.VRFPrimaryNodeName] = scripts.Node{ + nodesMap[model.VRFPrimaryNodeName] = model.Node{ URL: *vrfPrimaryNodeURL, - SendingKeyFundingAmount: *big.NewInt(*nodeSendingKeyFundingAmount), + SendingKeyFundingAmount: fundingAmount, CredsFile: *vrfPrimaryCredsFile, } } if *vrfBackupNodeURL != "" { - nodesMap[scripts.VRFBackupNodeName] = scripts.Node{ + nodesMap[model.VRFBackupNodeName] = model.Node{ URL: *vrfBackupNodeURL, - SendingKeyFundingAmount: *big.NewInt(*nodeSendingKeyFundingAmount), + SendingKeyFundingAmount: fundingAmount, CredsFile: *vrfBackupCredsFile, } } if *bhsNodeURL != "" { - nodesMap[scripts.BHSNodeName] = scripts.Node{ + nodesMap[model.BHSNodeName] = model.Node{ URL: *bhsNodeURL, - SendingKeyFundingAmount: *big.NewInt(*nodeSendingKeyFundingAmount), + SendingKeyFundingAmount: fundingAmount, CredsFile: *bhsCredsFile, } } if *bhsBackupNodeURL != "" { - nodesMap[scripts.BHSBackupNodeName] = scripts.Node{ + nodesMap[model.BHSBackupNodeName] = model.Node{ URL: *bhsBackupNodeURL, - SendingKeyFundingAmount: *big.NewInt(*nodeSendingKeyFundingAmount), + SendingKeyFundingAmount: fundingAmount, CredsFile: *bhsBackupCredsFile, } } if *bhfNodeURL != "" { - nodesMap[scripts.BHFNodeName] = scripts.Node{ + nodesMap[model.BHFNodeName] = model.Node{ URL: *bhfNodeURL, - SendingKeyFundingAmount: *big.NewInt(*nodeSendingKeyFundingAmount), + SendingKeyFundingAmount: fundingAmount, CredsFile: *bhfCredsFile, } } @@ -124,14 +140,14 @@ func main() { client, app := connectToNode(&node.URL, output, node.CredsFile) ethKeys := createETHKeysIfNeeded(client, app, output, numEthKeys, &node.URL, maxGasPriceGwei) - if key == scripts.VRFPrimaryNodeName { + if key == model.VRFPrimaryNodeName { vrfKeys := createVRFKeyIfNeeded(client, app, output, numVRFKeys, &node.URL) node.VrfKeys = mapVrfKeysToStringArr(vrfKeys) printVRFKeyData(vrfKeys) exportVRFKey(client, app, vrfKeys[0], output) } - if key == scripts.VRFBackupNodeName { + if key == model.VRFBackupNodeName { vrfKeys := getVRFKeys(client, app, output) node.VrfKeys = mapVrfKeysToStringArr(vrfKeys) } @@ -141,23 +157,11 @@ func main() { fundNodesIfNeeded(node, key, e) nodesMap[key] = node } - importVRFKeyToNodeIfSet(vrfBackupNodeURL, nodesMap, output, nodesMap[scripts.VRFBackupNodeName].CredsFile) - fmt.Println() + importVRFKeyToNodeIfSet(vrfBackupNodeURL, nodesMap, output, nodesMap[model.VRFBackupNodeName].CredsFile) - if *deployContracts { - feeConfig := vrf_coordinator_v2.VRFCoordinatorV2FeeConfig{ - FulfillmentFlatFeeLinkPPMTier1: uint32(constants.FlatFeeTier1), - FulfillmentFlatFeeLinkPPMTier2: uint32(constants.FlatFeeTier2), - FulfillmentFlatFeeLinkPPMTier3: uint32(constants.FlatFeeTier3), - FulfillmentFlatFeeLinkPPMTier4: uint32(constants.FlatFeeTier4), - FulfillmentFlatFeeLinkPPMTier5: uint32(constants.FlatFeeTier5), - ReqsForTier2: big.NewInt(constants.ReqsForTier2), - ReqsForTier3: big.NewInt(constants.ReqsForTier3), - ReqsForTier4: big.NewInt(constants.ReqsForTier4), - ReqsForTier5: big.NewInt(constants.ReqsForTier5), - } + if *deployContractsAndCreateJobs { - contractAddresses := scripts.ContractAddresses{ + contractAddresses := model.ContractAddresses{ LinkAddress: *linkAddress, LinkEthAddress: *linkEthAddress, BhsContractAddress: common.HexToAddress(*bhsContractAddressString), @@ -166,24 +170,65 @@ func main() { BatchCoordinatorAddress: common.HexToAddress(*batchCoordinatorAddressString), } - coordinatorConfig := scripts.CoordinatorConfig{ - MinConfs: minConfs, - MaxGasLimit: &constants.MaxGasLimit, - StalenessSeconds: &constants.StalenessSeconds, - GasAfterPayment: &constants.GasAfterPayment, - FallbackWeiPerUnitLink: constants.FallbackWeiPerUnitLink, - FeeConfig: feeConfig, - } + var jobSpecs model.JobSpecs + + switch *vrfVersion { + case "v2": + feeConfigV2 := vrf_coordinator_v2.VRFCoordinatorV2FeeConfig{ + FulfillmentFlatFeeLinkPPMTier1: uint32(constants.FlatFeeTier1), + FulfillmentFlatFeeLinkPPMTier2: uint32(constants.FlatFeeTier2), + FulfillmentFlatFeeLinkPPMTier3: uint32(constants.FlatFeeTier3), + FulfillmentFlatFeeLinkPPMTier4: uint32(constants.FlatFeeTier4), + FulfillmentFlatFeeLinkPPMTier5: uint32(constants.FlatFeeTier5), + ReqsForTier2: big.NewInt(constants.ReqsForTier2), + ReqsForTier3: big.NewInt(constants.ReqsForTier3), + ReqsForTier4: big.NewInt(constants.ReqsForTier4), + ReqsForTier5: big.NewInt(constants.ReqsForTier5), + } + + coordinatorConfigV2 := v2scripts.CoordinatorConfigV2{ + MinConfs: minConfs, + MaxGasLimit: &constants.MaxGasLimit, + StalenessSeconds: &constants.StalenessSeconds, + GasAfterPayment: &constants.GasAfterPayment, + FallbackWeiPerUnitLink: constants.FallbackWeiPerUnitLink, + FeeConfig: feeConfigV2, + } - jobSpecs := scripts.VRFV2DeployUniverse( - e, - constants.SubscriptionBalanceJuels, - &nodesMap[scripts.VRFPrimaryNodeName].VrfKeys[0], - contractAddresses, - coordinatorConfig, - *batchFulfillmentEnabled, - nodesMap, - ) + jobSpecs = v2scripts.VRFV2DeployUniverse( + e, + subscriptionBalanceJuels, + &nodesMap[model.VRFPrimaryNodeName].VrfKeys[0], + contractAddresses, + coordinatorConfigV2, + *batchFulfillmentEnabled, + nodesMap, + ) + case "v2plus": + feeConfigV2Plus := vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: uint32(constants.FlatFeeLinkPPM), + FulfillmentFlatFeeNativePPM: uint32(constants.FlatFeeNativePPM), + } + coordinatorConfigV2Plus := v2plusscripts.CoordinatorConfigV2Plus{ + MinConfs: minConfs, + MaxGasLimit: &constants.MaxGasLimit, + StalenessSeconds: &constants.StalenessSeconds, + GasAfterPayment: &constants.GasAfterPayment, + FallbackWeiPerUnitLink: constants.FallbackWeiPerUnitLink, + FeeConfig: feeConfigV2Plus, + } + + jobSpecs = v2plusscripts.VRFV2PlusDeployUniverse( + e, + subscriptionBalanceJuels, + subscriptionBalanceNativeWei, + &nodesMap[model.VRFPrimaryNodeName].VrfKeys[0], + contractAddresses, + coordinatorConfigV2Plus, + *batchFulfillmentEnabled, + nodesMap, + ) + } for key, node := range nodesMap { client, app := connectToNode(&node.URL, output, node.CredsFile) @@ -196,41 +241,43 @@ func main() { deleteJob(jobID, client, app, output) } //CREATE JOBS + switch key { - case scripts.VRFPrimaryNodeName: + case model.VRFPrimaryNodeName: createJob(jobSpecs.VRFPrimaryNode, client, app, output) - case scripts.VRFBackupNodeName: + case model.VRFBackupNodeName: createJob(jobSpecs.VRFBackupyNode, client, app, output) - case scripts.BHSNodeName: + case model.BHSNodeName: createJob(jobSpecs.BHSNode, client, app, output) - case scripts.BHSBackupNodeName: + case model.BHSBackupNodeName: createJob(jobSpecs.BHSBackupNode, client, app, output) - case scripts.BHFNodeName: + case model.BHFNodeName: createJob(jobSpecs.BHFNode, client, app, output) } } } - } -func fundNodesIfNeeded(node scripts.Node, key string, e helpers.Environment) { - if node.SendingKeyFundingAmount.Int64() > 0 { - fmt.Println("\nFunding", key, "Node's Sending Keys...") +func fundNodesIfNeeded(node model.Node, key string, e helpers.Environment) { + if node.SendingKeyFundingAmount.Cmp(big.NewInt(0)) == 1 { + fmt.Println("\nFunding", key, "Node's Sending Keys. Need to fund each key with", node.SendingKeyFundingAmount, "wei") for _, sendingKey := range node.SendingKeys { - fundingToSendWei := node.SendingKeyFundingAmount.Int64() - sendingKey.BalanceEth.Int64() - if fundingToSendWei > 0 { - helpers.FundNode(e, sendingKey.Address, big.NewInt(fundingToSendWei)) + fundingToSendWei := new(big.Int).Sub(node.SendingKeyFundingAmount, sendingKey.BalanceEth) + if fundingToSendWei.Cmp(big.NewInt(0)) == 1 { + helpers.FundNode(e, sendingKey.Address, fundingToSendWei) } else { - fmt.Println("\nSkipping Funding", sendingKey.Address, "since it has", sendingKey.BalanceEth.Int64(), "wei") + fmt.Println("\nSkipping Funding", sendingKey.Address, "since it has", sendingKey.BalanceEth.String(), "wei") } } + } else { + fmt.Println("\nSkipping Funding", key, "Node's Sending Keys since funding amount is 0 wei") } } -func importVRFKeyToNodeIfSet(vrfBackupNodeURL *string, nodes map[string]scripts.Node, output *bytes.Buffer, file string) { +func importVRFKeyToNodeIfSet(vrfBackupNodeURL *string, nodes map[string]model.Node, output *bytes.Buffer, file string) { if *vrfBackupNodeURL != "" { - vrfBackupNode := nodes[scripts.VRFBackupNodeName] - vrfPrimaryNode := nodes[scripts.VRFBackupNodeName] + vrfBackupNode := nodes[model.VRFBackupNodeName] + vrfPrimaryNode := nodes[model.VRFBackupNodeName] if len(vrfBackupNode.VrfKeys) == 0 || vrfPrimaryNode.VrfKeys[0] != vrfBackupNode.VrfKeys[0] { client, app := connectToNode(&vrfBackupNode.URL, output, file) @@ -335,10 +382,10 @@ func printETHKeyData(ethKeys []presenters.ETHKeyResource) { } } -func mapEthKeysToSendingKeyArr(ethKeys []presenters.ETHKeyResource) []scripts.SendingKey { - var sendingKeys []scripts.SendingKey +func mapEthKeysToSendingKeyArr(ethKeys []presenters.ETHKeyResource) []model.SendingKey { + var sendingKeys []model.SendingKey for _, ethKey := range ethKeys { - sendingKey := scripts.SendingKey{Address: ethKey.Address, BalanceEth: *ethKey.EthBalance.ToInt()} + sendingKey := model.SendingKey{Address: ethKey.Address, BalanceEth: ethKey.EthBalance.ToInt()} sendingKeys = append(sendingKeys, sendingKey) } return sendingKeys diff --git a/core/scripts/common/vrf/util/util.go b/core/scripts/common/vrf/util/util.go new file mode 100644 index 00000000000..751aa013201 --- /dev/null +++ b/core/scripts/common/vrf/util/util.go @@ -0,0 +1,22 @@ +package util + +import ( + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/model" +) + +func MapToSendingKeyArr(nodeSendingKeys []string) []model.SendingKey { + var sendingKeys []model.SendingKey + + for _, key := range nodeSendingKeys { + sendingKeys = append(sendingKeys, model.SendingKey{Address: key}) + } + return sendingKeys +} + +func MapToAddressArr(sendingKeys []model.SendingKey) []string { + var sendingKeysString []string + for _, sendingKey := range sendingKeys { + sendingKeysString = append(sendingKeysString, sendingKey.Address) + } + return sendingKeysString +} diff --git a/core/scripts/vrfv2/testnet/constants/constants.go b/core/scripts/vrfv2/testnet/constants/constants.go deleted file mode 100644 index 73356d48ffc..00000000000 --- a/core/scripts/vrfv2/testnet/constants/constants.go +++ /dev/null @@ -1,28 +0,0 @@ -package constants - -import ( - "github.com/smartcontractkit/chainlink/v2/core/assets" - "math/big" -) - -var ( - SubscriptionBalanceJuels = assets.Ether(10).ToInt() - - // optional flags - FallbackWeiPerUnitLink = big.NewInt(6e16) - BatchFulfillmentEnabled = true - MinConfs = 3 - NodeSendingKeyFundingAmountGwei = assets.GWei(0).Int64() //100000000 = 0.1 ETH - MaxGasLimit = int64(2.5e6) - StalenessSeconds = int64(86400) - GasAfterPayment = int64(33285) - FlatFeeTier1 = int64(500) - FlatFeeTier2 = int64(500) - FlatFeeTier3 = int64(500) - FlatFeeTier4 = int64(500) - FlatFeeTier5 = int64(500) - ReqsForTier2 = int64(0) - ReqsForTier3 = int64(0) - ReqsForTier4 = int64(0) - ReqsForTier5 = int64(0) -) diff --git a/core/scripts/vrfv2/testnet/main.go b/core/scripts/vrfv2/testnet/main.go index d418eb6d153..5b216776bd9 100644 --- a/core/scripts/vrfv2/testnet/main.go +++ b/core/scripts/vrfv2/testnet/main.go @@ -11,7 +11,7 @@ import ( "os" "strings" - "github.com/smartcontractkit/chainlink/core/scripts/vrfv2/testnet/scripts" + "github.com/smartcontractkit/chainlink/core/scripts/vrfv2/testnet/v2scripts" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_owner_test_consumer" "github.com/ethereum/go-ethereum" @@ -350,7 +350,7 @@ func main() { cmd := flag.NewFlagSet("batch-bhs-deploy", flag.ExitOnError) bhsAddr := cmd.String("bhs-address", "", "address of the blockhash store contract") helpers.ParseArgs(cmd, os.Args[2:], "bhs-address") - scripts.DeployBatchBHS(e, common.HexToAddress(*bhsAddr)) + v2scripts.DeployBatchBHS(e, common.HexToAddress(*bhsAddr)) case "batch-bhs-store": cmd := flag.NewFlagSet("batch-bhs-store", flag.ExitOnError) batchAddr := cmd.String("batch-bhs-address", "", "address of the batch bhs contract") @@ -418,7 +418,7 @@ func main() { } if *startBlock == -1 { - closestBlock, err2 := scripts.ClosestBlock(e, common.HexToAddress(*batchAddr), uint64(*endBlock), uint64(*batchSize)) + closestBlock, err2 := v2scripts.ClosestBlock(e, common.HexToAddress(*batchAddr), uint64(*endBlock), uint64(*batchSize)) // found a block with blockhash stored that's more recent that end block if err2 == nil { *startBlock = int64(closestBlock) @@ -491,14 +491,14 @@ func main() { helpers.PanicErr(err) fmt.Println("latest head number:", h.Number.String()) case "bhs-deploy": - scripts.DeployBHS(e) + v2scripts.DeployBHS(e) case "coordinator-deploy": coordinatorDeployCmd := flag.NewFlagSet("coordinator-deploy", flag.ExitOnError) coordinatorDeployLinkAddress := coordinatorDeployCmd.String("link-address", "", "address of link token") coordinatorDeployBHSAddress := coordinatorDeployCmd.String("bhs-address", "", "address of bhs") coordinatorDeployLinkEthFeedAddress := coordinatorDeployCmd.String("link-eth-feed", "", "address of link-eth-feed") helpers.ParseArgs(coordinatorDeployCmd, os.Args[2:], "link-address", "bhs-address", "link-eth-feed") - scripts.DeployCoordinator(e, *coordinatorDeployLinkAddress, *coordinatorDeployBHSAddress, *coordinatorDeployLinkEthFeedAddress) + v2scripts.DeployCoordinator(e, *coordinatorDeployLinkAddress, *coordinatorDeployBHSAddress, *coordinatorDeployLinkEthFeedAddress) case "coordinator-get-config": cmd := flag.NewFlagSet("coordinator-get-config", flag.ExitOnError) coordinatorAddress := cmd.String("coordinator-address", "", "coordinator address") @@ -507,7 +507,7 @@ func main() { coordinator, err := vrf_coordinator_v2.NewVRFCoordinatorV2(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) - scripts.PrintCoordinatorConfig(coordinator) + v2scripts.PrintCoordinatorConfig(coordinator) case "coordinator-set-config": cmd := flag.NewFlagSet("coordinator-set-config", flag.ExitOnError) setConfigAddress := cmd.String("coordinator-address", "", "coordinator address") @@ -530,7 +530,7 @@ func main() { coordinator, err := vrf_coordinator_v2.NewVRFCoordinatorV2(common.HexToAddress(*setConfigAddress), e.Ec) helpers.PanicErr(err) - scripts.SetCoordinatorConfig( + v2scripts.SetCoordinatorConfig( e, *coordinator, uint16(*minConfs), @@ -564,7 +564,7 @@ func main() { *registerKeyUncompressedPubKey = strings.Replace(*registerKeyUncompressedPubKey, "0x", "04", 1) } - scripts.RegisterCoordinatorProvingKey(e, *coordinator, *registerKeyUncompressedPubKey, *registerKeyOracleAddress) + v2scripts.RegisterCoordinatorProvingKey(e, *coordinator, *registerKeyUncompressedPubKey, *registerKeyOracleAddress) case "coordinator-deregister-key": coordinatorDeregisterKey := flag.NewFlagSet("coordinator-deregister-key", flag.ExitOnError) deregisterKeyAddress := coordinatorDeregisterKey.String("address", "", "coordinator address") @@ -692,14 +692,14 @@ func main() { helpers.PanicErr(err) fmt.Printf("Request config %+v Rw %+v Rid %+v\n", rc, rw, rid) case "deploy-universe": - scripts.DeployUniverseViaCLI(e) + v2scripts.DeployUniverseViaCLI(e) case "eoa-consumer-deploy": consumerDeployCmd := flag.NewFlagSet("eoa-consumer-deploy", flag.ExitOnError) consumerCoordinator := consumerDeployCmd.String("coordinator-address", "", "coordinator address") consumerLinkAddress := consumerDeployCmd.String("link-address", "", "link-address") helpers.ParseArgs(consumerDeployCmd, os.Args[2:], "coordinator-address", "link-address") - scripts.EoaDeployConsumer(e, *consumerCoordinator, *consumerLinkAddress) + v2scripts.EoaDeployConsumer(e, *consumerCoordinator, *consumerLinkAddress) case "eoa-load-test-consumer-deploy": loadTestConsumerDeployCmd := flag.NewFlagSet("eoa-load-test-consumer-deploy", flag.ExitOnError) consumerCoordinator := loadTestConsumerDeployCmd.String("coordinator-address", "", "coordinator address") @@ -716,7 +716,7 @@ func main() { loadTestConsumerDeployCmd := flag.NewFlagSet("eoa-load-test-consumer-with-metrics-deploy", flag.ExitOnError) consumerCoordinator := loadTestConsumerDeployCmd.String("coordinator-address", "", "coordinator address") helpers.ParseArgs(loadTestConsumerDeployCmd, os.Args[2:], "coordinator-address") - scripts.EoaLoadTestConsumerWithMetricsDeploy(e, *consumerCoordinator) + v2scripts.EoaLoadTestConsumerWithMetricsDeploy(e, *consumerCoordinator) case "eoa-vrf-owner-test-consumer-deploy": loadTestConsumerDeployCmd := flag.NewFlagSet("eoa-vrf-owner-test-consumer-deploy", flag.ExitOnError) consumerCoordinator := loadTestConsumerDeployCmd.String("coordinator-address", "", "coordinator address") @@ -734,7 +734,7 @@ func main() { helpers.ParseArgs(createSubCmd, os.Args[2:], "coordinator-address") coordinator, err := vrf_coordinator_v2.NewVRFCoordinatorV2(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) - scripts.EoaCreateSub(e, *coordinator) + v2scripts.EoaCreateSub(e, *coordinator) case "eoa-add-sub-consumer": addSubConsCmd := flag.NewFlagSet("eoa-add-sub-consumer", flag.ExitOnError) coordinatorAddress := addSubConsCmd.String("coordinator-address", "", "coordinator address") @@ -743,7 +743,7 @@ func main() { helpers.ParseArgs(addSubConsCmd, os.Args[2:], "coordinator-address", "sub-id", "consumer-address") coordinator, err := vrf_coordinator_v2.NewVRFCoordinatorV2(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) - scripts.EoaAddConsumerToSub(e, *coordinator, uint64(*subID), *consumerAddress) + v2scripts.EoaAddConsumerToSub(e, *coordinator, uint64(*subID), *consumerAddress) case "eoa-create-fund-authorize-sub": // Lets just treat the owner key as the EOA controlling the sub cfaSubCmd := flag.NewFlagSet("eoa-create-fund-authorize-sub", flag.ExitOnError) @@ -1029,7 +1029,7 @@ func main() { coordinator, err := vrf_coordinator_v2.NewVRFCoordinatorV2(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) - scripts.EoaFundSubscription(e, *coordinator, *consumerLinkAddress, amount, uint64(*subID)) + v2scripts.EoaFundSubscription(e, *coordinator, *consumerLinkAddress, amount, uint64(*subID)) case "eoa-read": cmd := flag.NewFlagSet("eoa-read", flag.ExitOnError) consumerAddress := cmd.String("consumer", "", "consumer address") @@ -1197,7 +1197,7 @@ func main() { linkETHFeedAddress := cmd.String("link-eth-feed", "", "address of link-eth-feed") coordinatorAddress := cmd.String("coordinator-address", "", "address of the vrf coordinator v2 contract") helpers.ParseArgs(cmd, os.Args[2:], "link-address", "link-eth-feed", "coordinator-address") - scripts.WrapperDeploy(e, + v2scripts.WrapperDeploy(e, common.HexToAddress(*linkAddress), common.HexToAddress(*linkETHFeedAddress), common.HexToAddress(*coordinatorAddress)) @@ -1235,7 +1235,7 @@ func main() { maxNumWords := cmd.Uint("max-num-words", 10, "the keyhash that wrapper requests should use") helpers.ParseArgs(cmd, os.Args[2:], "wrapper-address", "key-hash") - scripts.WrapperConfigure(e, + v2scripts.WrapperConfigure(e, common.HexToAddress(*wrapperAddress), *wrapperGasOverhead, *coordinatorGasOverhead, @@ -1267,7 +1267,7 @@ func main() { wrapperAddress := cmd.String("wrapper-address", "", "address of the VRFV2Wrapper contract") helpers.ParseArgs(cmd, os.Args[2:], "link-address", "wrapper-address") - scripts.WrapperConsumerDeploy(e, + v2scripts.WrapperConsumerDeploy(e, common.HexToAddress(*linkAddress), common.HexToAddress(*wrapperAddress)) case "wrapper-consumer-request": @@ -1344,10 +1344,10 @@ func main() { batchBHSAddress := cmd.String("batch-bhs-address", "", "address of the batch blockhash store") batchSize := cmd.Uint64("batch-size", 100, "batch size") helpers.ParseArgs(cmd, os.Args[2:], "block-number", "batch-bhs-address") - _, err := scripts.ClosestBlock(e, common.HexToAddress(*batchBHSAddress), *blockNumber, *batchSize) + _, err := v2scripts.ClosestBlock(e, common.HexToAddress(*batchBHSAddress), *blockNumber, *batchSize) helpers.PanicErr(err) case "wrapper-universe-deploy": - scripts.DeployWrapperUniverse(e) + v2scripts.DeployWrapperUniverse(e) default: panic("unrecognized subcommand: " + os.Args[1]) } diff --git a/core/scripts/vrfv2/testnet/scripts/super_scripts.go b/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go similarity index 83% rename from core/scripts/vrfv2/testnet/scripts/super_scripts.go rename to core/scripts/vrfv2/testnet/v2scripts/super_scripts.go index 3594636a604..f5e37005690 100644 --- a/core/scripts/vrfv2/testnet/scripts/super_scripts.go +++ b/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go @@ -1,12 +1,14 @@ -package scripts +package v2scripts import ( "context" "encoding/hex" "flag" "fmt" - "github.com/smartcontractkit/chainlink/core/scripts/vrfv2/testnet/constants" - "github.com/smartcontractkit/chainlink/core/scripts/vrfv2/testnet/jobs" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/constants" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/jobs" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/model" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/util" "math/big" "os" "strings" @@ -22,47 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" ) -var ( - VRFPrimaryNodeName = "vrf-primary-node" - VRFBackupNodeName = "vrf-backup-node" - BHSNodeName = "bhs-node" - BHSBackupNodeName = "bhs-backup-node" - BHFNodeName = "bhf-node" -) - -type Node struct { - URL string - CredsFile string - SendingKeys []SendingKey - NumberOfSendingKeysToCreate int - SendingKeyFundingAmount big.Int - VrfKeys []string - jobSpec string -} - -type SendingKey struct { - Address string - BalanceEth big.Int -} - -type JobSpecs struct { - VRFPrimaryNode string - VRFBackupyNode string - BHSNode string - BHSBackupNode string - BHFNode string -} - -type ContractAddresses struct { - LinkAddress string - LinkEthAddress string - BhsContractAddress common.Address - BatchBHSAddress common.Address - CoordinatorAddress common.Address - BatchCoordinatorAddress common.Address -} - -type CoordinatorConfig struct { +type CoordinatorConfigV2 struct { MinConfs *int MaxGasLimit *int64 StalenessSeconds *int64 @@ -82,8 +44,8 @@ func DeployUniverseViaCLI(e helpers.Environment) { coordinatorAddressString := *deployCmd.String("coordinator-address", "", "address of VRF Coordinator contract") batchCoordinatorAddressString := *deployCmd.String("batch-coordinator-address", "", "address Batch VRF Coordinator contract") - subscriptionBalanceJuelsString := deployCmd.String("subscription-balance", constants.SubscriptionBalanceJuels.String(), "amount to fund subscription") - nodeSendingKeyFundingAmount := deployCmd.Int64("sending-key-funding-amount", constants.NodeSendingKeyFundingAmountGwei, "CL node sending key funding amount") + subscriptionBalanceJuelsString := deployCmd.String("subscription-balance", constants.SubscriptionBalanceJuels, "amount to fund subscription") + nodeSendingKeyFundingAmount := deployCmd.String("sending-key-funding-amount", constants.NodeSendingKeyFundingAmount, "CL node sending key funding amount") batchFulfillmentEnabled := deployCmd.Bool("batch-fulfillment-enabled", constants.BatchFulfillmentEnabled, "whether send randomness fulfillments in batches inside one tx from CL node") @@ -127,11 +89,15 @@ func DeployUniverseViaCLI(e helpers.Environment) { vrfPrimaryNodeSendingKeys := strings.Split(*vrfPrimaryNodeSendingKeysString, ",") - nodesMap := make(map[string]Node) + nodesMap := make(map[string]model.Node) - nodesMap[VRFPrimaryNodeName] = Node{ - SendingKeys: mapToSendingKeyArr(vrfPrimaryNodeSendingKeys), - SendingKeyFundingAmount: *big.NewInt(*nodeSendingKeyFundingAmount), + fundingAmount, ok := new(big.Int).SetString(*nodeSendingKeyFundingAmount, 10) + if !ok { + panic(fmt.Sprintf("failed to parse node sending key funding amount '%s'", *nodeSendingKeyFundingAmount)) + } + nodesMap[model.VRFPrimaryNodeName] = model.Node{ + SendingKeys: util.MapToSendingKeyArr(vrfPrimaryNodeSendingKeys), + SendingKeyFundingAmount: fundingAmount, } bhsContractAddress := common.HexToAddress(bhsContractAddressString) @@ -139,7 +105,7 @@ func DeployUniverseViaCLI(e helpers.Environment) { coordinatorAddress := common.HexToAddress(coordinatorAddressString) batchCoordinatorAddress := common.HexToAddress(batchCoordinatorAddressString) - contractAddresses := ContractAddresses{ + contractAddresses := model.ContractAddresses{ LinkAddress: linkAddress, LinkEthAddress: linkEthAddress, BhsContractAddress: bhsContractAddress, @@ -148,7 +114,7 @@ func DeployUniverseViaCLI(e helpers.Environment) { BatchCoordinatorAddress: batchCoordinatorAddress, } - coordinatorConfig := CoordinatorConfig{ + coordinatorConfig := CoordinatorConfigV2{ MinConfs: minConfs, MaxGasLimit: maxGasLimit, StalenessSeconds: stalenessSeconds, @@ -167,31 +133,22 @@ func DeployUniverseViaCLI(e helpers.Environment) { nodesMap, ) - vrfPrimaryNode := nodesMap[VRFPrimaryNodeName] + vrfPrimaryNode := nodesMap[model.VRFPrimaryNodeName] fmt.Println("Funding node's sending keys...") for _, sendingKey := range vrfPrimaryNode.SendingKeys { - helpers.FundNode(e, sendingKey.Address, &vrfPrimaryNode.SendingKeyFundingAmount) + helpers.FundNode(e, sendingKey.Address, vrfPrimaryNode.SendingKeyFundingAmount) } } -func mapToSendingKeyArr(nodeSendingKeys []string) []SendingKey { - var sendingKeys []SendingKey - - for _, key := range nodeSendingKeys { - sendingKeys = append(sendingKeys, SendingKey{Address: key}) - } - return sendingKeys -} - func VRFV2DeployUniverse( e helpers.Environment, subscriptionBalanceJuels *big.Int, registerKeyUncompressedPubKey *string, - contractAddresses ContractAddresses, - coordinatorConfig CoordinatorConfig, + contractAddresses model.ContractAddresses, + coordinatorConfig CoordinatorConfigV2, batchFulfillmentEnabled bool, - nodesMap map[string]Node, -) JobSpecs { + nodesMap map[string]model.Node, +) model.JobSpecs { // Put key in ECDSA format if strings.HasPrefix(*registerKeyUncompressedPubKey, "0x") { @@ -246,7 +203,7 @@ func VRFV2DeployUniverse( if contractAddresses.BatchCoordinatorAddress.String() == "0x0000000000000000000000000000000000000000" { fmt.Println("\nDeploying Batch Coordinator...") - contractAddresses.BatchCoordinatorAddress = deployBatchCoordinatorV2(e, contractAddresses.CoordinatorAddress) + contractAddresses.BatchCoordinatorAddress = DeployBatchCoordinatorV2(e, contractAddresses.CoordinatorAddress) } fmt.Println("\nSetting Coordinator Config...") @@ -302,31 +259,31 @@ func VRFV2DeployUniverse( fmt.Printf("Subscription %+v\n", s) formattedVrfPrimaryJobSpec := fmt.Sprintf( - jobs.VRFJobFormatted, + jobs.VRFV2JobFormatted, contractAddresses.CoordinatorAddress, //coordinatorAddress contractAddresses.BatchCoordinatorAddress, //batchCoordinatorAddress batchFulfillmentEnabled, //batchFulfillmentEnabled compressedPkHex, //publicKey *coordinatorConfig.MinConfs, //minIncomingConfirmations e.ChainID, //evmChainID - strings.Join(mapToAddressArr(nodesMap[VRFPrimaryNodeName].SendingKeys), "\",\""), //fromAddresses + strings.Join(util.MapToAddressArr(nodesMap[model.VRFPrimaryNodeName].SendingKeys), "\",\""), //fromAddresses contractAddresses.CoordinatorAddress, - nodesMap[VRFPrimaryNodeName].SendingKeys[0].Address, + nodesMap[model.VRFPrimaryNodeName].SendingKeys[0].Address, contractAddresses.CoordinatorAddress, contractAddresses.CoordinatorAddress, ) formattedVrfBackupJobSpec := fmt.Sprintf( - jobs.VRFJobFormatted, + jobs.VRFV2JobFormatted, contractAddresses.CoordinatorAddress, //coordinatorAddress contractAddresses.BatchCoordinatorAddress, //batchCoordinatorAddress batchFulfillmentEnabled, //batchFulfillmentEnabled compressedPkHex, //publicKey 100, //minIncomingConfirmations e.ChainID, //evmChainID - strings.Join(mapToAddressArr(nodesMap[VRFBackupNodeName].SendingKeys), "\",\""), //fromAddresses + strings.Join(util.MapToAddressArr(nodesMap[model.VRFBackupNodeName].SendingKeys), "\",\""), //fromAddresses contractAddresses.CoordinatorAddress, - nodesMap[VRFPrimaryNodeName].SendingKeys[0], + nodesMap[model.VRFPrimaryNodeName].SendingKeys[0], contractAddresses.CoordinatorAddress, contractAddresses.CoordinatorAddress, ) @@ -338,7 +295,7 @@ func VRFV2DeployUniverse( 200, //lookbackBlocks contractAddresses.BhsContractAddress, //bhs address e.ChainID, //chain id - strings.Join(mapToAddressArr(nodesMap[BHSNodeName].SendingKeys), "\",\""), //sending addresses + strings.Join(util.MapToAddressArr(nodesMap[model.BHSNodeName].SendingKeys), "\",\""), //sending addresses ) formattedBHSBackupJobSpec := fmt.Sprintf( @@ -348,7 +305,7 @@ func VRFV2DeployUniverse( 200, //lookbackBlocks contractAddresses.BhsContractAddress, //bhs adreess e.ChainID, //chain id - strings.Join(mapToAddressArr(nodesMap[BHSBackupNodeName].SendingKeys), "\",\""), //sending addresses + strings.Join(util.MapToAddressArr(nodesMap[model.BHSBackupNodeName].SendingKeys), "\",\""), //sending addresses ) formattedBHFJobSpec := fmt.Sprintf( @@ -357,7 +314,7 @@ func VRFV2DeployUniverse( contractAddresses.BhsContractAddress, //bhs adreess contractAddresses.BatchBHSAddress, //batchBHS e.ChainID, //chain id - strings.Join(mapToAddressArr(nodesMap[BHFNodeName].SendingKeys), "\",\""), //sending addresses + strings.Join(util.MapToAddressArr(nodesMap[model.BHFNodeName].SendingKeys), "\",\""), //sending addresses ) fmt.Println( @@ -379,7 +336,7 @@ func VRFV2DeployUniverse( formattedVrfPrimaryJobSpec, ) - return JobSpecs{ + return model.JobSpecs{ VRFPrimaryNode: formattedVrfPrimaryJobSpec, VRFBackupyNode: formattedVrfBackupJobSpec, BHSNode: formattedBHSJobSpec, @@ -388,14 +345,6 @@ func VRFV2DeployUniverse( } } -func mapToAddressArr(sendingKeys []SendingKey) []string { - var sendingKeysString []string - for _, sendingKey := range sendingKeys { - sendingKeysString = append(sendingKeysString, sendingKey.Address) - } - return sendingKeysString -} - func DeployWrapperUniverse(e helpers.Environment) { cmd := flag.NewFlagSet("wrapper-universe-deploy", flag.ExitOnError) linkAddress := cmd.String("link-address", "", "address of link token") diff --git a/core/scripts/vrfv2/testnet/scripts/util.go b/core/scripts/vrfv2/testnet/v2scripts/util.go similarity index 99% rename from core/scripts/vrfv2/testnet/scripts/util.go rename to core/scripts/vrfv2/testnet/v2scripts/util.go index a55a78adb58..0e348e9c01c 100644 --- a/core/scripts/vrfv2/testnet/scripts/util.go +++ b/core/scripts/vrfv2/testnet/v2scripts/util.go @@ -1,4 +1,4 @@ -package scripts +package v2scripts import ( "context" @@ -53,7 +53,7 @@ func DeployCoordinator( return helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) } -func deployBatchCoordinatorV2(e helpers.Environment, coordinatorAddress common.Address) (batchCoordinatorAddress common.Address) { +func DeployBatchCoordinatorV2(e helpers.Environment, coordinatorAddress common.Address) (batchCoordinatorAddress common.Address) { _, tx, _, err := batch_vrf_coordinator_v2.DeployBatchVRFCoordinatorV2(e.Owner, e.Ec, coordinatorAddress) helpers.PanicErr(err) return helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) diff --git a/core/scripts/vrfv2plus/testnet/main.go b/core/scripts/vrfv2plus/testnet/main.go index 889350a61dd..0d1bf9a9481 100644 --- a/core/scripts/vrfv2plus/testnet/main.go +++ b/core/scripts/vrfv2plus/testnet/main.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "flag" "fmt" + "github.com/smartcontractkit/chainlink/core/scripts/vrfv2plus/testnet/v2plusscripts" "log" "math/big" "os" @@ -50,7 +51,6 @@ import ( var ( batchCoordinatorV2PlusABI = evmtypes.MustGetABI(batch_vrf_coordinator_v2plus.BatchVRFCoordinatorV2PlusABI) - coordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalABI) ) func main() { @@ -102,9 +102,9 @@ func main() { helpers.PanicErr(err) fmt.Println("gas cost:", gasCost) case "smoke": - smokeTestVRF(e) + v2plusscripts.SmokeTestVRF(e) case "smoke-bhs": - smokeTestBHS(e) + v2plusscripts.SmokeTestBHS(e) case "manual-fulfill": cmd := flag.NewFlagSet("manual-fulfill", flag.ExitOnError) // In order to get the tx data for a fulfillment transaction, you can grep the @@ -337,7 +337,7 @@ func main() { cmd := flag.NewFlagSet("batch-bhs-deploy", flag.ExitOnError) bhsAddr := cmd.String("bhs-address", "", "address of the blockhash store contract") helpers.ParseArgs(cmd, os.Args[2:], "bhs-address") - deployBatchBHS(e, common.HexToAddress(*bhsAddr)) + v2plusscripts.DeployBatchBHS(e, common.HexToAddress(*bhsAddr)) case "batch-bhs-store": cmd := flag.NewFlagSet("batch-bhs-store", flag.ExitOnError) batchAddr := cmd.String("batch-bhs-address", "", "address of the batch bhs contract") @@ -513,14 +513,14 @@ func main() { helpers.PanicErr(err) fmt.Println("latest head number:", h.Number.String()) case "bhs-deploy": - deployBHS(e) + v2plusscripts.DeployBHS(e) case "coordinator-deploy": coordinatorDeployCmd := flag.NewFlagSet("coordinator-deploy", flag.ExitOnError) coordinatorDeployLinkAddress := coordinatorDeployCmd.String("link-address", "", "address of link token") coordinatorDeployBHSAddress := coordinatorDeployCmd.String("bhs-address", "", "address of bhs") coordinatorDeployLinkEthFeedAddress := coordinatorDeployCmd.String("link-eth-feed", "", "address of link-eth-feed") helpers.ParseArgs(coordinatorDeployCmd, os.Args[2:], "link-address", "bhs-address", "link-eth-feed") - deployCoordinator(e, *coordinatorDeployLinkAddress, *coordinatorDeployBHSAddress, *coordinatorDeployLinkEthFeedAddress) + v2plusscripts.DeployCoordinator(e, *coordinatorDeployLinkAddress, *coordinatorDeployBHSAddress, *coordinatorDeployLinkEthFeedAddress) case "coordinator-get-config": cmd := flag.NewFlagSet("coordinator-get-config", flag.ExitOnError) coordinatorAddress := cmd.String("coordinator-address", "", "coordinator address") @@ -529,7 +529,7 @@ func main() { coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) - printCoordinatorConfig(coordinator) + v2plusscripts.PrintCoordinatorConfig(coordinator) case "coordinator-set-config": cmd := flag.NewFlagSet("coordinator-set-config", flag.ExitOnError) setConfigAddress := cmd.String("coordinator-address", "", "coordinator address") @@ -545,7 +545,7 @@ func main() { coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*setConfigAddress), e.Ec) helpers.PanicErr(err) - setCoordinatorConfig( + v2plusscripts.SetCoordinatorConfig( e, *coordinator, uint16(*minConfs), @@ -572,7 +572,7 @@ func main() { *registerKeyUncompressedPubKey = strings.Replace(*registerKeyUncompressedPubKey, "0x", "04", 1) } - registerCoordinatorProvingKey(e, *coordinator, *registerKeyUncompressedPubKey, *registerKeyOracleAddress) + v2plusscripts.RegisterCoordinatorProvingKey(e, *coordinator, *registerKeyUncompressedPubKey, *registerKeyOracleAddress) case "coordinator-deregister-key": coordinatorDeregisterKey := flag.NewFlagSet("coordinator-deregister-key", flag.ExitOnError) deregisterKeyAddress := coordinatorDeregisterKey.String("address", "", "coordinator address") @@ -704,7 +704,7 @@ func main() { helpers.PanicErr(err) fmt.Printf("Request config %+v Rw %+v Rid %+v\n", rc, rw, rid) case "deploy-universe": - deployUniverse(e) + v2plusscripts.DeployUniverseViaCLI(e) case "generate-proof-v2-plus": generateProofForV2Plus(e) case "eoa-consumer-deploy": @@ -713,7 +713,7 @@ func main() { consumerLinkAddress := consumerDeployCmd.String("link-address", "", "link-address") helpers.ParseArgs(consumerDeployCmd, os.Args[2:], "coordinator-address", "link-address", "key-hash") - eoaDeployConsumer(e, *consumerCoordinator, *consumerLinkAddress) + v2plusscripts.EoaDeployConsumer(e, *consumerCoordinator, *consumerLinkAddress) case "eoa-load-test-consumer-deploy": loadTestConsumerDeployCmd := flag.NewFlagSet("eoa-load-test-consumer-deploy", flag.ExitOnError) consumerCoordinator := loadTestConsumerDeployCmd.String("coordinator-address", "", "coordinator address") @@ -743,7 +743,7 @@ func main() { helpers.ParseArgs(createSubCmd, os.Args[2:], "coordinator-address") coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) - eoaCreateSub(e, *coordinator) + v2plusscripts.EoaCreateSub(e, *coordinator) case "eoa-add-sub-consumer": addSubConsCmd := flag.NewFlagSet("eoa-add-sub-consumer", flag.ExitOnError) coordinatorAddress := addSubConsCmd.String("coordinator-address", "", "coordinator address") @@ -753,7 +753,7 @@ func main() { coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) parsedSubID := parseSubID(*subID) - eoaAddConsumerToSub(e, *coordinator, parsedSubID, *consumerAddress) + v2plusscripts.EoaAddConsumerToSub(e, *coordinator, parsedSubID, *consumerAddress) case "eoa-create-fund-authorize-sub": // Lets just treat the owner key as the EOA controlling the sub cfaSubCmd := flag.NewFlagSet("eoa-create-fund-authorize-sub", flag.ExitOnError) @@ -969,12 +969,9 @@ func main() { if !s { panic(fmt.Sprintf("failed to parse top up amount '%s'", *amountStr)) } - coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) - helpers.PanicErr(err) - e.Owner.Value = amount - tx, err := coordinator.FundSubscriptionWithNative(e.Owner, parseSubID(*subID)) - helpers.PanicErr(err) - helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID) + parsedSubID := parseSubID(*subID) + + v2plusscripts.EoaFundSubWithNative(e, common.HexToAddress(*coordinatorAddress), parsedSubID, amount) case "eoa-fund-sub": fund := flag.NewFlagSet("eoa-fund-sub", flag.ExitOnError) coordinatorAddress := fund.String("coordinator-address", "", "coordinator address") @@ -989,7 +986,7 @@ func main() { coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) - eoaFundSubscription(e, *coordinator, *consumerLinkAddress, amount, parseSubID(*subID)) + v2plusscripts.EoaFundSubWithLink(e, *coordinator, *consumerLinkAddress, amount, parseSubID(*subID)) case "eoa-read": cmd := flag.NewFlagSet("eoa-read", flag.ExitOnError) consumerAddress := cmd.String("consumer", "", "consumer address") @@ -1122,7 +1119,7 @@ func main() { linkETHFeedAddress := cmd.String("link-eth-feed", "", "address of link-eth-feed") coordinatorAddress := cmd.String("coordinator-address", "", "address of the vrf coordinator v2 contract") helpers.ParseArgs(cmd, os.Args[2:], "link-address", "link-eth-feed", "coordinator-address") - wrapperDeploy(e, + v2plusscripts.WrapperDeploy(e, common.HexToAddress(*linkAddress), common.HexToAddress(*linkETHFeedAddress), common.HexToAddress(*coordinatorAddress)) @@ -1164,7 +1161,7 @@ func main() { fulfillmentFlatFeeNativePPM := cmd.Uint("fulfillment-flat-fee-native-ppm", 500, "the native flat fee in ppm to charge for fulfillment") helpers.ParseArgs(cmd, os.Args[2:], "wrapper-address", "key-hash", "fallback-wei-per-unit-link") - wrapperConfigure(e, + v2plusscripts.WrapperConfigure(e, common.HexToAddress(*wrapperAddress), *wrapperGasOverhead, *coordinatorGasOverhead, @@ -1200,7 +1197,7 @@ func main() { wrapperAddress := cmd.String("wrapper-address", "", "address of the VRFV2Wrapper contract") helpers.ParseArgs(cmd, os.Args[2:], "link-address", "wrapper-address") - wrapperConsumerDeploy(e, + v2plusscripts.WrapperConsumerDeploy(e, common.HexToAddress(*linkAddress), common.HexToAddress(*wrapperAddress)) case "wrapper-consumer-request": @@ -1272,7 +1269,7 @@ func main() { helpers.ParseArgs(cmd, os.Args[2:]) _ = helpers.CalculateLatestBlockHeader(e, *blockNumber) case "wrapper-universe-deploy": - deployWrapperUniverse(e) + v2plusscripts.DeployWrapperUniverse(e) default: panic("unrecognized subcommand: " + os.Args[1]) } diff --git a/core/scripts/vrfv2plus/testnet/super_scripts.go b/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go similarity index 61% rename from core/scripts/vrfv2plus/testnet/super_scripts.go rename to core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go index 24a737be111..4e93d20f6d6 100644 --- a/core/scripts/vrfv2plus/testnet/super_scripts.go +++ b/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go @@ -1,4 +1,4 @@ -package main +package v2plusscripts import ( "bytes" @@ -6,6 +6,12 @@ import ( "encoding/hex" "flag" "fmt" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/constants" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/jobs" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/model" + "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/util" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "math/big" "os" "strings" @@ -18,7 +24,6 @@ import ( "github.com/shopspring/decimal" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/v2/core/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" @@ -30,46 +35,18 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) -const formattedVRFJob = ` -type = "vrf" -name = "vrf_v2_plus" -schemaVersion = 1 -coordinatorAddress = "%s" -batchCoordinatorAddress = "%s" -batchFulfillmentEnabled = %t -batchFulfillmentGasMultiplier = 1.1 -publicKey = "%s" -minIncomingConfirmations = 3 -evmChainID = "%d" -fromAddresses = ["%s"] -pollPeriod = "5s" -requestTimeout = "24h" -observationSource = """ -decode_log [type=ethabidecodelog - abi="RandomWordsRequested(bytes32 indexed keyHash,uint256 requestId,uint256 preSeed,uint256 indexed subId,uint16 minimumRequestConfirmations,uint32 callbackGasLimit,uint32 numWords,bytes extraArgs,address indexed sender)" - data="$(jobRun.logData)" - topics="$(jobRun.logTopics)"] -generate_proof [type=vrfv2plus - publicKey="$(jobSpec.publicKey)" - requestBlockHash="$(jobRun.logBlockHash)" - requestBlockNumber="$(jobRun.logBlockNumber)" - topics="$(jobRun.logTopics)"] -estimate_gas [type=estimategaslimit - to="%s" - multiplier="1.1" - data="$(generate_proof.output)"] -simulate_fulfillment [type=ethcall - to="%s" - gas="$(estimate_gas)" - gasPrice="$(jobSpec.maxGasPrice)" - extractRevertReason=true - contract="%s" - data="$(generate_proof.output)"] -decode_log->generate_proof->estimate_gas->simulate_fulfillment -""" -` - -func smokeTestVRF(e helpers.Environment) { +var coordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalABI) + +type CoordinatorConfigV2Plus struct { + MinConfs *int + MaxGasLimit *int64 + StalenessSeconds *int64 + GasAfterPayment *int64 + FallbackWeiPerUnitLink *big.Int + FeeConfig vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig +} + +func SmokeTestVRF(e helpers.Environment) { smokeCmd := flag.NewFlagSet("smoke", flag.ExitOnError) // required flags @@ -120,7 +97,7 @@ func smokeTestVRF(e helpers.Environment) { var bhsContractAddress common.Address if len(*bhsAddressStr) == 0 { fmt.Println("\nDeploying BHS...") - bhsContractAddress = deployBHS(e) + bhsContractAddress = DeployBHS(e) } else { bhsContractAddress = common.HexToAddress(*bhsAddressStr) } @@ -128,7 +105,7 @@ func smokeTestVRF(e helpers.Environment) { var batchBHSAddress common.Address if len(*batchBHSAddressStr) == 0 { fmt.Println("\nDeploying Batch BHS...") - batchBHSAddress = deployBatchBHS(e, bhsContractAddress) + batchBHSAddress = DeployBatchBHS(e, bhsContractAddress) } else { batchBHSAddress = common.HexToAddress(*batchBHSAddressStr) } @@ -136,7 +113,7 @@ func smokeTestVRF(e helpers.Environment) { var coordinatorAddress common.Address if len(*coordinatorAddressStr) == 0 { fmt.Println("\nDeploying Coordinator...") - coordinatorAddress = deployCoordinator(e, *linkAddress, bhsContractAddress.String(), *linkEthAddress) + coordinatorAddress = DeployCoordinator(e, *linkAddress, bhsContractAddress.String(), *linkEthAddress) } else { coordinatorAddress = common.HexToAddress(*coordinatorAddressStr) } @@ -147,14 +124,14 @@ func smokeTestVRF(e helpers.Environment) { var batchCoordinatorAddress common.Address if len(*batchCoordinatorAddressStr) == 0 { fmt.Println("\nDeploying Batch Coordinator...") - batchCoordinatorAddress = deployBatchCoordinatorV2(e, coordinatorAddress) + batchCoordinatorAddress = DeployBatchCoordinatorV2(e, coordinatorAddress) } else { batchCoordinatorAddress = common.HexToAddress(*batchCoordinatorAddressStr) } if !*skipConfig { fmt.Println("\nSetting Coordinator Config...") - setCoordinatorConfig( + SetCoordinatorConfig( e, *coordinator, uint16(*minConfs), @@ -170,7 +147,7 @@ func smokeTestVRF(e helpers.Environment) { } fmt.Println("\nConfig set, getting current config from deployed contract...") - printCoordinatorConfig(coordinator) + PrintCoordinatorConfig(coordinator) // Generate compressed public key and key hash uncompressed, err := key.PublicKey.StringUncompressed() @@ -250,20 +227,20 @@ func smokeTestVRF(e helpers.Environment) { } fmt.Println("\nDeploying consumer...") - consumerAddress := eoaDeployConsumer(e, coordinatorAddress.String(), *linkAddress) + consumerAddress := EoaDeployConsumer(e, coordinatorAddress.String(), *linkAddress) fmt.Println("\nAdding subscription...") - eoaCreateSub(e, *coordinator) + EoaCreateSub(e, *coordinator) - subID := findSubscriptionID(e, coordinator) + subID := FindSubscriptionID(e, coordinator) helpers.PanicErr(err) fmt.Println("\nAdding consumer to subscription...") - eoaAddConsumerToSub(e, *coordinator, subID, consumerAddress.String()) + EoaAddConsumerToSub(e, *coordinator, subID, consumerAddress.String()) if subscriptionBalance.Cmp(big.NewInt(0)) > 0 { fmt.Println("\nFunding subscription with", subscriptionBalance, "juels...") - eoaFundSubscription(e, *coordinator, *linkAddress, subscriptionBalance, subID) + EoaFundSubWithLink(e, *coordinator, *linkAddress, subscriptionBalance, subID) } else { fmt.Println("Subscription", subID, "NOT getting funded. You must fund the subscription in order to use it!") } @@ -378,7 +355,7 @@ func smokeTestVRF(e helpers.Environment) { fmt.Println("\nfulfillment successful") } -func smokeTestBHS(e helpers.Environment) { +func SmokeTestBHS(e helpers.Environment) { smokeCmd := flag.NewFlagSet("smoke-bhs", flag.ExitOnError) // optional args @@ -390,7 +367,7 @@ func smokeTestBHS(e helpers.Environment) { var bhsContractAddress common.Address if len(*bhsAddress) == 0 { fmt.Println("\nDeploying BHS...") - bhsContractAddress = deployBHS(e) + bhsContractAddress = DeployBHS(e) } else { bhsContractAddress = common.HexToAddress(*bhsAddress) } @@ -398,7 +375,7 @@ func smokeTestBHS(e helpers.Environment) { var batchBHSContractAddress common.Address if len(*batchBHSAddress) == 0 { fmt.Println("\nDeploying Batch BHS...") - batchBHSContractAddress = deployBatchBHS(e, bhsContractAddress) + batchBHSContractAddress = DeployBatchBHS(e, bhsContractAddress) } else { batchBHSContractAddress = common.HexToAddress(*batchBHSAddress) } @@ -486,117 +463,183 @@ func sendTx(e helpers.Environment, to common.Address, data []byte) (*types.Recei e.ChainID, "send tx", signedTx.Hash().String(), "to", to.String()), signedTx.Hash() } -func deployUniverse(e helpers.Environment) { +func DeployUniverseViaCLI(e helpers.Environment) { deployCmd := flag.NewFlagSet("deploy-universe", flag.ExitOnError) // required flags - linkAddress := deployCmd.String("link-address", "", "address of link token") - linkEthAddress := deployCmd.String("link-eth-feed", "", "address of link eth feed") - bhsAddress := deployCmd.String("bhs-address", "", "address of blockhash store") - batchBHSAddress := deployCmd.String("batch-bhs-address", "", "address of batch blockhash store") - subscriptionBalanceString := deployCmd.String("subscription-balance", "1e19", "amount to fund subscription") + linkAddress := *deployCmd.String("link-address", "", "address of link token") + linkEthAddress := *deployCmd.String("link-eth-feed", "", "address of link eth feed") + bhsContractAddressString := *deployCmd.String("bhs-address", "", "address of BHS contract") + batchBHSAddressString := *deployCmd.String("batch-bhs-address", "", "address of Batch BHS contract") + coordinatorAddressString := *deployCmd.String("coordinator-address", "", "address of VRF Coordinator contract") + batchCoordinatorAddressString := *deployCmd.String("batch-coordinator-address", "", "address Batch VRF Coordinator contract") + subscriptionBalanceJuelsString := deployCmd.String("subscription-balance", "1e19", "amount to fund subscription with Link token (Juels)") + subscriptionBalanceNativeWeiString := deployCmd.String("subscription-balance-native", "1e18", "amount to fund subscription with native token (Wei)") + + batchFulfillmentEnabled := deployCmd.Bool("batch-fulfillment-enabled", constants.BatchFulfillmentEnabled, "whether send randomness fulfillments in batches inside one tx from CL node") // optional flags fallbackWeiPerUnitLinkString := deployCmd.String("fallback-wei-per-unit-link", "6e16", "fallback wei/link ratio") registerKeyUncompressedPubKey := deployCmd.String("uncompressed-pub-key", "", "uncompressed public key") - registerKeyOracleAddress := deployCmd.String("oracle-address", "", "oracle sender address") - minConfs := deployCmd.Int("min-confs", 3, "min confs") - oracleFundingAmount := deployCmd.Int64("oracle-funding-amount", assets.GWei(100_000_000).Int64(), "amount to fund sending oracle") - maxGasLimit := deployCmd.Int64("max-gas-limit", 2.5e6, "max gas limit") - stalenessSeconds := deployCmd.Int64("staleness-seconds", 86400, "staleness in seconds") - gasAfterPayment := deployCmd.Int64("gas-after-payment", 33285, "gas after payment calculation") - flatFeeLinkPPM := deployCmd.Int64("flat-fee-link-ppm", 500, "fulfillment flat fee LINK ppm") - flatFeeEthPPM := deployCmd.Int64("flat-fee-eth-ppm", 500, "fulfillment flat fee ETH ppm") + vrfPrimaryNodeSendingKeysString := deployCmd.String("vrf-primary-node-sending-keys", "", "VRF Primary Node sending keys") + minConfs := deployCmd.Int("min-confs", constants.MinConfs, "min confs") + nodeSendingKeyFundingAmount := deployCmd.String("sending-key-funding-amount", constants.NodeSendingKeyFundingAmount, "CL node sending key funding amount") + maxGasLimit := deployCmd.Int64("max-gas-limit", constants.MaxGasLimit, "max gas limit") + stalenessSeconds := deployCmd.Int64("staleness-seconds", constants.StalenessSeconds, "staleness in seconds") + gasAfterPayment := deployCmd.Int64("gas-after-payment", constants.GasAfterPayment, "gas after payment calculation") + flatFeeLinkPPM := deployCmd.Int64("flat-fee-link-ppm", constants.FlatFeeLinkPPM, "fulfillment flat fee LINK ppm") + flatFeeEthPPM := deployCmd.Int64("flat-fee-eth-ppm", constants.FlatFeeNativePPM, "fulfillment flat fee ETH ppm") - helpers.ParseArgs(deployCmd, os.Args[2:]) + helpers.ParseArgs( + deployCmd, os.Args[2:], + ) fallbackWeiPerUnitLink := decimal.RequireFromString(*fallbackWeiPerUnitLinkString).BigInt() - subscriptionBalance := decimal.RequireFromString(*subscriptionBalanceString).BigInt() + subscriptionBalanceJuels := decimal.RequireFromString(*subscriptionBalanceJuelsString).BigInt() + subscriptionBalanceNativeWei := decimal.RequireFromString(*subscriptionBalanceNativeWeiString).BigInt() + fundingAmount := decimal.RequireFromString(*nodeSendingKeyFundingAmount).BigInt() + + feeConfig := vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ + FulfillmentFlatFeeLinkPPM: uint32(*flatFeeLinkPPM), + FulfillmentFlatFeeNativePPM: uint32(*flatFeeEthPPM), + } + vrfPrimaryNodeSendingKeys := strings.Split(*vrfPrimaryNodeSendingKeysString, ",") + + nodesMap := make(map[string]model.Node) + + nodesMap[model.VRFPrimaryNodeName] = model.Node{ + SendingKeys: util.MapToSendingKeyArr(vrfPrimaryNodeSendingKeys), + SendingKeyFundingAmount: fundingAmount, + } + + bhsContractAddress := common.HexToAddress(bhsContractAddressString) + batchBHSAddress := common.HexToAddress(batchBHSAddressString) + coordinatorAddress := common.HexToAddress(coordinatorAddressString) + batchCoordinatorAddress := common.HexToAddress(batchCoordinatorAddressString) + + contractAddresses := model.ContractAddresses{ + LinkAddress: linkAddress, + LinkEthAddress: linkEthAddress, + BhsContractAddress: bhsContractAddress, + BatchBHSAddress: batchBHSAddress, + CoordinatorAddress: coordinatorAddress, + BatchCoordinatorAddress: batchCoordinatorAddress, + } + + coordinatorConfig := CoordinatorConfigV2Plus{ + MinConfs: minConfs, + MaxGasLimit: maxGasLimit, + StalenessSeconds: stalenessSeconds, + GasAfterPayment: gasAfterPayment, + FallbackWeiPerUnitLink: fallbackWeiPerUnitLink, + FeeConfig: feeConfig, + } + + VRFV2PlusDeployUniverse( + e, + subscriptionBalanceJuels, + subscriptionBalanceNativeWei, + registerKeyUncompressedPubKey, + contractAddresses, + coordinatorConfig, + *batchFulfillmentEnabled, + nodesMap, + ) + + vrfPrimaryNode := nodesMap[model.VRFPrimaryNodeName] + fmt.Println("Funding node's sending keys...") + for _, sendingKey := range vrfPrimaryNode.SendingKeys { + helpers.FundNode(e, sendingKey.Address, vrfPrimaryNode.SendingKeyFundingAmount) + } +} + +func VRFV2PlusDeployUniverse(e helpers.Environment, + subscriptionBalanceJuels *big.Int, + subscriptionBalanceNativeWei *big.Int, + registerKeyUncompressedPubKey *string, + contractAddresses model.ContractAddresses, + coordinatorConfig CoordinatorConfigV2Plus, + batchFulfillmentEnabled bool, + nodesMap map[string]model.Node, +) model.JobSpecs { // Put key in ECDSA format if strings.HasPrefix(*registerKeyUncompressedPubKey, "0x") { *registerKeyUncompressedPubKey = strings.Replace(*registerKeyUncompressedPubKey, "0x", "04", 1) } - if len(*linkAddress) == 0 { + // Generate compressed public key and key hash + pubBytes, err := hex.DecodeString(*registerKeyUncompressedPubKey) + helpers.PanicErr(err) + pk, err := crypto.UnmarshalPubkey(pubBytes) + helpers.PanicErr(err) + var pkBytes []byte + if big.NewInt(0).Mod(pk.Y, big.NewInt(2)).Uint64() != 0 { + pkBytes = append(pk.X.Bytes(), 1) + } else { + pkBytes = append(pk.X.Bytes(), 0) + } + var newPK secp256k1.PublicKey + copy(newPK[:], pkBytes) + + compressedPkHex := hexutil.Encode(pkBytes) + keyHash, err := newPK.Hash() + helpers.PanicErr(err) + + if len(contractAddresses.LinkAddress) == 0 { fmt.Println("\nDeploying LINK Token...") - address := helpers.DeployLinkToken(e).String() - linkAddress = &address + contractAddresses.LinkAddress = helpers.DeployLinkToken(e).String() } - if len(*linkEthAddress) == 0 { + if len(contractAddresses.LinkEthAddress) == 0 { fmt.Println("\nDeploying LINK/ETH Feed...") - address := helpers.DeployLinkEthFeed(e, *linkAddress, fallbackWeiPerUnitLink).String() - linkEthAddress = &address + contractAddresses.LinkEthAddress = helpers.DeployLinkEthFeed(e, contractAddresses.LinkAddress, coordinatorConfig.FallbackWeiPerUnitLink).String() } - var bhsContractAddress common.Address - if len(*bhsAddress) == 0 { + if contractAddresses.BhsContractAddress.String() == "0x0000000000000000000000000000000000000000" { fmt.Println("\nDeploying BHS...") - bhsContractAddress = deployBHS(e) - } else { - bhsContractAddress = common.HexToAddress(*bhsAddress) + contractAddresses.BhsContractAddress = DeployBHS(e) } - var batchBHSContractAddress common.Address - if len(*batchBHSAddress) == 0 { + if contractAddresses.BatchBHSAddress.String() == "0x0000000000000000000000000000000000000000" { fmt.Println("\nDeploying Batch BHS...") - batchBHSContractAddress = deployBatchBHS(e, bhsContractAddress) - } else { - batchBHSContractAddress = common.HexToAddress(*batchBHSAddress) + contractAddresses.BatchBHSAddress = DeployBatchBHS(e, contractAddresses.BhsContractAddress) } - var coordinatorAddress common.Address - fmt.Println("\nDeploying Coordinator...") - coordinatorAddress = deployCoordinator(e, *linkAddress, bhsContractAddress.String(), *linkEthAddress) + if contractAddresses.CoordinatorAddress.String() == "0x0000000000000000000000000000000000000000" { + fmt.Println("\nDeploying Coordinator...") + contractAddresses.CoordinatorAddress = DeployCoordinator(e, contractAddresses.LinkAddress, contractAddresses.BhsContractAddress.String(), contractAddresses.LinkEthAddress) + } - coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(coordinatorAddress, e.Ec) + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(contractAddresses.CoordinatorAddress, e.Ec) helpers.PanicErr(err) - fmt.Println("\nDeploying Batch Coordinator...") - batchCoordinatorAddress := deployBatchCoordinatorV2(e, coordinatorAddress) + if contractAddresses.BatchCoordinatorAddress.String() == "0x0000000000000000000000000000000000000000" { + fmt.Println("\nDeploying Batch Coordinator...") + contractAddresses.BatchCoordinatorAddress = DeployBatchCoordinatorV2(e, contractAddresses.CoordinatorAddress) + } fmt.Println("\nSetting Coordinator Config...") - setCoordinatorConfig( + SetCoordinatorConfig( e, *coordinator, - uint16(*minConfs), - uint32(*maxGasLimit), - uint32(*stalenessSeconds), - uint32(*gasAfterPayment), - fallbackWeiPerUnitLink, - vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{ - FulfillmentFlatFeeLinkPPM: uint32(*flatFeeLinkPPM), - FulfillmentFlatFeeNativePPM: uint32(*flatFeeEthPPM), - }, + uint16(*coordinatorConfig.MinConfs), + uint32(*coordinatorConfig.MaxGasLimit), + uint32(*coordinatorConfig.StalenessSeconds), + uint32(*coordinatorConfig.GasAfterPayment), + coordinatorConfig.FallbackWeiPerUnitLink, + coordinatorConfig.FeeConfig, ) fmt.Println("\nConfig set, getting current config from deployed contract...") - printCoordinatorConfig(coordinator) - - var compressedPkHex string - var keyHash common.Hash - if len(*registerKeyUncompressedPubKey) > 0 && len(*registerKeyOracleAddress) > 0 { - // Generate compressed public key and key hash - pubBytes, err := hex.DecodeString(*registerKeyUncompressedPubKey) - helpers.PanicErr(err) - pk, err := crypto.UnmarshalPubkey(pubBytes) - helpers.PanicErr(err) - var pkBytes []byte - if big.NewInt(0).Mod(pk.Y, big.NewInt(2)).Uint64() != 0 { - pkBytes = append(pk.X.Bytes(), 1) - } else { - pkBytes = append(pk.X.Bytes(), 0) - } - var newPK secp256k1.PublicKey - copy(newPK[:], pkBytes) - - compressedPkHex = hexutil.Encode(pkBytes) - keyHash, err = newPK.Hash() - helpers.PanicErr(err) + PrintCoordinatorConfig(coordinator) + if len(*registerKeyUncompressedPubKey) > 0 { fmt.Println("\nRegistering proving key...") - registerCoordinatorProvingKey(e, *coordinator, *registerKeyUncompressedPubKey, *registerKeyOracleAddress) + + //NOTE - register proving key against EOA account, and not against Oracle's sending address in other to be able + // easily withdraw funds from Coordinator contract back to EOA account + RegisterCoordinatorProvingKey(e, *coordinator, *registerKeyUncompressedPubKey, e.Owner.From.String()) fmt.Println("\nProving key registered, getting proving key hashes from deployed contract...") _, _, provingKeyHashes, configErr := coordinator.GetRequestConfig(nil) @@ -607,22 +650,28 @@ func deployUniverse(e helpers.Environment) { } fmt.Println("\nDeploying consumer...") - consumerAddress := eoaDeployConsumer(e, coordinatorAddress.String(), *linkAddress) + consumerAddress := EoaV2PlusLoadTestConsumerWithMetricsDeploy(e, contractAddresses.CoordinatorAddress.String()) fmt.Println("\nAdding subscription...") - eoaCreateSub(e, *coordinator) + EoaCreateSub(e, *coordinator) - subID := findSubscriptionID(e, coordinator) + subID := FindSubscriptionID(e, coordinator) helpers.PanicErr(err) fmt.Println("\nAdding consumer to subscription...") - eoaAddConsumerToSub(e, *coordinator, subID, consumerAddress.String()) + EoaAddConsumerToSub(e, *coordinator, subID, consumerAddress.String()) - if subscriptionBalance.Cmp(big.NewInt(0)) > 0 { - fmt.Println("\nFunding subscription with", subscriptionBalance, "juels...") - eoaFundSubscription(e, *coordinator, *linkAddress, subscriptionBalance, subID) + if subscriptionBalanceJuels.Cmp(big.NewInt(0)) > 0 { + fmt.Println("\nFunding subscription with Link Token.", subscriptionBalanceJuels, "juels...") + EoaFundSubWithLink(e, *coordinator, contractAddresses.LinkAddress, subscriptionBalanceJuels, subID) } else { - fmt.Println("Subscription", subID, "NOT getting funded. You must fund the subscription in order to use it!") + fmt.Println("Subscription", subID, "NOT getting funded with Link Token. You must fund the subscription in order to use it!") + } + if subscriptionBalanceNativeWei.Cmp(big.NewInt(0)) > 0 { + fmt.Println("\nFunding subscription with Native Token.", subscriptionBalanceNativeWei, "wei...") + EoaFundSubWithNative(e, coordinator.Address(), subID, subscriptionBalanceNativeWei) + } else { + fmt.Println("Subscription", subID, "NOT getting funded with Native Token. You must fund the subscription in order to use it!") } fmt.Println("\nSubscribed and (possibly) funded, retrieving subscription from deployed contract...") @@ -630,45 +679,94 @@ func deployUniverse(e helpers.Environment) { helpers.PanicErr(err) fmt.Printf("Subscription %+v\n", s) - if len(*registerKeyOracleAddress) > 0 && *oracleFundingAmount > 0 { - fmt.Println("\nFunding oracle...") - helpers.FundNodes(e, []string{*registerKeyOracleAddress}, big.NewInt(*oracleFundingAmount)) - } - - formattedJobSpec := fmt.Sprintf( - formattedVRFJob, - coordinatorAddress, - batchCoordinatorAddress, - false, - compressedPkHex, - e.ChainID, - *registerKeyOracleAddress, - coordinatorAddress, - coordinatorAddress, - coordinatorAddress, + formattedVrfV2PlusPrimaryJobSpec := fmt.Sprintf( + jobs.VRFV2PlusJobFormatted, + contractAddresses.CoordinatorAddress, //coordinatorAddress + contractAddresses.BatchCoordinatorAddress, //batchCoordinatorAddress + batchFulfillmentEnabled, //batchFulfillmentEnabled + compressedPkHex, //publicKey + *coordinatorConfig.MinConfs, //minIncomingConfirmations + e.ChainID, //evmChainID + strings.Join(util.MapToAddressArr(nodesMap[model.VRFPrimaryNodeName].SendingKeys), "\",\""), //fromAddresses + contractAddresses.CoordinatorAddress, + nodesMap[model.VRFPrimaryNodeName].SendingKeys[0].Address, + contractAddresses.CoordinatorAddress, + contractAddresses.CoordinatorAddress, + ) + + formattedVrfV2PlusBackupJobSpec := fmt.Sprintf( + jobs.VRFV2PlusJobFormatted, + contractAddresses.CoordinatorAddress, //coordinatorAddress + contractAddresses.BatchCoordinatorAddress, //batchCoordinatorAddress + batchFulfillmentEnabled, //batchFulfillmentEnabled + compressedPkHex, //publicKey + 100, //minIncomingConfirmations + e.ChainID, //evmChainID + strings.Join(util.MapToAddressArr(nodesMap[model.VRFBackupNodeName].SendingKeys), "\",\""), //fromAddresses + contractAddresses.CoordinatorAddress, + nodesMap[model.VRFPrimaryNodeName].SendingKeys[0], + contractAddresses.CoordinatorAddress, + contractAddresses.CoordinatorAddress, + ) + + formattedBHSJobSpec := fmt.Sprintf( + jobs.BHSJobFormatted, + contractAddresses.CoordinatorAddress, //coordinatorAddress + 30, //waitBlocks + 200, //lookbackBlocks + contractAddresses.BhsContractAddress, //bhs address + e.ChainID, //chain id + strings.Join(util.MapToAddressArr(nodesMap[model.BHSNodeName].SendingKeys), "\",\""), //sending addresses + ) + + formattedBHSBackupJobSpec := fmt.Sprintf( + jobs.BHSJobFormatted, + contractAddresses.CoordinatorAddress, //coordinatorAddress + 100, //waitBlocks + 200, //lookbackBlocks + contractAddresses.BhsContractAddress, //bhs adreess + e.ChainID, //chain id + strings.Join(util.MapToAddressArr(nodesMap[model.BHSBackupNodeName].SendingKeys), "\",\""), //sending addresses + ) + + formattedBHFJobSpec := fmt.Sprintf( + jobs.BHFJobFormatted, + contractAddresses.CoordinatorAddress, //coordinatorAddress + contractAddresses.BhsContractAddress, //bhs adreess + contractAddresses.BatchBHSAddress, //batchBHS + e.ChainID, //chain id + strings.Join(util.MapToAddressArr(nodesMap[model.BHFNodeName].SendingKeys), "\",\""), //sending addresses ) fmt.Println( - "\n----------------------------", "\nDeployment complete.", - "\nLINK Token contract address:", *linkAddress, - "\nLINK/ETH Feed contract address:", *linkEthAddress, - "\nBlockhash Store contract address:", bhsContractAddress, - "\nBatch Blockhash Store contract address:", batchBHSContractAddress, - "\nVRF Coordinator Address:", coordinatorAddress, - "\nBatch VRF Coordinator Address:", batchCoordinatorAddress, + "\nLINK Token contract address:", contractAddresses.LinkAddress, + "\nLINK/ETH Feed contract address:", contractAddresses.LinkEthAddress, + "\nBlockhash Store contract address:", contractAddresses.BhsContractAddress, + "\nBatch Blockhash Store contract address:", contractAddresses.BatchBHSAddress, + "\nVRF Coordinator Address:", contractAddresses.CoordinatorAddress, + "\nBatch VRF Coordinator Address:", contractAddresses.BatchCoordinatorAddress, "\nVRF Consumer Address:", consumerAddress, "\nVRF Subscription Id:", subID, - "\nVRF Subscription Balance:", *subscriptionBalanceString, + "\nVRF Subscription Balance:", *subscriptionBalanceJuels, "\nPossible VRF Request command: ", - fmt.Sprintf("go run . eoa-request --consumer-address %s --sub-id %d --key-hash %s", consumerAddress, subID, keyHash), + fmt.Sprintf("go run . eoa-load-test-request-with-metrics --consumer-address=%s --sub-id=%d --key-hash=%s --request-confirmations %d --requests 1 --runs 1 --cb-gas-limit 1_000_000", consumerAddress, subID, keyHash, *coordinatorConfig.MinConfs), + "\nRetrieve Request Status: ", + fmt.Sprintf("go run . eoa-load-test-read-metrics --consumer-address=%s", consumerAddress), "\nA node can now be configured to run a VRF job with the below job spec :\n", - formattedJobSpec, - "\n----------------------------", + formattedVrfV2PlusPrimaryJobSpec, ) + + return model.JobSpecs{ + VRFPrimaryNode: formattedVrfV2PlusPrimaryJobSpec, + VRFBackupyNode: formattedVrfV2PlusBackupJobSpec, + BHSNode: formattedBHSJobSpec, + BHSBackupNode: formattedBHSBackupJobSpec, + BHFNode: formattedBHFJobSpec, + } } -func deployWrapperUniverse(e helpers.Environment) { +func DeployWrapperUniverse(e helpers.Environment) { cmd := flag.NewFlagSet("wrapper-universe-deploy", flag.ExitOnError) linkAddress := cmd.String("link-address", "", "address of link token") linkETHFeedAddress := cmd.String("link-eth-feed", "", "address of link-eth-feed") @@ -691,12 +789,12 @@ func deployWrapperUniverse(e helpers.Environment) { panic(fmt.Sprintf("failed to parse top up amount '%s'", *subFunding)) } - wrapper, subID := wrapperDeploy(e, + wrapper, subID := WrapperDeploy(e, common.HexToAddress(*linkAddress), common.HexToAddress(*linkETHFeedAddress), common.HexToAddress(*coordinatorAddress)) - wrapperConfigure(e, + WrapperConfigure(e, wrapper, *wrapperGasOverhead, *coordinatorGasOverhead, @@ -709,14 +807,14 @@ func deployWrapperUniverse(e helpers.Environment) { uint32(*fulfillmentFlatFeeNativePPM), ) - consumer := wrapperConsumerDeploy(e, + consumer := WrapperConsumerDeploy(e, common.HexToAddress(*linkAddress), wrapper) coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(common.HexToAddress(*coordinatorAddress), e.Ec) helpers.PanicErr(err) - eoaFundSubscription(e, *coordinator, *linkAddress, amount, subID) + EoaFundSubWithLink(e, *coordinator, *linkAddress, amount, subID) link, err := link_token_interface.NewLinkToken(common.HexToAddress(*linkAddress), e.Ec) helpers.PanicErr(err) diff --git a/core/scripts/vrfv2plus/testnet/util.go b/core/scripts/vrfv2plus/testnet/v2plusscripts/util.go similarity index 79% rename from core/scripts/vrfv2plus/testnet/util.go rename to core/scripts/vrfv2plus/testnet/v2plusscripts/util.go index 2aeb71bd598..ebe881a9951 100644 --- a/core/scripts/vrfv2plus/testnet/util.go +++ b/core/scripts/vrfv2plus/testnet/v2plusscripts/util.go @@ -1,9 +1,10 @@ -package main +package v2plusscripts import ( "context" "encoding/hex" "fmt" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" "math/big" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -22,19 +23,19 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func deployBHS(e helpers.Environment) (blockhashStoreAddress common.Address) { +func DeployBHS(e helpers.Environment) (blockhashStoreAddress common.Address) { _, tx, _, err := blockhash_store.DeployBlockhashStore(e.Owner, e.Ec) helpers.PanicErr(err) return helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) } -func deployBatchBHS(e helpers.Environment, bhsAddress common.Address) (batchBHSAddress common.Address) { +func DeployBatchBHS(e helpers.Environment, bhsAddress common.Address) (batchBHSAddress common.Address) { _, tx, _, err := batch_blockhash_store.DeployBatchBlockhashStore(e.Owner, e.Ec, bhsAddress) helpers.PanicErr(err) return helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) } -func deployCoordinator( +func DeployCoordinator( e helpers.Environment, linkAddress string, bhsAddress string, @@ -58,27 +59,31 @@ func deployCoordinator( return coordinatorAddress } -func deployBatchCoordinatorV2(e helpers.Environment, coordinatorAddress common.Address) (batchCoordinatorAddress common.Address) { +func DeployBatchCoordinatorV2(e helpers.Environment, coordinatorAddress common.Address) (batchCoordinatorAddress common.Address) { _, tx, _, err := batch_vrf_coordinator_v2plus.DeployBatchVRFCoordinatorV2Plus(e.Owner, e.Ec, coordinatorAddress) helpers.PanicErr(err) return helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) } -func eoaAddConsumerToSub(e helpers.Environment, - coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, subID *big.Int, consumerAddress string) { +func EoaAddConsumerToSub( + e helpers.Environment, + coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, + subID *big.Int, + consumerAddress string, +) { txadd, err := coordinator.AddConsumer(e.Owner, subID, common.HexToAddress(consumerAddress)) helpers.PanicErr(err) helpers.ConfirmTXMined(context.Background(), e.Ec, txadd, e.ChainID) } -func eoaCreateSub(e helpers.Environment, coordinator vrf_coordinator_v2_5.VRFCoordinatorV25) { +func EoaCreateSub(e helpers.Environment, coordinator vrf_coordinator_v2_5.VRFCoordinatorV25) { tx, err := coordinator.CreateSubscription(e.Owner) helpers.PanicErr(err) helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID) } // returns subscription ID that belongs to the given owner. Returns result found first -func findSubscriptionID(e helpers.Environment, coordinator *vrf_coordinator_v2_5.VRFCoordinatorV25) *big.Int { +func FindSubscriptionID(e helpers.Environment, coordinator *vrf_coordinator_v2_5.VRFCoordinatorV25) *big.Int { // Use most recent 500 blocks as search window. head, err := e.Ec.BlockNumber(context.Background()) helpers.PanicErr(err) @@ -95,7 +100,7 @@ func findSubscriptionID(e helpers.Environment, coordinator *vrf_coordinator_v2_5 return subscriptionIterator.Event.SubId } -func eoaDeployConsumer(e helpers.Environment, +func EoaDeployConsumer(e helpers.Environment, coordinatorAddress string, linkAddress string) ( consumerAddress common.Address) { @@ -108,13 +113,17 @@ func eoaDeployConsumer(e helpers.Environment, return helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) } -func eoaFundSubscription(e helpers.Environment, - coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, linkAddress string, amount, subID *big.Int) { +func EoaFundSubWithLink( + e helpers.Environment, + coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, + linkAddress string, amount, + subID *big.Int, +) { linkToken, err := link_token_interface.NewLinkToken(common.HexToAddress(linkAddress), e.Ec) helpers.PanicErr(err) bal, err := linkToken.BalanceOf(nil, e.Owner.From) helpers.PanicErr(err) - fmt.Println("Initial account balance:", bal, e.Owner.From.String(), "Funding amount:", amount.String()) + fmt.Println("Initial account balance (Juels):", bal, e.Owner.From.String(), "Funding amount:", amount.String()) b, err := utils.ABIEncode(`[{"type":"uint256"}]`, subID) helpers.PanicErr(err) tx, err := linkToken.TransferAndCall(e.Owner, coordinator.Address(), amount, b) @@ -122,7 +131,16 @@ func eoaFundSubscription(e helpers.Environment, helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID, fmt.Sprintf("sub ID: %d", subID)) } -func printCoordinatorConfig(coordinator *vrf_coordinator_v2_5.VRFCoordinatorV25) { +func EoaFundSubWithNative(e helpers.Environment, coordinatorAddress common.Address, subID *big.Int, amount *big.Int) { + coordinator, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(coordinatorAddress, e.Ec) + helpers.PanicErr(err) + e.Owner.Value = amount + tx, err := coordinator.FundSubscriptionWithNative(e.Owner, subID) + helpers.PanicErr(err) + helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID) +} + +func PrintCoordinatorConfig(coordinator *vrf_coordinator_v2_5.VRFCoordinatorV25) { cfg, err := coordinator.SConfig(nil) helpers.PanicErr(err) @@ -133,7 +151,7 @@ func printCoordinatorConfig(coordinator *vrf_coordinator_v2_5.VRFCoordinatorV25) fmt.Printf("Coordinator fee config: %+v\n", feeConfig) } -func setCoordinatorConfig( +func SetCoordinatorConfig( e helpers.Environment, coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, minConfs uint16, @@ -156,7 +174,7 @@ func setCoordinatorConfig( helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID) } -func registerCoordinatorProvingKey(e helpers.Environment, +func RegisterCoordinatorProvingKey(e helpers.Environment, coordinator vrf_coordinator_v2_5.VRFCoordinatorV25, uncompressed string, oracleAddress string) { pubBytes, err := hex.DecodeString(uncompressed) helpers.PanicErr(err) @@ -176,7 +194,7 @@ func registerCoordinatorProvingKey(e helpers.Environment, ) } -func wrapperDeploy( +func WrapperDeploy( e helpers.Environment, link, linkEthFeed, coordinator common.Address, ) (common.Address, *big.Int) { @@ -199,7 +217,7 @@ func wrapperDeploy( return address, subID } -func wrapperConfigure( +func WrapperConfigure( e helpers.Environment, wrapperAddress common.Address, wrapperGasOverhead, coordinatorGasOverhead, premiumPercentage uint, @@ -230,7 +248,7 @@ func wrapperConfigure( helpers.ConfirmTXMined(context.Background(), e.Ec, tx, e.ChainID) } -func wrapperConsumerDeploy( +func WrapperConsumerDeploy( e helpers.Environment, link, wrapper common.Address, ) common.Address { @@ -243,3 +261,13 @@ func wrapperConsumerDeploy( fmt.Printf("VRFV2WrapperConsumerExample address: %s\n", address) return address } + +func EoaV2PlusLoadTestConsumerWithMetricsDeploy(e helpers.Environment, consumerCoordinator string) (consumerAddress common.Address) { + _, tx, _, err := vrf_v2plus_load_test_with_metrics.DeployVRFV2PlusLoadTestWithMetrics( + e.Owner, + e.Ec, + common.HexToAddress(consumerCoordinator), + ) + helpers.PanicErr(err) + return helpers.ConfirmContractDeployed(context.Background(), e.Ec, tx, e.ChainID) +} From a4154c752af09eb02df961ffdac6b5bec1434fa3 Mon Sep 17 00:00:00 2001 From: george-dorin <120329946+george-dorin@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:28:52 +0300 Subject: [PATCH 76/84] Set aliveLoopSub (#10893) --- core/chains/evm/client/node_lifecycle.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/chains/evm/client/node_lifecycle.go b/core/chains/evm/client/node_lifecycle.go index d55df58d6ef..609d1522ea5 100644 --- a/core/chains/evm/client/node_lifecycle.go +++ b/core/chains/evm/client/node_lifecycle.go @@ -97,6 +97,7 @@ func (n *node) aliveLoop() { n.declareUnreachable() return } + n.aliveLoopSub = sub defer sub.Unsubscribe() var outOfSyncT *time.Ticker From 743ee499821a8238bc5b7212b2b31979162a1d6b Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 10 Oct 2023 07:29:55 -0500 Subject: [PATCH 77/84] shadow: declaration of X shadows declaration at line 913 (govet) (#10890) --- core/chains/evm/txmgr/confirmer_test.go | 155 ++++++++++-------------- core/cmd/admin_commands.go | 5 +- core/cmd/ocr2vrf_configure_commands.go | 93 ++++++++------ core/cmd/shell_local.go | 3 +- core/internal/cltest/cltest.go | 10 +- 5 files changed, 126 insertions(+), 140 deletions(-) diff --git a/core/chains/evm/txmgr/confirmer_test.go b/core/chains/evm/txmgr/confirmer_test.go index e0070e35b17..6a1c50d1949 100644 --- a/core/chains/evm/txmgr/confirmer_test.go +++ b/core/chains/evm/txmgr/confirmer_test.go @@ -187,8 +187,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { _, fromAddress := cltest.MustAddRandomKeyToKeystore(t, ethKeyStore) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) nonce := int64(0) ctx := testutils.Context(t) @@ -605,9 +604,7 @@ func TestEthConfirmer_CheckForReceipts_batching(t *testing.T) { evmcfg := evmtest.NewChainScopedConfig(t, cfg) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) - + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) ctx := testutils.Context(t) etx := cltest.MustInsertUnconfirmedEthTx(t, txStore, 0, fromAddress) @@ -667,8 +664,7 @@ func TestEthConfirmer_CheckForReceipts_HandlesNonFwdTxsWithForwardingEnabled(t * evmcfg := evmtest.NewChainScopedConfig(t, cfg) _, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore, 0) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) ctx := testutils.Context(t) // tx is not forwarded and doesn't have meta set. EthConfirmer should handle nil meta values etx := cltest.MustInsertUnconfirmedEthTx(t, txStore, 0, fromAddress) @@ -721,9 +717,7 @@ func TestEthConfirmer_CheckForReceipts_only_likely_confirmed(t *testing.T) { evmcfg := evmtest.NewChainScopedConfig(t, cfg) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) - + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) ctx := testutils.Context(t) var attempts []txmgr.TxAttempt @@ -777,9 +771,7 @@ func TestEthConfirmer_CheckForReceipts_should_not_check_for_likely_unconfirmed(t ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) - + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) ctx := testutils.Context(t) etx := cltest.MustInsertUnconfirmedEthTx(t, txStore, 1, fromAddress) @@ -811,8 +803,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt_scoped_to_key(t ethClient.On("SequenceAt", mock.Anything, mock.Anything, mock.Anything).Return(evmtypes.Nonce(20), nil) evmcfg := evmtest.NewChainScopedConfig(t, cfg) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) ctx := testutils.Context(t) // STATE @@ -879,9 +870,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { evmcfg := evmtest.NewChainScopedConfig(t, cfg) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) - + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) ctx := testutils.Context(t) // STATE @@ -961,7 +950,8 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { // Expected state is that the "top" eth_tx is now confirmed, with the // two below it "confirmed_missing_receipt" and the "bottom" eth_tx also confirmed - etx3, err := txStore.FindTxWithAttempts(etx3.ID) + var err error + etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) require.Equal(t, txmgrcommon.TxConfirmed, etx3.State) @@ -1021,7 +1011,8 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { // Expected state is that the "top" two eth_txes are now confirmed, with the // one below it still "confirmed_missing_receipt" and the bottom one remains confirmed - etx3, err := txStore.FindTxWithAttempts(etx3.ID) + var err error + etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) require.Equal(t, txmgrcommon.TxConfirmed, etx3.State) etx2, err = txStore.FindTxWithAttempts(etx2.ID) @@ -1065,7 +1056,8 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { // Expected state is that the "top" two eth_txes are now confirmed, with the // one below it still "confirmed_missing_receipt" and the bottom one remains confirmed - etx3, err := txStore.FindTxWithAttempts(etx3.ID) + var err error + etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) require.Equal(t, txmgrcommon.TxConfirmed, etx3.State) etx2, err = txStore.FindTxWithAttempts(etx2.ID) @@ -1105,7 +1097,8 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { // Expected state is that the "top" two eth_txes are now confirmed, with the // one below it marked as "fatal_error" and the bottom one remains confirmed - etx3, err := txStore.FindTxWithAttempts(etx3.ID) + var err error + etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) require.Equal(t, txmgrcommon.TxConfirmed, etx3.State) etx2, err = txStore.FindTxWithAttempts(etx2.ID) @@ -1137,9 +1130,7 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt(t *testing.T) { evmcfg := evmtest.NewChainScopedConfig(t, cfg) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) - + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) ctx := testutils.Context(t) // STATE @@ -1182,6 +1173,7 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt(t *testing.T) { // Expected state is that the "top" eth_tx is untouched but the other two // are marked as unconfirmed + var err error etx0, err = txStore.FindTxWithAttempts(etx0.ID) assert.NoError(t, err) assert.Equal(t, txmgrcommon.TxConfirmedMissingReceipt, etx0.State) @@ -1217,9 +1209,7 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt_batchSendTransactions_fails(t evmcfg := evmtest.NewChainScopedConfig(t, cfg) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) - + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) ctx := testutils.Context(t) // STATE @@ -1250,6 +1240,7 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt_batchSendTransactions_fails(t require.NoError(t, ec.CheckConfirmedMissingReceipt(ctx)) // Expected state is that all txes are marked as unconfirmed, since the batch call had failed + var err error etx0, err = txStore.FindTxWithAttempts(etx0.ID) assert.NoError(t, err) assert.Equal(t, txmgrcommon.TxUnconfirmed, etx0.State) @@ -1282,9 +1273,7 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt_smallEvmRPCBatchSize_middleBa evmcfg := evmtest.NewChainScopedConfig(t, cfg) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) - + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) ctx := testutils.Context(t) // STATE @@ -1321,6 +1310,7 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt_smallEvmRPCBatchSize_middleBa require.NoError(t, ec.CheckConfirmedMissingReceipt(ctx)) // Expected state is that all transactions since failed batch will be unconfirmed + var err error etx0, err = txStore.FindTxWithAttempts(etx0.ID) assert.NoError(t, err) assert.Equal(t, txmgrcommon.TxConfirmedMissingReceipt, etx0.State) @@ -1365,8 +1355,7 @@ func TestEthConfirmer_FindTxsRequiringRebroadcast(t *testing.T) { lggr := logger.TestLogger(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) t.Run("returns nothing when there are no transactions", func(t *testing.T) { etxs, err := ec.FindTxsRequiringRebroadcast(testutils.Context(t), lggr, evmFromAddress, currentHead, gasBumpThreshold, 10, 0, &cltest.FixtureChainID) @@ -1747,8 +1736,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { addresses := []gethCommon.Address{fromAddress} kst.On("EnabledAddressesForChain", &cltest.FixtureChainID).Return(addresses, nil).Maybe() // Use a mock keystore for this test - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, kst, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, kst, nil) currentHead := int64(30) oldEnough := int64(19) nonce := int64(0) @@ -1773,7 +1761,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { mock.Anything).Return(nil, errors.New("signing error")).Once() // Do the thing - err = ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead) + err := ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead) require.Error(t, err) require.Contains(t, err.Error(), "signing error") @@ -1804,7 +1792,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -1836,7 +1824,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -1875,7 +1863,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -1891,7 +1879,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { t.Run("does nothing if there is an attempt without BroadcastBeforeBlockNum set", func(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -1921,7 +1909,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -1961,7 +1949,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx, err = txStore.FindTxWithAttempts(etx.ID) require.NoError(t, err) @@ -2012,7 +2000,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { }), fromAddress).Return(clienttypes.Unknown, errors.New("some network error")).Once() // Do the thing - err = ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead) + err := ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead) require.Error(t, err) require.Contains(t, err.Error(), "some network error") @@ -2080,6 +2068,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Creates new attempt as normal if currentHead is not high enough require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) + var err error etx2, err = txStore.FindTxWithAttempts(etx2.ID) require.NoError(t, err) assert.Equal(t, txmgrcommon.TxConfirmedMissingReceipt, etx2.State) @@ -2120,7 +2109,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) @@ -2157,7 +2146,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) @@ -2196,7 +2185,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) @@ -2217,8 +2206,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { c.EVM[0].GasEstimator.PriceMax = assets.NewWeiI(60500000000) }) newCfg := evmtest.NewChainScopedConfig(t, gcfg) - ec2, err := cltest.NewEthConfirmer(t, txStore, ethClient, newCfg, ethKeyStore, nil) - require.NoError(t, err) + ec2 := cltest.NewEthConfirmer(t, txStore, ethClient, newCfg, ethKeyStore, nil) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return evmtypes.Nonce(tx.Nonce()) == *etx3.Sequence && gasPrice.Cmp(tx.GasPrice()) == 0 @@ -2226,7 +2214,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec2.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) @@ -2248,8 +2236,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { c.EVM[0].GasEstimator.PriceMax = assets.NewWeiI(60480000000) }) newCfg := evmtest.NewChainScopedConfig(t, gcfg) - ec2, err := cltest.NewEthConfirmer(t, txStore, ethClient, newCfg, ethKeyStore, nil) - require.NoError(t, err) + ec2 := cltest.NewEthConfirmer(t, txStore, ethClient, newCfg, ethKeyStore, nil) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return evmtypes.Nonce(tx.Nonce()) == *etx3.Sequence && gasPrice.Cmp(tx.GasPrice()) == 0 @@ -2257,7 +2244,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do the thing require.NoError(t, ec2.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx3, err = txStore.FindTxWithAttempts(etx3.ID) require.NoError(t, err) @@ -2294,7 +2281,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { return evmtypes.Nonce(tx.Nonce()) == *etx4.Sequence && gasTipCap.ToInt().Cmp(tx.GasTipCap()) == 0 }), fromAddress).Return(clienttypes.Successful, nil).Once() require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx4, err = txStore.FindTxWithAttempts(etx4.ID) require.NoError(t, err) @@ -2317,8 +2304,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { c.EVM[0].GasEstimator.PriceMax = assets.GWei(1000) }) newCfg := evmtest.NewChainScopedConfig(t, gcfg) - ec2, err := cltest.NewEthConfirmer(t, txStore, ethClient, newCfg, ethKeyStore, nil) - require.NoError(t, err) + ec2 := cltest.NewEthConfirmer(t, txStore, ethClient, newCfg, ethKeyStore, nil) // Third attempt failed to bump, resubmits old one instead ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { @@ -2326,7 +2312,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { }), fromAddress).Return(clienttypes.Successful, nil).Once() require.NoError(t, ec2.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx4, err = txStore.FindTxWithAttempts(etx4.ID) require.NoError(t, err) @@ -2364,7 +2350,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) { // Do it require.NoError(t, ec.RebroadcastWhereNecessary(testutils.Context(t), currentHead)) - + var err error etx4, err = txStore.FindTxWithAttempts(etx4.ID) require.NoError(t, err) @@ -2405,8 +2391,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyUnderpriced_ThenGoesTh t.Run("terminally underpriced transaction with in_progress attempt is retried with more gas", func(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, kst, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, kst, nil) originalBroadcastAt := time.Unix(1616509100, 0) etx := cltest.MustInsertUnconfirmedEthTxWithAttemptState(t, txStore, nonce, fromAddress, txmgrtypes.TxAttemptInProgress, originalBroadcastAt) @@ -2432,8 +2417,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyUnderpriced_ThenGoesTh t.Run("multiple gas bumps with existing broadcast attempts are retried with more gas until success in legacy mode", func(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, kst, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, kst, nil) etx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, nonce, fromAddress) nonce++ @@ -2465,8 +2449,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyUnderpriced_ThenGoesTh t.Run("multiple gas bumps with existing broadcast attempts are retried with more gas until success in EIP-1559 mode", func(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, kst, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, kst, nil) etx := cltest.MustInsertUnconfirmedEthTxWithBroadcastDynamicFeeAttempt(t, txStore, nonce, fromAddress) nonce++ @@ -2531,8 +2514,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { insufficientEthError := errors.New("insufficient funds for gas * price + value") t.Run("saves attempt with state 'insufficient_eth' if eth node returns this error", func(t *testing.T) { - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) expectedBumpedGasPrice := big.NewInt(20000000000) require.Greater(t, expectedBumpedGasPrice.Int64(), attempt1_1.TxFee.Legacy.ToInt().Int64()) @@ -2558,8 +2540,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { }) t.Run("does not bump gas when previous error was 'out of eth', instead resubmits existing transaction", func(t *testing.T) { - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) expectedBumpedGasPrice := big.NewInt(20000000000) require.Greater(t, expectedBumpedGasPrice.Int64(), attempt1_1.TxFee.Legacy.ToInt().Int64()) @@ -2584,8 +2565,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { }) t.Run("saves the attempt as broadcast after node wallet has been topped up with sufficient balance", func(t *testing.T) { - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) expectedBumpedGasPrice := big.NewInt(20000000000) require.Greater(t, expectedBumpedGasPrice.Int64(), attempt1_1.TxFee.Legacy.ToInt().Int64()) @@ -2617,8 +2597,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { c.EVM[0].GasEstimator.BumpTxDepth = ptr(uint32(depth)) }) evmcfg := evmtest.NewChainScopedConfig(t, cfg) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, nil) for i := 0; i < etxCount; i++ { n := nonce @@ -2653,8 +2632,7 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) config := newTestChainScopedConfig(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) head := evmtypes.Head{ Hash: utils.NewHash(), @@ -2835,8 +2813,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { t.Run("rebroadcasts one eth_tx if it falls within in nonce range", func(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx1.Sequence) && @@ -2851,8 +2828,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { t.Run("uses default gas limit if overrideGasLimit is 0", func(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx1.Sequence) && @@ -2867,8 +2843,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { t.Run("rebroadcasts several eth_txes in nonce range", func(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(*etx1.Sequence) && tx.GasPrice().Int64() == gasPriceWei.Legacy.Int64() && tx.Gas() == uint64(overrideGasLimit) @@ -2882,8 +2857,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { t.Run("broadcasts zero transactions if eth_tx doesn't exist for that nonce", func(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(1) @@ -2909,8 +2883,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { t.Run("zero transactions use default gas limit if override wasn't specified", func(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) - require.NoError(t, err) + ec := cltest.NewEthConfirmer(t, txStore, ethClient, config, ethKeyStore, nil) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { return tx.Nonce() == uint64(0) && tx.GasPrice().Int64() == gasPriceWei.Legacy.Int64() && uint32(tx.Gas()) == config.EVM().GasEstimator().LimitDefault() @@ -2954,11 +2927,10 @@ func TestEthConfirmer_ResumePendingRuns(t *testing.T) { pgtest.MustExec(t, db, `SET CONSTRAINTS pipeline_runs_pipeline_spec_id_fkey DEFERRED`) t.Run("doesn't process task runs that are not suspended (possibly already previously resumed)", func(t *testing.T) { - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, func(uuid.UUID, interface{}, error) error { + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, func(uuid.UUID, interface{}, error) error { t.Fatal("No value expected") return nil }) - require.NoError(t, err) run := cltest.MustInsertPipelineRun(t, db) tr := cltest.MustInsertUnfinishedPipelineTaskRun(t, db, run.ID) @@ -2967,17 +2939,16 @@ func TestEthConfirmer_ResumePendingRuns(t *testing.T) { cltest.MustInsertEthReceipt(t, txStore, head.Number-minConfirmations, head.Hash, etx.TxAttempts[0].Hash) pgtest.MustExec(t, db, `UPDATE evm.txes SET pipeline_task_run_id = $1, min_confirmations = $2 WHERE id = $3`, &tr.ID, minConfirmations, etx.ID) - err = ec.ResumePendingTaskRuns(testutils.Context(t), &head) + err := ec.ResumePendingTaskRuns(testutils.Context(t), &head) require.NoError(t, err) }) t.Run("doesn't process task runs where the receipt is younger than minConfirmations", func(t *testing.T) { - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, func(uuid.UUID, interface{}, error) error { + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, func(uuid.UUID, interface{}, error) error { t.Fatal("No value expected") return nil }) - require.NoError(t, err) run := cltest.MustInsertPipelineRun(t, db) tr := cltest.MustInsertUnfinishedPipelineTaskRun(t, db, run.ID) @@ -2987,7 +2958,7 @@ func TestEthConfirmer_ResumePendingRuns(t *testing.T) { pgtest.MustExec(t, db, `UPDATE evm.txes SET pipeline_task_run_id = $1, min_confirmations = $2 WHERE id = $3`, &tr.ID, minConfirmations, etx.ID) - err = ec.ResumePendingTaskRuns(testutils.Context(t), &head) + err := ec.ResumePendingTaskRuns(testutils.Context(t), &head) require.NoError(t, err) }) @@ -2995,12 +2966,11 @@ func TestEthConfirmer_ResumePendingRuns(t *testing.T) { t.Run("processes eth_txes with receipts older than minConfirmations", func(t *testing.T) { ch := make(chan interface{}) var err error - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, func(id uuid.UUID, value interface{}, thisErr error) error { + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, func(id uuid.UUID, value interface{}, thisErr error) error { err = thisErr ch <- value return nil }) - require.NoError(t, err) run := cltest.MustInsertPipelineRun(t, db) tr := cltest.MustInsertUnfinishedPipelineTaskRun(t, db, run.ID) @@ -3035,12 +3005,11 @@ func TestEthConfirmer_ResumePendingRuns(t *testing.T) { t.Run("processes eth_txes with receipt older than minConfirmations that reverted", func(t *testing.T) { ch := make(chan interface{}) var err error - ec, err := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, func(id uuid.UUID, value interface{}, thisErr error) error { + ec := cltest.NewEthConfirmer(t, txStore, ethClient, evmcfg, ethKeyStore, func(id uuid.UUID, value interface{}, thisErr error) error { err = thisErr ch <- value return nil }) - require.NoError(t, err) run := cltest.MustInsertPipelineRun(t, db) tr := cltest.MustInsertUnfinishedPipelineTaskRun(t, db, run.ID) diff --git a/core/cmd/admin_commands.go b/core/cmd/admin_commands.go index 6ff7a5f6312..5daf5b4b1e6 100644 --- a/core/cmd/admin_commands.go +++ b/core/cmd/admin_commands.go @@ -204,7 +204,7 @@ func (s *Shell) CreateUser(c *cli.Context) (err error) { }() var links jsonapi.Links var users AdminUsersPresenters - if err := s.deserializeAPIResponse(resp, &users, &links); err != nil { + if err = s.deserializeAPIResponse(resp, &users, &links); err != nil { return s.errorOut(err) } for _, user := range users { @@ -316,8 +316,7 @@ func (s *Shell) Profile(c *cli.Context) error { genDir := filepath.Join(baseDir, fmt.Sprintf("debuginfo-%s", time.Now().Format(time.RFC3339))) - err := os.Mkdir(genDir, 0o755) - if err != nil { + if err := os.Mkdir(genDir, 0o755); err != nil { return s.errorOut(err) } var wgPprof sync.WaitGroup diff --git a/core/cmd/ocr2vrf_configure_commands.go b/core/cmd/ocr2vrf_configure_commands.go index 01bfd89c32b..c218485c96a 100644 --- a/core/cmd/ocr2vrf_configure_commands.go +++ b/core/cmd/ocr2vrf_configure_commands.go @@ -14,6 +14,8 @@ import ( "github.com/pkg/errors" "github.com/urfave/cli" + "github.com/smartcontractkit/sqlx" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/authorized_forwarder" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -202,47 +204,12 @@ func (s *Shell) ConfigureOCR2VRFNode(c *cli.Context, owner *bind.TransactOpts, e } if useForwarder { - // Replace the transmitter ID with the forwarder address. - forwarderAddress := c.String("forwarder-address") - - ks := app.GetKeyStore().Eth() - // Add extra sending keys if using a forwarder. - for i := 0; i < forwarderAdditionalEOACount; i++ { - - // Create the sending key in the keystore. - k, err := ks.Create() - if err != nil { - return nil, err - } - - // Enable the sending key for the current chain. - err = ks.Enable(k.Address, big.NewInt(chainID)) - if err != nil { - return nil, err - } - - sendingKeys = append(sendingKeys, k.Address.String()) - sendingKeysAddresses = append(sendingKeysAddresses, k.Address) - } - - // We have to set the authorized senders on-chain here, otherwise the job spawner will fail as the - // forwarder will not be recognized. - ctx, cancel := context.WithTimeout(context.Background(), 300*time.Second) - defer cancel() - f, err := authorized_forwarder.NewAuthorizedForwarder(common.HexToAddress(forwarderAddress), ec) - tx, err := f.SetAuthorizedSenders(owner, sendingKeysAddresses) + sendingKeys, sendingKeysAddresses, err = s.appendForwarders(chainID, app.GetKeyStore().Eth(), sendingKeys, sendingKeysAddresses) if err != nil { return nil, err } - _, err = bind.WaitMined(ctx, ec, tx) - if err != nil { - return nil, err - } - - // Create forwarder for management in forwarder_manager.go. - orm := forwarders.NewORM(ldb.DB(), lggr, s.Config.Database()) - _, err = orm.CreateForwarder(common.HexToAddress(forwarderAddress), *utils.NewBigI(chainID)) + err = s.authorizeForwarder(c, ldb.DB(), lggr, chainID, ec, owner, sendingKeysAddresses) if err != nil { return nil, err } @@ -331,6 +298,58 @@ func (s *Shell) ConfigureOCR2VRFNode(c *cli.Context, owner *bind.TransactOpts, e }, nil } +func (s *Shell) appendForwarders(chainID int64, ks keystore.Eth, sendingKeys []string, sendingKeysAddresses []common.Address) ([]string, []common.Address, error) { + for i := 0; i < forwarderAdditionalEOACount; i++ { + // Create the sending key in the keystore. + k, err := ks.Create() + if err != nil { + return nil, nil, err + } + + // Enable the sending key for the current chain. + err = ks.Enable(k.Address, big.NewInt(chainID)) + if err != nil { + return nil, nil, err + } + + sendingKeys = append(sendingKeys, k.Address.String()) + sendingKeysAddresses = append(sendingKeysAddresses, k.Address) + } + + return sendingKeys, sendingKeysAddresses, nil +} + +func (s *Shell) authorizeForwarder(c *cli.Context, db *sqlx.DB, lggr logger.Logger, chainID int64, ec *ethclient.Client, owner *bind.TransactOpts, sendingKeysAddresses []common.Address) error { + // Replace the transmitter ID with the forwarder address. + forwarderAddress := c.String("forwarder-address") + + // We have to set the authorized senders on-chain here, otherwise the job spawner will fail as the + // forwarder will not be recognized. + ctx, cancel := context.WithTimeout(context.Background(), 300*time.Second) + defer cancel() + f, err := authorized_forwarder.NewAuthorizedForwarder(common.HexToAddress(forwarderAddress), ec) + if err != nil { + return err + } + tx, err := f.SetAuthorizedSenders(owner, sendingKeysAddresses) + if err != nil { + return err + } + _, err = bind.WaitMined(ctx, ec, tx) + if err != nil { + return err + } + + // Create forwarder for management in forwarder_manager.go. + orm := forwarders.NewORM(db, lggr, s.Config.Database()) + _, err = orm.CreateForwarder(common.HexToAddress(forwarderAddress), *utils.NewBigI(chainID)) + if err != nil { + return err + } + + return nil +} + func setupKeystore(cli *Shell, app chainlink.Application, keyStore keystore.Master) error { err := cli.KeyStoreAuthenticator.authenticate(keyStore, cli.Config.Password()) if err != nil { diff --git a/core/cmd/shell_local.go b/core/cmd/shell_local.go index 372aad01384..613e8f5a6e0 100644 --- a/core/cmd/shell_local.go +++ b/core/cmd/shell_local.go @@ -292,8 +292,7 @@ func (s *Shell) runNode(c *cli.Context) error { s.Config.LogConfiguration(lggr.Debugf) - err := s.Config.Validate() - if err != nil { + if err := s.Config.Validate(); err != nil { return errors.Wrap(err, "config validation failed") } diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index 671d4072816..4f573078587 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -33,14 +33,15 @@ import ( p2ppeer "github.com/libp2p/go-libp2p-core/peer" "github.com/manyminds/api2go/jsonapi" "github.com/onsi/gomega" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" - "github.com/smartcontractkit/sqlx" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/tidwall/gjson" "github.com/urfave/cli" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" + "github.com/smartcontractkit/sqlx" + "github.com/smartcontractkit/chainlink-relay/pkg/loop" clienttypes "github.com/smartcontractkit/chainlink/v2/common/chains/client" @@ -209,8 +210,7 @@ func NewEventBroadcaster(t testing.TB, dbURL url.URL) pg.EventBroadcaster { return pg.NewEventBroadcaster(dbURL, 0, 0, lggr, uuid.New()) } -func NewEthConfirmer(t testing.TB, txStore txmgr.EvmTxStore, ethClient evmclient.Client, config evmconfig.ChainScopedConfig, ks keystore.Eth, fn txmgrcommon.ResumeCallback) (*txmgr.Confirmer, error) { - t.Helper() +func NewEthConfirmer(t testing.TB, txStore txmgr.EvmTxStore, ethClient evmclient.Client, config evmconfig.ChainScopedConfig, ks keystore.Eth, fn txmgrcommon.ResumeCallback) *txmgr.Confirmer { lggr := logger.TestLogger(t) ge := config.EVM().GasEstimator() estimator := gas.NewWrappedEvmEstimator(gas.NewFixedPriceEstimator(ge, ge.BlockHistory(), lggr), ge.EIP1559DynamicFees(), nil) @@ -218,7 +218,7 @@ func NewEthConfirmer(t testing.TB, txStore txmgr.EvmTxStore, ethClient evmclient ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient), txmgr.NewEvmTxmConfig(config.EVM()), txmgr.NewEvmTxmFeeConfig(ge), config.EVM().Transactions(), config.Database(), ks, txBuilder, lggr) ec.SetResumeCallback(fn) require.NoError(t, ec.Start(testutils.Context(t))) - return ec, nil + return ec } // TestApplication holds the test application and test servers From 2ce9e60414c57b80a289ceaa5beb9d8052e330b6 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Tue, 10 Oct 2023 15:42:35 +0200 Subject: [PATCH 78/84] bump foundry version (#10889) * bump foundry version * bump forge-std 1.6.1 -> 1.7.1 * fix snapshot and rm failfast CI * turn off failing tests with TODO * bump foundry version * bump foundry version (#10896) * run prettier * fix wrong prettier --------- Co-authored-by: Makram --- .github/workflows/solidity-foundry.yml | 3 +- contracts/GNUmakefile | 2 +- contracts/foundry-lib/forge-std | 2 +- .../gas-snapshots/functions.gas-snapshot | 12 ++-- .../gas-snapshots/llo-feeds.gas-snapshot | 32 +++++------ .../test/v0.8/foundry/vrf/VRFV2Plus.t.sol | 56 +++++++++---------- 6 files changed, 54 insertions(+), 53 deletions(-) diff --git a/.github/workflows/solidity-foundry.yml b/.github/workflows/solidity-foundry.yml index 8f0181640ea..38b6a511127 100644 --- a/.github/workflows/solidity-foundry.yml +++ b/.github/workflows/solidity-foundry.yml @@ -30,6 +30,7 @@ jobs: tests: strategy: + fail-fast: false matrix: product: [vrf, automation, llo-feeds, functions, shared] needs: [changes] @@ -54,7 +55,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: # Has to match the `make foundry` version. - version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + version: nightly-e0722a10b45859892ec3b998df958a9edc77c202 - name: Run Forge build run: | diff --git a/contracts/GNUmakefile b/contracts/GNUmakefile index 328c921545c..5e9397e2b0e 100644 --- a/contracts/GNUmakefile +++ b/contracts/GNUmakefile @@ -38,7 +38,7 @@ mockery: $(mockery) ## Install mockery. .PHONY: foundry foundry: ## Install foundry. - foundryup --version nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + foundryup --version nightly-e0722a10b45859892ec3b998df958a9edc77c202 .PHONY: foundry-refresh foundry-refresh: foundry diff --git a/contracts/foundry-lib/forge-std b/contracts/foundry-lib/forge-std index 1d9650e9512..f73c73d2018 160000 --- a/contracts/foundry-lib/forge-std +++ b/contracts/foundry-lib/forge-std @@ -1 +1 @@ -Subproject commit 1d9650e951204a0ddce9ff89c32f1997984cef4d +Subproject commit f73c73d2018eb6a111f35e4dae7b4f27401e9421 diff --git a/contracts/gas-snapshots/functions.gas-snapshot b/contracts/gas-snapshots/functions.gas-snapshot index 0c3caa6522e..b2ef072c1f7 100644 --- a/contracts/gas-snapshots/functions.gas-snapshot +++ b/contracts/gas-snapshots/functions.gas-snapshot @@ -95,9 +95,9 @@ FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNotAll FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNotSubscriptionOwner() (gas: 89316) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfPaused() (gas: 20191) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfPendingRequests() (gas: 193222) -FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessForfeitAllBalanceAsDeposit() (gas: 113352) -FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessForfeitSomeBalanceAsDeposit() (gas: 124604) -FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessRecieveDeposit() (gas: 310090) +FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessForfeitAllBalanceAsDeposit() (gas: 114636) +FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessForfeitSomeBalanceAsDeposit() (gas: 125891) +FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessRecieveDeposit() (gas: 311988) FunctionsSubscriptions_Constructor:test_Constructor_Success() (gas: 7654) FunctionsSubscriptions_CreateSubscriptionWithConsumer:test_CreateSubscriptionWithConsumer_RevertIfNotAllowedSender() (gas: 28637) FunctionsSubscriptions_CreateSubscriptionWithConsumer:test_CreateSubscriptionWithConsumer_RevertIfPaused() (gas: 17948) @@ -106,8 +106,8 @@ FunctionsSubscriptions_GetConsumer:test_GetConsumer_Success() (gas: 16225) FunctionsSubscriptions_GetFlags:test_GetFlags_Success() (gas: 40858) FunctionsSubscriptions_GetSubscription:test_GetSubscription_Success() (gas: 30959) FunctionsSubscriptions_GetSubscriptionCount:test_GetSubscriptionCount_Success() (gas: 12967) -FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_RevertIfEndIsAfterLastSubscription() (gas: 14949) -FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_RevertIfStartIsAfterEnd() (gas: 11863) +FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_RevertIfEndIsAfterLastSubscription() (gas: 16523) +FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_RevertIfStartIsAfterEnd() (gas: 13436) FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_Success() (gas: 59568) FunctionsSubscriptions_GetTotalBalance:test_GetTotalBalance_Success() (gas: 15032) FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfCallerIsNoCalldata() (gas: 27594) @@ -124,7 +124,7 @@ FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_SuccessSetsBalanceToZe FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_RevertIfNoSubscription() (gas: 12818) FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_RevertIfNotOwner() (gas: 15549) FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_Success() (gas: 54867) -FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessDeletesSubscription() (gas: 48362) +FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessDeletesSubscription() (gas: 49624) FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessSubOwnerRefunded() (gas: 50896) FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessWhenRequestInFlight() (gas: 163867) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfAmountMoreThanBalance() (gas: 17924) diff --git a/contracts/gas-snapshots/llo-feeds.gas-snapshot b/contracts/gas-snapshots/llo-feeds.gas-snapshot index 74b9a9f9258..a9877fbe33c 100644 --- a/contracts/gas-snapshots/llo-feeds.gas-snapshot +++ b/contracts/gas-snapshots/llo-feeds.gas-snapshot @@ -20,7 +20,7 @@ FeeManagerProcessFeeTest:test_discountIsNoLongerAppliedAfterRemoving() (gas: 459 FeeManagerProcessFeeTest:test_discountIsNotAppliedForInvalidTokenAddress() (gas: 17546) FeeManagerProcessFeeTest:test_discountIsNotAppliedToOtherFeeds() (gas: 54241) FeeManagerProcessFeeTest:test_discountIsReturnedForLink() (gas: 49252) -FeeManagerProcessFeeTest:test_emptyQuoteRevertsWithError() (gas: 11286) +FeeManagerProcessFeeTest:test_emptyQuoteRevertsWithError() (gas: 12152) FeeManagerProcessFeeTest:test_eventIsEmittedAfterSurchargeIsSet() (gas: 41348) FeeManagerProcessFeeTest:test_eventIsEmittedIfNotEnoughLink() (gas: 172711) FeeManagerProcessFeeTest:test_eventIsEmittedUponWithdraw() (gas: 68984) @@ -87,7 +87,7 @@ FeeManagerProcessFeeTest:test_surchargeIsAppliedForNativeFeeWithDiscount() (gas: FeeManagerProcessFeeTest:test_surchargeIsNoLongerAppliedAfterRemoving() (gas: 46503) FeeManagerProcessFeeTest:test_surchargeIsNotAppliedForLinkFee() (gas: 49585) FeeManagerProcessFeeTest:test_surchargeIsNotAppliedWith100PercentDiscount() (gas: 77890) -FeeManagerProcessFeeTest:test_testRevertIfReportHasExpired() (gas: 14042) +FeeManagerProcessFeeTest:test_testRevertIfReportHasExpired() (gas: 14908) RewardManagerClaimTest:test_claimAllRecipients() (gas: 275763) RewardManagerClaimTest:test_claimMultipleRecipients() (gas: 153306) RewardManagerClaimTest:test_claimRewardsWithDuplicatePoolIdsDoesNotPayoutTwice() (gas: 328345) @@ -123,7 +123,7 @@ RewardManagerRecipientClaimMultiplePoolsTest:test_claimSingleUniqueRecipient() ( RewardManagerRecipientClaimMultiplePoolsTest:test_claimUnevenAmountRoundsDown() (gas: 576289) RewardManagerRecipientClaimMultiplePoolsTest:test_claimUnregisteredRecipient() (gas: 63555) RewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorAndTotalPoolsEqual() (gas: 10202) -RewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorCannotBeGreaterThanTotalPools() (gas: 11107) +RewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorCannotBeGreaterThanTotalPools() (gas: 12680) RewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorSingleResult() (gas: 19606) RewardManagerRecipientClaimMultiplePoolsTest:test_getRewardsAvailableToRecipientInBothPools() (gas: 29052) RewardManagerRecipientClaimMultiplePoolsTest:test_getRewardsAvailableToRecipientInBothPoolsWhereAlreadyClaimed() (gas: 147218) @@ -181,11 +181,11 @@ VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrappedReturnsChange( VerifierConstructorTest:test_revertsIfInitializedWithEmptyVerifierProxy() (gas: 59967) VerifierConstructorTest:test_setsTheCorrectProperties() (gas: 1815769) VerifierDeactivateFeedWithVerifyTest:test_currentReportAllowsVerification() (gas: 192062) -VerifierDeactivateFeedWithVerifyTest:test_currentReportFailsVerification() (gas: 111727) +VerifierDeactivateFeedWithVerifyTest:test_currentReportFailsVerification() (gas: 113377) VerifierDeactivateFeedWithVerifyTest:test_previousReportAllowsVerification() (gas: 99613) -VerifierDeactivateFeedWithVerifyTest:test_previousReportFailsVerification() (gas: 68305) +VerifierDeactivateFeedWithVerifyTest:test_previousReportFailsVerification() (gas: 69932) VerifierProxyAccessControlledVerificationTest:test_proxiesToTheVerifierIfHasAccess() (gas: 205796) -VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 110688) +VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 112334) VerifierProxyConstructorTest:test_correctlySetsTheCorrectAccessControllerInterface() (gas: 1482522) VerifierProxyConstructorTest:test_correctlySetsTheOwner() (gas: 1462646) VerifierProxyConstructorTest:test_correctlySetsVersion() (gas: 6873) @@ -207,7 +207,7 @@ VerifierProxyUnsetVerifierTest:test_revertsIfNotAdmin() (gas: 14965) VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_correctlyUnsetsVerifier() (gas: 12720) VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_emitsAnEventAfterUnsettingVerifier() (gas: 17965) VerifierProxyVerifyTest:test_proxiesToTheCorrectVerifier() (gas: 201609) -VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 115615) +VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 117256) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538896) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964726) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520480) @@ -230,17 +230,17 @@ VerifierTestBillingReport:test_verifyWithNativeUnwrapped() (gas: 317892) VerifierTestBillingReport:test_verifyWithNativeUnwrappedReturnsChange() (gas: 324958) VerifierVerifyMultipleConfigDigestTest:test_canVerifyNewerReportsWithNewerConfigs() (gas: 131228) VerifierVerifyMultipleConfigDigestTest:test_canVerifyOlderReportsWithOlderConfigs() (gas: 187132) -VerifierVerifyMultipleConfigDigestTest:test_revertsIfAReportIsVerifiedWithAnExistingButIncorrectDigest() (gas: 86566) -VerifierVerifyMultipleConfigDigestTest:test_revertsIfVerifyingWithAnUnsetDigest() (gas: 126411) +VerifierVerifyMultipleConfigDigestTest:test_revertsIfAReportIsVerifiedWithAnExistingButIncorrectDigest() (gas: 88205) +VerifierVerifyMultipleConfigDigestTest:test_revertsIfVerifyingWithAnUnsetDigest() (gas: 128062) VerifierVerifySingleConfigDigestTest:test_emitsAnEventIfReportVerified() (gas: 186945) VerifierVerifySingleConfigDigestTest:test_returnsThePriceAndBlockNumIfReportVerified() (gas: 187114) -VerifierVerifySingleConfigDigestTest:test_revertsIfConfigDigestNotSet() (gas: 114479) -VerifierVerifySingleConfigDigestTest:test_revertsIfDuplicateSignersHaveSigned() (gas: 180665) -VerifierVerifySingleConfigDigestTest:test_revertsIfMismatchedSignatureLength() (gas: 51479) -VerifierVerifySingleConfigDigestTest:test_revertsIfReportHasUnconfiguredFeedID() (gas: 102318) -VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedByNonProxy() (gas: 99348) -VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedWithIncorrectAddresses() (gas: 182416) -VerifierVerifySingleConfigDigestTest:test_revertsIfWrongNumberOfSigners() (gas: 108382) +VerifierVerifySingleConfigDigestTest:test_revertsIfConfigDigestNotSet() (gas: 116130) +VerifierVerifySingleConfigDigestTest:test_revertsIfDuplicateSignersHaveSigned() (gas: 182315) +VerifierVerifySingleConfigDigestTest:test_revertsIfMismatchedSignatureLength() (gas: 53037) +VerifierVerifySingleConfigDigestTest:test_revertsIfReportHasUnconfiguredFeedID() (gas: 103976) +VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedByNonProxy() (gas: 100992) +VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedWithIncorrectAddresses() (gas: 184066) +VerifierVerifySingleConfigDigestTest:test_revertsIfWrongNumberOfSigners() (gas: 110031) VerifierVerifySingleConfigDigestTest:test_setsTheCorrectEpoch() (gas: 194270) Verifier_accessControlledVerify:testVerifyWithAccessControl_gas() (gas: 212066) Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithLinkFeeSuccess_gas() (gas: 519368) diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol index 13d52b676c5..90b3d460fe2 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol @@ -282,15 +282,15 @@ contract VRFV2Plus is BaseTest { // Store the previous block's blockhash, and assert that it is as expected. vm.roll(requestBlock + 1); s_bhs.store(requestBlock); - assertEq(hex"c65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8", s_bhs.getBlockhash(requestBlock)); + assertEq(hex"000000000000000000000000000000000000000000000000000000000000000a", s_bhs.getBlockhash(requestBlock)); // Fulfill the request. // Proof generated via the generate-proof-v2-plus script command. Example usage: /* go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 53391429126065232382402681707515137895470547057819816488254124798726362946635 \ - -block-hash 0xc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8 \ + -pre-seed 93724884573574303181157854277074121673523280784530506403108144933983063023487 \ + -block-hash 0x000000000000000000000000000000000000000000000000000000000000000a \ -block-num 10 \ -sender 0x90A8820424CC8a819d14cBdE54D12fD3fbFa9bb2 \ -native-payment true @@ -301,22 +301,22 @@ contract VRFV2Plus is BaseTest { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 2973102176083872659982988645522968133664529102555885971868619302367987919116, - 43610558806647181042154132372309425100765955827430056035281841579494767100593 + 51111463251706978184511913295560024261167135799300172382907308330135472647507, + 41885656274025752055847945432737871864088659248922821023734315208027501951872 ], - c: 44558436621153210954487996771157467729629491520915192177070584116261579650304, - s: 18447217702001910909971999949841419857536434117467121546901211519652998560328, - seed: 53391429126065232382402681707515137895470547057819816488254124798726362946635, - uWitness: 0x61e70839187C12Fe136bdcC78D1D3765BecA245d, + c: 96917856581077810363012153828220232197567408835708926581335248000925197916153, + s: 103298896676233752268329042222773891728807677368628421408380318882272184455566, + seed: 93724884573574303181157854277074121673523280784530506403108144933983063023487, + uWitness: 0xFCaA10875C6692f6CcC86c64300eb0b52f2D4323, cGammaWitness: [ - 57868024672571504735938309170346165090467827794150592801232968679608710558443, - 19249635816589941728350586356475545703589085434839461964712223344491075318152 + 61463607927970680172418313129927007099021056249775757132623753443657677198526, + 48686021866486086188742596461341782400160109177829661164208082534005682984658 ], sHashWitness: [ - 61151023867440095994162103308586528914977848168432699421313437043942463394142, - 107161674609768447269383119603000260750848712436031813376573304048979100187696 + 91508089836242281395929619352465003226819385335975246221498243754781593857533, + 63571625936444669399167157725633389238098818902162172059681813608664564703308 ], - zInv: 92231836131549905872346812799402691650433126386650679876913933650318463342041 + zInv: 97568175302326019383632009699686265453584842953005404815285123863099260038246 }); VRFCoordinatorV2_5.RequestCommitment memory rc = VRFCoordinatorV2_5.RequestCommitment({ blockNum: requestBlock, @@ -399,15 +399,15 @@ contract VRFV2Plus is BaseTest { // Store the previous block's blockhash, and assert that it is as expected. vm.roll(requestBlock + 1); s_bhs.store(requestBlock); - assertEq(hex"ce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec", s_bhs.getBlockhash(requestBlock)); + assertEq(hex"0000000000000000000000000000000000000000000000000000000000000014", s_bhs.getBlockhash(requestBlock)); // Fulfill the request. // Proof generated via the generate-proof-v2-plus script command. Example usage: /* go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 14817911724325909152780695848148728017190840227899344848185245004944693487904 \ - -block-hash 0xce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec \ + -pre-seed 108233140904510496268355288815996296196427471042093167619305836589216327096601 \ + -block-hash 0x0000000000000000000000000000000000000000000000000000000000000014 \ -block-num 20 \ -sender 0x90A8820424CC8a819d14cBdE54D12fD3fbFa9bb2 */ @@ -417,22 +417,22 @@ contract VRFV2Plus is BaseTest { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 33866404953216897461413961842321788789902210776565180957857448351149268461878, - 115311460432520855364215812517921508651759645277579047898967111537639679255245 + 49785247270467418393187938018746488660500261614113251546613288843777654841004, + 8320717868018488740308781441198484312662094766876176838868269181386589318272 ], - c: 32561838617228634441320154326890637858849550728945663611942735469609183032389, - s: 55806041637816588920133401262818662941786708593795051215322306020699218819370, - seed: 14817911724325909152780695848148728017190840227899344848185245004944693487904, - uWitness: 0x917554f18dB75eac206Ae5366B80c0b6A87b5996, + c: 41596204381278553342984662603150353549780558761307588910860350083645227536604, + s: 81592778991188138734863787790226463602813498664606420860910885269124681994753, + seed: 108233140904510496268355288815996296196427471042093167619305836589216327096601, + uWitness: 0x56920892EE71E624d369dCc8dc63B6878C85Ca70, cGammaWitness: [ - 84076069514674055711740813040098459867759972960517070154541804330775196519927, - 23456142794899412334950030002327578074149212885334118042147040122102091306080 + 28250667431035633903490940933503696927659499415200427260709034207157951953043, + 105660182690338773283351292037478192732977803900032569393220726139772041021018 ], sHashWitness: [ - 67919054534004130885903575144858988177160334233773664996450084407340736891592, - 82934864721844704662104532515068228502043057799129930869203380251475000254135 + 18420263847278540234821121001488166570853056146131705862117248292063859054211, + 15740432967529684573970722302302642068194042971767150190061244675457227502736 ], - zInv: 37397948970756055003892765560695914630264479979131589134478580629419519112029 + zInv: 100579074451139970455673776933943662313989441807178260211316504761358492254052 }); VRFCoordinatorV2_5.RequestCommitment memory rc = VRFCoordinatorV2_5.RequestCommitment({ blockNum: requestBlock, From e66a735dbfbff2c901749269304f07f6288fe0cd Mon Sep 17 00:00:00 2001 From: Makram Date: Tue, 10 Oct 2023 17:38:40 +0300 Subject: [PATCH 79/84] chore: move dev vrf contracts into v0.8/vrf (#10894) * chore: move dev vrf contracts into v0.8/vrf * chore: fix imports * fix: forge tests * chore: update native_solc_compile_all_vrf * Revert "fix: forge tests" This reverts commit 6efb6b78c1c6555ce8969e86335e7218de0c982c. Was using the wrong foundry version locally * fix: native_solc_compile_all_automation * fix: solhint * chore: bump changelog * update warning count on solhintignore --------- Co-authored-by: Rens Rooimans --- contracts/.solhintignore | 7 +- contracts/CHANGELOG.md | 3 +- .../native_solc_compile_all_automation | 3 - contracts/scripts/native_solc_compile_all_vrf | 52 ++++++------ contracts/src/v0.8/dev/BlockhashStore.sol | 81 ------------------- .../src/v0.8/{ => vrf}/KeepersVRFConsumer.sol | 10 ++- contracts/src/v0.8/vrf/VRFCoordinatorV2.sol | 4 +- contracts/src/v0.8/vrf/VRFV2Wrapper.sol | 4 +- .../src/v0.8/vrf/VRFV2WrapperConsumerBase.sol | 2 +- .../dev}/BatchVRFCoordinatorV2Plus.sol | 2 +- .../{dev/vrf => vrf/dev}/BlockhashStore.sol | 0 .../{dev/vrf => vrf/dev}/SubscriptionAPI.sol | 2 +- .../vrf => vrf/dev}/TrustedBlockhashStore.sol | 0 .../vrf => vrf/dev}/VRFConsumerBaseV2Plus.sol | 4 +- .../dev/VRFConsumerBaseV2Upgradeable.sol | 0 .../vrf => vrf/dev}/VRFCoordinatorV2_5.sol | 6 +- .../dev/VRFSubscriptionBalanceMonitor.sol | 6 +- .../{dev/vrf => vrf/dev}/VRFV2PlusWrapper.sol | 4 +- .../dev}/VRFV2PlusWrapperConsumerBase.sol | 2 +- .../dev/interfaces/IVRFCoordinatorV2Plus.sol | 2 +- .../IVRFCoordinatorV2PlusInternal.sol | 0 .../IVRFCoordinatorV2PlusMigration.sol | 0 .../IVRFMigratableConsumerV2Plus.sol | 0 .../dev/interfaces/IVRFSubscriptionV2Plus.sol | 0 .../dev/interfaces/IVRFV2PlusMigrate.sol | 0 .../dev/interfaces/IVRFV2PlusWrapper.sol | 0 .../dev}/libraries/VRFV2PlusClient.sol | 0 .../testhelpers/ExposedVRFCoordinatorV2_5.sol | 0 .../VRFConsumerV2PlusUpgradeableExample.sol | 4 +- .../VRFCoordinatorV2PlusUpgradedVersion.sol | 6 +- .../VRFCoordinatorV2Plus_V2Example.sol | 2 +- .../VRFMaliciousConsumerV2Plus.sol | 2 +- .../testhelpers/VRFV2PlusConsumerExample.sol | 2 +- .../VRFV2PlusExternalSubOwnerExample.sol | 2 +- .../VRFV2PlusLoadTestWithMetrics.sol | 0 .../VRFV2PlusMaliciousMigrator.sol | 4 +- .../testhelpers/VRFV2PlusRevertingExample.sol | 2 +- .../VRFV2PlusSingleConsumerExample.sol | 2 +- .../VRFV2PlusWrapperConsumerExample.sol | 0 .../VRFV2PlusWrapperLoadTestConsumer.sol | 2 +- .../interfaces/BlockhashStoreInterface.sol | 0 .../interfaces/VRFCoordinatorV2Interface.sol | 0 .../interfaces/VRFV2WrapperInterface.sol | 0 .../{ => vrf}/mocks/VRFCoordinatorMock.sol | 9 ++- .../{ => vrf}/mocks/VRFCoordinatorV2Mock.sol | 23 +++--- .../src/v0.8/vrf/testhelpers/VRFConsumer.sol | 3 +- .../v0.8/vrf/testhelpers/VRFConsumerV2.sol | 10 +-- .../VRFConsumerV2UpgradeableExample.sol | 8 +- .../VRFCoordinatorV2TestHelper.sol | 4 +- .../VRFExternalSubOwnerExample.sol | 12 +-- .../VRFLoadTestExternalSubOwner.sol | 8 +- .../VRFLoadTestOwnerlessConsumer.sol | 4 +- .../testhelpers/VRFMaliciousConsumerV2.sol | 12 +-- .../VRFOwnerlessConsumerExample.sol | 4 +- .../VRFRequestIDBaseTestHelper.sol | 2 +- .../testhelpers/VRFSingleConsumerExample.sol | 10 +-- .../VRFSubscriptionBalanceMonitorExposed.sol | 2 +- .../v0.8/vrf/testhelpers/VRFTestHelper.sol | 2 +- .../testhelpers/VRFV2LoadTestWithMetrics.sol | 10 +-- .../testhelpers/VRFV2OwnerTestConsumer.sol | 11 ++- .../vrf/testhelpers/VRFV2RevertingExample.sol | 13 +-- .../VRFV2WrapperConsumerExample.sol | 6 +- .../VRFV2WrapperOutOfGasConsumerExample.sol | 6 +- .../VRFV2WrapperRevertingConsumerExample.sol | 6 +- .../VRFV2WrapperUnderFundingConsumer.sol | 6 +- contracts/test/v0.8/VRFD20.test.ts | 2 +- .../v0.8/dev/VRFCoordinatorV2Mock.test.ts | 2 +- .../transmission/EIP_712_1014_4337.t.sol | 2 +- .../foundry/vrf/TrustedBlockhashStore.t.sol | 2 +- .../foundry/vrf/VRFCoordinatorV2Mock.t.sol | 2 +- .../vrf/VRFCoordinatorV2Plus_Migration.t.sol | 12 +-- .../test/v0.8/foundry/vrf/VRFV2Plus.t.sol | 12 +-- .../vrf/VRFV2PlusSubscriptionAPI.t.sol | 4 +- .../test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol | 12 +-- .../foundry/vrf/VRFV2Wrapper_Migration.t.sol | 16 ++-- 75 files changed, 197 insertions(+), 262 deletions(-) delete mode 100644 contracts/src/v0.8/dev/BlockhashStore.sol rename contracts/src/v0.8/{ => vrf}/KeepersVRFConsumer.sol (88%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/BatchVRFCoordinatorV2Plus.sol (98%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/BlockhashStore.sol (100%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/SubscriptionAPI.sol (99%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/TrustedBlockhashStore.sol (100%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/VRFConsumerBaseV2Plus.sol (97%) rename contracts/src/v0.8/{ => vrf}/dev/VRFConsumerBaseV2Upgradeable.sol (100%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/VRFCoordinatorV2_5.sol (98%) rename contracts/src/v0.8/{ => vrf}/dev/VRFSubscriptionBalanceMonitor.sol (97%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/VRFV2PlusWrapper.sol (99%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/VRFV2PlusWrapperConsumerBase.sol (98%) rename contracts/src/v0.8/{ => vrf}/dev/interfaces/IVRFCoordinatorV2Plus.sol (96%) rename contracts/src/v0.8/{ => vrf}/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol (100%) rename contracts/src/v0.8/{ => vrf}/dev/interfaces/IVRFCoordinatorV2PlusMigration.sol (100%) rename contracts/src/v0.8/{ => vrf}/dev/interfaces/IVRFMigratableConsumerV2Plus.sol (100%) rename contracts/src/v0.8/{ => vrf}/dev/interfaces/IVRFSubscriptionV2Plus.sol (100%) rename contracts/src/v0.8/{ => vrf}/dev/interfaces/IVRFV2PlusMigrate.sol (100%) rename contracts/src/v0.8/{ => vrf}/dev/interfaces/IVRFV2PlusWrapper.sol (100%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/libraries/VRFV2PlusClient.sol (100%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/ExposedVRFCoordinatorV2_5.sol (100%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol (94%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol (99%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFCoordinatorV2Plus_V2Example.sol (98%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFMaliciousConsumerV2Plus.sol (96%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFV2PlusConsumerExample.sol (98%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFV2PlusExternalSubOwnerExample.sol (96%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFV2PlusLoadTestWithMetrics.sol (100%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFV2PlusMaliciousMigrator.sol (82%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFV2PlusRevertingExample.sol (97%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFV2PlusSingleConsumerExample.sol (98%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFV2PlusWrapperConsumerExample.sol (100%) rename contracts/src/v0.8/{dev/vrf => vrf/dev}/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol (98%) rename contracts/src/v0.8/{ => vrf}/interfaces/BlockhashStoreInterface.sol (100%) rename contracts/src/v0.8/{ => vrf}/interfaces/VRFCoordinatorV2Interface.sol (100%) rename contracts/src/v0.8/{ => vrf}/interfaces/VRFV2WrapperInterface.sol (100%) rename contracts/src/v0.8/{ => vrf}/mocks/VRFCoordinatorMock.sol (77%) rename contracts/src/v0.8/{ => vrf}/mocks/VRFCoordinatorV2Mock.sol (92%) diff --git a/contracts/.solhintignore b/contracts/.solhintignore index 88ad92c6b87..91a58b34e5b 100644 --- a/contracts/.solhintignore +++ b/contracts/.solhintignore @@ -1,13 +1,12 @@ -# 368 warnings +# 351 warnings #./src/v0.8/automation -# 302 warnings +# 60 warnings #./src/v0.8/dev # 91 warnings #./src/v0.8/functions # 91 warnings #./src/v0.8/l2ep/dev -# 116 warnings -#./src/v0.8/vrf + # Temp ignore the following files as they contain issues. ./src/v0.8/ChainlinkClient.sol diff --git a/contracts/CHANGELOG.md b/contracts/CHANGELOG.md index 1cb2e0e905b..3b21f5405ac 100644 --- a/contracts/CHANGELOG.md +++ b/contracts/CHANGELOG.md @@ -2,7 +2,8 @@ ## Unreleased -... +- Moved `VRFCoordinatorV2Mock.sol` to src/v0.8/vrf/mocks +- Moved `VRFCoordinatorMock.sol` to src/v0.8/vrf/mocks ## 0.8.0 - 2023-10-04 diff --git a/contracts/scripts/native_solc_compile_all_automation b/contracts/scripts/native_solc_compile_all_automation index 005570f4c12..7e0b6058aed 100755 --- a/contracts/scripts/native_solc_compile_all_automation +++ b/contracts/scripts/native_solc_compile_all_automation @@ -39,9 +39,6 @@ compileContract automation/UpkeepTranscoder.sol compileContract automation/mocks/MockAggregatorProxy.sol compileContract automation/testhelpers/LogUpkeepCounter.sol -# Keepers x VRF v2 -compileContract KeepersVRFConsumer.sol - compileContract automation/mocks/KeeperRegistrar1_2Mock.sol compileContract automation/mocks/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.sol diff --git a/contracts/scripts/native_solc_compile_all_vrf b/contracts/scripts/native_solc_compile_all_vrf index fd9f1b91539..302dc18d2fe 100755 --- a/contracts/scripts/native_solc_compile_all_vrf +++ b/contracts/scripts/native_solc_compile_all_vrf @@ -36,7 +36,7 @@ compileContract vrf/VRFRequestIDBase.sol compileContract vrf/VRFConsumerBase.sol compileContract vrf/testhelpers/VRFConsumer.sol compileContract vrf/testhelpers/VRFRequestIDBaseTestHelper.sol -compileContract mocks/VRFCoordinatorMock.sol +compileContract vrf/mocks/VRFCoordinatorMock.sol # VRF V2 compileContract vrf/VRFConsumerBaseV2.sol @@ -52,34 +52,35 @@ compileContract vrf/BatchBlockhashStore.sol compileContract vrf/BatchVRFCoordinatorV2.sol compileContract vrf/testhelpers/VRFCoordinatorV2TestHelper.sol compileContractAltOpts vrf/VRFCoordinatorV2.sol 10000 -compileContract mocks/VRFCoordinatorV2Mock.sol +compileContract vrf/mocks/VRFCoordinatorV2Mock.sol compileContract vrf/VRFOwner.sol -compileContract dev/VRFSubscriptionBalanceMonitor.sol +compileContract vrf/dev/VRFSubscriptionBalanceMonitor.sol +compileContract vrf/KeepersVRFConsumer.sol # VRF V2Plus -compileContract dev/interfaces/IVRFCoordinatorV2PlusInternal.sol -compileContract dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol -compileContractAltOpts dev/vrf/VRFCoordinatorV2_5.sol 50 -compileContract dev/vrf/BatchVRFCoordinatorV2Plus.sol -compileContract dev/vrf/VRFV2PlusWrapper.sol -compileContract dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol -compileContract dev/vrf/testhelpers/VRFMaliciousConsumerV2Plus.sol -compileContract dev/vrf/testhelpers/VRFV2PlusExternalSubOwnerExample.sol -compileContract dev/vrf/testhelpers/VRFV2PlusSingleConsumerExample.sol -compileContract dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol -compileContract dev/vrf/testhelpers/VRFV2PlusRevertingExample.sol -compileContract dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol -compileContract dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol -compileContract dev/vrf/libraries/VRFV2PlusClient.sol -compileContract dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol -compileContract dev/vrf/TrustedBlockhashStore.sol -compileContract dev/vrf/testhelpers/VRFV2PlusLoadTestWithMetrics.sol -compileContractAltOpts dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol 5 -compileContract dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol +compileContract vrf/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol +compileContract vrf/dev/testhelpers/VRFV2PlusConsumerExample.sol +compileContractAltOpts vrf/dev/VRFCoordinatorV2_5.sol 50 +compileContract vrf/dev/BatchVRFCoordinatorV2Plus.sol +compileContract vrf/dev/VRFV2PlusWrapper.sol +compileContract vrf/dev/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol +compileContract vrf/dev/testhelpers/VRFMaliciousConsumerV2Plus.sol +compileContract vrf/dev/testhelpers/VRFV2PlusExternalSubOwnerExample.sol +compileContract vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol +compileContract vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol +compileContract vrf/dev/testhelpers/VRFV2PlusRevertingExample.sol +compileContract vrf/dev/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol +compileContract vrf/dev/testhelpers/VRFV2PlusMaliciousMigrator.sol +compileContract vrf/dev/libraries/VRFV2PlusClient.sol +compileContract vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol +compileContract vrf/dev/TrustedBlockhashStore.sol +compileContract vrf/dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol +compileContractAltOpts vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol 5 +compileContract vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol # VRF V2 Wrapper compileContract vrf/VRFV2Wrapper.sol -compileContract interfaces/VRFV2WrapperInterface.sol +compileContract vrf/interfaces/VRFV2WrapperInterface.sol compileContract vrf/VRFV2WrapperConsumerBase.sol compileContract vrf/testhelpers/VRFV2WrapperConsumerExample.sol @@ -91,3 +92,8 @@ compileContract vrf/testhelpers/VRFLoadTestOwnerlessConsumer.sol compileContract vrf/testhelpers/VRFLoadTestExternalSubOwner.sol compileContract vrf/testhelpers/VRFV2LoadTestWithMetrics.sol compileContract vrf/testhelpers/VRFV2OwnerTestConsumer.sol + +# Helper contracts +compileContract vrf/interfaces/IAuthorizedReceiver.sol +compileContract vrf/interfaces/VRFCoordinatorV2Interface.sol +compileContract vrf/interfaces/VRFV2WrapperInterface.sol diff --git a/contracts/src/v0.8/dev/BlockhashStore.sol b/contracts/src/v0.8/dev/BlockhashStore.sol deleted file mode 100644 index 4104be77ed7..00000000000 --- a/contracts/src/v0.8/dev/BlockhashStore.sol +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.6; - -import {ChainSpecificUtil} from "../ChainSpecificUtil.sol"; - -/** - * @title BlockhashStore - * @notice This contract provides a way to access blockhashes older than - * the 256 block limit imposed by the BLOCKHASH opcode. - * You may assume that any blockhash stored by the contract is correct. - * Note that the contract depends on the format of serialized Ethereum - * blocks. If a future hardfork of Ethereum changes that format, the - * logic in this contract may become incorrect and an updated version - * would have to be deployed. - */ -contract BlockhashStore { - mapping(uint256 => bytes32) internal s_blockhashes; - - /** - * @notice stores blockhash of a given block, assuming it is available through BLOCKHASH - * @param n the number of the block whose blockhash should be stored - */ - function store(uint256 n) public { - bytes32 h = ChainSpecificUtil.getBlockhash(uint64(n)); - // solhint-disable-next-line custom-errors - require(h != 0x0, "blockhash(n) failed"); - s_blockhashes[n] = h; - } - - /** - * @notice stores blockhash of the earliest block still available through BLOCKHASH. - */ - function storeEarliest() external { - store(ChainSpecificUtil.getBlockNumber() - 256); - } - - /** - * @notice stores blockhash after verifying blockheader of child/subsequent block - * @param n the number of the block whose blockhash should be stored - * @param header the rlp-encoded blockheader of block n+1. We verify its correctness by checking - * that it hashes to a stored blockhash, and then extract parentHash to get the n-th blockhash. - */ - function storeVerifyHeader(uint256 n, bytes memory header) public { - // solhint-disable-next-line custom-errors - require(keccak256(header) == s_blockhashes[n + 1], "header has unknown blockhash"); - - // At this point, we know that header is the correct blockheader for block n+1. - - // The header is an rlp-encoded list. The head item of that list is the 32-byte blockhash of the parent block. - // Based on how rlp works, we know that blockheaders always have the following form: - // 0xf9____a0PARENTHASH... - // ^ ^ ^ - // | | | - // | | +--- PARENTHASH is 32 bytes. rlpenc(PARENTHASH) is 0xa || PARENTHASH. - // | | - // | +--- 2 bytes containing the sum of the lengths of the encoded list items - // | - // +--- 0xf9 because we have a list and (sum of lengths of encoded list items) fits exactly into two bytes. - // - // As a consequence, the PARENTHASH is always at offset 4 of the rlp-encoded block header. - - bytes32 parentHash; - assembly { - parentHash := mload(add(header, 36)) // 36 = 32 byte offset for length prefix of ABI-encoded array - // + 4 byte offset of PARENTHASH (see above) - } - - s_blockhashes[n] = parentHash; - } - - /** - * @notice gets a blockhash from the store. If no hash is known, this function reverts. - * @param n the number of the block whose blockhash should be returned - */ - function getBlockhash(uint256 n) external view returns (bytes32) { - bytes32 h = s_blockhashes[n]; - // solhint-disable-next-line custom-errors - require(h != 0x0, "blockhash not found in store"); - return h; - } -} diff --git a/contracts/src/v0.8/KeepersVRFConsumer.sol b/contracts/src/v0.8/vrf/KeepersVRFConsumer.sol similarity index 88% rename from contracts/src/v0.8/KeepersVRFConsumer.sol rename to contracts/src/v0.8/vrf/KeepersVRFConsumer.sol index 21fd26290a4..438696c7f4d 100644 --- a/contracts/src/v0.8/KeepersVRFConsumer.sol +++ b/contracts/src/v0.8/vrf/KeepersVRFConsumer.sol @@ -1,9 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; -import "./automation/KeeperCompatible.sol"; -import "./vrf/VRFConsumerBaseV2.sol"; -import "./interfaces/VRFCoordinatorV2Interface.sol"; +import {AutomationCompatibleInterface as KeeperCompatibleInterface} from "../automation/interfaces/AutomationCompatibleInterface.sol"; +import {VRFConsumerBaseV2} from "./VRFConsumerBaseV2.sol"; +import {VRFCoordinatorV2Interface} from "./interfaces/VRFCoordinatorV2Interface.sol"; + +// solhint-disable chainlink-solidity/prefix-immutable-variables-with-i +// solhint-disable chainlink-solidity/prefix-internal-functions-with-underscore /** * @title KeepersVRFConsumer @@ -85,6 +88,7 @@ contract KeepersVRFConsumer is KeeperCompatibleInterface, VRFConsumerBaseV2 { function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { // Check that the request exists. If not, revert. RequestRecord memory record = s_requests[requestId]; + // solhint-disable-next-line custom-errors require(record.requestId == requestId, "request ID not found in map"); // Update the randomness in the record, and increment the response counter. diff --git a/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol b/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol index 92cb0cdb324..0df99bdb081 100644 --- a/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol +++ b/contracts/src/v0.8/vrf/VRFCoordinatorV2.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.4; import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; -import {BlockhashStoreInterface} from "../interfaces/BlockhashStoreInterface.sol"; +import {BlockhashStoreInterface} from "./interfaces/BlockhashStoreInterface.sol"; import {AggregatorV3Interface} from "../interfaces/AggregatorV3Interface.sol"; -import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFCoordinatorV2Interface} from "./interfaces/VRFCoordinatorV2Interface.sol"; import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; import {IERC677Receiver} from "../shared/interfaces/IERC677Receiver.sol"; import {VRF} from "./VRF.sol"; diff --git a/contracts/src/v0.8/vrf/VRFV2Wrapper.sol b/contracts/src/v0.8/vrf/VRFV2Wrapper.sol index 3573b972276..7f066762d3f 100644 --- a/contracts/src/v0.8/vrf/VRFV2Wrapper.sol +++ b/contracts/src/v0.8/vrf/VRFV2Wrapper.sol @@ -7,8 +7,8 @@ import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol import {VRFConsumerBaseV2} from "./VRFConsumerBaseV2.sol"; import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; import {AggregatorV3Interface} from "../interfaces/AggregatorV3Interface.sol"; -import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; -import {VRFV2WrapperInterface} from "../interfaces/VRFV2WrapperInterface.sol"; +import {VRFCoordinatorV2Interface} from "./interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFV2WrapperInterface} from "./interfaces/VRFV2WrapperInterface.sol"; import {VRFV2WrapperConsumerBase} from "./VRFV2WrapperConsumerBase.sol"; import {ChainSpecificUtil} from "../ChainSpecificUtil.sol"; diff --git a/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol b/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol index a9c8e5568a9..2876b19dd7b 100644 --- a/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol +++ b/contracts/src/v0.8/vrf/VRFV2WrapperConsumerBase.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; -import {VRFV2WrapperInterface} from "../interfaces/VRFV2WrapperInterface.sol"; +import {VRFV2WrapperInterface} from "./interfaces/VRFV2WrapperInterface.sol"; /** ******************************************************************************* * @notice Interface for contracts using VRF randomness through the VRF V2 wrapper diff --git a/contracts/src/v0.8/dev/vrf/BatchVRFCoordinatorV2Plus.sol b/contracts/src/v0.8/vrf/dev/BatchVRFCoordinatorV2Plus.sol similarity index 98% rename from contracts/src/v0.8/dev/vrf/BatchVRFCoordinatorV2Plus.sol rename to contracts/src/v0.8/vrf/dev/BatchVRFCoordinatorV2Plus.sol index 9247cc21dd5..34b5ff6f189 100644 --- a/contracts/src/v0.8/dev/vrf/BatchVRFCoordinatorV2Plus.sol +++ b/contracts/src/v0.8/vrf/dev/BatchVRFCoordinatorV2Plus.sol @@ -2,7 +2,7 @@ // solhint-disable-next-line one-contract-per-file pragma solidity 0.8.6; -import {VRFTypes} from "../../vrf/VRFTypes.sol"; +import {VRFTypes} from "../VRFTypes.sol"; /** * @title BatchVRFCoordinatorV2Plus diff --git a/contracts/src/v0.8/dev/vrf/BlockhashStore.sol b/contracts/src/v0.8/vrf/dev/BlockhashStore.sol similarity index 100% rename from contracts/src/v0.8/dev/vrf/BlockhashStore.sol rename to contracts/src/v0.8/vrf/dev/BlockhashStore.sol diff --git a/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol b/contracts/src/v0.8/vrf/dev/SubscriptionAPI.sol similarity index 99% rename from contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol rename to contracts/src/v0.8/vrf/dev/SubscriptionAPI.sol index d79b6daf844..478ff4cce4a 100644 --- a/contracts/src/v0.8/dev/vrf/SubscriptionAPI.sol +++ b/contracts/src/v0.8/vrf/dev/SubscriptionAPI.sol @@ -6,7 +6,7 @@ import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {AggregatorV3Interface} from "../../interfaces/AggregatorV3Interface.sol"; import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; -import {IVRFSubscriptionV2Plus} from "../interfaces/IVRFSubscriptionV2Plus.sol"; +import {IVRFSubscriptionV2Plus} from "./interfaces/IVRFSubscriptionV2Plus.sol"; abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscriptionV2Plus { using EnumerableSet for EnumerableSet.UintSet; diff --git a/contracts/src/v0.8/dev/vrf/TrustedBlockhashStore.sol b/contracts/src/v0.8/vrf/dev/TrustedBlockhashStore.sol similarity index 100% rename from contracts/src/v0.8/dev/vrf/TrustedBlockhashStore.sol rename to contracts/src/v0.8/vrf/dev/TrustedBlockhashStore.sol diff --git a/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol b/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol similarity index 97% rename from contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol rename to contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol index c256630f7c6..fdfbcebaaa2 100644 --- a/contracts/src/v0.8/dev/vrf/VRFConsumerBaseV2Plus.sol +++ b/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; -import {IVRFMigratableConsumerV2Plus} from "../interfaces/IVRFMigratableConsumerV2Plus.sol"; +import {IVRFCoordinatorV2Plus} from "./interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFMigratableConsumerV2Plus} from "./interfaces/IVRFMigratableConsumerV2Plus.sol"; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; /** **************************************************************************** diff --git a/contracts/src/v0.8/dev/VRFConsumerBaseV2Upgradeable.sol b/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Upgradeable.sol similarity index 100% rename from contracts/src/v0.8/dev/VRFConsumerBaseV2Upgradeable.sol rename to contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Upgradeable.sol diff --git a/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol b/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol similarity index 98% rename from contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol rename to contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol index d69fa38c096..3bccf50c6ea 100644 --- a/contracts/src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol +++ b/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import {BlockhashStoreInterface} from "../../interfaces/BlockhashStoreInterface.sol"; +import {BlockhashStoreInterface} from "../interfaces/BlockhashStoreInterface.sol"; import {VRF} from "../../vrf/VRF.sol"; import {VRFConsumerBaseV2Plus, IVRFMigratableConsumerV2Plus} from "./VRFConsumerBaseV2Plus.sol"; import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; import {SubscriptionAPI} from "./SubscriptionAPI.sol"; import {VRFV2PlusClient} from "./libraries/VRFV2PlusClient.sol"; -import {IVRFCoordinatorV2PlusMigration} from "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; +import {IVRFCoordinatorV2PlusMigration} from "./interfaces/IVRFCoordinatorV2PlusMigration.sol"; // solhint-disable-next-line no-unused-import -import {IVRFCoordinatorV2Plus, IVRFSubscriptionV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFCoordinatorV2Plus, IVRFSubscriptionV2Plus} from "./interfaces/IVRFCoordinatorV2Plus.sol"; // solhint-disable-next-line contract-name-camelcase contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { diff --git a/contracts/src/v0.8/dev/VRFSubscriptionBalanceMonitor.sol b/contracts/src/v0.8/vrf/dev/VRFSubscriptionBalanceMonitor.sol similarity index 97% rename from contracts/src/v0.8/dev/VRFSubscriptionBalanceMonitor.sol rename to contracts/src/v0.8/vrf/dev/VRFSubscriptionBalanceMonitor.sol index 958ecdc1bad..2dd44c8b1a8 100644 --- a/contracts/src/v0.8/dev/VRFSubscriptionBalanceMonitor.sol +++ b/contracts/src/v0.8/vrf/dev/VRFSubscriptionBalanceMonitor.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.6; -import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; -import {AutomationCompatibleInterface as KeeperCompatibleInterface} from "../automation/interfaces/AutomationCompatibleInterface.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {AutomationCompatibleInterface as KeeperCompatibleInterface} from "../../automation/interfaces/AutomationCompatibleInterface.sol"; import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; -import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol"; /** diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol b/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapper.sol similarity index 99% rename from contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol rename to contracts/src/v0.8/vrf/dev/VRFV2PlusWrapper.sol index 29573aa2363..6953d2eb6e5 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapper.sol +++ b/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapper.sol @@ -3,12 +3,12 @@ pragma solidity ^0.8.6; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; -import {IVRFV2PlusMigrate} from "../interfaces/IVRFV2PlusMigrate.sol"; +import {IVRFV2PlusMigrate} from "./interfaces/IVRFV2PlusMigrate.sol"; import {VRFConsumerBaseV2Plus} from "./VRFConsumerBaseV2Plus.sol"; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; import {AggregatorV3Interface} from "../../interfaces/AggregatorV3Interface.sol"; import {VRFV2PlusClient} from "./libraries/VRFV2PlusClient.sol"; -import {IVRFV2PlusWrapper} from "../interfaces/IVRFV2PlusWrapper.sol"; +import {IVRFV2PlusWrapper} from "./interfaces/IVRFV2PlusWrapper.sol"; import {VRFV2PlusWrapperConsumerBase} from "./VRFV2PlusWrapperConsumerBase.sol"; import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; diff --git a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol b/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapperConsumerBase.sol similarity index 98% rename from contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol rename to contracts/src/v0.8/vrf/dev/VRFV2PlusWrapperConsumerBase.sol index e800753af2b..dd450c9f94a 100644 --- a/contracts/src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol +++ b/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapperConsumerBase.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; -import {IVRFV2PlusWrapper} from "../interfaces/IVRFV2PlusWrapper.sol"; +import {IVRFV2PlusWrapper} from "./interfaces/IVRFV2PlusWrapper.sol"; /** * diff --git a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol b/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol similarity index 96% rename from contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol rename to contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol index 20c60b593da..846da0b1edc 100644 --- a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2Plus.sol +++ b/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {VRFV2PlusClient} from "../vrf/libraries/VRFV2PlusClient.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; import {IVRFSubscriptionV2Plus} from "./IVRFSubscriptionV2Plus.sol"; // Interface that enables consumers of VRFCoordinatorV2Plus to be future-proof for upgrades diff --git a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol b/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol similarity index 100% rename from contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol rename to contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol diff --git a/contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusMigration.sol b/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2PlusMigration.sol similarity index 100% rename from contracts/src/v0.8/dev/interfaces/IVRFCoordinatorV2PlusMigration.sol rename to contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2PlusMigration.sol diff --git a/contracts/src/v0.8/dev/interfaces/IVRFMigratableConsumerV2Plus.sol b/contracts/src/v0.8/vrf/dev/interfaces/IVRFMigratableConsumerV2Plus.sol similarity index 100% rename from contracts/src/v0.8/dev/interfaces/IVRFMigratableConsumerV2Plus.sol rename to contracts/src/v0.8/vrf/dev/interfaces/IVRFMigratableConsumerV2Plus.sol diff --git a/contracts/src/v0.8/dev/interfaces/IVRFSubscriptionV2Plus.sol b/contracts/src/v0.8/vrf/dev/interfaces/IVRFSubscriptionV2Plus.sol similarity index 100% rename from contracts/src/v0.8/dev/interfaces/IVRFSubscriptionV2Plus.sol rename to contracts/src/v0.8/vrf/dev/interfaces/IVRFSubscriptionV2Plus.sol diff --git a/contracts/src/v0.8/dev/interfaces/IVRFV2PlusMigrate.sol b/contracts/src/v0.8/vrf/dev/interfaces/IVRFV2PlusMigrate.sol similarity index 100% rename from contracts/src/v0.8/dev/interfaces/IVRFV2PlusMigrate.sol rename to contracts/src/v0.8/vrf/dev/interfaces/IVRFV2PlusMigrate.sol diff --git a/contracts/src/v0.8/dev/interfaces/IVRFV2PlusWrapper.sol b/contracts/src/v0.8/vrf/dev/interfaces/IVRFV2PlusWrapper.sol similarity index 100% rename from contracts/src/v0.8/dev/interfaces/IVRFV2PlusWrapper.sol rename to contracts/src/v0.8/vrf/dev/interfaces/IVRFV2PlusWrapper.sol diff --git a/contracts/src/v0.8/dev/vrf/libraries/VRFV2PlusClient.sol b/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol similarity index 100% rename from contracts/src/v0.8/dev/vrf/libraries/VRFV2PlusClient.sol rename to contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol b/contracts/src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol similarity index 100% rename from contracts/src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol similarity index 94% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol index 1211014cd2f..aeaaf4ba266 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.0; import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; -import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; -import {VRFConsumerBaseV2Upgradeable} from "../../VRFConsumerBaseV2Upgradeable.sol"; +import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Upgradeable} from "../VRFConsumerBaseV2Upgradeable.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable-4.7.3/proxy/utils/Initializable.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol similarity index 99% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol index 07b55388e10..5b2e2322285 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import {BlockhashStoreInterface} from "../../../interfaces/BlockhashStoreInterface.sol"; +import {BlockhashStoreInterface} from "../../interfaces/BlockhashStoreInterface.sol"; // solhint-disable-next-line no-unused-import -import {IVRFCoordinatorV2Plus, IVRFSubscriptionV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFCoordinatorV2Plus, IVRFSubscriptionV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; import {VRF} from "../../../vrf/VRF.sol"; import {VRFConsumerBaseV2Plus, IVRFMigratableConsumerV2Plus} from "../VRFConsumerBaseV2Plus.sol"; import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; import {SubscriptionAPI} from "../SubscriptionAPI.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; -import {IVRFCoordinatorV2PlusMigration} from "../../interfaces/IVRFCoordinatorV2PlusMigration.sol"; +import {IVRFCoordinatorV2PlusMigration} from "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; contract VRFCoordinatorV2PlusUpgradedVersion is diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol similarity index 98% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol index 7306931570a..af49abbf6b5 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; -import {IVRFCoordinatorV2PlusMigration} from "../../interfaces/IVRFCoordinatorV2PlusMigration.sol"; +import {IVRFCoordinatorV2PlusMigration} from "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFMaliciousConsumerV2Plus.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFMaliciousConsumerV2Plus.sol similarity index 96% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFMaliciousConsumerV2Plus.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFMaliciousConsumerV2Plus.sol index cc3e465bc0c..7ddbb448ab9 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFMaliciousConsumerV2Plus.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFMaliciousConsumerV2Plus.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; -import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusConsumerExample.sol similarity index 98% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusConsumerExample.sol index 8acc0ce6d0b..6898e101f82 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusConsumerExample.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; -import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusExternalSubOwnerExample.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusExternalSubOwnerExample.sol similarity index 96% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusExternalSubOwnerExample.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusExternalSubOwnerExample.sol index 384a5890018..4fe7381b5f2 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusExternalSubOwnerExample.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusExternalSubOwnerExample.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; -import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusLoadTestWithMetrics.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol similarity index 100% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusLoadTestWithMetrics.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusMaliciousMigrator.sol similarity index 82% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusMaliciousMigrator.sol index 2be0024ae71..16797bb9390 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusMaliciousMigrator.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; -import {IVRFMigratableConsumerV2Plus} from "../../interfaces/IVRFMigratableConsumerV2Plus.sol"; -import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFMigratableConsumerV2Plus} from "../interfaces/IVRFMigratableConsumerV2Plus.sol"; +import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; contract VRFV2PlusMaliciousMigrator is IVRFMigratableConsumerV2Plus { diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusRevertingExample.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusRevertingExample.sol similarity index 97% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusRevertingExample.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusRevertingExample.sol index 170ff9dd6e9..10c79a1af5c 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusRevertingExample.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusRevertingExample.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; -import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusSingleConsumerExample.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol similarity index 98% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusSingleConsumerExample.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol index b190ebc8715..5d16a9674d2 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusSingleConsumerExample.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.0; import {LinkTokenInterface} from "../../../shared/interfaces/LinkTokenInterface.sol"; -import {IVRFCoordinatorV2Plus} from "../../interfaces/IVRFCoordinatorV2Plus.sol"; +import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; import {VRFConsumerBaseV2Plus} from "../VRFConsumerBaseV2Plus.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol similarity index 100% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol diff --git a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol similarity index 98% rename from contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol rename to contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol index 7b6df2c563e..7293c9a2041 100644 --- a/contracts/src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol @@ -5,7 +5,7 @@ import {VRFV2PlusWrapperConsumerBase} from "../VRFV2PlusWrapperConsumerBase.sol" import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; -import {IVRFV2PlusWrapper} from "../../interfaces/IVRFV2PlusWrapper.sol"; +import {IVRFV2PlusWrapper} from "../interfaces/IVRFV2PlusWrapper.sol"; contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, ConfirmedOwner { uint256 public s_responseCount; diff --git a/contracts/src/v0.8/interfaces/BlockhashStoreInterface.sol b/contracts/src/v0.8/vrf/interfaces/BlockhashStoreInterface.sol similarity index 100% rename from contracts/src/v0.8/interfaces/BlockhashStoreInterface.sol rename to contracts/src/v0.8/vrf/interfaces/BlockhashStoreInterface.sol diff --git a/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol b/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol similarity index 100% rename from contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol rename to contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol diff --git a/contracts/src/v0.8/interfaces/VRFV2WrapperInterface.sol b/contracts/src/v0.8/vrf/interfaces/VRFV2WrapperInterface.sol similarity index 100% rename from contracts/src/v0.8/interfaces/VRFV2WrapperInterface.sol rename to contracts/src/v0.8/vrf/interfaces/VRFV2WrapperInterface.sol diff --git a/contracts/src/v0.8/mocks/VRFCoordinatorMock.sol b/contracts/src/v0.8/vrf/mocks/VRFCoordinatorMock.sol similarity index 77% rename from contracts/src/v0.8/mocks/VRFCoordinatorMock.sol rename to contracts/src/v0.8/vrf/mocks/VRFCoordinatorMock.sol index 7e179d5a445..6695e79b052 100644 --- a/contracts/src/v0.8/mocks/VRFCoordinatorMock.sol +++ b/contracts/src/v0.8/vrf/mocks/VRFCoordinatorMock.sol @@ -1,15 +1,17 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../shared/interfaces/LinkTokenInterface.sol"; -import "../vrf/VRFConsumerBase.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFConsumerBase} from "../../vrf/VRFConsumerBase.sol"; + +// solhint-disable custom-errors contract VRFCoordinatorMock { LinkTokenInterface public LINK; event RandomnessRequest(address indexed sender, bytes32 indexed keyHash, uint256 indexed seed, uint256 fee); - constructor(address linkAddress) public { + constructor(address linkAddress) { LINK = LinkTokenInterface(linkAddress); } @@ -23,6 +25,7 @@ contract VRFCoordinatorMock { bytes memory resp = abi.encodeWithSelector(v.rawFulfillRandomness.selector, requestId, randomness); uint256 b = 206000; require(gasleft() >= b, "not enough gas for consumer"); + // solhint-disable-next-line avoid-low-level-calls, no-unused-vars (bool success, ) = consumerContract.call(resp); } diff --git a/contracts/src/v0.8/mocks/VRFCoordinatorV2Mock.sol b/contracts/src/v0.8/vrf/mocks/VRFCoordinatorV2Mock.sol similarity index 92% rename from contracts/src/v0.8/mocks/VRFCoordinatorV2Mock.sol rename to contracts/src/v0.8/vrf/mocks/VRFCoordinatorV2Mock.sol index a263a3be500..b605815f7eb 100644 --- a/contracts/src/v0.8/mocks/VRFCoordinatorV2Mock.sol +++ b/contracts/src/v0.8/vrf/mocks/VRFCoordinatorV2Mock.sol @@ -2,10 +2,13 @@ // A mock for testing code that relies on VRFCoordinatorV2. pragma solidity ^0.8.4; -import "../shared/interfaces/LinkTokenInterface.sol"; -import "../interfaces/VRFCoordinatorV2Interface.sol"; -import "../vrf/VRFConsumerBaseV2.sol"; -import "../shared/access/ConfirmedOwner.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; + +// solhint-disable chainlink-solidity/prefix-immutable-variables-with-i +// solhint-disable custom-errors +// solhint-disable avoid-low-level-calls contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface, ConfirmedOwner { uint96 public immutable BASE_FEE; @@ -43,22 +46,22 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface, ConfirmedOwner { bool reentrancyLock; } Config private s_config; - uint64 s_currentSubId; - uint256 s_nextRequestId = 1; - uint256 s_nextPreSeed = 100; + uint64 internal s_currentSubId; + uint256 internal s_nextRequestId = 1; + uint256 internal s_nextPreSeed = 100; struct Subscription { address owner; uint96 balance; } - mapping(uint64 => Subscription) s_subscriptions; /* subId */ /* subscription */ - mapping(uint64 => address[]) s_consumers; /* subId */ /* consumers */ + mapping(uint64 => Subscription) internal s_subscriptions; /* subId */ /* subscription */ + mapping(uint64 => address[]) internal s_consumers; /* subId */ /* consumers */ struct Request { uint64 subId; uint32 callbackGasLimit; uint32 numWords; } - mapping(uint256 => Request) s_requests; /* requestId */ /* request */ + mapping(uint256 => Request) internal s_requests; /* requestId */ /* request */ constructor(uint96 _baseFee, uint96 _gasPriceLink) ConfirmedOwner(msg.sender) { BASE_FEE = _baseFee; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFConsumer.sol b/contracts/src/v0.8/vrf/testhelpers/VRFConsumer.sol index 2f063e67267..eaac0be11b1 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFConsumer.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFConsumer.sol @@ -1,8 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../VRFConsumerBase.sol"; +import {VRFConsumerBase} from "../VRFConsumerBase.sol"; contract VRFConsumer is VRFConsumerBase { uint256 public randomnessOutput; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFConsumerV2.sol b/contracts/src/v0.8/vrf/testhelpers/VRFConsumerV2.sol index 466451c7b6a..e2502fad3ed 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFConsumerV2.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFConsumerV2.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../VRFConsumerBaseV2.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; contract VRFConsumerV2 is VRFConsumerBaseV2 { uint256[] public s_randomWords; uint256 public s_requestId; - VRFCoordinatorV2Interface COORDINATOR; - LinkTokenInterface LINKTOKEN; + VRFCoordinatorV2Interface internal COORDINATOR; + LinkTokenInterface internal LINKTOKEN; uint64 public s_subId; uint256 public s_gasAvailable; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFConsumerV2UpgradeableExample.sol b/contracts/src/v0.8/vrf/testhelpers/VRFConsumerV2UpgradeableExample.sol index b99abedf3c7..1bd11fc2249 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFConsumerV2UpgradeableExample.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFConsumerV2UpgradeableExample.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../../dev/VRFConsumerBaseV2Upgradeable.sol"; -import "@openzeppelin/contracts-upgradeable-4.7.3/proxy/utils/Initializable.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2Upgradeable} from "../dev/VRFConsumerBaseV2Upgradeable.sol"; +import {Initializable} from "@openzeppelin/contracts-upgradeable-4.7.3/proxy/utils/Initializable.sol"; contract VRFConsumerV2UpgradeableExample is Initializable, VRFConsumerBaseV2Upgradeable { uint256[] public s_randomWords; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFCoordinatorV2TestHelper.sol b/contracts/src/v0.8/vrf/testhelpers/VRFCoordinatorV2TestHelper.sol index 5d336594e5e..f9385329686 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFCoordinatorV2TestHelper.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFCoordinatorV2TestHelper.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../interfaces/AggregatorV3Interface.sol"; +import {AggregatorV3Interface} from "../../interfaces/AggregatorV3Interface.sol"; // Ideally this contract should inherit from VRFCoordinatorV2 and delegate calls to VRFCoordinatorV2 // However, due to exceeding contract size limit, the logic from VRFCoordinatorV2 is ported over to this contract contract VRFCoordinatorV2TestHelper { - uint96 s_paymentAmount; + uint96 internal s_paymentAmount; AggregatorV3Interface public immutable LINK_ETH_FEED; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFExternalSubOwnerExample.sol b/contracts/src/v0.8/vrf/testhelpers/VRFExternalSubOwnerExample.sol index f6b171cb508..ee2a71df71b 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFExternalSubOwnerExample.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFExternalSubOwnerExample.sol @@ -1,17 +1,17 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../VRFConsumerBaseV2.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; contract VRFExternalSubOwnerExample is VRFConsumerBaseV2 { - VRFCoordinatorV2Interface COORDINATOR; - LinkTokenInterface LINKTOKEN; + VRFCoordinatorV2Interface internal COORDINATOR; + LinkTokenInterface internal LINKTOKEN; uint256[] public s_randomWords; uint256 public s_requestId; - address s_owner; + address internal s_owner; constructor(address vrfCoordinator, address link) VRFConsumerBaseV2(vrfCoordinator) { COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator); diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFLoadTestExternalSubOwner.sol b/contracts/src/v0.8/vrf/testhelpers/VRFLoadTestExternalSubOwner.sol index b4bf37990d7..0193e3f67f0 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFLoadTestExternalSubOwner.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFLoadTestExternalSubOwner.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../VRFConsumerBaseV2.sol"; -import "../../shared/access/ConfirmedOwner.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; /** * @title The VRFLoadTestExternalSubOwner contract. diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFLoadTestOwnerlessConsumer.sol b/contracts/src/v0.8/vrf/testhelpers/VRFLoadTestOwnerlessConsumer.sol index 93c75298d9e..a967c8a565e 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFLoadTestOwnerlessConsumer.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFLoadTestOwnerlessConsumer.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../VRFConsumerBase.sol"; -import "../../shared/interfaces/IERC677Receiver.sol"; +import {VRFConsumerBase} from "../VRFConsumerBase.sol"; +import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; /** * @title The VRFLoadTestOwnerlessConsumer contract. diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFMaliciousConsumerV2.sol b/contracts/src/v0.8/vrf/testhelpers/VRFMaliciousConsumerV2.sol index f11fcc0b7d0..be416e9a5cf 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFMaliciousConsumerV2.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFMaliciousConsumerV2.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../VRFConsumerBaseV2.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; contract VRFMaliciousConsumerV2 is VRFConsumerBaseV2 { uint256[] public s_randomWords; uint256 public s_requestId; - VRFCoordinatorV2Interface COORDINATOR; - LinkTokenInterface LINKTOKEN; + VRFCoordinatorV2Interface internal COORDINATOR; + LinkTokenInterface internal LINKTOKEN; uint64 public s_subId; uint256 public s_gasAvailable; - bytes32 s_keyHash; + bytes32 internal s_keyHash; constructor(address vrfCoordinator, address link) VRFConsumerBaseV2(vrfCoordinator) { COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator); diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFOwnerlessConsumerExample.sol b/contracts/src/v0.8/vrf/testhelpers/VRFOwnerlessConsumerExample.sol index 0eeb5ebc8f1..a641267597c 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFOwnerlessConsumerExample.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFOwnerlessConsumerExample.sol @@ -3,8 +3,8 @@ // contract. pragma solidity ^0.8.4; -import "../VRFConsumerBase.sol"; -import "../../shared/interfaces/IERC677Receiver.sol"; +import {VRFConsumerBase} from "../VRFConsumerBase.sol"; +import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; contract VRFOwnerlessConsumerExample is VRFConsumerBase, IERC677Receiver { uint256 public s_randomnessOutput; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFRequestIDBaseTestHelper.sol b/contracts/src/v0.8/vrf/testhelpers/VRFRequestIDBaseTestHelper.sol index b97a835a94d..344797f0df3 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFRequestIDBaseTestHelper.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFRequestIDBaseTestHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../VRFRequestIDBase.sol"; +import {VRFRequestIDBase} from "../VRFRequestIDBase.sol"; contract VRFRequestIDBaseTestHelper is VRFRequestIDBase { function makeVRFInputSeed_( diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFSingleConsumerExample.sol b/contracts/src/v0.8/vrf/testhelpers/VRFSingleConsumerExample.sol index d4dd7b9087a..303394ee888 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFSingleConsumerExample.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFSingleConsumerExample.sol @@ -2,13 +2,13 @@ // Example of a single consumer contract which owns the subscription. pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../VRFConsumerBaseV2.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; contract VRFSingleConsumerExample is VRFConsumerBaseV2 { - VRFCoordinatorV2Interface COORDINATOR; - LinkTokenInterface LINKTOKEN; + VRFCoordinatorV2Interface internal COORDINATOR; + LinkTokenInterface internal LINKTOKEN; struct RequestConfig { uint64 subId; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFSubscriptionBalanceMonitorExposed.sol b/contracts/src/v0.8/vrf/testhelpers/VRFSubscriptionBalanceMonitorExposed.sol index e2c276615a9..471b6f99301 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFSubscriptionBalanceMonitorExposed.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFSubscriptionBalanceMonitorExposed.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.6; -import "../../dev/VRFSubscriptionBalanceMonitor.sol"; +import {VRFSubscriptionBalanceMonitor} from "../dev/VRFSubscriptionBalanceMonitor.sol"; contract VRFSubscriptionBalanceMonitorExposed is VRFSubscriptionBalanceMonitor { constructor( diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFTestHelper.sol b/contracts/src/v0.8/vrf/testhelpers/VRFTestHelper.sol index 56a1058bf03..e3f9ee04824 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFTestHelper.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFTestHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../VRF.sol"; +import {VRF} from "../VRF.sol"; /** *********************************************************************** @notice Testing harness for VRF.sol, exposing its internal methods. Not to diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2LoadTestWithMetrics.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2LoadTestWithMetrics.sol index 3fd3f4e4038..d7b9f9d1084 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2LoadTestWithMetrics.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2LoadTestWithMetrics.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../VRFConsumerBaseV2.sol"; -import "../../shared/access/ConfirmedOwner.sol"; -import "../../ChainSpecificUtil.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; /** * @title The VRFLoadTestExternalSubOwner contract. @@ -19,7 +19,7 @@ contract VRFV2LoadTestWithMetrics is VRFConsumerBaseV2, ConfirmedOwner { uint256 public s_slowestFulfillment = 0; uint256 public s_fastestFulfillment = 999; uint256 public s_lastRequestId; - mapping(uint256 => uint256) requestHeights; // requestIds to block number when rand request was made + mapping(uint256 => uint256) internal requestHeights; // requestIds to block number when rand request was made struct RequestStatus { bool fulfilled; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2OwnerTestConsumer.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2OwnerTestConsumer.sol index 361c32706f4..43a1e0e0150 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2OwnerTestConsumer.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2OwnerTestConsumer.sol @@ -1,11 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../VRFConsumerBaseV2.sol"; -import "../../shared/access/ConfirmedOwner.sol"; -import "../../ChainSpecificUtil.sol"; -import "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {ChainSpecificUtil} from "../../ChainSpecificUtil.sol"; contract VRFV2OwnerTestConsumer is VRFConsumerBaseV2, ConfirmedOwner { VRFCoordinatorV2Interface public COORDINATOR; @@ -16,7 +15,7 @@ contract VRFV2OwnerTestConsumer is VRFConsumerBaseV2, ConfirmedOwner { uint256 public s_slowestFulfillment = 0; uint256 public s_fastestFulfillment = 999; uint256 public s_lastRequestId; - mapping(uint256 => uint256) requestHeights; // requestIds to block number when rand request was made + mapping(uint256 => uint256) internal requestHeights; // requestIds to block number when rand request was made struct RequestStatus { bool fulfilled; diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2RevertingExample.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2RevertingExample.sol index 72be535a000..4eccafa37ef 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2RevertingExample.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2RevertingExample.sol @@ -1,16 +1,16 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/VRFCoordinatorV2Interface.sol"; -import "../VRFConsumerBaseV2.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFCoordinatorV2Interface} from "../interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "../VRFConsumerBaseV2.sol"; // VRFV2RevertingExample will always revert. Used for testing only, useless in prod. contract VRFV2RevertingExample is VRFConsumerBaseV2 { uint256[] public s_randomWords; uint256 public s_requestId; - VRFCoordinatorV2Interface COORDINATOR; - LinkTokenInterface LINKTOKEN; + VRFCoordinatorV2Interface internal COORDINATOR; + LinkTokenInterface internal LINKTOKEN; uint64 public s_subId; uint256 public s_gasAvailable; @@ -20,6 +20,7 @@ contract VRFV2RevertingExample is VRFConsumerBaseV2 { } function fulfillRandomWords(uint256, uint256[] memory) internal pure override { + // solhint-disable-next-line custom-errors, reason-string revert(); } @@ -33,12 +34,14 @@ contract VRFV2RevertingExample is VRFConsumerBaseV2 { } function topUpSubscription(uint96 amount) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "sub not set"); // Approve the link transfer. LINKTOKEN.transferAndCall(address(COORDINATOR), amount, abi.encode(s_subId)); } function updateSubscription(address[] memory consumers) external { + // solhint-disable-next-line custom-errors require(s_subId != 0, "subID not set"); for (uint256 i = 0; i < consumers.length; i++) { COORDINATOR.addConsumer(s_subId, consumers[i]); diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperConsumerExample.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperConsumerExample.sol index 7ab54ee9fa3..563a5b09288 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperConsumerExample.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperConsumerExample.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; -import "../VRFV2WrapperConsumerBase.sol"; -import "../../shared/access/ConfirmedOwner.sol"; +import {VRFV2WrapperConsumerBase} from "../VRFV2WrapperConsumerBase.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; contract VRFV2WrapperConsumerExample is VRFV2WrapperConsumerBase, ConfirmedOwner { event WrappedRequestFulfilled(uint256 requestId, uint256[] randomWords, uint256 payment); @@ -33,6 +33,7 @@ contract VRFV2WrapperConsumerExample is VRFV2WrapperConsumerBase, ConfirmedOwner } function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal override { + // solhint-disable-next-line custom-errors require(s_requests[_requestId].paid > 0, "request not found"); s_requests[_requestId].fulfilled = true; s_requests[_requestId].randomWords = _randomWords; @@ -42,6 +43,7 @@ contract VRFV2WrapperConsumerExample is VRFV2WrapperConsumerBase, ConfirmedOwner function getRequestStatus( uint256 _requestId ) external view returns (uint256 paid, bool fulfilled, uint256[] memory randomWords) { + // solhint-disable-next-line custom-errors require(s_requests[_requestId].paid > 0, "request not found"); RequestStatus memory request = s_requests[_requestId]; return (request.paid, request.fulfilled, request.randomWords); diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperOutOfGasConsumerExample.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperOutOfGasConsumerExample.sol index e6747820fdb..353027d5570 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperOutOfGasConsumerExample.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperOutOfGasConsumerExample.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; -import "../VRFV2WrapperConsumerBase.sol"; -import "../../shared/access/ConfirmedOwner.sol"; +import {VRFV2WrapperConsumerBase} from "../VRFV2WrapperConsumerBase.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; contract VRFV2WrapperOutOfGasConsumerExample is VRFV2WrapperConsumerBase, ConfirmedOwner { constructor( @@ -18,7 +18,7 @@ contract VRFV2WrapperOutOfGasConsumerExample is VRFV2WrapperConsumerBase, Confir return requestRandomness(_callbackGasLimit, _requestConfirmations, _numWords); } - function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal view override { + function fulfillRandomWords(uint256 /* _requestId */, uint256[] memory /* _randomWords */) internal view override { while (gasleft() > 0) {} } } diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperRevertingConsumerExample.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperRevertingConsumerExample.sol index c3699a1d74b..d78992acfd8 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperRevertingConsumerExample.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperRevertingConsumerExample.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; -import "../VRFV2WrapperConsumerBase.sol"; -import "../../shared/access/ConfirmedOwner.sol"; +import {VRFV2WrapperConsumerBase} from "../VRFV2WrapperConsumerBase.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; contract VRFV2WrapperRevertingConsumerExample is VRFV2WrapperConsumerBase, ConfirmedOwner { constructor( @@ -18,7 +18,7 @@ contract VRFV2WrapperRevertingConsumerExample is VRFV2WrapperConsumerBase, Confi return requestRandomness(_callbackGasLimit, _requestConfirmations, _numWords); } - function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal pure override { + function fulfillRandomWords(uint256 /* _requestId */, uint256[] memory /* _randomWords */) internal pure override { revert("reverting example"); } } diff --git a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperUnderFundingConsumer.sol b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperUnderFundingConsumer.sol index ae0f9eac83c..3bae36f58f1 100644 --- a/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperUnderFundingConsumer.sol +++ b/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperUnderFundingConsumer.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../shared/access/ConfirmedOwner.sol"; -import "../../shared/interfaces/LinkTokenInterface.sol"; -import "../../interfaces/VRFV2WrapperInterface.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {VRFV2WrapperInterface} from "../interfaces/VRFV2WrapperInterface.sol"; contract VRFV2WrapperUnderFundingConsumer is ConfirmedOwner { LinkTokenInterface internal immutable LINK; diff --git a/contracts/test/v0.8/VRFD20.test.ts b/contracts/test/v0.8/VRFD20.test.ts index 6183658336f..f1c1278b89a 100644 --- a/contracts/test/v0.8/VRFD20.test.ts +++ b/contracts/test/v0.8/VRFD20.test.ts @@ -34,7 +34,7 @@ before(async () => { roles.defaultAccount, ) vrfCoordinatorMockFactory = await ethers.getContractFactory( - 'src/v0.8/mocks/VRFCoordinatorMock.sol:VRFCoordinatorMock', + 'src/v0.8/vrf/mocks/VRFCoordinatorMock.sol:VRFCoordinatorMock', roles.defaultAccount, ) vrfD20Factory = await ethers.getContractFactory( diff --git a/contracts/test/v0.8/dev/VRFCoordinatorV2Mock.test.ts b/contracts/test/v0.8/dev/VRFCoordinatorV2Mock.test.ts index b0a2a10b201..04771e4ef7f 100644 --- a/contracts/test/v0.8/dev/VRFCoordinatorV2Mock.test.ts +++ b/contracts/test/v0.8/dev/VRFCoordinatorV2Mock.test.ts @@ -23,7 +23,7 @@ describe('VRFCoordinatorV2Mock', () => { random = accounts[2] const vrfCoordinatorV2MockFactory = await ethers.getContractFactory( - 'src/v0.8/mocks/VRFCoordinatorV2Mock.sol:VRFCoordinatorV2Mock', + 'src/v0.8/vrf/mocks/VRFCoordinatorV2Mock.sol:VRFCoordinatorV2Mock', accounts[0], ) vrfCoordinatorV2Mock = await vrfCoordinatorV2MockFactory.deploy( diff --git a/contracts/test/v0.8/foundry/transmission/EIP_712_1014_4337.t.sol b/contracts/test/v0.8/foundry/transmission/EIP_712_1014_4337.t.sol index acdc6773642..ad7b2999c90 100644 --- a/contracts/test/v0.8/foundry/transmission/EIP_712_1014_4337.t.sol +++ b/contracts/test/v0.8/foundry/transmission/EIP_712_1014_4337.t.sol @@ -12,7 +12,7 @@ import "../../../../src/v0.8/vendor/entrypoint/interfaces/IEntryPoint.sol"; import "../../../../src/v0.8/dev/transmission/ERC-4337/SCALibrary.sol"; import "../../../../src/v0.8/mocks/MockLinkToken.sol"; import "../../../../src/v0.8/shared/interfaces/LinkTokenInterface.sol"; -import "../../../../src/v0.8/mocks/VRFCoordinatorMock.sol"; +import "../../../../src/v0.8/vrf/mocks/VRFCoordinatorMock.sol"; import "../../../../src/v0.8/tests/MockV3Aggregator.sol"; import "../../../../src/v0.8/vrf/testhelpers/VRFConsumer.sol"; diff --git a/contracts/test/v0.8/foundry/vrf/TrustedBlockhashStore.t.sol b/contracts/test/v0.8/foundry/vrf/TrustedBlockhashStore.t.sol index 47fff7ea900..4f3ea40d828 100644 --- a/contracts/test/v0.8/foundry/vrf/TrustedBlockhashStore.t.sol +++ b/contracts/test/v0.8/foundry/vrf/TrustedBlockhashStore.t.sol @@ -1,7 +1,7 @@ pragma solidity 0.8.6; import "../BaseTest.t.sol"; -import {TrustedBlockhashStore} from "../../../../src/v0.8/dev/vrf/TrustedBlockhashStore.sol"; +import {TrustedBlockhashStore} from "../../../../src/v0.8/vrf/dev/TrustedBlockhashStore.sol"; import {console} from "forge-std/console.sol"; contract TrustedBlockhashStoreTest is BaseTest { diff --git a/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Mock.t.sol b/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Mock.t.sol index dd607f2ce7b..6378d40167b 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Mock.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Mock.t.sol @@ -4,7 +4,7 @@ import "../BaseTest.t.sol"; import {VRF} from "../../../../src/v0.8/vrf/VRF.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; -import {VRFCoordinatorV2Mock} from "../../../../src/v0.8/mocks/VRFCoordinatorV2Mock.sol"; +import {VRFCoordinatorV2Mock} from "../../../../src/v0.8/vrf/mocks/VRFCoordinatorV2Mock.sol"; import {VRFConsumerV2} from "../../../../src/v0.8/vrf/testhelpers/VRFConsumerV2.sol"; contract VRFCoordinatorV2MockTest is BaseTest { diff --git a/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Plus_Migration.t.sol b/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Plus_Migration.t.sol index a847bd5beee..d7a54d6223c 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Plus_Migration.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFCoordinatorV2Plus_Migration.t.sol @@ -1,14 +1,14 @@ pragma solidity 0.8.6; import "../BaseTest.t.sol"; -import {VRFCoordinatorV2Plus_V2Example} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol"; -import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; -import {VRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol"; -import {SubscriptionAPI} from "../../../../src/v0.8/dev/vrf/SubscriptionAPI.sol"; -import {VRFV2PlusConsumerExample} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol"; +import {VRFCoordinatorV2Plus_V2Example} from "../../../../src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; +import {VRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol"; +import {SubscriptionAPI} from "../../../../src/v0.8/vrf/dev/SubscriptionAPI.sol"; +import {VRFV2PlusConsumerExample} from "../../../../src/v0.8/vrf/dev/testhelpers/VRFV2PlusConsumerExample.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; -import {VRFV2PlusMaliciousMigrator} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusMaliciousMigrator.sol"; +import {VRFV2PlusMaliciousMigrator} from "../../../../src/v0.8/vrf/dev/testhelpers/VRFV2PlusMaliciousMigrator.sol"; contract VRFCoordinatorV2Plus_Migration is BaseTest { uint256 internal constant DEFAULT_LINK_FUNDING = 10 ether; // 10 LINK diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol index 90b3d460fe2..e2734f17288 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol @@ -4,12 +4,12 @@ import "../BaseTest.t.sol"; import {VRF} from "../../../../src/v0.8/vrf/VRF.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; -import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; -import {VRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol"; -import {SubscriptionAPI} from "../../../../src/v0.8/dev/vrf/SubscriptionAPI.sol"; -import {BlockhashStore} from "../../../../src/v0.8/dev/BlockhashStore.sol"; -import {VRFV2PlusConsumerExample} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusConsumerExample.sol"; -import {VRFV2PlusClient} from "../../../../src/v0.8/dev/vrf/libraries/VRFV2PlusClient.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; +import {VRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol"; +import {SubscriptionAPI} from "../../../../src/v0.8/vrf/dev/SubscriptionAPI.sol"; +import {BlockhashStore} from "../../../../src/v0.8/vrf/dev/BlockhashStore.sol"; +import {VRFV2PlusConsumerExample} from "../../../../src/v0.8/vrf/dev/testhelpers/VRFV2PlusConsumerExample.sol"; +import {VRFV2PlusClient} from "../../../../src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol"; import {console} from "forge-std/console.sol"; import {VmSafe} from "forge-std/Vm.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; // for Math.ceilDiv diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol index db9e11e059e..335e64ff7ef 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol @@ -1,8 +1,8 @@ pragma solidity 0.8.6; import "../BaseTest.t.sol"; -import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; -import {SubscriptionAPI} from "../../../../src/v0.8/dev/vrf/SubscriptionAPI.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; +import {SubscriptionAPI} from "../../../../src/v0.8/vrf/dev/SubscriptionAPI.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; // for Strings.toString diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol index 4cb02991da1..462db4447fd 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper.t.sol @@ -4,12 +4,12 @@ import "../BaseTest.t.sol"; import {VRF} from "../../../../src/v0.8/vrf/VRF.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; -import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; -import {VRFV2PlusWrapperConsumerBase} from "../../../../src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol"; -import {VRFV2PlusWrapperConsumerExample} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol"; -import {VRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol"; -import {VRFV2PlusWrapper} from "../../../../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol"; -import {VRFV2PlusClient} from "../../../../src/v0.8/dev/vrf/libraries/VRFV2PlusClient.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; +import {VRFV2PlusWrapperConsumerBase} from "../../../../src/v0.8/vrf/dev/VRFV2PlusWrapperConsumerBase.sol"; +import {VRFV2PlusWrapperConsumerExample} from "../../../../src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol"; +import {VRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol"; +import {VRFV2PlusWrapper} from "../../../../src/v0.8/vrf/dev/VRFV2PlusWrapper.sol"; +import {VRFV2PlusClient} from "../../../../src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol"; import {console} from "forge-std/console.sol"; contract VRFV2PlusWrapperTest is BaseTest { diff --git a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper_Migration.t.sol b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper_Migration.t.sol index e4c8a40172f..91eedb585e9 100644 --- a/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper_Migration.t.sol +++ b/contracts/test/v0.8/foundry/vrf/VRFV2Wrapper_Migration.t.sol @@ -4,14 +4,14 @@ import "../BaseTest.t.sol"; import {VRF} from "../../../../src/v0.8/vrf/VRF.sol"; import {MockLinkToken} from "../../../../src/v0.8/mocks/MockLinkToken.sol"; import {MockV3Aggregator} from "../../../../src/v0.8/tests/MockV3Aggregator.sol"; -import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/testhelpers/ExposedVRFCoordinatorV2_5.sol"; -import {VRFCoordinatorV2Plus_V2Example} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFCoordinatorV2Plus_V2Example.sol"; -import {VRFV2PlusWrapperConsumerBase} from "../../../../src/v0.8/dev/vrf/VRFV2PlusWrapperConsumerBase.sol"; -import {VRFV2PlusWrapperConsumerExample} from "../../../../src/v0.8/dev/vrf/testhelpers/VRFV2PlusWrapperConsumerExample.sol"; -import {SubscriptionAPI} from "../../../../src/v0.8/dev/vrf/SubscriptionAPI.sol"; -import {VRFCoordinatorV2_5} from "../../../../src/v0.8/dev/vrf/VRFCoordinatorV2_5.sol"; -import {VRFV2PlusWrapper} from "../../../../src/v0.8/dev/vrf/VRFV2PlusWrapper.sol"; -import {VRFV2PlusClient} from "../../../../src/v0.8/dev/vrf/libraries/VRFV2PlusClient.sol"; +import {ExposedVRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol"; +import {VRFCoordinatorV2Plus_V2Example} from "../../../../src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol"; +import {VRFV2PlusWrapperConsumerBase} from "../../../../src/v0.8/vrf/dev/VRFV2PlusWrapperConsumerBase.sol"; +import {VRFV2PlusWrapperConsumerExample} from "../../../../src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol"; +import {SubscriptionAPI} from "../../../../src/v0.8/vrf/dev/SubscriptionAPI.sol"; +import {VRFCoordinatorV2_5} from "../../../../src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol"; +import {VRFV2PlusWrapper} from "../../../../src/v0.8/vrf/dev/VRFV2PlusWrapper.sol"; +import {VRFV2PlusClient} from "../../../../src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol"; contract VRFV2PlusWrapperTest is BaseTest { address internal constant LINK_WHALE = 0xD883a6A1C22fC4AbFE938a5aDF9B2Cc31b1BF18B; From 5efd686a0a17d53feb22ee92a30647c4a19f3df8 Mon Sep 17 00:00:00 2001 From: Anirudh Warrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Tue, 10 Oct 2023 19:42:03 +0400 Subject: [PATCH 80/84] [AUTO-5283] Fix on demand test CI (#10883) * Fix on demand test CI * Increase test timeout to 1h * Increase parallel nodes for upgrade test * Replace utils.GetEnv with os.GetEnv * reduce nodes to 1 for node upgrade test * increase nodes to 3 and increase runner size for node upgrade test * throw error if upgrade envs not set --------- Co-authored-by: anirudhwarrier --- .github/workflows/automation-ondemand-tests.yml | 12 +++++++----- integration-tests/smoke/automation_test.go | 10 +++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/automation-ondemand-tests.yml b/.github/workflows/automation-ondemand-tests.yml index 71cd08eaf45..1693e001634 100644 --- a/.github/workflows/automation-ondemand-tests.yml +++ b/.github/workflows/automation-ondemand-tests.yml @@ -140,8 +140,8 @@ jobs: command: -run ^TestAutomationReorg$ ./reorg - name: upgrade suite: smoke - nodes: 1 - os: ubuntu-latest + nodes: 3 + os: ubuntu20.04-8cores-32GB pyroscope_env: ci-automation-on-demand-upgrade network: SIMULATED command: -run ^TestAutomationNodeUpgrade$ ./smoke @@ -160,10 +160,12 @@ jobs: echo "image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT echo "version=${{ github.sha }}" >>$GITHUB_OUTPUT echo "upgrade_version=${{ github.sha }}" >>$GITHUB_OUTPUT + echo "upgrade_image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT else echo "image=${{ inputs.chainlinkImage }}" >>$GITHUB_OUTPUT echo "version=${{ inputs.chainlinkVersion }}" >>$GITHUB_OUTPUT echo "upgrade_version=${{ inputs.chainlinkVersion }}" >>$GITHUB_OUTPUT + echo "upgrade_image=${{ inputs.chainlinkImage }}" >>$GITHUB_OUTPUT fi if [[ "${{ matrix.tests.name }}" == "upgrade" ]]; then echo "image=${{ inputs.chainlinkImageUpdate }}" >>$GITHUB_OUTPUT @@ -177,10 +179,10 @@ jobs: PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} SELECTED_NETWORKS: ${{ matrix.tests.network }} TEST_SUITE: ${{ matrix.tests.suite }} - TEST_UPGRADE_VERSION: ${{ steps.determine-build.outputs.upgrade_version }} - TEST_UPGRADE_IMAGE: ${{ env.CHAINLINK_IMAGE }} + UPGRADE_VERSION: ${{ steps.determine-build.outputs.upgrade_version }} + UPGRADE_IMAGE: ${{ steps.determine-build.outputs.upgrade_image }} with: - test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.tests.nodes }} ${{ matrix.tests.command }} 2>&1 | tee /tmp/gotest.log | gotestfmt + test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 60m -count=1 -json -test.parallel=${{ matrix.tests.nodes }} ${{ matrix.tests.command }} 2>&1 | tee /tmp/gotest.log | gotestfmt test_download_vendor_packages_command: cd ./integration-tests && go mod download cl_repo: ${{ steps.determine-build.outputs.image }} cl_image_tag: ${{ steps.determine-build.outputs.version }} diff --git a/integration-tests/smoke/automation_test.go b/integration-tests/smoke/automation_test.go index db34cb28e1e..b7aba624e4c 100644 --- a/integration-tests/smoke/automation_test.go +++ b/integration-tests/smoke/automation_test.go @@ -16,7 +16,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/utils" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -105,10 +104,11 @@ func SetupAutomationBasic(t *testing.T, nodeUpgrade bool) { testName = "basic-upkeep" ) if nodeUpgrade { - upgradeImage, err = utils.GetEnv("UPGRADE_IMAGE") - require.NoError(t, err, "Error getting upgrade image") - upgradeVersion, err = utils.GetEnv("UPGRADE_VERSION") - require.NoError(t, err, "Error getting upgrade version") + upgradeImage = os.Getenv("UPGRADE_IMAGE") + upgradeVersion = os.Getenv("UPGRADE_VERSION") + if len(upgradeImage) == 0 || len(upgradeVersion) == 0 { + t.Fatal("UPGRADE_IMAGE and UPGRADE_VERSION must be set to upgrade nodes") + } testName = "node-upgrade" } chainClient, _, contractDeployer, linkToken, registry, registrar, testEnv := setupAutomationTestDocker( From 9fe119d2c66c191c9e4bd8053c9d9f2e5527a81b Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 10 Oct 2023 10:59:53 -0500 Subject: [PATCH 81/84] core/internal/testutils: use github.com/hashicorp/consul/sdk/freeport (#10895) --- core/internal/features/features_test.go | 32 +++++++++++-------- .../features/ocr2/features_ocr2_test.go | 15 +++++---- core/internal/testutils/testutils.go | 14 -------- core/scripts/go.sum | 2 ++ .../v0/internal/testutils.go | 9 +++--- .../v1/internal/testutils.go | 9 +++--- .../ocr2/plugins/mercury/helpers_test.go | 19 +++++------ .../ocr2/plugins/mercury/integration_test.go | 31 ++++++++++-------- .../plugins/ocr2keeper/integration_21_test.go | 15 +++++---- .../plugins/ocr2keeper/integration_test.go | 18 +++++++---- .../internal/ocr2vrf_integration_test.go | 8 +++-- go.mod | 1 + go.sum | 6 ++-- integration-tests/go.sum | 4 +-- 14 files changed, 99 insertions(+), 84 deletions(-) diff --git a/core/internal/features/features_test.go b/core/internal/features/features_test.go index 489f744cdef..82b335927cf 100644 --- a/core/internal/features/features_test.go +++ b/core/internal/features/features_test.go @@ -24,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/rpc" "github.com/google/uuid" + "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -670,7 +671,7 @@ func setupOCRContracts(t *testing.T) (*bind.TransactOpts, *backends.SimulatedBac return owner, b, ocrContractAddress, ocrContract, flagsContract, flagsContractAddress } -func setupNode(t *testing.T, owner *bind.TransactOpts, portV1, portV2 uint16, dbName string, +func setupNode(t *testing.T, owner *bind.TransactOpts, portV1, portV2 int, dbName string, b *backends.SimulatedBackend, ns ocrnetworking.NetworkingStack, overrides func(c *chainlink.Config, s *chainlink.Secrets), ) (*cltest.TestApplication, string, common.Address, ocrkey.KeyV2) { p2pKey, err := p2pkey.NewV2() @@ -743,7 +744,7 @@ func setupForwarderEnabledNode( t *testing.T, owner *bind.TransactOpts, portV1, - portV2 uint16, + portV2 int, dbName string, b *backends.SimulatedBackend, ns ocrnetworking.NetworkingStack, @@ -856,8 +857,9 @@ func TestIntegration_OCR(t *testing.T) { for _, tt := range tests { test := tt t.Run(test.name, func(t *testing.T) { - bootstrapNodePortV1 := testutils.GetFreePort(t) - bootstrapNodePortV2 := testutils.GetFreePort(t) + t.Parallel() + bootstrapNodePortV1 := freeport.GetOne(t) + bootstrapNodePortV2 := freeport.GetOne(t) g := gomega.NewWithT(t) owner, b, ocrContractAddress, ocrContract, flagsContract, flagsContractAddress := setupOCRContracts(t) @@ -870,9 +872,10 @@ func TestIntegration_OCR(t *testing.T) { keys []ocrkey.KeyV2 apps []*cltest.TestApplication ) + ports := freeport.GetN(t, 2*numOracles) for i := 0; i < numOracles; i++ { - portV1 := testutils.GetFreePort(t) - portV2 := testutils.GetFreePort(t) + portV1 := ports[2*i] + portV2 := ports[2*i+1] app, peerID, transmitter, key := setupNode(t, owner, portV1, portV2, fmt.Sprintf("o%d_%d", i, test.id), b, test.ns, func(c *chainlink.Config, s *chainlink.Secrets) { c.EVM[0].FlagsContractAddress = ptr(ethkey.EIP55AddressFromAddress(flagsContractAddress)) c.EVM[0].GasEstimator.EIP1559DynamicFees = ptr(test.eip1559) @@ -891,10 +894,10 @@ func TestIntegration_OCR(t *testing.T) { OracleIdentity: confighelper.OracleIdentity{ OnChainSigningAddress: ocrtypes.OnChainSigningAddress(key.OnChainSigning.Address()), TransmitAddress: transmitter, - OffchainPublicKey: ocrtypes.OffchainPublicKey(key.PublicKeyOffChain()), + OffchainPublicKey: key.PublicKeyOffChain(), PeerID: peerID, }, - SharedSecretEncryptionPublicKey: ocrtypes.SharedSecretEncryptionPublicKey(key.PublicKeyConfig()), + SharedSecretEncryptionPublicKey: key.PublicKeyConfig(), }) } @@ -1080,8 +1083,8 @@ func TestIntegration_OCR_ForwarderFlow(t *testing.T) { t.Parallel() numOracles := 4 t.Run("ocr_forwarder_flow", func(t *testing.T) { - bootstrapNodePortV1 := testutils.GetFreePort(t) - bootstrapNodePortV2 := testutils.GetFreePort(t) + bootstrapNodePortV1 := freeport.GetOne(t) + bootstrapNodePortV2 := freeport.GetOne(t) g := gomega.NewWithT(t) owner, b, ocrContractAddress, ocrContract, flagsContract, flagsContractAddress := setupOCRContracts(t) @@ -1096,9 +1099,10 @@ func TestIntegration_OCR_ForwarderFlow(t *testing.T) { keys []ocrkey.KeyV2 apps []*cltest.TestApplication ) + ports := freeport.GetN(t, 2*numOracles) for i := 0; i < numOracles; i++ { - portV1 := testutils.GetFreePort(t) - portV2 := testutils.GetFreePort(t) + portV1 := ports[2*i] + portV2 := ports[2*i+1] app, peerID, transmitter, forwarder, key := setupForwarderEnabledNode(t, owner, portV1, portV2, fmt.Sprintf("o%d_%d", i, 1), b, ocrnetworking.NetworkingStackV2, func(c *chainlink.Config, s *chainlink.Secrets) { c.Feature.LogPoller = ptr(true) c.EVM[0].FlagsContractAddress = ptr(ethkey.EIP55AddressFromAddress(flagsContractAddress)) @@ -1117,10 +1121,10 @@ func TestIntegration_OCR_ForwarderFlow(t *testing.T) { OracleIdentity: confighelper.OracleIdentity{ OnChainSigningAddress: ocrtypes.OnChainSigningAddress(key.OnChainSigning.Address()), TransmitAddress: forwarder, - OffchainPublicKey: ocrtypes.OffchainPublicKey(key.PublicKeyOffChain()), + OffchainPublicKey: key.PublicKeyOffChain(), PeerID: peerID, }, - SharedSecretEncryptionPublicKey: ocrtypes.SharedSecretEncryptionPublicKey(key.PublicKeyConfig()), + SharedSecretEncryptionPublicKey: key.PublicKeyConfig(), }) } diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index f31f19a4f2d..bde0fa3533f 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -22,6 +22,7 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -103,7 +104,7 @@ func setupOCR2Contracts(t *testing.T) (*bind.TransactOpts, *backends.SimulatedBa func setupNodeOCR2( t *testing.T, owner *bind.TransactOpts, - port uint16, + port int, dbName string, useForwarder bool, b *backends.SimulatedBackend, @@ -192,7 +193,7 @@ func TestIntegration_OCR2(t *testing.T) { owner, b, ocrContractAddress, ocrContract := setupOCR2Contracts(t) lggr := logger.TestLogger(t) - bootstrapNodePort := testutils.GetFreePort(t) + bootstrapNodePort := freeport.GetOne(t) bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, "bootstrap", false /* useForwarders */, b, nil) var ( @@ -201,8 +202,9 @@ func TestIntegration_OCR2(t *testing.T) { kbs []ocr2key.KeyBundle apps []*cltest.TestApplication ) - for i := uint16(0); i < 4; i++ { - node := setupNodeOCR2(t, owner, bootstrapNodePort+1+i, fmt.Sprintf("oracle%d", i), false /* useForwarders */, b, []commontypes.BootstrapperLocator{ + ports := freeport.GetN(t, 4) + for i := 0; i < 4; i++ { + node := setupNodeOCR2(t, owner, ports[i], fmt.Sprintf("oracle%d", i), false /* useForwarders */, b, []commontypes.BootstrapperLocator{ // Supply the bootstrap IP and port as a V2 peer address {PeerID: bootstrapNode.peerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, }) @@ -461,7 +463,7 @@ func TestIntegration_OCR2_ForwarderFlow(t *testing.T) { owner, b, ocrContractAddress, ocrContract := setupOCR2Contracts(t) lggr := logger.TestLogger(t) - bootstrapNodePort := testutils.GetFreePort(t) + bootstrapNodePort := freeport.GetOne(t) bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, "bootstrap", true /* useForwarders */, b, nil) var ( @@ -471,8 +473,9 @@ func TestIntegration_OCR2_ForwarderFlow(t *testing.T) { kbs []ocr2key.KeyBundle apps []*cltest.TestApplication ) + ports := freeport.GetN(t, 4) for i := uint16(0); i < 4; i++ { - node := setupNodeOCR2(t, owner, bootstrapNodePort+1+i, fmt.Sprintf("oracle%d", i), true /* useForwarders */, b, []commontypes.BootstrapperLocator{ + node := setupNodeOCR2(t, owner, ports[i], fmt.Sprintf("oracle%d", i), true /* useForwarders */, b, []commontypes.BootstrapperLocator{ // Supply the bootstrap IP and port as a V2 peer address {PeerID: bootstrapNode.peerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, }) diff --git a/core/internal/testutils/testutils.go b/core/internal/testutils/testutils.go index 0d4e710b497..938d814b9eb 100644 --- a/core/internal/testutils/testutils.go +++ b/core/internal/testutils/testutils.go @@ -10,7 +10,6 @@ import ( "math" "math/big" mrand "math/rand" - "net" "net/http" "net/http/httptest" "net/url" @@ -452,16 +451,3 @@ func MustDecodeBase64(s string) (b []byte) { } return } - -// GetFreePort returns a free port. -// NOTE: This approach is technically incorrect because the returned port -// can still be taken by the time the caller attempts to bind to it. -// Unfortunately, we can't specify zero port in P2P.V2.ListenAddresses at the moment. -func GetFreePort(t *testing.T) uint16 { - addr, err := net.ResolveTCPAddr("tcp", "localhost:0") - require.NoError(t, err) - listener, err := net.ListenTCP("tcp", addr) - require.NoError(t, err) - require.NoError(t, listener.Close()) - return uint16(listener.Addr().(*net.TCPAddr).Port) -} diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 640e5dd1982..4dd0f0545c7 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -655,6 +655,8 @@ github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfm github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs= +github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= diff --git a/core/services/ocr2/plugins/functions/integration_tests/v0/internal/testutils.go b/core/services/ocr2/plugins/functions/integration_tests/v0/internal/testutils.go index a36b3cd3ea7..5feddbda75d 100644 --- a/core/services/ocr2/plugins/functions/integration_tests/v0/internal/testutils.go +++ b/core/services/ocr2/plugins/functions/integration_tests/v0/internal/testutils.go @@ -20,6 +20,7 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -228,7 +229,7 @@ type Node struct { func StartNewNode( t *testing.T, owner *bind.TransactOpts, - port uint16, + port int, dbName string, b *backends.SimulatedBackend, maxGas uint32, @@ -469,11 +470,12 @@ func CreateFunctionsNodes( require.Fail(t, "ocr2Keystores and thresholdKeyShares must have the same length") } - bootstrapPort := testutils.GetFreePort(t) + bootstrapPort := freeport.GetOne(t) bootstrapNode = StartNewNode(t, owner, bootstrapPort, "bootstrap", b, uint32(maxGas), nil, nil, "") AddBootstrapJob(t, bootstrapNode.App, oracleContractAddress) // oracle nodes with jobs, bridges and mock EAs + ports := freeport.GetN(t, nOracleNodes) for i := 0; i < nOracleNodes; i++ { var thresholdKeyShare string if len(thresholdKeyShares) == 0 { @@ -487,8 +489,7 @@ func CreateFunctionsNodes( } else { ocr2Keystore = ocr2Keystores[i] } - nodePort := testutils.GetFreePort(t) - oracleNode := StartNewNode(t, owner, nodePort, fmt.Sprintf("oracle%d", i), b, uint32(maxGas), []commontypes.BootstrapperLocator{ + oracleNode := StartNewNode(t, owner, ports[i], fmt.Sprintf("oracle%d", i), b, uint32(maxGas), []commontypes.BootstrapperLocator{ {PeerID: bootstrapNode.PeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapPort)}}, }, ocr2Keystore, thresholdKeyShare) oracleNodes = append(oracleNodes, oracleNode.App) diff --git a/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go b/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go index 0970ea7c482..fb0fe4e2478 100644 --- a/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go +++ b/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go @@ -21,6 +21,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -300,7 +301,7 @@ type Node struct { func StartNewNode( t *testing.T, owner *bind.TransactOpts, - port uint16, + port int, dbName string, b *backends.SimulatedBackend, maxGas uint32, @@ -549,11 +550,12 @@ func CreateFunctionsNodes( require.Fail(t, "ocr2Keystores and thresholdKeyShares must have the same length") } - bootstrapPort := testutils.GetFreePort(t) + bootstrapPort := freeport.GetOne(t) bootstrapNode = StartNewNode(t, owner, bootstrapPort, "bootstrap", b, uint32(maxGas), nil, nil, "") AddBootstrapJob(t, bootstrapNode.App, routerAddress) // oracle nodes with jobs, bridges and mock EAs + ports := freeport.GetN(t, nOracleNodes) for i := 0; i < nOracleNodes; i++ { var thresholdKeyShare string if len(thresholdKeyShares) == 0 { @@ -567,8 +569,7 @@ func CreateFunctionsNodes( } else { ocr2Keystore = ocr2Keystores[i] } - nodePort := testutils.GetFreePort(t) - oracleNode := StartNewNode(t, owner, nodePort, fmt.Sprintf("oracle%d", i), b, uint32(maxGas), []commontypes.BootstrapperLocator{ + oracleNode := StartNewNode(t, owner, ports[i], fmt.Sprintf("oracle%d", i), b, uint32(maxGas), []commontypes.BootstrapperLocator{ {PeerID: bootstrapNode.PeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapPort)}}, }, ocr2Keystore, thresholdKeyShare) oracleNodes = append(oracleNodes, oracleNode.App) diff --git a/core/services/ocr2/plugins/mercury/helpers_test.go b/core/services/ocr2/plugins/mercury/helpers_test.go index 97b86cfc561..ce4e0895164 100644 --- a/core/services/ocr2/plugins/mercury/helpers_test.go +++ b/core/services/ocr2/plugins/mercury/helpers_test.go @@ -13,14 +13,15 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/wsrpc" - "github.com/smartcontractkit/wsrpc/credentials" - "github.com/smartcontractkit/wsrpc/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" + "github.com/smartcontractkit/wsrpc" + "github.com/smartcontractkit/wsrpc/credentials" + "github.com/smartcontractkit/wsrpc/peer" + "github.com/smartcontractkit/libocr/offchainreporting2/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -150,14 +151,14 @@ func (node *Node) AddBootstrapJob(t *testing.T, spec string) { func setupNode( t *testing.T, - port int64, + port int, dbName string, backend *backends.SimulatedBackend, csaKey csakey.KeyV2, ) (app chainlink.Application, peerID string, clientPubKey credentials.StaticSizedPublicKey, ocr2kb ocr2key.KeyBundle, observedLogs *observer.ObservedLogs) { - k := big.NewInt(port) // keys unique to port + k := big.NewInt(int64(port)) // keys unique to port p2pKey := p2pkey.MustNewV2XXXTestingOnly(k) - rdr := keystest.NewRandReaderFromSeed(port) + rdr := keystest.NewRandReaderFromSeed(int64(port)) ocr2kb = ocr2key.MustNewInsecure(rdr, chaintype.EVM) p2paddresses := []string{fmt.Sprintf("127.0.0.1:%d", port)} @@ -241,7 +242,7 @@ func addV1MercuryJob( i int, verifierAddress common.Address, bootstrapPeerID string, - bootstrapNodePort int64, + bootstrapNodePort int, bmBridge, bidBridge, askBridge, @@ -324,7 +325,7 @@ func addV2MercuryJob( i int, verifierAddress common.Address, bootstrapPeerID string, - bootstrapNodePort int64, + bootstrapNodePort int, bmBridge, serverURL string, serverPubKey, @@ -389,7 +390,7 @@ func addV3MercuryJob( i int, verifierAddress common.Address, bootstrapPeerID string, - bootstrapNodePort int64, + bootstrapNodePort int, bmBridge, bidBridge, askBridge, diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index fa3aef0451a..e7e059289a2 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -22,16 +22,18 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/hashicorp/consul/sdk/freeport" "github.com/shopspring/decimal" - "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" - "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" - ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/wsrpc/credentials" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" + "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" + ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/wsrpc/credentials" + relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" relaycodecv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" relaycodecv2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" @@ -172,7 +174,7 @@ func TestIntegration_MercuryV1(t *testing.T) { steve, backend, verifier, verifierAddress := setupBlockchain(t) // Setup bootstrap + oracle nodes - bootstrapNodePort := int64(19700) + bootstrapNodePort := freeport.GetOne(t) appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", backend, clientCSAKeys[n]) bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) @@ -182,8 +184,9 @@ func TestIntegration_MercuryV1(t *testing.T) { oracles []confighelper.OracleIdentityExtra nodes []Node ) - for i := int64(0); i < int64(n); i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) + ports := freeport.GetN(t, n) + for i := 0; i < n; i++ { + app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) nodes = append(nodes, Node{ app, transmitter, kb, @@ -520,7 +523,7 @@ func TestIntegration_MercuryV2(t *testing.T) { steve, backend, verifier, verifierAddress := setupBlockchain(t) // Setup bootstrap + oracle nodes - bootstrapNodePort := int64(20700) + bootstrapNodePort := freeport.GetOne(t) appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", backend, clientCSAKeys[n]) bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) @@ -530,8 +533,9 @@ func TestIntegration_MercuryV2(t *testing.T) { oracles []confighelper.OracleIdentityExtra nodes []Node ) - for i := int64(0); i < int64(n); i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) + ports := freeport.GetN(t, n) + for i := 0; i < n; i++ { + app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) nodes = append(nodes, Node{ app, transmitter, kb, @@ -795,7 +799,7 @@ func TestIntegration_MercuryV3(t *testing.T) { steve, backend, verifier, verifierAddress := setupBlockchain(t) // Setup bootstrap + oracle nodes - bootstrapNodePort := int64(21700) + bootstrapNodePort := freeport.GetOne(t) appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", backend, clientCSAKeys[n]) bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) @@ -805,8 +809,9 @@ func TestIntegration_MercuryV3(t *testing.T) { oracles []confighelper.OracleIdentityExtra nodes []Node ) - for i := int64(0); i < int64(n); i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) + ports := freeport.GetN(t, n) + for i := 0; i < n; i++ { + app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) nodes = append(nodes, Node{ app, transmitter, kb, diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go index e864b0d7e2f..15280de73cf 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go @@ -20,15 +20,17 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/umbracle/ethgo/abi" + "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" ocrTypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/ocr2keepers/pkg/v3/config" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/umbracle/ethgo/abi" relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/assets" @@ -476,7 +478,7 @@ func setupNodes(t *testing.T, nodeKeys [5]ethkey.KeyV2, registry *iregistry21.IK mServer.Start() // Setup bootstrap + oracle nodes - bootstrapNodePort := int64(19599) + bootstrapNodePort := freeport.GetOne(t) appBootstrap, bootstrapPeerID, bootstrapTransmitter, bootstrapKb := setupNode(t, bootstrapNodePort, "bootstrap_keeper_ocr", nodeKeys[0], backend, nil, mServer) bootstrapNode := Node{ appBootstrap, bootstrapTransmitter, bootstrapKb, @@ -486,8 +488,9 @@ func setupNodes(t *testing.T, nodeKeys [5]ethkey.KeyV2, registry *iregistry21.IK nodes []Node ) // Set up the minimum 4 oracles all funded - for i := int64(0); i < 4; i++ { - app, peerID, transmitter, kb := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_keeper%d", i), nodeKeys[i+1], backend, []commontypes.BootstrapperLocator{ + ports := freeport.GetN(t, 4) + for i := 0; i < 4; i++ { + app, peerID, transmitter, kb := setupNode(t, ports[i], fmt.Sprintf("oracle_keeper%d", i), nodeKeys[i+1], backend, []commontypes.BootstrapperLocator{ // Supply the bootstrap IP and port as a V2 peer address {PeerID: bootstrapPeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, }, mServer) diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_test.go index eea9c1574cf..bf10fa482fd 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_test.go @@ -21,8 +21,10 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" "github.com/pkg/errors" + "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocrTypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -108,7 +110,7 @@ func deployKeeper20Registry( func setupNode( t *testing.T, - port int64, + port int, dbName string, nodeKey ethkey.KeyV2, backend *backends.SimulatedBackend, @@ -238,7 +240,7 @@ func TestIntegration_KeeperPluginBasic(t *testing.T) { registry := deployKeeper20Registry(t, steve, backend, linkAddr, linkFeedAddr, gasFeedAddr) // Setup bootstrap + oracle nodes - bootstrapNodePort := int64(19599) + bootstrapNodePort := freeport.GetOne(t) appBootstrap, bootstrapPeerID, bootstrapTransmitter, bootstrapKb := setupNode(t, bootstrapNodePort, "bootstrap_keeper_ocr", nodeKeys[0], backend, nil, NewSimulatedMercuryServer()) bootstrapNode := Node{ appBootstrap, bootstrapTransmitter, bootstrapKb, @@ -248,8 +250,9 @@ func TestIntegration_KeeperPluginBasic(t *testing.T) { nodes []Node ) // Set up the minimum 4 oracles all funded - for i := int64(0); i < 4; i++ { - app, peerID, transmitter, kb := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_keeper%d", i), nodeKeys[i+1], backend, []commontypes.BootstrapperLocator{ + ports := freeport.GetN(t, 4) + for i := 0; i < 4; i++ { + app, peerID, transmitter, kb := setupNode(t, ports[i], fmt.Sprintf("oracle_keeper%d", i), nodeKeys[i+1], backend, []commontypes.BootstrapperLocator{ // Supply the bootstrap IP and port as a V2 peer address {PeerID: bootstrapPeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, }, NewSimulatedMercuryServer()) @@ -498,7 +501,7 @@ func TestIntegration_KeeperPluginForwarderEnabled(t *testing.T) { effectiveTransmitters := make([]common.Address, 0) // Setup bootstrap + oracle nodes - bootstrapNodePort := int64(19599) + bootstrapNodePort := freeport.GetOne(t) appBootstrap, bootstrapPeerID, bootstrapTransmitter, bootstrapKb := setupNode(t, bootstrapNodePort, "bootstrap_keeper_ocr", nodeKeys[0], backend, nil, NewSimulatedMercuryServer()) bootstrapNode := Node{ @@ -509,8 +512,9 @@ func TestIntegration_KeeperPluginForwarderEnabled(t *testing.T) { nodes []Node ) // Set up the minimum 4 oracles all funded - for i := int64(0); i < 4; i++ { - app, peerID, transmitter, kb := setupNode(t, bootstrapNodePort+i+1, fmt.Sprintf("oracle_keeper%d", i), nodeKeys[i+1], backend, []commontypes.BootstrapperLocator{ + ports := freeport.GetN(t, 4) + for i := 0; i < 4; i++ { + app, peerID, transmitter, kb := setupNode(t, ports[i], fmt.Sprintf("oracle_keeper%d", i), nodeKeys[i+1], backend, []commontypes.BootstrapperLocator{ // Supply the bootstrap IP and port as a V2 peer address {PeerID: bootstrapPeerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, }, NewSimulatedMercuryServer()) diff --git a/core/services/ocr2/plugins/ocr2vrf/internal/ocr2vrf_integration_test.go b/core/services/ocr2/plugins/ocr2vrf/internal/ocr2vrf_integration_test.go index 852017dffa9..9ae025d50cf 100644 --- a/core/services/ocr2/plugins/ocr2vrf/internal/ocr2vrf_integration_test.go +++ b/core/services/ocr2/plugins/ocr2vrf/internal/ocr2vrf_integration_test.go @@ -18,6 +18,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" "github.com/stretchr/testify/require" "go.dedis.ch/kyber/v3" @@ -217,7 +218,7 @@ func setupOCR2VRFContracts( func setupNodeOCR2( t *testing.T, owner *bind.TransactOpts, - port uint16, + port int, dbName string, b *backends.SimulatedBackend, useForwarders bool, @@ -336,7 +337,7 @@ func runOCR2VRFTest(t *testing.T, useForwarders bool) { t.Log("Creating bootstrap node") - bootstrapNodePort := testutils.GetFreePort(t) + bootstrapNodePort := freeport.GetOne(t) bootstrapNode := setupNodeOCR2(t, uni.owner, bootstrapNodePort, "bootstrap", uni.backend, false, nil) numNodes := 5 @@ -354,6 +355,7 @@ func runOCR2VRFTest(t *testing.T, useForwarders bool) { dkgSigners []dkgsignkey.Key sendingKeys [][]string ) + ports := freeport.GetN(t, numNodes) for i := 0; i < numNodes; i++ { // Supply the bootstrap IP and port as a V2 peer address bootstrappers := []commontypes.BootstrapperLocator{ @@ -361,7 +363,7 @@ func runOCR2VRFTest(t *testing.T, useForwarders bool) { fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort), }}, } - node := setupNodeOCR2(t, uni.owner, testutils.GetFreePort(t), fmt.Sprintf("ocr2vrforacle%d", i), uni.backend, useForwarders, bootstrappers) + node := setupNodeOCR2(t, uni.owner, ports[i], fmt.Sprintf("ocr2vrforacle%d", i), uni.backend, useForwarders, bootstrappers) sendingKeys = append(sendingKeys, node.sendingKeys) dkgSignKey, err := node.app.GetKeyStore().DKGSign().Create() diff --git a/go.mod b/go.mod index 5ffcb338675..fc58d0df7ff 100644 --- a/go.mod +++ b/go.mod @@ -33,6 +33,7 @@ require ( github.com/grafana/pyroscope-go v1.0.2 github.com/graph-gophers/dataloader v5.0.0+incompatible github.com/graph-gophers/graphql-go v1.3.0 + github.com/hashicorp/consul/sdk v0.14.1 github.com/hashicorp/go-plugin v1.5.2 github.com/hdevalence/ed25519consensus v0.1.0 github.com/jackc/pgconn v1.14.1 diff --git a/go.sum b/go.sum index 8df4ccfc30c..241cf6618b7 100644 --- a/go.sum +++ b/go.sum @@ -652,6 +652,8 @@ github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfm github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs= +github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -681,8 +683,8 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 802011b54ed..f215e54fdff 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1402,8 +1402,8 @@ github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBt github.com/hashicorp/consul/api v1.21.0 h1:WMR2JiyuaQWRAMFaOGiYfY4Q4HRpyYRe/oYQofjyduM= github.com/hashicorp/consul/api v1.21.0/go.mod h1:f8zVJwBcLdr1IQnfdfszjUM0xzp31Zl3bpws3pL9uFM= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.13.1 h1:EygWVWWMczTzXGpO93awkHFzfUka6hLYJ0qhETd+6lY= -github.com/hashicorp/consul/sdk v0.13.1/go.mod h1:SW/mM4LbKfqmMvcFu8v+eiQQ7oitXEFeiBe9StxERb0= +github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs= +github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg= github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c= github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= From f512ca51326f7c3d53f55435f4d4cd465961f402 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 10 Oct 2023 12:07:52 -0400 Subject: [PATCH 82/84] [TT-619] Poly zkEVM Compatibility (#10877) * Fix imports * Fixes bad gas estimation --- .../contracts/contract_deployer.go | 11 +++++++-- .../contracts/contract_loader.go | 5 ++++ .../contracts/contract_vrf_models.go | 10 ++++---- .../contracts/ethereum_contracts.go | 23 +++++++++---------- .../contracts/ethereum_contracts_local.go | 4 +++- .../contracts/ethereum_keeper_contracts.go | 5 ++-- .../contracts/ethereum_ocr2vrf_contracts.go | 6 +++-- .../contracts/ethereum_vrfv2_contracts.go | 7 ++++-- .../contracts/ethereum_vrfv2plus_contracts.go | 1 + integration-tests/docker/test_env/cl_node.go | 6 ++++- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- 12 files changed, 52 insertions(+), 32 deletions(-) diff --git a/integration-tests/contracts/contract_deployer.go b/integration-tests/contracts/contract_deployer.go index e92b3870faf..6389c75271d 100644 --- a/integration-tests/contracts/contract_deployer.go +++ b/integration-tests/contracts/contract_deployer.go @@ -11,12 +11,11 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/libocr/gethwrappers/offchainaggregator" "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" - eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_load_test_client" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_v1_events_mock" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_consumer_benchmark" @@ -56,6 +55,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/werc20_mock" + + eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" ) // ContractDeployer is an interface for abstracting the contract deployment methods across network implementations @@ -154,6 +155,8 @@ func NewContractDeployer(bcClient blockchain.EVMClient, logger zerolog.Logger) ( return &BSCContractDeployer{NewEthereumContractDeployer(clientImpl, logger)}, nil case *blockchain.ScrollClient: return &ScrollContractDeployer{NewEthereumContractDeployer(clientImpl, logger)}, nil + case *blockchain.PolygonZkEvmClient: + return &PolygonZkEvmContractDeployer{NewEthereumContractDeployer(clientImpl, logger)}, nil } return nil, errors.New("unknown blockchain client implementation for contract deployer, register blockchain client in NewContractDeployer") } @@ -209,6 +212,10 @@ type ScrollContractDeployer struct { *EthereumContractDeployer } +type PolygonZkEvmContractDeployer struct { + *EthereumContractDeployer +} + // NewEthereumContractDeployer returns an instantiated instance of the ETH contract deployer func NewEthereumContractDeployer(ethClient blockchain.EVMClient, logger zerolog.Logger) *EthereumContractDeployer { return &EthereumContractDeployer{ diff --git a/integration-tests/contracts/contract_loader.go b/integration-tests/contracts/contract_loader.go index fc0272b107e..ded570cbdc9 100644 --- a/integration-tests/contracts/contract_loader.go +++ b/integration-tests/contracts/contract_loader.go @@ -56,6 +56,8 @@ func NewContractLoader(bcClient blockchain.EVMClient, logger zerolog.Logger) (Co return &PolygonContractLoader{NewEthereumContractLoader(clientImpl, logger)}, nil case *blockchain.OptimismClient: return &OptimismContractLoader{NewEthereumContractLoader(clientImpl, logger)}, nil + case *blockchain.PolygonZkEvmClient: + return &PolygonZkEvmContractLoader{NewEthereumContractLoader(clientImpl, logger)}, nil } return nil, errors.New("unknown blockchain client implementation for contract Loader, register blockchain client in NewContractLoader") } @@ -90,6 +92,9 @@ type PolygonContractLoader struct { type OptimismContractLoader struct { *EthereumContractLoader } +type PolygonZkEvmContractLoader struct { + *EthereumContractLoader +} // NewEthereumContractLoader returns an instantiated instance of the ETH contract Loader func NewEthereumContractLoader(ethClient blockchain.EVMClient, logger zerolog.Logger) *EthereumContractLoader { diff --git a/integration-tests/contracts/contract_vrf_models.go b/integration-tests/contracts/contract_vrf_models.go index 2b623469aa4..f766ee7e3a0 100644 --- a/integration-tests/contracts/contract_vrf_models.go +++ b/integration-tests/contracts/contract_vrf_models.go @@ -2,20 +2,18 @@ package contracts import ( "context" - "math/big" "time" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_load_test_with_metrics" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/dkg" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/vrf_beacon" ) diff --git a/integration-tests/contracts/ethereum_contracts.go b/integration-tests/contracts/ethereum_contracts.go index fdeccfedad1..5f1f1eb8bb5 100644 --- a/integration-tests/contracts/ethereum_contracts.go +++ b/integration-tests/contracts/ethereum_contracts.go @@ -5,27 +5,19 @@ import ( "encoding/hex" "fmt" "math/big" + "strings" "time" "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + "github.com/pkg/errors" "github.com/rs/zerolog" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/libocr/gethwrappers/offchainaggregator" - "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" - ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" - ocrTypes "github.com/smartcontractkit/libocr/offchainreporting/types" - - "strings" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/pkg/errors" - - "github.com/smartcontractkit/chainlink/integration-tests/client" - eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_coordinator" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_load_test_client" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_router" @@ -52,6 +44,13 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/werc20_mock" + "github.com/smartcontractkit/libocr/gethwrappers/offchainaggregator" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" + ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" + ocrTypes "github.com/smartcontractkit/libocr/offchainreporting/types" + + "github.com/smartcontractkit/chainlink/integration-tests/client" + eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" ) // EthereumOracle oracle for "directrequest" job tests diff --git a/integration-tests/contracts/ethereum_contracts_local.go b/integration-tests/contracts/ethereum_contracts_local.go index aba6bc354e1..316658a791e 100644 --- a/integration-tests/contracts/ethereum_contracts_local.go +++ b/integration-tests/contracts/ethereum_contracts_local.go @@ -3,11 +3,13 @@ package contracts import ( "encoding/hex" "fmt" + "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/chainlink/integration-tests/client" ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" ocrTypes "github.com/smartcontractkit/libocr/offchainreporting/types" + + "github.com/smartcontractkit/chainlink/integration-tests/client" ) // SetConfigLocal sets the payees and the offchain reporting protocol configuration diff --git a/integration-tests/contracts/ethereum_keeper_contracts.go b/integration-tests/contracts/ethereum_keeper_contracts.go index afb6550bd2c..91cffd10e1e 100644 --- a/integration-tests/contracts/ethereum_keeper_contracts.go +++ b/integration-tests/contracts/ethereum_keeper_contracts.go @@ -11,14 +11,12 @@ import ( geth "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - goabi "github.com/umbracle/ethgo/abi" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" cltypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_consumer_benchmark" registrar21 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_registrar_wrapper2_1" @@ -34,6 +32,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_upkeep_counter_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/upkeep_transcoder" "github.com/smartcontractkit/chainlink/v2/core/utils" + goabi "github.com/umbracle/ethgo/abi" "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" "github.com/smartcontractkit/chainlink/integration-tests/testreporters" diff --git a/integration-tests/contracts/ethereum_ocr2vrf_contracts.go b/integration-tests/contracts/ethereum_ocr2vrf_contracts.go index 11606de53e5..e8149b21251 100644 --- a/integration-tests/contracts/ethereum_ocr2vrf_contracts.go +++ b/integration-tests/contracts/ethereum_ocr2vrf_contracts.go @@ -4,11 +4,15 @@ import ( "context" "encoding/hex" "fmt" + "math/big" + "time" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" "github.com/rs/zerolog/log" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" @@ -16,8 +20,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/vrf_beacon" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/vrf_beacon_consumer" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/vrf_coordinator" - "math/big" - "time" ) // EthereumDKG represents DKG contract diff --git a/integration-tests/contracts/ethereum_vrfv2_contracts.go b/integration-tests/contracts/ethereum_vrfv2_contracts.go index 88dfe58eb2f..5d8f03ae77b 100644 --- a/integration-tests/contracts/ethereum_vrfv2_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2_contracts.go @@ -3,17 +3,20 @@ package contracts import ( "context" "encoding/hex" + "math/big" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog/log" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_consumer_v2" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_load_test_with_metrics" - "math/big" + + eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" ) // EthereumVRFCoordinatorV2 represents VRFV2 coordinator contract diff --git a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go index 4ca5c0fec45..0543eb1d985 100644 --- a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" diff --git a/integration-tests/docker/test_env/cl_node.go b/integration-tests/docker/test_env/cl_node.go index d6ebaa69d81..7ff811df0c8 100644 --- a/integration-tests/docker/test_env/cl_node.go +++ b/integration-tests/docker/test_env/cl_node.go @@ -232,12 +232,16 @@ func (n *ClNode) Fund(evmClient blockchain.EVMClient, amount *big.Float) error { if err != nil { return err } - gasEstimates, err := evmClient.EstimateGas(ethereum.CallMsg{}) + toAddr := common.HexToAddress(toAddress) + gasEstimates, err := evmClient.EstimateGas(ethereum.CallMsg{ + To: &toAddr, + }) if err != nil { return err } return evmClient.Fund(toAddress, amount, gasEstimates) } + func (n *ClNode) StartContainer() error { err := n.PostgresDb.StartContainer() if err != nil { diff --git a/integration-tests/go.mod b/integration-tests/go.mod index b9a4641eaf6..f960e8998d7 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -20,7 +20,7 @@ require ( github.com/rs/zerolog v1.30.0 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-env v0.38.1 - github.com/smartcontractkit/chainlink-testing-framework v1.17.6 + github.com/smartcontractkit/chainlink-testing-framework v1.17.7 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 github.com/smartcontractkit/ocr2keepers v0.7.27 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index f215e54fdff..6ef96a4141b 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2370,8 +2370,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97ac github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918/go.mod h1:/yp/sqD8Iz5GU5fcercjrw0ivJF7HDcupYg+Gjr7EPg= -github.com/smartcontractkit/chainlink-testing-framework v1.17.6 h1:hcsP1eyzrqQf3veK4xh0T37PFkq5AasDwlgJfl11atY= -github.com/smartcontractkit/chainlink-testing-framework v1.17.6/go.mod h1:rypNxetVFh6bwaoHn05bsd4vCtgdEsF+1Vdyy/AhAR8= +github.com/smartcontractkit/chainlink-testing-framework v1.17.7 h1:VvxVDyj1eC/a5ZdOGa07U8VrfXUL/ecFEyO8KMvLaCw= +github.com/smartcontractkit/chainlink-testing-framework v1.17.7/go.mod h1:rypNxetVFh6bwaoHn05bsd4vCtgdEsF+1Vdyy/AhAR8= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= From 7b926c8864605f57299a01c68f2c511fd9137ca6 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 10 Oct 2023 13:36:32 -0400 Subject: [PATCH 83/84] [TT-619] zkEVM Integration and Gas Fixes (#10898) * Fix imports * Fix more imports * Fix gas estimations * Fix version * Fix To address --- integration-tests/actions/actions.go | 15 +++- .../actions/ocr_helpers_local.go | 5 +- .../contracts/contract_deployer.go | 6 +- .../contracts/contract_loader.go | 5 ++ .../contracts/ethereum_contracts.go | 73 +++++++++++-------- .../contracts/ethereum_keeper_contracts.go | 2 +- .../contracts/ethereum_vrf_contracts.go | 8 +- .../contracts/ethereum_vrfv2_contracts.go | 4 +- .../contracts/ethereum_vrfv2plus_contracts.go | 4 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- 11 files changed, 82 insertions(+), 46 deletions(-) diff --git a/integration-tests/actions/actions.go b/integration-tests/actions/actions.go index b09782e9e8a..dcdca91cc78 100644 --- a/integration-tests/actions/actions.go +++ b/integration-tests/actions/actions.go @@ -72,7 +72,10 @@ func FundChainlinkNodesAddress( if err != nil { return err } - gasEstimates, err := client.EstimateGas(ethereum.CallMsg{}) + toAddr := common.HexToAddress(toAddress[keyIndex]) + gasEstimates, err := client.EstimateGas(ethereum.CallMsg{ + To: &toAddr, + }) if err != nil { return err } @@ -96,7 +99,10 @@ func FundChainlinkNodesAddresses( return err } for _, addr := range toAddress { - gasEstimates, err := client.EstimateGas(ethereum.CallMsg{}) + toAddr := common.HexToAddress(addr) + gasEstimates, err := client.EstimateGas(ethereum.CallMsg{ + To: &toAddr, + }) if err != nil { return err } @@ -379,7 +385,10 @@ func ReturnFunds(chainlinkNodes []*client.ChainlinkK8sClient, blockchainClient b // FundAddresses will fund a list of addresses with an amount of native currency func FundAddresses(blockchain blockchain.EVMClient, amount *big.Float, addresses ...string) error { for _, address := range addresses { - gasEstimates, err := blockchain.EstimateGas(ethereum.CallMsg{}) + toAddr := common.HexToAddress(address) + gasEstimates, err := blockchain.EstimateGas(ethereum.CallMsg{ + To: &toAddr, + }) if err != nil { return err } diff --git a/integration-tests/actions/ocr_helpers_local.go b/integration-tests/actions/ocr_helpers_local.go index 4d8afc52c49..8bb4e834794 100644 --- a/integration-tests/actions/ocr_helpers_local.go +++ b/integration-tests/actions/ocr_helpers_local.go @@ -35,7 +35,10 @@ func FundChainlinkNodesLocal( if err != nil { return err } - gasEstimates, err := client.EstimateGas(ethereum.CallMsg{}) + toAddr := common.HexToAddress(toAddress) + gasEstimates, err := client.EstimateGas(ethereum.CallMsg{ + To: &toAddr, + }) if err != nil { return err } diff --git a/integration-tests/contracts/contract_deployer.go b/integration-tests/contracts/contract_deployer.go index 6389c75271d..c267a82d94f 100644 --- a/integration-tests/contracts/contract_deployer.go +++ b/integration-tests/contracts/contract_deployer.go @@ -11,9 +11,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/libocr/gethwrappers/offchainaggregator" - "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" - ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_load_test_client" @@ -55,6 +52,9 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/werc20_mock" + "github.com/smartcontractkit/libocr/gethwrappers/offchainaggregator" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" + ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" ) diff --git a/integration-tests/contracts/contract_loader.go b/integration-tests/contracts/contract_loader.go index ded570cbdc9..be5a9aa5e8f 100644 --- a/integration-tests/contracts/contract_loader.go +++ b/integration-tests/contracts/contract_loader.go @@ -96,6 +96,11 @@ type PolygonZkEvmContractLoader struct { *EthereumContractLoader } +// PolygonZKEVMContractLoader wraps for Polygon zkEVM +type PolygonZKEVMContractLoader struct { + *EthereumContractLoader +} + // NewEthereumContractLoader returns an instantiated instance of the ETH contract Loader func NewEthereumContractLoader(ethClient blockchain.EVMClient, logger zerolog.Logger) *EthereumContractLoader { return &EthereumContractLoader{ diff --git a/integration-tests/contracts/ethereum_contracts.go b/integration-tests/contracts/ethereum_contracts.go index 5f1f1eb8bb5..5b3a93fe0c2 100644 --- a/integration-tests/contracts/ethereum_contracts.go +++ b/integration-tests/contracts/ethereum_contracts.go @@ -65,7 +65,9 @@ func (e *EthereumOracle) Address() string { } func (e *EthereumOracle) Fund(ethAmount *big.Float) error { - gasEstimates, err := e.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := e.client.EstimateGas(ethereum.CallMsg{ + To: e.address, + }) if err != nil { return err } @@ -105,7 +107,9 @@ func (e *EthereumAPIConsumer) RoundID(ctx context.Context) (*big.Int, error) { } func (e *EthereumAPIConsumer) Fund(ethAmount *big.Float) error { - gasEstimates, err := e.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := e.client.EstimateGas(ethereum.CallMsg{ + To: e.address, + }) if err != nil { return err } @@ -157,7 +161,9 @@ func (f *EthereumStaking) Address() string { // Fund sends specified currencies to the contract func (f *EthereumStaking) Fund(ethAmount *big.Float) error { - gasEstimates, err := f.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := f.client.EstimateGas(ethereum.CallMsg{ + To: f.address, + }) if err != nil { return err } @@ -901,7 +907,9 @@ func (f *EthereumFluxAggregator) Address() string { // Fund sends specified currencies to the contract func (f *EthereumFluxAggregator) Fund(ethAmount *big.Float) error { - gasEstimates, err := f.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := f.client.EstimateGas(ethereum.CallMsg{ + To: f.address, + }) if err != nil { return err } @@ -1192,7 +1200,9 @@ type EthereumLinkToken struct { // Fund the LINK Token contract with ETH to distribute the token func (l *EthereumLinkToken) Fund(ethAmount *big.Float) error { - gasEstimates, err := l.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := l.client.EstimateGas(ethereum.CallMsg{ + To: &l.address, + }) if err != nil { return err } @@ -1289,7 +1299,9 @@ type EthereumOffchainAggregator struct { // Fund sends specified currencies to the contract func (o *EthereumOffchainAggregator) Fund(ethAmount *big.Float) error { - gasEstimates, err := o.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := o.client.EstimateGas(ethereum.CallMsg{ + To: o.address, + }) if err != nil { return err } @@ -1959,7 +1971,9 @@ func (e *EthereumOffchainAggregatorV2) Address() string { } func (e *EthereumOffchainAggregatorV2) Fund(nativeAmount *big.Float) error { - gasEstimates, err := e.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := e.client.EstimateGas(ethereum.CallMsg{ + To: e.address, + }) if err != nil { return err } @@ -2237,10 +2251,7 @@ func (e *EthereumFunctionsLoadTestClient) ResetStats() error { if err != nil { return err } - if err := e.client.ProcessTransaction(tx); err != nil { - return err - } - return nil + return e.client.ProcessTransaction(tx) } func (e *EthereumFunctionsLoadTestClient) SendRequest(times uint32, source string, encryptedSecretsReferences []byte, args []string, subscriptionId uint64, jobId [32]byte) error { @@ -2432,66 +2443,66 @@ func (e *EthereumWERC20Mock) Address() common.Address { return e.address } -func (l *EthereumWERC20Mock) Approve(to string, amount *big.Int) error { - opts, err := l.client.TransactionOpts(l.client.GetDefaultWallet()) +func (e *EthereumWERC20Mock) Approve(to string, amount *big.Int) error { + opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if err != nil { return err } - l.l.Info(). - Str("From", l.client.GetDefaultWallet().Address()). + e.l.Info(). + Str("From", e.client.GetDefaultWallet().Address()). Str("To", to). Str("Amount", amount.String()). Uint64("Nonce", opts.Nonce.Uint64()). Msg("Approving LINK Transfer") - tx, err := l.instance.Approve(opts, common.HexToAddress(to), amount) + tx, err := e.instance.Approve(opts, common.HexToAddress(to), amount) if err != nil { return err } - return l.client.ProcessTransaction(tx) + return e.client.ProcessTransaction(tx) } -func (l *EthereumWERC20Mock) BalanceOf(ctx context.Context, addr string) (*big.Int, error) { +func (e *EthereumWERC20Mock) BalanceOf(ctx context.Context, addr string) (*big.Int, error) { opts := &bind.CallOpts{ - From: common.HexToAddress(l.client.GetDefaultWallet().Address()), + From: common.HexToAddress(e.client.GetDefaultWallet().Address()), Context: ctx, } - balance, err := l.instance.BalanceOf(opts, common.HexToAddress(addr)) + balance, err := e.instance.BalanceOf(opts, common.HexToAddress(addr)) if err != nil { return nil, err } return balance, nil } -func (l *EthereumWERC20Mock) Transfer(to string, amount *big.Int) error { - opts, err := l.client.TransactionOpts(l.client.GetDefaultWallet()) +func (e *EthereumWERC20Mock) Transfer(to string, amount *big.Int) error { + opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if err != nil { return err } - l.l.Info(). - Str("From", l.client.GetDefaultWallet().Address()). + e.l.Info(). + Str("From", e.client.GetDefaultWallet().Address()). Str("To", to). Str("Amount", amount.String()). Uint64("Nonce", opts.Nonce.Uint64()). Msg("EthereumWERC20Mock.Transfer()") - tx, err := l.instance.Transfer(opts, common.HexToAddress(to), amount) + tx, err := e.instance.Transfer(opts, common.HexToAddress(to), amount) if err != nil { return err } - return l.client.ProcessTransaction(tx) + return e.client.ProcessTransaction(tx) } -func (l *EthereumWERC20Mock) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { - opts, err := l.client.TransactionOpts(l.client.GetDefaultWallet()) +func (e *EthereumWERC20Mock) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + opts, err := e.client.TransactionOpts(e.client.GetDefaultWallet()) if err != nil { return nil, err } - l.l.Info(). + e.l.Info(). Str("account", account.Hex()). Str("amount", amount.String()). Msg("EthereumWERC20Mock.Mint()") - tx, err := l.instance.Mint(opts, account, amount) + tx, err := e.instance.Mint(opts, account, amount) if err != nil { return tx, err } - return tx, l.client.ProcessTransaction(tx) + return tx, e.client.ProcessTransaction(tx) } diff --git a/integration-tests/contracts/ethereum_keeper_contracts.go b/integration-tests/contracts/ethereum_keeper_contracts.go index 91cffd10e1e..eea0a36aceb 100644 --- a/integration-tests/contracts/ethereum_keeper_contracts.go +++ b/integration-tests/contracts/ethereum_keeper_contracts.go @@ -15,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" + goabi "github.com/umbracle/ethgo/abi" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" cltypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -32,7 +33,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_upkeep_counter_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/upkeep_transcoder" "github.com/smartcontractkit/chainlink/v2/core/utils" - goabi "github.com/umbracle/ethgo/abi" "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" "github.com/smartcontractkit/chainlink/integration-tests/testreporters" diff --git a/integration-tests/contracts/ethereum_vrf_contracts.go b/integration-tests/contracts/ethereum_vrf_contracts.go index f97ba86d975..4e7ba45d55b 100644 --- a/integration-tests/contracts/ethereum_vrf_contracts.go +++ b/integration-tests/contracts/ethereum_vrf_contracts.go @@ -175,7 +175,9 @@ func (v *EthereumVRFConsumer) Address() string { } func (v *EthereumVRFConsumer) Fund(ethAmount *big.Float) error { - gasEstimates, err := v.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := v.client.EstimateGas(ethereum.CallMsg{ + To: v.address, + }) if err != nil { return err } @@ -277,7 +279,9 @@ func (f *VRFConsumerRoundConfirmer) Wait() error { // Fund sends specified currencies to the contract func (v *EthereumVRF) Fund(ethAmount *big.Float) error { - gasEstimates, err := v.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := v.client.EstimateGas(ethereum.CallMsg{ + To: v.address, + }) if err != nil { return err } diff --git a/integration-tests/contracts/ethereum_vrfv2_contracts.go b/integration-tests/contracts/ethereum_vrfv2_contracts.go index 5d8f03ae77b..1bcd460c399 100644 --- a/integration-tests/contracts/ethereum_vrfv2_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2_contracts.go @@ -289,7 +289,9 @@ func (v *EthereumVRFConsumerV2) GasAvailable() (*big.Int, error) { } func (v *EthereumVRFConsumerV2) Fund(ethAmount *big.Float) error { - gasEstimates, err := v.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := v.client.EstimateGas(ethereum.CallMsg{ + To: v.address, + }) if err != nil { return err } diff --git a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go index 0543eb1d985..15a9770f4e5 100644 --- a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go @@ -786,7 +786,9 @@ func (v *EthereumVRFV2PlusWrapper) GetSubID(ctx context.Context) (*big.Int, erro } func (v *EthereumVRFV2PlusWrapperLoadTestConsumer) Fund(ethAmount *big.Float) error { - gasEstimates, err := v.client.EstimateGas(ethereum.CallMsg{}) + gasEstimates, err := v.client.EstimateGas(ethereum.CallMsg{ + To: v.address, + }) if err != nil { return err } diff --git a/integration-tests/go.mod b/integration-tests/go.mod index f960e8998d7..e82de0d4567 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -20,7 +20,7 @@ require ( github.com/rs/zerolog v1.30.0 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-env v0.38.1 - github.com/smartcontractkit/chainlink-testing-framework v1.17.7 + github.com/smartcontractkit/chainlink-testing-framework v1.17.8 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20230922131214-122accb19ea6 github.com/smartcontractkit/ocr2keepers v0.7.27 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 6ef96a4141b..af8a8b573fe 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2370,8 +2370,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97ac github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918/go.mod h1:/yp/sqD8Iz5GU5fcercjrw0ivJF7HDcupYg+Gjr7EPg= -github.com/smartcontractkit/chainlink-testing-framework v1.17.7 h1:VvxVDyj1eC/a5ZdOGa07U8VrfXUL/ecFEyO8KMvLaCw= -github.com/smartcontractkit/chainlink-testing-framework v1.17.7/go.mod h1:rypNxetVFh6bwaoHn05bsd4vCtgdEsF+1Vdyy/AhAR8= +github.com/smartcontractkit/chainlink-testing-framework v1.17.8 h1:/VEMK3biV/Ml8Liswn5M6pVrRoTnHdLvsoqKr/Cq1f8= +github.com/smartcontractkit/chainlink-testing-framework v1.17.8/go.mod h1:rypNxetVFh6bwaoHn05bsd4vCtgdEsF+1Vdyy/AhAR8= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= From 5e5173471218bb95a5c2cc0f1832a8c1b7023235 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 10 Oct 2023 14:38:54 -0400 Subject: [PATCH 84/84] Fixes Odd Exit Code (#10900) --- integration-tests/scripts/entrypoint | 4 +++- integration-tests/testsetups/keeper_benchmark.go | 2 -- integration-tests/testsetups/ocr.go | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/integration-tests/scripts/entrypoint b/integration-tests/scripts/entrypoint index 3955023685d..cb5c98fde6a 100755 --- a/integration-tests/scripts/entrypoint +++ b/integration-tests/scripts/entrypoint @@ -21,7 +21,9 @@ exit_code=$? echo "Test exit code: ${exit_code}" -if [ $exit_code -eq 2 ]; then # 2 is the code for an interrupted test, we only want to restart the test when the test is interrupted +# 3 is the code for an interrupted test, we only want to restart the test when the test is interrupted and in a state +# that it can recover from. Otherwise we mark the test as "passed" as far as K8s is concerned so it doesn't restart it. +if [ $exit_code -eq 3 ]; then exit 1 # Exiting with non-zero status to trigger pod restart fi diff --git a/integration-tests/testsetups/keeper_benchmark.go b/integration-tests/testsetups/keeper_benchmark.go index ba0cc23b23b..2fd19d35cb3 100644 --- a/integration-tests/testsetups/keeper_benchmark.go +++ b/integration-tests/testsetups/keeper_benchmark.go @@ -132,8 +132,6 @@ func (k *KeeperBenchmarkTest) Setup(t *testing.T, env *environment.Environment) } } - var () - c := inputs.Contracts if common.IsHexAddress(c.LinkTokenAddress) { diff --git a/integration-tests/testsetups/ocr.go b/integration-tests/testsetups/ocr.go index 7781e6c114f..49ee8a69780 100644 --- a/integration-tests/testsetups/ocr.go +++ b/integration-tests/testsetups/ocr.go @@ -43,7 +43,10 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/testreporters" ) -const saveFileLocation = "/persistence/ocr-soak-test-state.toml" +const ( + saveFileLocation = "/persistence/ocr-soak-test-state.toml" + interruptedExitCode = 3 +) // OCRSoakTest defines a typical OCR soak test type OCRSoakTest struct { @@ -485,7 +488,7 @@ func (o *OCRSoakTest) testLoop(testDuration time.Duration, newValue int) { o.log.Error().Err(err).Msg("Error saving state") } o.log.Warn().Str("Time Taken", time.Since(saveStart).String()).Msg("Saved state") - os.Exit(2) // Exit with code 2 to indicate test was interrupted, not just a normal failure + os.Exit(interruptedExitCode) // Exit with interrupted code to indicate test was interrupted, not just a normal failure case <-endTest: return case <-newRoundTrigger.C: