contracts

package
v1.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 20 Imported by: 0

README

Contracts

Contains all code to launch, and interact with smart contracts on a blockchain.

All contracts are generalized by interfaces in order to simplify test logic across different chains.

Documentation

Overview

Package contracts handles deployment, management, and interactions of smart contracts on various chains

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConsumer

type APIConsumer interface {
	Address() string
	RoundID(ctx context.Context) (*big.Int, error)
	Fund(ethAmount *big.Float) error
	Data(ctx context.Context) (*big.Int, error)
	CreateRequestTo(
		oracleAddr string,
		jobID [32]byte,
		payment *big.Int,
		url string,
		path string,
		times *big.Int,
	) error
	WatchPerfEvents(ctx context.Context, eventChan chan<- *PerfEvent) error
}

type BlockHashStore

type BlockHashStore interface {
	Address() string
}

type ContractDeployer

type ContractDeployer interface {
	DeployStorageContract() (Storage, error)
	DeployAPIConsumer(linkAddr string) (APIConsumer, error)
	DeployOracle(linkAddr string) (Oracle, error)
	DeployReadAccessController() (ReadAccessController, error)
	DeployFlags(rac string) (Flags, error)
	DeployDeviationFlaggingValidator(
		flags string,
		flaggingThreshold *big.Int,
	) (DeviationFlaggingValidator, error)
	DeployFluxAggregatorContract(linkAddr string, fluxOptions FluxAggregatorOptions) (FluxAggregator, error)
	DeployLinkTokenContract() (LinkToken, error)
	DeployOffChainAggregator(linkAddr string, offchainOptions OffchainOptions) (OffchainAggregator, error)
	DeployVRFContract() (VRF, error)
	DeployMockETHLINKFeed(answer *big.Int) (MockETHLINKFeed, error)
	DeployMockGasFeed(answer *big.Int) (MockGasFeed, error)
	DeployKeeperRegistrar(linkAddr string, registrarSettings KeeperRegistrarSettings) (KeeperRegistrar, error)
	DeployKeeperRegistry(opts *KeeperRegistryOpts) (KeeperRegistry, error)
	DeployKeeperConsumer(updateInterval *big.Int) (KeeperConsumer, error)
	DeployKeeperConsumerPerformance(
		testBlockRange,
		averageCadence,
		checkGasToBurn,
		performGasToBurn *big.Int,
	) (KeeperConsumerPerformance, error)
	DeployUpkeepCounter(testRange *big.Int, interval *big.Int) (UpkeepCounter, error)
	DeployUpkeepPerformCounterRestrictive(testRange *big.Int, averageEligibilityCadence *big.Int) (UpkeepPerformCounterRestrictive, error)
	DeployVRFConsumer(linkAddr string, coordinatorAddr string) (VRFConsumer, error)
	DeployVRFConsumerV2(linkAddr string, coordinatorAddr string) (VRFConsumerV2, error)
	DeployVRFCoordinator(linkAddr string, bhsAddr string) (VRFCoordinator, error)
	DeployVRFCoordinatorV2(linkAddr string, bhsAddr string, linkEthFeedAddr string) (VRFCoordinatorV2, error)
	DeployBlockhashStore() (BlockHashStore, error)
}

ContractDeployer is an interface for abstracting the contract deployment methods across network implementations

func NewContractDeployer

func NewContractDeployer(bcClient blockchain.EVMClient) (ContractDeployer, error)

NewContractDeployer returns an instance of a contract deployer based on the client type

type DeviationFlaggingValidator

type DeviationFlaggingValidator interface {
	Address() string
}

DeviationFlaggingValidator contract used as an external validator, fox ex. in flux monitor rounds validation

type EthereumAPIConsumer

type EthereumAPIConsumer struct {
	// contains filtered or unexported fields
}

EthereumAPIConsumer API consumer for job type "directrequest" tests

func (*EthereumAPIConsumer) Address

func (e *EthereumAPIConsumer) Address() string

func (*EthereumAPIConsumer) CreateRequestTo

func (e *EthereumAPIConsumer) CreateRequestTo(
	oracleAddr string,
	jobID [32]byte,
	payment *big.Int,
	url string,
	path string,
	times *big.Int,
) error

CreateRequestTo creates request to an oracle for particular jobID with params

func (*EthereumAPIConsumer) Data

func (e *EthereumAPIConsumer) Data(ctx context.Context) (*big.Int, error)

func (*EthereumAPIConsumer) Fund

func (e *EthereumAPIConsumer) Fund(ethAmount *big.Float) error

func (*EthereumAPIConsumer) RoundID

func (e *EthereumAPIConsumer) RoundID(ctx context.Context) (*big.Int, error)

func (*EthereumAPIConsumer) WatchPerfEvents

func (e *EthereumAPIConsumer) WatchPerfEvents(ctx context.Context, eventChan chan<- *PerfEvent) error

type EthereumBlockhashStore

type EthereumBlockhashStore struct {
	// contains filtered or unexported fields
}

EthereumBlockhashStore represents a blockhash store for VRF contract

func (*EthereumBlockhashStore) Address

func (v *EthereumBlockhashStore) Address() string

type EthereumContractDeployer

type EthereumContractDeployer struct {
	// contains filtered or unexported fields
}

EthereumContractDeployer provides the implementations for deploying ETH (EVM) based contracts

func NewEthereumContractDeployer

func NewEthereumContractDeployer(ethClient blockchain.EVMClient) *EthereumContractDeployer

NewEthereumContractDeployer returns an instantiated instance of the ETH contract deployer

func (*EthereumContractDeployer) DeployAPIConsumer

func (e *EthereumContractDeployer) DeployAPIConsumer(linkAddr string) (APIConsumer, error)

DeployAPIConsumer deploys api consumer for oracle

func (*EthereumContractDeployer) DeployBlockhashStore

func (e *EthereumContractDeployer) DeployBlockhashStore() (BlockHashStore, error)

DeployBlockhashStore deploys blockhash store used with VRF contract

func (*EthereumContractDeployer) DeployDeviationFlaggingValidator

func (e *EthereumContractDeployer) DeployDeviationFlaggingValidator(
	flags string,
	flaggingThreshold *big.Int,
) (DeviationFlaggingValidator, error)

DeployDeviationFlaggingValidator deploys deviation flagging validator contract

func (*EthereumContractDeployer) DeployFlags

func (e *EthereumContractDeployer) DeployFlags(
	rac string,
) (Flags, error)

DeployFlags deploys flags contract

func (*EthereumContractDeployer) DeployFluxAggregatorContract

func (e *EthereumContractDeployer) DeployFluxAggregatorContract(
	linkAddr string,
	fluxOptions FluxAggregatorOptions,
) (FluxAggregator, error)

DeployFluxAggregatorContract deploys the Flux Aggregator Contract on an EVM chain

func (*EthereumContractDeployer) DeployKeeperConsumer

func (e *EthereumContractDeployer) DeployKeeperConsumer(updateInterval *big.Int) (KeeperConsumer, error)

func (*EthereumContractDeployer) DeployKeeperConsumerPerformance

func (e *EthereumContractDeployer) DeployKeeperConsumerPerformance(
	testBlockRange,
	averageCadence,
	checkGasToBurn,
	performGasToBurn *big.Int,
) (KeeperConsumerPerformance, error)

func (*EthereumContractDeployer) DeployKeeperRegistrar added in v1.3.7

func (e *EthereumContractDeployer) DeployKeeperRegistrar(linkAddr string,
	registrarSettings KeeperRegistrarSettings) (KeeperRegistrar, error)

func (*EthereumContractDeployer) DeployKeeperRegistry

func (e *EthereumContractDeployer) DeployKeeperRegistry(
	opts *KeeperRegistryOpts,
) (KeeperRegistry, error)

func (*EthereumContractDeployer) DeployLinkTokenContract

func (e *EthereumContractDeployer) DeployLinkTokenContract() (LinkToken, error)

DeployLinkTokenContract deploys a Link Token contract to an EVM chain

func (*EthereumContractDeployer) DeployMockETHLINKFeed

func (e *EthereumContractDeployer) DeployMockETHLINKFeed(answer *big.Int) (MockETHLINKFeed, error)

func (*EthereumContractDeployer) DeployMockGasFeed

func (e *EthereumContractDeployer) DeployMockGasFeed(answer *big.Int) (MockGasFeed, error)

func (*EthereumContractDeployer) DeployOffChainAggregator

func (e *EthereumContractDeployer) DeployOffChainAggregator(
	linkAddr string,
	offchainOptions OffchainOptions,
) (OffchainAggregator, error)

DeployOffChainAggregator deploys the offchain aggregation contract to the EVM chain

func (*EthereumContractDeployer) DeployOracle

func (e *EthereumContractDeployer) DeployOracle(linkAddr string) (Oracle, error)

DeployOracle deploys oracle for consumer test

func (*EthereumContractDeployer) DeployReadAccessController

func (e *EthereumContractDeployer) DeployReadAccessController() (ReadAccessController, error)

DeployReadAccessController deploys read/write access controller contract

func (*EthereumContractDeployer) DeployStorageContract

func (e *EthereumContractDeployer) DeployStorageContract() (Storage, error)

DeployStorageContract deploys a vanilla storage contract that is a value store

func (*EthereumContractDeployer) DeployUpkeepCounter added in v1.1.19

func (e *EthereumContractDeployer) DeployUpkeepCounter(testRange *big.Int, interval *big.Int) (UpkeepCounter, error)

func (*EthereumContractDeployer) DeployUpkeepPerformCounterRestrictive added in v1.1.20

func (e *EthereumContractDeployer) DeployUpkeepPerformCounterRestrictive(testRange *big.Int, averageEligibilityCadence *big.Int) (UpkeepPerformCounterRestrictive, error)

func (*EthereumContractDeployer) DeployVRFConsumer

func (e *EthereumContractDeployer) DeployVRFConsumer(linkAddr string, coordinatorAddr string) (VRFConsumer, error)

DeployVRFConsumer deploys VRF consumer contract

func (*EthereumContractDeployer) DeployVRFConsumerV2

func (e *EthereumContractDeployer) DeployVRFConsumerV2(linkAddr string, coordinatorAddr string) (VRFConsumerV2, error)

DeployVRFConsumerV2 deploys VRFv@ consumer contract

func (*EthereumContractDeployer) DeployVRFContract

func (e *EthereumContractDeployer) DeployVRFContract() (VRF, error)

DeployVRFContract deploy VRF contract

func (*EthereumContractDeployer) DeployVRFCoordinator

func (e *EthereumContractDeployer) DeployVRFCoordinator(linkAddr string, bhsAddr string) (VRFCoordinator, error)

DeployVRFCoordinator deploys VRF coordinator contract

func (*EthereumContractDeployer) DeployVRFCoordinatorV2

func (e *EthereumContractDeployer) DeployVRFCoordinatorV2(linkAddr string, bhsAddr string, linkEthFeedAddr string) (VRFCoordinatorV2, error)

DeployVRFCoordinatorV2 deploys VRFV2 coordinator contract

type EthereumDeviationFlaggingValidator

type EthereumDeviationFlaggingValidator struct {
	// contains filtered or unexported fields
}

EthereumDeviationFlaggingValidator represents deviation flagging validator contract

func (*EthereumDeviationFlaggingValidator) Address

type EthereumFlags

type EthereumFlags struct {
	// contains filtered or unexported fields
}

EthereumFlags represents flags contract

func (*EthereumFlags) Address

func (e *EthereumFlags) Address() string

func (*EthereumFlags) GetFlag

func (e *EthereumFlags) GetFlag(ctx context.Context, addr string) (bool, error)

GetFlag returns boolean if a flag was set for particular address

type EthereumFluxAggregator

type EthereumFluxAggregator struct {
	// contains filtered or unexported fields
}

EthereumFluxAggregator represents the basic flux aggregation contract

func (*EthereumFluxAggregator) Address

func (f *EthereumFluxAggregator) Address() string

func (*EthereumFluxAggregator) Description

func (f *EthereumFluxAggregator) Description(ctxt context.Context) (string, error)

Description returns the description of the flux aggregator contract

func (*EthereumFluxAggregator) Fund

func (f *EthereumFluxAggregator) Fund(ethAmount *big.Float) error

Fund sends specified currencies to the contract

func (*EthereumFluxAggregator) GetContractData

func (f *EthereumFluxAggregator) GetContractData(ctx context.Context) (*FluxAggregatorData, error)

GetContractData retrieves basic data for the flux aggregator contract

func (*EthereumFluxAggregator) GetOracles

func (f *EthereumFluxAggregator) GetOracles(ctx context.Context) ([]string, error)

func (*EthereumFluxAggregator) LatestRoundData

func (f *EthereumFluxAggregator) LatestRoundData(ctx context.Context) (RoundData, error)

func (*EthereumFluxAggregator) LatestRoundID

func (f *EthereumFluxAggregator) LatestRoundID(ctx context.Context) (*big.Int, error)

func (*EthereumFluxAggregator) PaymentAmount

func (f *EthereumFluxAggregator) PaymentAmount(ctx context.Context) (*big.Int, error)

func (*EthereumFluxAggregator) RequestNewRound

func (f *EthereumFluxAggregator) RequestNewRound(ctx context.Context) error

func (*EthereumFluxAggregator) SetOracles

SetOracles allows the ability to add and/or remove oracles from the contract, and to set admins

func (*EthereumFluxAggregator) SetRequesterPermissions

func (f *EthereumFluxAggregator) SetRequesterPermissions(ctx context.Context, addr common.Address, authorized bool, roundsDelay uint32) error

func (*EthereumFluxAggregator) UpdateAvailableFunds

func (f *EthereumFluxAggregator) UpdateAvailableFunds() error

func (*EthereumFluxAggregator) WatchSubmissionReceived

func (f *EthereumFluxAggregator) WatchSubmissionReceived(ctx context.Context, eventChan chan<- *SubmissionEvent) error

WatchSubmissionReceived subscribes to any submissions on a flux feed

func (*EthereumFluxAggregator) WithdrawPayment

func (f *EthereumFluxAggregator) WithdrawPayment(
	ctx context.Context,
	from common.Address,
	to common.Address,
	amount *big.Int) error

func (*EthereumFluxAggregator) WithdrawablePayment

func (f *EthereumFluxAggregator) WithdrawablePayment(ctx context.Context, addr common.Address) (*big.Int, error)

type EthereumKeeperConsumer

type EthereumKeeperConsumer struct {
	// contains filtered or unexported fields
}

EthereumKeeperConsumer represents keeper consumer (upkeep) contract

func (*EthereumKeeperConsumer) Address

func (v *EthereumKeeperConsumer) Address() string

func (*EthereumKeeperConsumer) Counter

func (v *EthereumKeeperConsumer) Counter(ctx context.Context) (*big.Int, error)

func (*EthereumKeeperConsumer) Fund

func (v *EthereumKeeperConsumer) Fund(ethAmount *big.Float) error

type EthereumKeeperConsumerPerformance

type EthereumKeeperConsumerPerformance struct {
	// contains filtered or unexported fields
}

EthereumKeeperConsumerPerformance represents a more complicated keeper consumer contract, one intended only for performance tests.

func (*EthereumKeeperConsumerPerformance) Address

func (*EthereumKeeperConsumerPerformance) CheckEligible

func (v *EthereumKeeperConsumerPerformance) CheckEligible(ctx context.Context) (bool, error)

func (*EthereumKeeperConsumerPerformance) Fund

func (v *EthereumKeeperConsumerPerformance) Fund(ethAmount *big.Float) error

func (*EthereumKeeperConsumerPerformance) GetUpkeepCount

func (v *EthereumKeeperConsumerPerformance) GetUpkeepCount(ctx context.Context) (*big.Int, error)

func (*EthereumKeeperConsumerPerformance) SetCheckGasToBurn added in v1.2.5

func (v *EthereumKeeperConsumerPerformance) SetCheckGasToBurn(ctx context.Context, gas *big.Int) error

func (*EthereumKeeperConsumerPerformance) SetPerformGasToBurn added in v1.2.5

func (v *EthereumKeeperConsumerPerformance) SetPerformGasToBurn(ctx context.Context, gas *big.Int) error

type EthereumKeeperRegistrar added in v1.3.7

type EthereumKeeperRegistrar struct {
	// contains filtered or unexported fields
}

EthereumKeeperRegistrar corresponds to the registrar which is used to send requests to the registry when registering new upkeeps.

func (*EthereumKeeperRegistrar) Address added in v1.3.7

func (v *EthereumKeeperRegistrar) Address() string

func (*EthereumKeeperRegistrar) EncodeRegisterRequest added in v1.3.7

func (v *EthereumKeeperRegistrar) EncodeRegisterRequest(
	name string,
	email []byte,
	upkeepAddr string,
	gasLimit uint32,
	adminAddr string,
	checkData []byte,
	amount *big.Int,
	source uint8,
	senderAddr string,
) ([]byte, error)

EncodeRegisterRequest encodes register request to call it through link token TransferAndCall

func (*EthereumKeeperRegistrar) Fund added in v1.3.7

func (v *EthereumKeeperRegistrar) Fund(ethAmount *big.Float) error

type EthereumKeeperRegistry

type EthereumKeeperRegistry struct {
	// contains filtered or unexported fields
}

EthereumKeeperRegistry represents keeper registry contract

func (*EthereumKeeperRegistry) AddUpkeepFunds

func (v *EthereumKeeperRegistry) AddUpkeepFunds(id *big.Int, amount *big.Int) error

AddUpkeepFunds adds link for particular upkeep id

func (*EthereumKeeperRegistry) Address

func (v *EthereumKeeperRegistry) Address() string

func (*EthereumKeeperRegistry) CancelUpkeep added in v1.2.0

func (v *EthereumKeeperRegistry) CancelUpkeep(id *big.Int) error

CancelUpkeep cancels the given upkeep ID

func (*EthereumKeeperRegistry) Fund

func (v *EthereumKeeperRegistry) Fund(ethAmount *big.Float) error

func (*EthereumKeeperRegistry) GetKeeperInfo

func (v *EthereumKeeperRegistry) GetKeeperInfo(ctx context.Context, keeperAddr string) (*KeeperInfo, error)

func (*EthereumKeeperRegistry) GetKeeperList

func (v *EthereumKeeperRegistry) GetKeeperList(ctx context.Context) ([]string, error)

GetKeeperList get list of all registered keeper addresses

func (*EthereumKeeperRegistry) GetUpkeepInfo

func (v *EthereumKeeperRegistry) GetUpkeepInfo(ctx context.Context, id *big.Int) (*UpkeepInfo, error)

GetUpkeepInfo gets upkeep info

func (*EthereumKeeperRegistry) ParseUpkeepIdFromRegisteredLog added in v1.2.4

func (v *EthereumKeeperRegistry) ParseUpkeepIdFromRegisteredLog(log *types.Log) (*big.Int, error)

Parses the upkeep ID from an 'UpkeepRegistered' log, returns error on any other log

func (*EthereumKeeperRegistry) Pause added in v1.2.6

func (v *EthereumKeeperRegistry) Pause() error

func (*EthereumKeeperRegistry) RegisterUpkeep

func (v *EthereumKeeperRegistry) RegisterUpkeep(target string, gasLimit uint32, admin string, checkData []byte) error

RegisterUpkeep registers contract to perform upkeep

func (*EthereumKeeperRegistry) SetConfig added in v1.2.4

func (*EthereumKeeperRegistry) SetKeepers

func (v *EthereumKeeperRegistry) SetKeepers(keepers []string, payees []string) error

func (*EthereumKeeperRegistry) SetRegistrar

func (v *EthereumKeeperRegistry) SetRegistrar(registrarAddr string) error

func (*EthereumKeeperRegistry) SetUpkeepGasLimit added in v1.2.5

func (v *EthereumKeeperRegistry) SetUpkeepGasLimit(id *big.Int, gas uint32) error

SetUpkeepGasLimit sets the perform gas limit for a given upkeep ID

type EthereumLinkToken

type EthereumLinkToken struct {
	// contains filtered or unexported fields
}

EthereumLinkToken represents a LinkToken address

func (*EthereumLinkToken) Address

func (l *EthereumLinkToken) Address() string

func (*EthereumLinkToken) Approve

func (l *EthereumLinkToken) Approve(to string, amount *big.Int) error

func (*EthereumLinkToken) BalanceOf

func (l *EthereumLinkToken) BalanceOf(ctx context.Context, addr string) (*big.Int, error)

func (*EthereumLinkToken) Fund

func (l *EthereumLinkToken) Fund(ethAmount *big.Float) error

Fund the LINK Token contract with ETH to distribute the token

func (*EthereumLinkToken) LoadExistingLinkToken added in v1.2.6

func (l *EthereumLinkToken) LoadExistingLinkToken(address string, client blockchain.EVMClient) error

LoadExistingLinkToken loads an EthereumLinkToken with a specific address

func (*EthereumLinkToken) Name

func (l *EthereumLinkToken) Name(ctxt context.Context) (string, error)

Name returns the name of the link token

func (*EthereumLinkToken) Transfer

func (l *EthereumLinkToken) Transfer(to string, amount *big.Int) error

func (*EthereumLinkToken) TransferAndCall

func (l *EthereumLinkToken) TransferAndCall(to string, amount *big.Int, data []byte) (*types.Transaction, error)

type EthereumMockETHLINKFeed

type EthereumMockETHLINKFeed struct {
	// contains filtered or unexported fields
}

EthereumMockETHLINKFeed represents mocked ETH/LINK feed contract

func (*EthereumMockETHLINKFeed) Address

func (v *EthereumMockETHLINKFeed) Address() string

func (*EthereumMockETHLINKFeed) LatestRoundData

func (v *EthereumMockETHLINKFeed) LatestRoundData() (*big.Int, error)

type EthereumMockGASFeed

type EthereumMockGASFeed struct {
	// contains filtered or unexported fields
}

EthereumMockGASFeed represents mocked Gas feed contract

func (*EthereumMockGASFeed) Address

func (v *EthereumMockGASFeed) Address() string

type EthereumOffchainAggregator

type EthereumOffchainAggregator struct {
	// contains filtered or unexported fields
}

EthereumOffchainAggregator represents the offchain aggregation contract

func (*EthereumOffchainAggregator) Address

func (o *EthereumOffchainAggregator) Address() string

func (*EthereumOffchainAggregator) Fund

func (o *EthereumOffchainAggregator) Fund(ethAmount *big.Float) error

Fund sends specified currencies to the contract

func (*EthereumOffchainAggregator) GetContractData

GetContractData retrieves basic data for the offchain aggregator contract

func (*EthereumOffchainAggregator) GetLatestAnswer

func (o *EthereumOffchainAggregator) GetLatestAnswer(ctxt context.Context) (*big.Int, error)

GetLatestAnswer returns the latest answer from the OCR contract

func (*EthereumOffchainAggregator) GetLatestRound

func (o *EthereumOffchainAggregator) GetLatestRound(ctxt context.Context) (*RoundData, error)

GetLatestRound returns data from the latest round

func (*EthereumOffchainAggregator) RequestNewRound

func (o *EthereumOffchainAggregator) RequestNewRound() error

RequestNewRound requests the OCR contract to create a new round

func (*EthereumOffchainAggregator) SetConfig

func (o *EthereumOffchainAggregator) SetConfig(
	chainlinkNodes []client.Chainlink,
	ocrConfig OffChainAggregatorConfig,
) error

SetConfig sets the payees and the offchain reporting protocol configuration

func (*EthereumOffchainAggregator) SetPayees

func (o *EthereumOffchainAggregator) SetPayees(
	transmitters, payees []string,
) error

SetPayees sets wallets for the contract to pay out to?

type EthereumOracle

type EthereumOracle struct {
	// contains filtered or unexported fields
}

EthereumOracle oracle for "directrequest" job tests

func (*EthereumOracle) Address

func (e *EthereumOracle) Address() string

func (*EthereumOracle) Fund

func (e *EthereumOracle) Fund(ethAmount *big.Float) error

func (*EthereumOracle) SetFulfillmentPermission

func (e *EthereumOracle) SetFulfillmentPermission(address string, allowed bool) error

SetFulfillmentPermission sets fulfillment permission for particular address

type EthereumReadAccessController

type EthereumReadAccessController struct {
	// contains filtered or unexported fields
}

EthereumReadAccessController represents read access controller contract

func (*EthereumReadAccessController) AddAccess

func (e *EthereumReadAccessController) AddAccess(addr string) error

AddAccess grants access to particular address to raise a flag

func (*EthereumReadAccessController) Address

func (e *EthereumReadAccessController) Address() string

func (*EthereumReadAccessController) DisableAccessCheck

func (e *EthereumReadAccessController) DisableAccessCheck() error

DisableAccessCheck disables all access checks

type EthereumStorage

type EthereumStorage struct {
	// contains filtered or unexported fields
}

EthereumStorage acts as a conduit for the ethereum version of the storage contract

func (*EthereumStorage) Get

func (e *EthereumStorage) Get(ctxt context.Context) (*big.Int, error)

Get retrieves a set value from the storage contract

func (*EthereumStorage) Set

func (e *EthereumStorage) Set(value *big.Int) error

Set sets a value in the storage contract

type EthereumUpkeepCounter added in v1.1.19

type EthereumUpkeepCounter struct {
	// contains filtered or unexported fields
}

EthereumUpkeepCounter represents keeper consumer (upkeep) counter contract

func (*EthereumUpkeepCounter) Address added in v1.1.19

func (v *EthereumUpkeepCounter) Address() string

func (*EthereumUpkeepCounter) Counter added in v1.1.19

func (v *EthereumUpkeepCounter) Counter(ctx context.Context) (*big.Int, error)

func (*EthereumUpkeepCounter) Fund added in v1.1.19

func (v *EthereumUpkeepCounter) Fund(ethAmount *big.Float) error

func (*EthereumUpkeepCounter) SetSpread added in v1.1.19

func (v *EthereumUpkeepCounter) SetSpread(testRange *big.Int, interval *big.Int) error

type EthereumUpkeepPerformCounterRestrictive added in v1.1.20

type EthereumUpkeepPerformCounterRestrictive struct {
	// contains filtered or unexported fields
}

EthereumUpkeepPerformCounterRestrictive represents keeper consumer (upkeep) counter contract

func (*EthereumUpkeepPerformCounterRestrictive) Address added in v1.1.20

func (*EthereumUpkeepPerformCounterRestrictive) Counter added in v1.1.20

func (*EthereumUpkeepPerformCounterRestrictive) Fund added in v1.1.20

func (*EthereumUpkeepPerformCounterRestrictive) SetSpread added in v1.1.20

func (v *EthereumUpkeepPerformCounterRestrictive) SetSpread(testRange *big.Int, interval *big.Int) error

type EthereumVRF

type EthereumVRF struct {
	// contains filtered or unexported fields
}

EthereumVRF represents a VRF contract

func (*EthereumVRF) Fund

func (v *EthereumVRF) Fund(ethAmount *big.Float) error

Fund sends specified currencies to the contract

func (*EthereumVRF) ProofLength

func (v *EthereumVRF) ProofLength(ctxt context.Context) (*big.Int, error)

ProofLength returns the PROOFLENGTH call from the VRF contract

type EthereumVRFConsumer

type EthereumVRFConsumer struct {
	// contains filtered or unexported fields
}

EthereumVRFConsumer represents VRF consumer contract

func (*EthereumVRFConsumer) Address

func (v *EthereumVRFConsumer) Address() string

func (*EthereumVRFConsumer) CurrentRoundID

func (v *EthereumVRFConsumer) CurrentRoundID(ctx context.Context) (*big.Int, error)

CurrentRoundID helper roundID counter in consumer to check when all randomness requests are finished

func (*EthereumVRFConsumer) Fund

func (v *EthereumVRFConsumer) Fund(ethAmount *big.Float) error

func (*EthereumVRFConsumer) RandomnessOutput

func (v *EthereumVRFConsumer) RandomnessOutput(ctx context.Context) (*big.Int, error)

RandomnessOutput get VRF randomness output

func (*EthereumVRFConsumer) RequestRandomness

func (v *EthereumVRFConsumer) RequestRandomness(hash [32]byte, fee *big.Int) error

RequestRandomness requests VRF randomness

func (*EthereumVRFConsumer) WatchPerfEvents

func (v *EthereumVRFConsumer) WatchPerfEvents(ctx context.Context, eventChan chan<- *PerfEvent) error

type EthereumVRFConsumerV2

type EthereumVRFConsumerV2 struct {
	// contains filtered or unexported fields
}

EthereumVRFConsumerV2 represents VRFv2 consumer contract

func (*EthereumVRFConsumerV2) Address

func (v *EthereumVRFConsumerV2) Address() string

func (*EthereumVRFConsumerV2) CreateFundedSubscription

func (v *EthereumVRFConsumerV2) CreateFundedSubscription(funds *big.Int) error

CreateFundedSubscription create funded subscription for VRFv2 randomness

func (*EthereumVRFConsumerV2) CurrentSubscription

func (v *EthereumVRFConsumerV2) CurrentSubscription() (uint64, error)

CurrentSubscription get current VRFv2 subscription

func (*EthereumVRFConsumerV2) Fund

func (v *EthereumVRFConsumerV2) Fund(ethAmount *big.Float) error

func (*EthereumVRFConsumerV2) GasAvailable

func (v *EthereumVRFConsumerV2) GasAvailable() (*big.Int, error)

GasAvailable get available gas after randomness fulfilled

func (*EthereumVRFConsumerV2) GetAllRandomWords

func (v *EthereumVRFConsumerV2) GetAllRandomWords(ctx context.Context, num int) ([]*big.Int, error)

GetAllRandomWords get all VRFv2 randomness output words

func (*EthereumVRFConsumerV2) LoadExistingConsumer added in v1.2.6

func (v *EthereumVRFConsumerV2) LoadExistingConsumer(address string, client blockchain.EVMClient) error

LoadExistingConsumer loads an EthereumVRFConsumerV2 with a specified address

func (*EthereumVRFConsumerV2) RandomnessOutput

func (v *EthereumVRFConsumerV2) RandomnessOutput(ctx context.Context, arg0 *big.Int) (*big.Int, error)

RandomnessOutput get VRFv2 randomness output (word)

func (*EthereumVRFConsumerV2) RequestRandomness

func (v *EthereumVRFConsumerV2) RequestRandomness(hash [32]byte, subID uint64, confs uint16, gasLimit uint32, numWords uint32) error

RequestRandomness request VRFv2 random words

func (*EthereumVRFConsumerV2) TopUpSubscriptionFunds

func (v *EthereumVRFConsumerV2) TopUpSubscriptionFunds(funds *big.Int) error

TopUpSubscriptionFunds add funds to a VRFv2 subscription

type EthereumVRFCoordinator

type EthereumVRFCoordinator struct {
	// contains filtered or unexported fields
}

EthereumVRFCoordinator represents VRF coordinator contract

func (*EthereumVRFCoordinator) Address

func (v *EthereumVRFCoordinator) Address() string

func (*EthereumVRFCoordinator) HashOfKey

func (v *EthereumVRFCoordinator) HashOfKey(ctx context.Context, pubKey [2]*big.Int) ([32]byte, error)

HashOfKey get a hash of proving key to use it as a request ID part for VRF

func (*EthereumVRFCoordinator) RegisterProvingKey

func (v *EthereumVRFCoordinator) RegisterProvingKey(
	fee *big.Int,
	oracleAddr string,
	publicProvingKey [2]*big.Int,
	jobID [32]byte,
) error

RegisterProvingKey register VRF proving key

type EthereumVRFCoordinatorV2

type EthereumVRFCoordinatorV2 struct {
	// contains filtered or unexported fields
}

EthereumVRFCoordinatorV2 represents VRFV2 coordinator contract

func (*EthereumVRFCoordinatorV2) Address

func (v *EthereumVRFCoordinatorV2) Address() string

func (*EthereumVRFCoordinatorV2) HashOfKey

func (v *EthereumVRFCoordinatorV2) HashOfKey(ctx context.Context, pubKey [2]*big.Int) ([32]byte, error)

func (*EthereumVRFCoordinatorV2) RegisterProvingKey

func (v *EthereumVRFCoordinatorV2) RegisterProvingKey(
	oracleAddr string,
	publicProvingKey [2]*big.Int,
) error

func (*EthereumVRFCoordinatorV2) SetConfig

func (v *EthereumVRFCoordinatorV2) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig ethereum.VRFCoordinatorV2FeeConfig) error

type Flags

type Flags interface {
	Address() string
	GetFlag(ctx context.Context, addr string) (bool, error)
}

Flags flags contract interface

type FluxAggregator

type FluxAggregator interface {
	Address() string
	Fund(ethAmount *big.Float) error
	LatestRoundID(ctx context.Context) (*big.Int, error)
	LatestRoundData(ctx context.Context) (RoundData, error)
	GetContractData(ctxt context.Context) (*FluxAggregatorData, error)
	UpdateAvailableFunds() error
	PaymentAmount(ctx context.Context) (*big.Int, error)
	RequestNewRound(ctx context.Context) error
	WithdrawPayment(ctx context.Context, from common.Address, to common.Address, amount *big.Int) error
	WithdrawablePayment(ctx context.Context, addr common.Address) (*big.Int, error)
	GetOracles(ctx context.Context) ([]string, error)
	SetOracles(opts FluxAggregatorSetOraclesOptions) error
	Description(ctxt context.Context) (string, error)
	SetRequesterPermissions(ctx context.Context, addr common.Address, authorized bool, roundsDelay uint32) error
	WatchSubmissionReceived(ctx context.Context, eventChan chan<- *SubmissionEvent) error
}

type FluxAggregatorData

type FluxAggregatorData struct {
	AllocatedFunds  *big.Int         // The amount of payment yet to be withdrawn by oracles
	AvailableFunds  *big.Int         // The amount of future funding available to oracles
	LatestRoundData RoundData        // Data about the latest round
	Oracles         []common.Address // Addresses of oracles on the contract
}

type FluxAggregatorOptions

type FluxAggregatorOptions struct {
	PaymentAmount *big.Int       // The amount of LINK paid to each oracle per submission, in wei (units of 10⁻¹⁸ LINK)
	Timeout       uint32         // The number of seconds after the previous round that are allowed to lapse before allowing an oracle to skip an unfinished round
	Validator     common.Address // An optional contract address for validating external validation of answers
	MinSubValue   *big.Int       // An immutable check for a lower bound of what submission values are accepted from an oracle
	MaxSubValue   *big.Int       // An immutable check for an upper bound of what submission values are accepted from an oracle
	Decimals      uint8          // The number of decimals to offset the answer by
	Description   string         // A short description of what is being reported
}

func DefaultFluxAggregatorOptions

func DefaultFluxAggregatorOptions() FluxAggregatorOptions

DefaultFluxAggregatorOptions produces some basic defaults for a flux aggregator contract

type FluxAggregatorRoundConfirmer

type FluxAggregatorRoundConfirmer struct {
	// contains filtered or unexported fields
}

FluxAggregatorRoundConfirmer is a header subscription that awaits for a certain flux round to be completed

func NewFluxAggregatorRoundConfirmer

func NewFluxAggregatorRoundConfirmer(
	contract FluxAggregator,
	roundID *big.Int,
	timeout time.Duration,
) *FluxAggregatorRoundConfirmer

NewFluxAggregatorRoundConfirmer provides a new instance of a FluxAggregatorRoundConfirmer

func (*FluxAggregatorRoundConfirmer) ReceiveBlock

func (f *FluxAggregatorRoundConfirmer) ReceiveBlock(block blockchain.NodeBlock) error

ReceiveBlock will query the latest FluxAggregator round and check to see whether the round has confirmed

func (*FluxAggregatorRoundConfirmer) Wait

Wait is a blocking function that will wait until the round has confirmed, and timeout if the deadline has passed

type FluxAggregatorSetOraclesOptions

type FluxAggregatorSetOraclesOptions struct {
	AddList            []common.Address // oracle addresses to add
	RemoveList         []common.Address // oracle addresses to remove
	AdminList          []common.Address // oracle addresses to become admin
	MinSubmissions     uint32           // min amount of submissions in round
	MaxSubmissions     uint32           // max amount of submissions in round
	RestartDelayRounds uint32           // rounds to wait after oracles has changed
}

type JobByInstance

type JobByInstance struct {
	ID       string
	Instance string
}

JobByInstance helper struct to match job + instance ID

type KeeperConsumer

type KeeperConsumer interface {
	Address() string
	Fund(ethAmount *big.Float) error
	Counter(ctx context.Context) (*big.Int, error)
}

type KeeperConsumerPerformance

type KeeperConsumerPerformance interface {
	Address() string
	Fund(ethAmount *big.Float) error
	CheckEligible(ctx context.Context) (bool, error)
	GetUpkeepCount(ctx context.Context) (*big.Int, error)
	SetCheckGasToBurn(ctx context.Context, gas *big.Int) error
	SetPerformGasToBurn(ctx context.Context, gas *big.Int) error
}

KeeperConsumerPerformance is a keeper consumer contract that is more complicated than the typical consumer, it's intended to only be used for performance tests.

type KeeperConsumerPerformanceRoundConfirmer

type KeeperConsumerPerformanceRoundConfirmer struct {
	// contains filtered or unexported fields
}

KeeperConsumerPerformanceRoundConfirmer is a header subscription that awaits for a round of upkeeps

func NewKeeperConsumerPerformanceRoundConfirmer

func NewKeeperConsumerPerformanceRoundConfirmer(
	contract KeeperConsumerPerformance,
	expectedBlockCadence int64,
	blockRange int64,
	metricsReporter *testreporters.KeeperBlockTimeTestReporter,
) *KeeperConsumerPerformanceRoundConfirmer

NewKeeperConsumerPerformanceRoundConfirmer provides a new instance of a KeeperConsumerPerformanceRoundConfirmer Used to track and log performance test results for keepers

func (*KeeperConsumerPerformanceRoundConfirmer) ReceiveBlock

func (o *KeeperConsumerPerformanceRoundConfirmer) ReceiveBlock(receivedBlock blockchain.NodeBlock) error

ReceiveBlock will query the latest Keeper round and check to see whether the round has confirmed

func (*KeeperConsumerPerformanceRoundConfirmer) Wait

Wait is a blocking function that will wait until the round has confirmed, and timeout if the deadline has passed

type KeeperConsumerRoundConfirmer

type KeeperConsumerRoundConfirmer struct {
	// contains filtered or unexported fields
}

KeeperConsumerRoundConfirmer is a header subscription that awaits for a round of upkeeps

func NewKeeperConsumerRoundConfirmer

func NewKeeperConsumerRoundConfirmer(
	contract KeeperConsumer,
	counterValue int,
	timeout time.Duration,
) *KeeperConsumerRoundConfirmer

NewKeeperConsumerRoundConfirmer provides a new instance of a KeeperConsumerRoundConfirmer

func (*KeeperConsumerRoundConfirmer) ReceiveBlock

ReceiveBlock will query the latest Keeper round and check to see whether the round has confirmed

func (*KeeperConsumerRoundConfirmer) Wait

Wait is a blocking function that will wait until the round has confirmed, and timeout if the deadline has passed

type KeeperInfo

type KeeperInfo struct {
	Payee   string
	Active  bool
	Balance *big.Int
}

KeeperInfo keeper status and balance info

type KeeperRegistrar added in v1.3.7

type KeeperRegistrar interface {
	Address() string

	EncodeRegisterRequest(
		name string,
		email []byte,
		upkeepAddr string,
		gasLimit uint32,
		adminAddr string,
		checkData []byte,
		amount *big.Int,
		source uint8,
		senderAddr string,
	) ([]byte, error)

	Fund(ethAmount *big.Float) error
}

type KeeperRegistrarSettings added in v1.1.20

type KeeperRegistrarSettings struct {
	AutoApproveConfigType uint8
	AutoApproveMaxAllowed uint16
	RegistryAddr          string
	MinLinkJuels          *big.Int
}

KeeperRegistrarSettings represents settings for registrar contract

type KeeperRegistry

type KeeperRegistry interface {
	Address() string
	Fund(ethAmount *big.Float) error
	SetConfig(config KeeperRegistrySettings) error
	SetRegistrar(registrarAddr string) error
	AddUpkeepFunds(id *big.Int, amount *big.Int) error
	GetUpkeepInfo(ctx context.Context, id *big.Int) (*UpkeepInfo, error)
	GetKeeperInfo(ctx context.Context, keeperAddr string) (*KeeperInfo, error)
	SetKeepers(keepers []string, payees []string) error
	GetKeeperList(ctx context.Context) ([]string, error)
	RegisterUpkeep(target string, gasLimit uint32, admin string, checkData []byte) error
	CancelUpkeep(id *big.Int) error
	SetUpkeepGasLimit(id *big.Int, gas uint32) error
	ParseUpkeepIdFromRegisteredLog(log *types.Log) (*big.Int, error)
	Pause() error
}

type KeeperRegistryOpts

type KeeperRegistryOpts struct {
	RegistryVersion ethereum.KeeperRegistryVersion
	LinkAddr        string
	ETHFeedAddr     string
	GasFeedAddr     string
	TranscoderAddr  string
	RegistrarAddr   string
	Settings        KeeperRegistrySettings
}

KeeperRegistryOpts opts to deploy keeper registry version

type KeeperRegistrySettings

type KeeperRegistrySettings struct {
	PaymentPremiumPPB    uint32   // payment premium rate oracles receive on top of being reimbursed for gas, measured in parts per billion
	FlatFeeMicroLINK     uint32   // flat fee charged for each upkeep
	BlockCountPerTurn    *big.Int // number of blocks each oracle has during their turn to perform upkeep before it will be the next keeper's turn to submit
	CheckGasLimit        uint32   // gas limit when checking for upkeep
	StalenessSeconds     *big.Int // number of seconds that is allowed for feed data to be stale before switching to the fallback pricing
	GasCeilingMultiplier uint16   // multiplier to apply to the fast gas feed price when calculating the payment ceiling for keepers
	MinUpkeepSpend       *big.Int // minimum spend required by an upkeep before they can withdraw funds
	MaxPerformGas        uint32   // max gas allowed for an upkeep within perform
	FallbackGasPrice     *big.Int // gas price used if the gas price feed is stale
	FallbackLinkPrice    *big.Int // LINK price used if the LINK price feed is stale
}

KeeperRegistrySettings represents the settins to fine tune keeper registry

type KlaytnContractDeployer

type KlaytnContractDeployer struct {
	*EthereumContractDeployer
}

KlaytnContractDeployer wraps ethereum contract deployments for Klaytn

type LinkToken

type LinkToken interface {
	Address() string
	Approve(to string, amount *big.Int) error
	Transfer(to string, amount *big.Int) error
	BalanceOf(ctx context.Context, addr string) (*big.Int, error)
	TransferAndCall(to string, amount *big.Int, data []byte) (*types.Transaction, error)
	Name(context.Context) (string, error)
}

type MetisContractDeployer

type MetisContractDeployer struct {
	*EthereumContractDeployer
}

MetisContractDeployer wraps ethereum contract deployments for Metis

type MockETHLINKFeed

type MockETHLINKFeed interface {
	Address() string
	LatestRoundData() (*big.Int, error)
}

type MockGasFeed

type MockGasFeed interface {
	Address() string
}

type OffChainAggregatorConfig

type OffChainAggregatorConfig struct {
	DeltaProgress    time.Duration // The duration in which a leader must achieve progress or be replaced
	DeltaResend      time.Duration // The interval at which nodes resend NEWEPOCH messages
	DeltaRound       time.Duration // The duration after which a new round is started
	DeltaGrace       time.Duration // The duration of the grace period during which delayed oracles can still submit observations
	DeltaC           time.Duration // Limits how often updates are transmitted to the contract as long as the median isn’t changing by more then AlphaPPB
	AlphaPPB         uint64        // Allows larger changes of the median to be reported immediately, bypassing DeltaC
	DeltaStage       time.Duration // Used to stagger stages of the transmission protocol. Multiple Ethereum blocks must be mineable in this period
	RMax             uint8         // The maximum number of rounds in an epoch
	S                []int         // Transmission Schedule
	F                int           // The allowed number of "bad" oracles
	N                int           // The number of oracles
	OracleIdentities []ocrConfigHelper.OracleIdentityExtra
}

https://uploads-ssl.webflow.com/5f6b7190899f41fb70882d08/603651a1101106649eef6a53_chainlink-ocr-protocol-paper-02-24-20.pdf

func DefaultOffChainAggregatorConfig

func DefaultOffChainAggregatorConfig(numberNodes int) OffChainAggregatorConfig

DefaultOffChainAggregatorConfig returns some base defaults for configuring an OCR contract

type OffChainAggregatorV2Config

type OffChainAggregatorV2Config struct {
	DeltaProgress                           time.Duration
	DeltaResend                             time.Duration
	DeltaRound                              time.Duration
	DeltaGrace                              time.Duration
	DeltaStage                              time.Duration
	RMax                                    uint8
	S                                       []int
	Oracles                                 []ocrConfigHelper2.OracleIdentityExtra
	ReportingPluginConfig                   []byte
	MaxDurationQuery                        time.Duration
	MaxDurationObservation                  time.Duration
	MaxDurationReport                       time.Duration
	MaxDurationShouldAcceptFinalizedReport  time.Duration
	MaxDurationShouldTransmitAcceptedReport time.Duration
	F                                       int
	OnchainConfig                           []byte
}

type OffchainAggregator

type OffchainAggregator interface {
	Address() string
	Fund(nativeAmount *big.Float) error
	GetContractData(ctxt context.Context) (*OffchainAggregatorData, error)
	SetConfig(chainlinkNodes []client.Chainlink, ocrConfig OffChainAggregatorConfig) error
	SetPayees([]string, []string) error
	RequestNewRound() error
	GetLatestAnswer(ctxt context.Context) (*big.Int, error)
	GetLatestRound(ctxt context.Context) (*RoundData, error)
}

type OffchainAggregatorData

type OffchainAggregatorData struct {
	LatestRoundData RoundData // Data about the latest round
}

type OffchainAggregatorRoundConfirmer

type OffchainAggregatorRoundConfirmer struct {
	// contains filtered or unexported fields
}

OffchainAggregatorRoundConfirmer is a header subscription that awaits for a certain OCR round to be completed

func NewOffchainAggregatorRoundConfirmer

func NewOffchainAggregatorRoundConfirmer(
	contract OffchainAggregator,
	roundID *big.Int,
	timeout time.Duration,
	optionalTestReport *testreporters.OCRSoakTestReport,
) *OffchainAggregatorRoundConfirmer

NewOffchainAggregatorRoundConfirmer provides a new instance of a OffchainAggregatorRoundConfirmer

func (*OffchainAggregatorRoundConfirmer) ReceiveBlock

ReceiveBlock will query the latest OffchainAggregator round and check to see whether the round has confirmed

func (*OffchainAggregatorRoundConfirmer) Wait

Wait is a blocking function that will wait until the round has confirmed, and timeout if the deadline has passed

type OffchainOptions

type OffchainOptions struct {
	MaximumGasPrice           uint32         // The highest gas price for which transmitter will be compensated
	ReasonableGasPrice        uint32         // The transmitter will receive reward for gas prices under this value
	MicroLinkPerEth           uint32         // The reimbursement per ETH of gas cost, in 1e-6LINK units
	LinkGweiPerObservation    uint32         // The reward to the oracle for contributing an observation to a successfully transmitted report, in 1e-9LINK units
	LinkGweiPerTransmission   uint32         // The reward to the transmitter of a successful report, in 1e-9LINK units
	MinimumAnswer             *big.Int       // The lowest answer the median of a report is allowed to be
	MaximumAnswer             *big.Int       // The highest answer the median of a report is allowed to be
	BillingAccessController   common.Address // The access controller for billing admin functions
	RequesterAccessController common.Address // The access controller for requesting new rounds
	Decimals                  uint8          // Answers are stored in fixed-point format, with this many digits of precision
	Description               string         // A short description of what is being reported
}

func DefaultOffChainAggregatorOptions

func DefaultOffChainAggregatorOptions() OffchainOptions

DefaultOffChainAggregatorOptions returns some base defaults for deploying an OCR contract

type Oracle

type Oracle interface {
	Address() string
	Fund(ethAmount *big.Float) error
	SetFulfillmentPermission(address string, allowed bool) error
}

type PerfEvent

type PerfEvent struct {
	Contract       DeviationFlaggingValidator
	Round          *big.Int
	RequestID      [32]byte
	BlockTimestamp *big.Int
}

PerfEvent is used to get some metrics for contracts, it contrains roundID for Keeper/OCR/Flux tests and request id for VRF/Runlog

type ReadAccessController

type ReadAccessController interface {
	Address() string
	AddAccess(addr string) error
	DisableAccessCheck() error
}

ReadAccessController is read/write access controller, just named by interface

type RoundData

type RoundData struct {
	RoundId         *big.Int
	Answer          *big.Int
	StartedAt       *big.Int
	UpdatedAt       *big.Int
	AnsweredInRound *big.Int
}

type RunlogRoundConfirmer

type RunlogRoundConfirmer struct {
	// contains filtered or unexported fields
}

RunlogRoundConfirmer is a header subscription that awaits for a certain Runlog round to be completed

func NewRunlogRoundConfirmer

func NewRunlogRoundConfirmer(
	contract APIConsumer,
	roundID *big.Int,
	timeout time.Duration,
) *RunlogRoundConfirmer

NewRunlogRoundConfirmer provides a new instance of a RunlogRoundConfirmer

func (*RunlogRoundConfirmer) ReceiveBlock

func (o *RunlogRoundConfirmer) ReceiveBlock(_ blockchain.NodeBlock) error

ReceiveBlock will query the latest Runlog round and check to see whether the round has confirmed

func (*RunlogRoundConfirmer) Wait

func (o *RunlogRoundConfirmer) Wait() error

Wait is a blocking function that will wait until the round has confirmed, and timeout if the deadline has passed

type Storage

type Storage interface {
	Get(ctxt context.Context) (*big.Int, error)
	Set(*big.Int) error
}

type SubmissionEvent

type SubmissionEvent struct {
	Contract    common.Address
	Submission  *big.Int
	Round       uint32
	BlockNumber uint64
	Oracle      common.Address
}

type UpkeepCounter added in v1.1.19

type UpkeepCounter interface {
	Address() string
	Fund(ethAmount *big.Float) error
	Counter(ctx context.Context) (*big.Int, error)
	SetSpread(testRange *big.Int, interval *big.Int) error
}

type UpkeepInfo

type UpkeepInfo struct {
	Target              string
	ExecuteGas          uint32
	CheckData           []byte
	Balance             *big.Int
	LastKeeper          string
	Admin               string
	MaxValidBlocknumber uint64
}

UpkeepInfo keeper target info

type UpkeepPerformCounterRestrictive added in v1.1.20

type UpkeepPerformCounterRestrictive interface {
	Address() string
	Fund(ethAmount *big.Float) error
	Counter(ctx context.Context) (*big.Int, error)
	SetSpread(testRange *big.Int, interval *big.Int) error
}

type VRF

type VRF interface {
	Fund(ethAmount *big.Float) error
	ProofLength(context.Context) (*big.Int, error)
}

type VRFConsumer

type VRFConsumer interface {
	Address() string
	RequestRandomness(hash [32]byte, fee *big.Int) error
	CurrentRoundID(ctx context.Context) (*big.Int, error)
	RandomnessOutput(ctx context.Context) (*big.Int, error)
	WatchPerfEvents(ctx context.Context, eventChan chan<- *PerfEvent) error
	Fund(ethAmount *big.Float) error
}

type VRFConsumerRoundConfirmer

type VRFConsumerRoundConfirmer struct {
	// contains filtered or unexported fields
}

VRFConsumerRoundConfirmer is a header subscription that awaits for a certain VRF round to be completed

func NewVRFConsumerRoundConfirmer

func NewVRFConsumerRoundConfirmer(
	contract VRFConsumer,
	roundID *big.Int,
	timeout time.Duration,
) *VRFConsumerRoundConfirmer

NewVRFConsumerRoundConfirmer provides a new instance of a NewVRFConsumerRoundConfirmer

func (*VRFConsumerRoundConfirmer) ReceiveBlock

func (f *VRFConsumerRoundConfirmer) ReceiveBlock(block blockchain.NodeBlock) error

ReceiveBlock will query the latest VRFConsumer round and check to see whether the round has confirmed

func (*VRFConsumerRoundConfirmer) Wait

func (f *VRFConsumerRoundConfirmer) Wait() error

Wait is a blocking function that will wait until the round has confirmed, and timeout if the deadline has passed

type VRFConsumerV2

type VRFConsumerV2 interface {
	Address() string
	CurrentSubscription() (uint64, error)
	CreateFundedSubscription(funds *big.Int) error
	TopUpSubscriptionFunds(funds *big.Int) error
	RequestRandomness(hash [32]byte, subID uint64, confs uint16, gasLimit uint32, numWords uint32) error
	RandomnessOutput(ctx context.Context, arg0 *big.Int) (*big.Int, error)
	GetAllRandomWords(ctx context.Context, num int) ([]*big.Int, error)
	GasAvailable() (*big.Int, error)
	Fund(ethAmount *big.Float) error
}

type VRFCoordinator

type VRFCoordinator interface {
	RegisterProvingKey(
		fee *big.Int,
		oracleAddr string,
		publicProvingKey [2]*big.Int,
		jobID [32]byte,
	) error
	HashOfKey(ctx context.Context, pubKey [2]*big.Int) ([32]byte, error)
	Address() string
}

type VRFCoordinatorV2

type VRFCoordinatorV2 interface {
	SetConfig(
		minimumRequestConfirmations uint16,
		maxGasLimit uint32,
		stalenessSeconds uint32,
		gasAfterPaymentCalculation uint32,
		fallbackWeiPerUnitLink *big.Int, feeConfig ethereum.VRFCoordinatorV2FeeConfig,
	) error
	RegisterProvingKey(
		oracleAddr string,
		publicProvingKey [2]*big.Int,
	) error
	HashOfKey(ctx context.Context, pubKey [2]*big.Int) ([32]byte, error)
	Address() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL