├── .env.example ├── .github └── workflows │ └── test.yml ├── .gitignore ├── .gitmodules ├── README.md ├── ai-request.js ├── docs ├── FOUNDRY.md └── INSTALL.md ├── foundry.toml ├── hardhat.config.js ├── lib └── chainlink │ ├── contracts │ ├── README.md │ ├── abi │ │ └── v0.8 │ │ │ ├── AccessControl.json │ │ │ ├── AccessControllerInterface.json │ │ │ ├── AggregatorInterface.json │ │ │ ├── AggregatorV2V3Interface.json │ │ │ ├── AggregatorV3Interface.json │ │ │ ├── AggregatorValidatorInterface.json │ │ │ ├── ArbGasInfo.json │ │ │ ├── ArbSys.json │ │ │ ├── ArbitrumCrossDomainForwarder.json │ │ │ ├── ArbitrumCrossDomainGovernor.json │ │ │ ├── ArbitrumModule.json │ │ │ ├── ArbitrumSequencerUptimeFeed.json │ │ │ ├── ArbitrumSequencerUptimeFeedInterface.json │ │ │ ├── ArbitrumValidator.json │ │ │ ├── AuthorizedForwarder.json │ │ │ ├── AuthorizedReceiver.json │ │ │ ├── AuthorizedReceiverInterface.json │ │ │ ├── AutomationBase.json │ │ │ ├── AutomationCompatible.json │ │ │ ├── AutomationCompatibleInterface.json │ │ │ ├── AutomationCompatibleUtils.json │ │ │ ├── AutomationConsumerBenchmark.json │ │ │ ├── AutomationForwarder.json │ │ │ ├── AutomationForwarderLogic.json │ │ │ ├── AutomationRegistrar2_1.json │ │ │ ├── AutomationRegistrar2_3.json │ │ │ ├── AutomationRegistry2_2.json │ │ │ ├── AutomationRegistry2_3.json │ │ │ ├── AutomationRegistryBase2_2.json │ │ │ ├── AutomationRegistryBase2_3.json │ │ │ ├── AutomationRegistryBaseInterface.json │ │ │ ├── AutomationRegistryExecutableInterface.json │ │ │ ├── AutomationRegistryInterface.json │ │ │ ├── AutomationRegistryLogicA2_2.json │ │ │ ├── AutomationRegistryLogicA2_3.json │ │ │ ├── AutomationRegistryLogicB2_2.json │ │ │ ├── AutomationRegistryLogicB2_3.json │ │ │ ├── AutomationRegistryLogicC2_3.json │ │ │ ├── AutomationUtils2_1.json │ │ │ ├── AutomationUtils2_2.json │ │ │ ├── AutomationUtils2_3.json │ │ │ ├── BasicConsumer.json │ │ │ ├── BatchBlockhashStore.json │ │ │ ├── BatchVRFCoordinatorV2.json │ │ │ ├── BatchVRFCoordinatorV2Plus.json │ │ │ ├── BlockhashStore.json │ │ │ ├── BlockhashStoreInterface.json │ │ │ ├── Broken.json │ │ │ ├── BurnMintERC677.json │ │ │ ├── ByteUtil.json │ │ │ ├── CallWithExactGas.json │ │ │ ├── CallWithExactGasHelper.json │ │ │ ├── ChainModuleBase.json │ │ │ ├── ChainSpecificUtilHelper.json │ │ │ ├── Chainable.json │ │ │ ├── ChainlinkClient.json │ │ │ ├── ChainlinkClientHelper.json │ │ │ ├── ChainlinkClientTestHelper.json │ │ │ ├── ChainlinkRequestInterface.json │ │ │ ├── ChainlinkTestHelper.json │ │ │ ├── Chainlinked.json │ │ │ ├── ChannelConfigStore.json │ │ │ ├── ChannelVerifier.json │ │ │ ├── ConfirmedOwner.json │ │ │ ├── ConfirmedOwnerTestHelper.json │ │ │ ├── ConfirmedOwnerWithProposal.json │ │ │ ├── Consumer.json │ │ │ ├── Counter.json │ │ │ ├── Cron.json │ │ │ ├── CronExternalTestHelper.json │ │ │ ├── CronInternalTestHelper.json │ │ │ ├── CronReceiver.json │ │ │ ├── CronUpkeep.json │ │ │ ├── CronUpkeepDelegate.json │ │ │ ├── CronUpkeepFactory.json │ │ │ ├── CronUpkeepTestHelper.json │ │ │ ├── CrossDomainDelegateForwarder.json │ │ │ ├── CrossDomainForwarder.json │ │ │ ├── CrossDomainOwnable.json │ │ │ ├── CrossDomainOwnableInterface.json │ │ │ ├── DelegateForwarderInterface.json │ │ │ ├── Denominations.json │ │ │ ├── DummyProtocol.json │ │ │ ├── ENSInterface.json │ │ │ ├── ENSResolver.json │ │ │ ├── ERC165.json │ │ │ ├── ERC20.json │ │ │ ├── ERC20BalanceMonitor.json │ │ │ ├── ERC20BalanceMonitorExposed.json │ │ │ ├── ERC20Burnable.json │ │ │ ├── ERC20Mock.json │ │ │ ├── ERC20Permit.json │ │ │ ├── ERC677.json │ │ │ ├── EmptyOracle.json │ │ │ ├── EntryPoint.json │ │ │ ├── ErroredVerifier.json │ │ │ ├── EthBalanceMonitor.json │ │ │ ├── EthBalanceMonitorExposed.json │ │ │ ├── ExecutionPrevention.json │ │ │ ├── ExposedChannelVerifier.json │ │ │ ├── ExposedVRFCoordinatorV2_5.json │ │ │ ├── ExposedVerifier.json │ │ │ ├── ExtendedVRFCoordinatorV2Interface.json │ │ │ ├── FeeManager.json │ │ │ ├── FeeManagerProxy.json │ │ │ ├── FeedConsumer.json │ │ │ ├── FeedRegistryInterface.json │ │ │ ├── Flags.json │ │ │ ├── FlagsInterface.json │ │ │ ├── FlagsTestHelper.json │ │ │ ├── ForwarderInterface.json │ │ │ ├── FunctionsBilling.json │ │ │ ├── FunctionsBillingRegistryEventsMock.json │ │ │ ├── FunctionsClient.json │ │ │ ├── FunctionsClientExample.json │ │ │ ├── FunctionsClientHarness.json │ │ │ ├── FunctionsClientTestHelper.json │ │ │ ├── FunctionsClientUpgradeHelper.json │ │ │ ├── FunctionsClientWithEmptyCallback.json │ │ │ ├── FunctionsCoordinator.json │ │ │ ├── FunctionsCoordinatorHarness.json │ │ │ ├── FunctionsCoordinatorTestHelper.json │ │ │ ├── FunctionsLoadTestClient.json │ │ │ ├── FunctionsOracleEventsMock.json │ │ │ ├── FunctionsRequest.json │ │ │ ├── FunctionsRouter.json │ │ │ ├── FunctionsRouterHarness.json │ │ │ ├── FunctionsSubscriptions.json │ │ │ ├── FunctionsSubscriptionsHarness.json │ │ │ ├── FunctionsTestHelper.json │ │ │ ├── FunctionsV1EventsMock.json │ │ │ ├── GasGuzzlingConsumer.json │ │ │ ├── GasPriceOracle.json │ │ │ ├── GenericReceiver.json │ │ │ ├── GetterSetter.json │ │ │ ├── Greeter.json │ │ │ ├── HeartbeatRequester.json │ │ │ ├── IAccessControl.json │ │ │ ├── IAccessController.json │ │ │ ├── IAccount.json │ │ │ ├── IAggregator.json │ │ │ ├── IAggregatorProxy.json │ │ │ ├── IArbitrumDelayedInbox.json │ │ │ ├── IAuthorizedReceiver.json │ │ │ ├── IAutomationForwarder.json │ │ │ ├── IAutomationRegistryConsumer.json │ │ │ ├── IAutomationRegistryMaster.json │ │ │ ├── IAutomationRegistryMaster2_3.json │ │ │ ├── IAutomationV21PlusCommon.json │ │ │ ├── IBridge.json │ │ │ ├── IBurnMintERC20.json │ │ │ ├── IChainModule.json │ │ │ ├── IChannelConfigStore.json │ │ │ ├── IChannelVerifier.json │ │ │ ├── IERC1155Errors.json │ │ │ ├── IERC165.json │ │ │ ├── IERC20.json │ │ │ ├── IERC20Errors.json │ │ │ ├── IERC20Metadata.json │ │ │ ├── IERC20Permit.json │ │ │ ├── IERC677.json │ │ │ ├── IERC677Receiver.json │ │ │ ├── IERC721Errors.json │ │ │ ├── IEntryPoint.json │ │ │ ├── IFeeManager.json │ │ │ ├── IFunctionsBilling.json │ │ │ ├── IFunctionsClient.json │ │ │ ├── IFunctionsCoordinator.json │ │ │ ├── IFunctionsRouter.json │ │ │ ├── IFunctionsSubscriptions.json │ │ │ ├── IInbox.json │ │ │ ├── IKeeperRegistryMaster.json │ │ │ ├── ILinkAvailable.json │ │ │ ├── ILogAutomation.json │ │ │ ├── IMessageProvider.json │ │ │ ├── IOffchainAggregator.json │ │ │ ├── IOptimismMintableERC20.json │ │ │ ├── IOptimismMintableERC20Minimal.json │ │ │ ├── IOwnable.json │ │ │ ├── IOwnableFunctionsRouter.json │ │ │ ├── IPaymaster.json │ │ │ ├── IRewardManager.json │ │ │ ├── IScrollL1GasPriceOracle.json │ │ │ ├── IScrollMessenger.json │ │ │ ├── ISemver.json │ │ │ ├── IStakeManager.json │ │ │ ├── ITermsOfServiceAllowList.json │ │ │ ├── ITypeAndVersion.json │ │ │ ├── IVRFCoordinatorV2.json │ │ │ ├── IVRFCoordinatorV2Plus.json │ │ │ ├── IVRFCoordinatorV2PlusFulfill.json │ │ │ ├── IVRFCoordinatorV2PlusInternal.json │ │ │ ├── IVRFCoordinatorV2PlusMigration.json │ │ │ ├── IVRFMigratableConsumerV2Plus.json │ │ │ ├── IVRFSubscriptionV2Plus.json │ │ │ ├── IVRFV2PlusMigrate.json │ │ │ ├── IVRFV2PlusWrapper.json │ │ │ ├── IVerifier.json │ │ │ ├── IVerifierFeeManager.json │ │ │ ├── IVerifierProxy.json │ │ │ ├── IWERC20.json │ │ │ ├── IWrappedNative.json │ │ │ ├── KeeperCompatibleTestHelper.json │ │ │ ├── KeeperConsumer.json │ │ │ ├── KeeperConsumerPerformance.json │ │ │ ├── KeeperRegistrar.json │ │ │ ├── KeeperRegistrar1_2Mock.json │ │ │ ├── KeeperRegistrar2_0.json │ │ │ ├── KeeperRegistry1_2.json │ │ │ ├── KeeperRegistry1_3.json │ │ │ ├── KeeperRegistry2_0.json │ │ │ ├── KeeperRegistry2_1.json │ │ │ ├── KeeperRegistryBase1_3.json │ │ │ ├── KeeperRegistryBase2_0.json │ │ │ ├── KeeperRegistryBase2_1.json │ │ │ ├── KeeperRegistryCheckUpkeepGasUsageWrapper1_2.json │ │ │ ├── KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.json │ │ │ ├── KeeperRegistryLogic1_3.json │ │ │ ├── KeeperRegistryLogic2_0.json │ │ │ ├── KeeperRegistryLogicA2_1.json │ │ │ ├── KeeperRegistryLogicB2_1.json │ │ │ ├── KeepersVRFConsumer.json │ │ │ ├── KeystoneForwarder.json │ │ │ ├── L1Block.json │ │ │ ├── LatestValueHolder.json │ │ │ ├── LinkAvailableBalanceMonitor.json │ │ │ ├── LinkToken.json │ │ │ ├── LinkTokenInterface.json │ │ │ ├── LinkTokenReceiver.json │ │ │ ├── LinkTokenTestHelper.json │ │ │ ├── LogEmitter.json │ │ │ ├── LogTriggeredStreamsLookup.json │ │ │ ├── LogUpkeepCounter.json │ │ │ ├── MaliciousChainlinked.json │ │ │ ├── MaliciousConsumer.json │ │ │ ├── MaliciousMultiWordConsumer.json │ │ │ ├── MaliciousRequester.json │ │ │ ├── MercuryRegistry.json │ │ │ ├── MercuryRegistryBatchUpkeep.json │ │ │ ├── MigratableKeeperRegistryInterface.json │ │ │ ├── MigratableKeeperRegistryInterfaceV2.json │ │ │ ├── MockAggregator.json │ │ │ ├── MockAggregatorProxy.json │ │ │ ├── MockAggregatorV2V3.json │ │ │ ├── MockAggregatorValidator.json │ │ │ ├── MockArbGasInfo.json │ │ │ ├── MockArbSys.json │ │ │ ├── MockArbitrumInbox.json │ │ │ ├── MockETHLINKAggregator.json │ │ │ ├── MockKeeperRegistry2_1.json │ │ │ ├── MockLinkToken.json │ │ │ ├── MockOVMCrossDomainMessenger.json │ │ │ ├── MockOVMGasPriceOracle.json │ │ │ ├── MockOffchainAggregator.json │ │ │ ├── MockOptimismL1CrossDomainMessenger.json │ │ │ ├── MockOptimismL2CrossDomainMessenger.json │ │ │ ├── MockScrollCrossDomainMessenger.json │ │ │ ├── MockScrollL1CrossDomainMessenger.json │ │ │ ├── MockScrollL1MessageQueue.json │ │ │ ├── MockScrollL2CrossDomainMessenger.json │ │ │ ├── MockUpkeep.json │ │ │ ├── MockV3Aggregator.json │ │ │ ├── MultiSend.json │ │ │ ├── MultiWordConsumer.json │ │ │ ├── OCR2Abstract.json │ │ │ ├── OCR2Base.json │ │ │ ├── OCR3Capability.json │ │ │ ├── OVM_GasPriceOracle.json │ │ │ ├── OpStackBurnMintERC677.json │ │ │ ├── Operator.json │ │ │ ├── OperatorFactory.json │ │ │ ├── OperatorInterface.json │ │ │ ├── OptimismCrossDomainForwarder.json │ │ │ ├── OptimismCrossDomainGovernor.json │ │ │ ├── OptimismModule.json │ │ │ ├── OptimismSequencerUptimeFeed.json │ │ │ ├── OptimismSequencerUptimeFeedInterface.json │ │ │ ├── OptimismValidator.json │ │ │ ├── OracleInterface.json │ │ │ ├── OwnerIsCreator.json │ │ │ ├── Pausable.json │ │ │ ├── Paymaster.json │ │ │ ├── PerformDataChecker.json │ │ │ ├── PermissionedForwardProxy.json │ │ │ ├── PoRAddressList.json │ │ │ ├── PointerInterface.json │ │ │ ├── Proxy.json │ │ │ ├── ReceiveEmitter.json │ │ │ ├── ReceiveFallbackEmitter.json │ │ │ ├── ReceiveReverter.json │ │ │ ├── RewardManager.json │ │ │ ├── Routable.json │ │ │ ├── SCA.json │ │ │ ├── ScrollCrossDomainForwarder.json │ │ │ ├── ScrollCrossDomainGovernor.json │ │ │ ├── ScrollModule.json │ │ │ ├── ScrollSequencerUptimeFeed.json │ │ │ ├── ScrollSequencerUptimeFeedInterface.json │ │ │ ├── ScrollValidator.json │ │ │ ├── SenderCreator.json │ │ │ ├── SimpleLogUpkeepCounter.json │ │ │ ├── SimpleReadAccessController.json │ │ │ ├── SimpleWriteAccessController.json │ │ │ ├── SmartContractAccountFactory.json │ │ │ ├── SmartContractAccountHelper.json │ │ │ ├── StakeManager.json │ │ │ ├── StreamsLookupCompatibleInterface.json │ │ │ ├── StreamsLookupUpkeep.json │ │ │ ├── SubscriptionAPI.json │ │ │ ├── TermsOfServiceAllowList.json │ │ │ ├── TrustedBlockhashStore.json │ │ │ ├── TypeAndVersionInterface.json │ │ │ ├── UpkeepAutoFunder.json │ │ │ ├── UpkeepBalanceMonitor.json │ │ │ ├── UpkeepCounter.json │ │ │ ├── UpkeepMock.json │ │ │ ├── UpkeepPerformCounterRestrictive.json │ │ │ ├── UpkeepReverter.json │ │ │ ├── UpkeepTranscoder.json │ │ │ ├── UpkeepTranscoder3_0.json │ │ │ ├── UpkeepTranscoder4_0.json │ │ │ ├── UpkeepTranscoder5_0.json │ │ │ ├── UpkeepTranscoderInterface.json │ │ │ ├── UpkeepTranscoderInterfaceV2.json │ │ │ ├── VRFConsumer.json │ │ │ ├── VRFConsumerBase.json │ │ │ ├── VRFConsumerBaseV2.json │ │ │ ├── VRFConsumerBaseV2Plus.json │ │ │ ├── VRFConsumerBaseV2Upgradeable.json │ │ │ ├── VRFConsumerV2.json │ │ │ ├── VRFConsumerV2PlusUpgradeableExample.json │ │ │ ├── VRFConsumerV2UpgradeableExample.json │ │ │ ├── VRFCoordinatorMock.json │ │ │ ├── VRFCoordinatorTestV2.json │ │ │ ├── VRFCoordinatorV2.json │ │ │ ├── VRFCoordinatorV2Interface.json │ │ │ ├── VRFCoordinatorV2Mock.json │ │ │ ├── VRFCoordinatorV2PlusUpgradedVersion.json │ │ │ ├── VRFCoordinatorV2Plus_V2Example.json │ │ │ ├── VRFCoordinatorV2TestHelper.json │ │ │ ├── VRFCoordinatorV2_5.json │ │ │ ├── VRFExternalSubOwnerExample.json │ │ │ ├── VRFLoadTestExternalSubOwner.json │ │ │ ├── VRFLoadTestOwnerlessConsumer.json │ │ │ ├── VRFLogEmitter.json │ │ │ ├── VRFMaliciousConsumerV2.json │ │ │ ├── VRFMaliciousConsumerV2Plus.json │ │ │ ├── VRFMockETHLINKAggregator.json │ │ │ ├── VRFOwner.json │ │ │ ├── VRFOwnerlessConsumerExample.json │ │ │ ├── VRFRequestIDBaseTestHelper.json │ │ │ ├── VRFSingleConsumerExample.json │ │ │ ├── VRFSubscriptionBalanceMonitor.json │ │ │ ├── VRFSubscriptionBalanceMonitorExposed.json │ │ │ ├── VRFTestHelper.json │ │ │ ├── VRFV2LoadTestWithMetrics.json │ │ │ ├── VRFV2OwnerTestConsumer.json │ │ │ ├── VRFV2PlusClient.json │ │ │ ├── VRFV2PlusConsumerExample.json │ │ │ ├── VRFV2PlusExternalSubOwnerExample.json │ │ │ ├── VRFV2PlusLoadTestWithMetrics.json │ │ │ ├── VRFV2PlusMaliciousMigrator.json │ │ │ ├── VRFV2PlusRevertingExample.json │ │ │ ├── VRFV2PlusSingleConsumerExample.json │ │ │ ├── VRFV2PlusWrapper.json │ │ │ ├── VRFV2PlusWrapperConsumerBase.json │ │ │ ├── VRFV2PlusWrapperConsumerExample.json │ │ │ ├── VRFV2PlusWrapperLoadTestConsumer.json │ │ │ ├── VRFV2ProxyAdmin.json │ │ │ ├── VRFV2RevertingExample.json │ │ │ ├── VRFV2TransparentUpgradeableProxy.json │ │ │ ├── VRFV2Wrapper.json │ │ │ ├── VRFV2WrapperConsumerBase.json │ │ │ ├── VRFV2WrapperConsumerExample.json │ │ │ ├── VRFV2WrapperInterface.json │ │ │ ├── VRFV2WrapperLoadTestConsumer.json │ │ │ ├── VRFV2WrapperOutOfGasConsumerExample.json │ │ │ ├── VRFV2WrapperRevertingConsumerExample.json │ │ │ ├── VRFV2WrapperUnderFundingConsumer.json │ │ │ ├── VRFv2Consumer.json │ │ │ ├── ValidatorProxy.json │ │ │ ├── VerifiableLoadBase.json │ │ │ ├── VerifiableLoadLogTriggerUpkeep.json │ │ │ ├── VerifiableLoadStreamsLookupUpkeep.json │ │ │ ├── VerifiableLoadUpkeep.json │ │ │ ├── Verifier.json │ │ │ ├── VerifierProxy.json │ │ │ ├── WERC20Mock.json │ │ │ ├── WETH9.json │ │ │ ├── WithdrawalInterface.json │ │ │ └── iOVM_CrossDomainMessenger.json │ ├── package.json │ └── src │ │ └── v0.8 │ │ ├── ChainSpecificUtil.sol │ │ ├── ChainSpecificUtil_v0_8_6.sol │ │ ├── Chainlink.sol │ │ ├── ChainlinkClient.sol │ │ ├── Denominations.sol │ │ ├── Flags.sol │ │ ├── PermissionedForwardProxy.sol │ │ ├── ValidatorProxy.sol │ │ ├── automation │ │ ├── AutomationBase.sol │ │ ├── AutomationCompatible.sol │ │ ├── AutomationCompatibleUtils.sol │ │ ├── AutomationForwarder.sol │ │ ├── AutomationForwarderLogic.sol │ │ ├── Chainable.sol │ │ ├── ExecutionPrevention.sol │ │ ├── HeartbeatRequester.sol │ │ ├── KeeperBase.sol │ │ ├── KeeperCompatible.sol │ │ ├── README.md │ │ ├── UpkeepFormat.sol │ │ ├── UpkeepTranscoder.sol │ │ ├── chains │ │ │ ├── ArbitrumModule.sol │ │ │ ├── ChainModuleBase.sol │ │ │ ├── OptimismModule.sol │ │ │ └── ScrollModule.sol │ │ ├── dev │ │ │ ├── MercuryRegistry.sol │ │ │ ├── MercuryRegistryBatchUpkeep.sol │ │ │ ├── interfaces │ │ │ │ └── v2_3 │ │ │ │ │ ├── IAutomationRegistryMaster2_3.sol │ │ │ │ │ └── IWrappedNative.sol │ │ │ ├── test │ │ │ │ ├── AutomationRegistrar2_3.t.sol │ │ │ │ ├── AutomationRegistry2_3.t.sol │ │ │ │ ├── BaseTest.t.sol │ │ │ │ └── WETH9.sol │ │ │ └── v2_3 │ │ │ │ ├── AutomationRegistrar2_3.sol │ │ │ │ ├── AutomationRegistry2_3.sol │ │ │ │ ├── AutomationRegistryBase2_3.sol │ │ │ │ ├── AutomationRegistryLogicA2_3.sol │ │ │ │ ├── AutomationRegistryLogicB2_3.sol │ │ │ │ ├── AutomationRegistryLogicC2_3.sol │ │ │ │ ├── AutomationUtils2_3.sol │ │ │ │ ├── LICENSE │ │ │ │ └── UpkeepTranscoder5_0.sol │ │ ├── interfaces │ │ │ ├── AutomationCompatibleInterface.sol │ │ │ ├── IAutomationForwarder.sol │ │ │ ├── IAutomationRegistryConsumer.sol │ │ │ ├── IAutomationV21PlusCommon.sol │ │ │ ├── IChainModule.sol │ │ │ ├── ILogAutomation.sol │ │ │ ├── KeeperCompatibleInterface.sol │ │ │ ├── MigratableKeeperRegistryInterface.sol │ │ │ ├── MigratableKeeperRegistryInterfaceV2.sol │ │ │ ├── StreamsLookupCompatibleInterface.sol │ │ │ ├── UpkeepTranscoderInterface.sol │ │ │ ├── UpkeepTranscoderInterfaceV2.sol │ │ │ ├── v1_2 │ │ │ │ ├── AutomationRegistryInterface1_2.sol │ │ │ │ └── KeeperRegistryInterface1_2.sol │ │ │ ├── v1_3 │ │ │ │ └── AutomationRegistryInterface1_3.sol │ │ │ ├── v2_0 │ │ │ │ └── AutomationRegistryInterface2_0.sol │ │ │ ├── v2_1 │ │ │ │ └── IKeeperRegistryMaster.sol │ │ │ └── v2_2 │ │ │ │ └── IAutomationRegistryMaster.sol │ │ ├── libraries │ │ │ ├── external │ │ │ │ └── Cron.sol │ │ │ └── internal │ │ │ │ └── Cron.sol │ │ ├── mocks │ │ │ ├── KeeperRegistrar1_2Mock.sol │ │ │ ├── KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.sol │ │ │ ├── MockAggregator.sol │ │ │ ├── MockAggregatorProxy.sol │ │ │ ├── MockKeeperRegistry2_1.sol │ │ │ └── MockUpkeep.sol │ │ ├── test │ │ │ ├── AutomationForwarder.t.sol │ │ │ ├── AutomationRegistry2_2.t.sol │ │ │ ├── BaseTest.t.sol │ │ │ ├── HeartbeatRequester.t.sol │ │ │ ├── MercuryRegistry.t.sol │ │ │ └── StructFactory.sol │ │ ├── testhelpers │ │ │ ├── CronTestHelper.sol │ │ │ ├── CronUpkeepTestHelper.sol │ │ │ ├── DummyProtocol.sol │ │ │ ├── KeeperConsumer.sol │ │ │ ├── KeeperConsumerPerformance.sol │ │ │ ├── LogTriggeredStreamsLookup.sol │ │ │ ├── LogUpkeepCounter.sol │ │ │ ├── PerformDataChecker.sol │ │ │ ├── SimpleLogUpkeepCounter.sol │ │ │ ├── UpkeepAutoFunder.sol │ │ │ ├── UpkeepCounter.sol │ │ │ ├── UpkeepMock.sol │ │ │ ├── UpkeepPerformCounterRestrictive.sol │ │ │ └── UpkeepReverter.sol │ │ ├── upkeeps │ │ │ ├── CronUpkeep.sol │ │ │ ├── CronUpkeepDelegate.sol │ │ │ ├── CronUpkeepFactory.sol │ │ │ ├── ERC20BalanceMonitor.sol │ │ │ ├── EthBalanceMonitor.sol │ │ │ ├── LinkAvailableBalanceMonitor.sol │ │ │ └── UpkeepBalanceMonitor.sol │ │ ├── v1_2 │ │ │ ├── KeeperRegistrar1_2.sol │ │ │ ├── KeeperRegistry1_2.sol │ │ │ └── KeeperRegistryCheckUpkeepGasUsageWrapper1_2.sol │ │ ├── v1_3 │ │ │ ├── KeeperRegistry1_3.sol │ │ │ ├── KeeperRegistryBase1_3.sol │ │ │ └── KeeperRegistryLogic1_3.sol │ │ ├── v2_0 │ │ │ ├── KeeperRegistrar2_0.sol │ │ │ ├── KeeperRegistry2_0.sol │ │ │ ├── KeeperRegistryBase2_0.sol │ │ │ ├── KeeperRegistryLogic2_0.sol │ │ │ └── UpkeepTranscoder3_0.sol │ │ ├── v2_1 │ │ │ ├── AutomationRegistrar2_1.sol │ │ │ ├── AutomationUtils2_1.sol │ │ │ ├── KeeperRegistry2_1.sol │ │ │ ├── KeeperRegistryBase2_1.sol │ │ │ ├── KeeperRegistryLogicA2_1.sol │ │ │ ├── KeeperRegistryLogicB2_1.sol │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── UpkeepTranscoder4_0.sol │ │ └── v2_2 │ │ │ ├── AutomationRegistry2_2.sol │ │ │ ├── AutomationRegistryBase2_2.sol │ │ │ ├── AutomationRegistryLogicA2_2.sol │ │ │ ├── AutomationRegistryLogicB2_2.sol │ │ │ ├── AutomationUtils2_2.sol │ │ │ ├── LICENSE │ │ │ └── README.md │ │ ├── functions │ │ ├── dev │ │ │ └── v1_X │ │ │ │ ├── FunctionsBilling.sol │ │ │ │ ├── FunctionsClient.sol │ │ │ │ ├── FunctionsCoordinator.sol │ │ │ │ ├── FunctionsRouter.sol │ │ │ │ ├── FunctionsSubscriptions.sol │ │ │ │ ├── Routable.sol │ │ │ │ ├── accessControl │ │ │ │ ├── TermsOfServiceAllowList.sol │ │ │ │ └── interfaces │ │ │ │ │ └── ITermsOfServiceAllowList.sol │ │ │ │ ├── example │ │ │ │ └── FunctionsClientExample.sol │ │ │ │ ├── interfaces │ │ │ │ ├── IFunctionsBilling.sol │ │ │ │ ├── IFunctionsClient.sol │ │ │ │ ├── IFunctionsCoordinator.sol │ │ │ │ ├── IFunctionsRouter.sol │ │ │ │ ├── IFunctionsSubscriptions.sol │ │ │ │ └── IOwnableFunctionsRouter.sol │ │ │ │ ├── libraries │ │ │ │ ├── ChainSpecificUtil.sol │ │ │ │ ├── FunctionsRequest.sol │ │ │ │ └── FunctionsResponse.sol │ │ │ │ ├── mocks │ │ │ │ └── FunctionsV1EventsMock.sol │ │ │ │ └── ocr │ │ │ │ ├── OCR2Abstract.sol │ │ │ │ └── OCR2Base.sol │ │ ├── interfaces │ │ │ └── .gitkeep │ │ ├── tests │ │ │ └── v1_X │ │ │ │ ├── BaseTest.t.sol │ │ │ │ ├── ChainSpecificUtil.t.sol │ │ │ │ ├── FunctionsBilling.t.sol │ │ │ │ ├── FunctionsClient.t.sol │ │ │ │ ├── FunctionsCoordinator.t.sol │ │ │ │ ├── FunctionsRequest.t.sol │ │ │ │ ├── FunctionsRouter.t.sol │ │ │ │ ├── FunctionsSubscriptions.t.sol │ │ │ │ ├── FunctionsTermsOfServiceAllowList.t.sol │ │ │ │ ├── Gas.t.sol │ │ │ │ ├── OCR2.t.sol │ │ │ │ ├── README.md │ │ │ │ ├── Setup.t.sol │ │ │ │ └── testhelpers │ │ │ │ ├── FunctionsClientHarness.sol │ │ │ │ ├── FunctionsClientTestHelper.sol │ │ │ │ ├── FunctionsClientUpgradeHelper.sol │ │ │ │ ├── FunctionsClientWithEmptyCallback.sol │ │ │ │ ├── FunctionsCoordinatorHarness.sol │ │ │ │ ├── FunctionsCoordinatorTestHelper.sol │ │ │ │ ├── FunctionsLoadTestClient.sol │ │ │ │ ├── FunctionsRouterHarness.sol │ │ │ │ ├── FunctionsSubscriptionsHarness.sol │ │ │ │ └── FunctionsTestHelper.sol │ │ ├── v1_0_0 │ │ │ ├── FunctionsBilling.sol │ │ │ ├── FunctionsClient.sol │ │ │ ├── FunctionsCoordinator.sol │ │ │ ├── FunctionsRouter.sol │ │ │ ├── FunctionsSubscriptions.sol │ │ │ ├── Routable.sol │ │ │ ├── accessControl │ │ │ │ ├── TermsOfServiceAllowList.sol │ │ │ │ └── interfaces │ │ │ │ │ └── ITermsOfServiceAllowList.sol │ │ │ ├── example │ │ │ │ └── FunctionsClientExample.sol │ │ │ ├── interfaces │ │ │ │ ├── IFunctionsBilling.sol │ │ │ │ ├── IFunctionsClient.sol │ │ │ │ ├── IFunctionsCoordinator.sol │ │ │ │ ├── IFunctionsRouter.sol │ │ │ │ ├── IFunctionsSubscriptions.sol │ │ │ │ └── IOwnableFunctionsRouter.sol │ │ │ ├── libraries │ │ │ │ ├── FunctionsRequest.sol │ │ │ │ └── FunctionsResponse.sol │ │ │ ├── mocks │ │ │ │ └── FunctionsV1EventsMock.sol │ │ │ └── ocr │ │ │ │ ├── OCR2Abstract.sol │ │ │ │ └── OCR2Base.sol │ │ ├── v1_1_0 │ │ │ ├── FunctionsBilling.sol │ │ │ ├── FunctionsCoordinator.sol │ │ │ ├── libraries │ │ │ │ └── ChainSpecificUtil.sol │ │ │ └── ocr │ │ │ │ ├── OCR2Abstract.sol │ │ │ │ └── OCR2Base.sol │ │ └── v1_3_0 │ │ │ ├── FunctionsBilling.sol │ │ │ ├── FunctionsClient.sol │ │ │ ├── FunctionsCoordinator.sol │ │ │ ├── accessControl │ │ │ ├── TermsOfServiceAllowList.sol │ │ │ └── interfaces │ │ │ │ └── ITermsOfServiceAllowList.sol │ │ │ ├── interfaces │ │ │ └── IFunctionsBilling.sol │ │ │ └── ocr │ │ │ ├── OCR2Abstract.sol │ │ │ └── OCR2Base.sol │ │ ├── interfaces │ │ ├── ChainlinkRequestInterface.sol │ │ ├── ENSInterface.sol │ │ ├── FeedRegistryInterface.sol │ │ ├── FlagsInterface.sol │ │ ├── OperatorInterface.sol │ │ ├── OracleInterface.sol │ │ ├── PoRAddressList.sol │ │ ├── PointerInterface.sol │ │ └── TypeAndVersionInterface.sol │ │ ├── keystone │ │ ├── KeystoneForwarder.sol │ │ ├── OCR3Capability.sol │ │ ├── interfaces │ │ │ └── IForwarder.sol │ │ ├── libraries │ │ │ └── Utils.sol │ │ └── test │ │ │ └── KeystoneForwarder.t.sol │ │ ├── l2ep │ │ ├── README.md │ │ ├── dev │ │ │ ├── CrossDomainDelegateForwarder.sol │ │ │ ├── CrossDomainForwarder.sol │ │ │ ├── CrossDomainOwnable.sol │ │ │ ├── Flags.sol │ │ │ ├── arbitrum │ │ │ │ ├── ArbitrumCrossDomainForwarder.sol │ │ │ │ ├── ArbitrumCrossDomainGovernor.sol │ │ │ │ ├── ArbitrumSequencerUptimeFeed.sol │ │ │ │ └── ArbitrumValidator.sol │ │ │ ├── interfaces │ │ │ │ ├── ArbitrumSequencerUptimeFeedInterface.sol │ │ │ │ ├── CrossDomainOwnableInterface.sol │ │ │ │ ├── DelegateForwarderInterface.sol │ │ │ │ ├── FlagsInterface.sol │ │ │ │ ├── ForwarderInterface.sol │ │ │ │ ├── IArbitrumDelayedInbox.sol │ │ │ │ ├── OptimismSequencerUptimeFeedInterface.sol │ │ │ │ └── ScrollSequencerUptimeFeedInterface.sol │ │ │ ├── optimism │ │ │ │ ├── OptimismCrossDomainForwarder.sol │ │ │ │ ├── OptimismCrossDomainGovernor.sol │ │ │ │ ├── OptimismSequencerUptimeFeed.sol │ │ │ │ └── OptimismValidator.sol │ │ │ └── scroll │ │ │ │ ├── ScrollCrossDomainForwarder.sol │ │ │ │ ├── ScrollCrossDomainGovernor.sol │ │ │ │ ├── ScrollSequencerUptimeFeed.sol │ │ │ │ └── ScrollValidator.sol │ │ └── test │ │ │ ├── mocks │ │ │ ├── MockAggregatorV2V3.sol │ │ │ ├── optimism │ │ │ │ └── MockOVMCrossDomainMessenger.sol │ │ │ └── scroll │ │ │ │ ├── MockScrollCrossDomainMessenger.sol │ │ │ │ ├── MockScrollL1CrossDomainMessenger.sol │ │ │ │ ├── MockScrollL1MessageQueue.sol │ │ │ │ └── MockScrollL2CrossDomainMessenger.sol │ │ │ └── v1_0_0 │ │ │ ├── L2EPTest.t.sol │ │ │ ├── arbitrum │ │ │ ├── ArbitrumCrossDomainForwarder.t.sol │ │ │ ├── ArbitrumCrossDomainGovernor.t.sol │ │ │ ├── ArbitrumSequencerUptimeFeed.t.sol │ │ │ └── ArbitrumValidator.t.sol │ │ │ ├── optimism │ │ │ ├── OptimismCrossDomainForwarder.t.sol │ │ │ ├── OptimismCrossDomainGovernor.t.sol │ │ │ ├── OptimismSequencerUptimeFeed.t.sol │ │ │ └── OptimismValidator.t.sol │ │ │ └── scroll │ │ │ ├── ScrollCrossDomainForwarder.t.sol │ │ │ ├── ScrollCrossDomainGovernor.t.sol │ │ │ ├── ScrollSequencerUptimeFeed.t.sol │ │ │ └── ScrollValidator.t.sol │ │ ├── llo-feeds │ │ ├── FeeManager.sol │ │ ├── RewardManager.sol │ │ ├── Verifier.sol │ │ ├── VerifierProxy.sol │ │ ├── dev │ │ │ ├── ChannelConfigStore.sol │ │ │ ├── ChannelVerifier.sol │ │ │ ├── interfaces │ │ │ │ ├── IChannelConfigStore.sol │ │ │ │ └── IChannelVerifier.sol │ │ │ └── test │ │ │ │ └── mocks │ │ │ │ ├── ExposedChannelVerifier.sol │ │ │ │ └── ExposedVerifier.sol │ │ ├── interfaces │ │ │ ├── IFeeManager.sol │ │ │ ├── IRewardManager.sol │ │ │ ├── IVerifier.sol │ │ │ ├── IVerifierFeeManager.sol │ │ │ └── IVerifierProxy.sol │ │ ├── libraries │ │ │ ├── ByteUtil.sol │ │ │ └── Common.sol │ │ └── test │ │ │ ├── ByteUtilTest.t.sol │ │ │ ├── fee-manager │ │ │ ├── BaseFeeManager.t.sol │ │ │ ├── FeeManager.general.t.sol │ │ │ ├── FeeManager.getFeeAndReward.t.sol │ │ │ ├── FeeManager.processFee.t.sol │ │ │ └── FeeManager.processFeeBulk.t.sol │ │ │ ├── gas │ │ │ └── Gas_VerifierTest.t.sol │ │ │ ├── mocks │ │ │ ├── ErroredVerifier.sol │ │ │ ├── ExposedVerifier.sol │ │ │ └── FeeManagerProxy.sol │ │ │ ├── reward-manager │ │ │ ├── BaseRewardManager.t.sol │ │ │ ├── RewardManager.claim.t.sol │ │ │ ├── RewardManager.general.t.sol │ │ │ ├── RewardManager.payRecipients.t.sol │ │ │ ├── RewardManager.setRecipients.t.sol │ │ │ └── RewardManager.updateRewardRecipients.t.sol │ │ │ └── verifier │ │ │ ├── BaseVerifierTest.t.sol │ │ │ ├── VerifierActivateConfigTest.t.sol │ │ │ ├── VerifierDeactivateFeedTest.t.sol │ │ │ ├── VerifierProxyConstructorTest.t.sol │ │ │ ├── VerifierProxyInitializeVerifierTest.t.sol │ │ │ ├── VerifierProxySetAccessControllerTest.t.sol │ │ │ ├── VerifierProxySetVerifierTest.t.sol │ │ │ ├── VerifierProxyTest.t.sol │ │ │ ├── VerifierProxyUnsetVerifierTest.t.sol │ │ │ ├── VerifierSetConfigFromSourceTest.t.sol │ │ │ ├── VerifierSetConfigTest.t.sol │ │ │ ├── VerifierTest.t.sol │ │ │ ├── VerifierTestBillingReport.t.sol │ │ │ ├── VerifierUnsetConfigTest.t.sol │ │ │ └── VerifierVerifyTest.t.sol │ │ ├── mocks │ │ ├── FunctionsBillingRegistryEventsMock.sol │ │ ├── FunctionsOracleEventsMock.sol │ │ ├── MockAggregatorValidator.sol │ │ ├── MockArbSys.sol │ │ ├── MockLinkToken.sol │ │ └── MockOffchainAggregator.sol │ │ ├── operatorforwarder │ │ └── dev │ │ │ ├── AuthorizedForwarder.sol │ │ │ ├── AuthorizedReceiver.sol │ │ │ ├── LinkTokenReceiver.sol │ │ │ ├── Operator.sol │ │ │ ├── OperatorFactory.sol │ │ │ ├── interfaces │ │ │ ├── AuthorizedReceiverInterface.sol │ │ │ └── WithdrawalInterface.sol │ │ │ └── test │ │ │ ├── operator.t.sol │ │ │ └── testhelpers │ │ │ ├── BasicConsumer.sol │ │ │ ├── ChainlinkClientHelper.sol │ │ │ ├── Chainlinked.sol │ │ │ ├── Consumer.sol │ │ │ ├── EmptyOracle.sol │ │ │ ├── GasGuzzlingConsumer.sol │ │ │ ├── GetterSetter.sol │ │ │ ├── MaliciousChainlink.sol │ │ │ ├── MaliciousChainlinked.sol │ │ │ ├── MaliciousConsumer.sol │ │ │ ├── MaliciousMultiWordConsumer.sol │ │ │ ├── MaliciousRequester.sol │ │ │ └── MultiWordConsumer.sol │ │ ├── shared │ │ ├── access │ │ │ ├── ConfirmedOwner.sol │ │ │ ├── ConfirmedOwnerWithProposal.sol │ │ │ ├── OwnerIsCreator.sol │ │ │ ├── SimpleReadAccessController.sol │ │ │ └── SimpleWriteAccessController.sol │ │ ├── call │ │ │ └── CallWithExactGas.sol │ │ ├── interfaces │ │ │ ├── AccessControllerInterface.sol │ │ │ ├── AggregatorInterface.sol │ │ │ ├── AggregatorV2V3Interface.sol │ │ │ ├── AggregatorV3Interface.sol │ │ │ ├── AggregatorValidatorInterface.sol │ │ │ ├── IAccessController.sol │ │ │ ├── IERC677Receiver.sol │ │ │ ├── IOwnable.sol │ │ │ ├── ITypeAndVersion.sol │ │ │ ├── IWERC20.sol │ │ │ └── LinkTokenInterface.sol │ │ ├── mocks │ │ │ └── WERC20Mock.sol │ │ ├── ocr2 │ │ │ ├── OCR2Abstract.sol │ │ │ ├── OCR2Base.sol │ │ │ └── README.md │ │ ├── test │ │ │ ├── BaseTest.t.sol │ │ │ ├── call │ │ │ │ ├── CallWithExactGas.t.sol │ │ │ │ └── CallWithExactGasHelper.sol │ │ │ ├── helpers │ │ │ │ ├── ChainReaderTestContract.sol │ │ │ │ └── LinkTokenTestHelper.sol │ │ │ ├── testhelpers │ │ │ │ ├── ConfirmedOwnerTestHelper.sol │ │ │ │ └── GenericReceiver.sol │ │ │ └── token │ │ │ │ └── ERC677 │ │ │ │ ├── BurnMintERC677.t.sol │ │ │ │ └── OpStackBurnMintERC677.t.sol │ │ └── token │ │ │ ├── ERC20 │ │ │ ├── IBurnMintERC20.sol │ │ │ └── IOptimismMintableERC20.sol │ │ │ └── ERC677 │ │ │ ├── BurnMintERC677.sol │ │ │ ├── ERC677.sol │ │ │ ├── IERC677.sol │ │ │ ├── LinkToken.sol │ │ │ └── OpStackBurnMintERC677.sol │ │ ├── tests │ │ ├── AutomationConsumerBenchmark.sol │ │ ├── Broken.sol │ │ ├── ChainlinkClientTestHelper.sol │ │ ├── ChainlinkTestHelper.sol │ │ ├── Counter.sol │ │ ├── CronReceiver.sol │ │ ├── ERC20BalanceMonitorExposed.sol │ │ ├── EthBalanceMonitorExposed.sol │ │ ├── FeedConsumer.sol │ │ ├── FlagsTestHelper.sol │ │ ├── Greeter.sol │ │ ├── KeeperCompatibleTestHelper.sol │ │ ├── LogEmitter.sol │ │ ├── MockArbGasInfo.sol │ │ ├── MockArbitrumInbox.sol │ │ ├── MockETHLINKAggregator.sol │ │ ├── MockOVMGasPriceOracle.sol │ │ ├── MockOptimismL1CrossDomainMessenger.sol │ │ ├── MockOptimismL2CrossDomainMessenger.sol │ │ ├── MockV3Aggregator.sol │ │ ├── ReceiveEmitter.sol │ │ ├── ReceiveFallbackEmitter.sol │ │ ├── ReceiveReverter.sol │ │ ├── StreamsLookupUpkeep.sol │ │ ├── VRFLogEmitter.sol │ │ ├── VerifiableLoadBase.sol │ │ ├── VerifiableLoadLogTriggerUpkeep.sol │ │ ├── VerifiableLoadStreamsLookupUpkeep.sol │ │ └── VerifiableLoadUpkeep.sol │ │ ├── transmission │ │ ├── dev │ │ │ ├── ERC-4337 │ │ │ │ ├── Paymaster.sol │ │ │ │ ├── SCA.sol │ │ │ │ ├── SCALibrary.sol │ │ │ │ └── SmartContractAccountFactory.sol │ │ │ └── testhelpers │ │ │ │ ├── Greeter.sol │ │ │ │ └── SmartContractAccountHelper.sol │ │ └── test │ │ │ ├── BaseTest.t.sol │ │ │ └── EIP_712_1014_4337.t.sol │ │ ├── vendor │ │ ├── @arbitrum │ │ │ └── nitro-contracts │ │ │ │ └── src │ │ │ │ └── precompiles │ │ │ │ ├── ArbGasInfo.sol │ │ │ │ └── ArbSys.sol │ │ ├── @ensdomains │ │ │ └── buffer │ │ │ │ └── v0.1.0 │ │ │ │ └── Buffer.sol │ │ ├── @eth-optimism │ │ │ ├── contracts-bedrock │ │ │ │ └── v0.16.2 │ │ │ │ │ └── src │ │ │ │ │ ├── L2 │ │ │ │ │ ├── GasPriceOracle.sol │ │ │ │ │ └── L1Block.sol │ │ │ │ │ ├── libraries │ │ │ │ │ └── Predeploys.sol │ │ │ │ │ └── universal │ │ │ │ │ └── ISemver.sol │ │ │ └── contracts │ │ │ │ ├── v0.4.7 │ │ │ │ └── contracts │ │ │ │ │ └── optimistic-ethereum │ │ │ │ │ └── iOVM │ │ │ │ │ └── bridge │ │ │ │ │ └── messaging │ │ │ │ │ └── iOVM_CrossDomainMessenger.sol │ │ │ │ ├── v0.8.6 │ │ │ │ └── contracts │ │ │ │ │ └── L2 │ │ │ │ │ └── predeploys │ │ │ │ │ └── OVM_GasPriceOracle.sol │ │ │ │ └── v0.8.9 │ │ │ │ └── contracts │ │ │ │ └── L2 │ │ │ │ └── predeploys │ │ │ │ └── OVM_GasPriceOracle.sol │ │ ├── @scroll-tech │ │ │ └── contracts │ │ │ │ └── src │ │ │ │ └── L2 │ │ │ │ └── predeploys │ │ │ │ └── IScrollL1GasPriceOracle.sol │ │ ├── BufferChainlink.sol │ │ ├── CBORChainlink.sol │ │ ├── DateTime.sol │ │ ├── ENSResolver.sol │ │ ├── IERC165.sol │ │ ├── MockOVMCrossDomainMessenger.sol │ │ ├── MockScrollCrossDomainMessenger.sol │ │ ├── MultiSend.sol │ │ ├── Strings.sol │ │ ├── arb-bridge-eth │ │ │ └── v0.8.0-custom │ │ │ │ └── contracts │ │ │ │ ├── bridge │ │ │ │ └── interfaces │ │ │ │ │ ├── IBridge.sol │ │ │ │ │ ├── IInbox.sol │ │ │ │ │ └── IMessageProvider.sol │ │ │ │ └── libraries │ │ │ │ └── AddressAliasHelper.sol │ │ ├── entrypoint │ │ │ ├── core │ │ │ │ ├── EntryPoint.sol │ │ │ │ ├── Helpers.sol │ │ │ │ ├── SenderCreator.sol │ │ │ │ └── StakeManager.sol │ │ │ ├── interfaces │ │ │ │ ├── IAccount.sol │ │ │ │ ├── IAggregator.sol │ │ │ │ ├── IEntryPoint.sol │ │ │ │ ├── IPaymaster.sol │ │ │ │ ├── IStakeManager.sol │ │ │ │ └── UserOperation.sol │ │ │ └── utils │ │ │ │ └── Exec.sol │ │ ├── openzeppelin-solidity │ │ │ ├── v4.7.3 │ │ │ │ └── contracts │ │ │ │ │ ├── proxy │ │ │ │ │ └── Proxy.sol │ │ │ │ │ └── utils │ │ │ │ │ ├── Address.sol │ │ │ │ │ ├── Context.sol │ │ │ │ │ └── structs │ │ │ │ │ ├── EnumerableMap.sol │ │ │ │ │ └── EnumerableSet.sol │ │ │ └── v4.8.3 │ │ │ │ └── contracts │ │ │ │ ├── access │ │ │ │ ├── AccessControl.sol │ │ │ │ └── IAccessControl.sol │ │ │ │ ├── interfaces │ │ │ │ ├── IERC165.sol │ │ │ │ ├── IERC20.sol │ │ │ │ └── draft-IERC20Permit.sol │ │ │ │ ├── mocks │ │ │ │ └── ERC20Mock.sol │ │ │ │ ├── security │ │ │ │ └── Pausable.sol │ │ │ │ ├── token │ │ │ │ └── ERC20 │ │ │ │ │ ├── ERC20.sol │ │ │ │ │ ├── IERC20.sol │ │ │ │ │ ├── extensions │ │ │ │ │ ├── ERC20Burnable.sol │ │ │ │ │ ├── IERC20Metadata.sol │ │ │ │ │ ├── draft-ERC20Permit.sol │ │ │ │ │ └── draft-IERC20Permit.sol │ │ │ │ │ └── utils │ │ │ │ │ └── SafeERC20.sol │ │ │ │ └── utils │ │ │ │ ├── Address.sol │ │ │ │ ├── Context.sol │ │ │ │ ├── Counters.sol │ │ │ │ ├── StorageSlot.sol │ │ │ │ ├── Strings.sol │ │ │ │ ├── cryptography │ │ │ │ ├── ECDSA.sol │ │ │ │ └── EIP712.sol │ │ │ │ ├── introspection │ │ │ │ ├── ERC165.sol │ │ │ │ └── IERC165.sol │ │ │ │ ├── math │ │ │ │ ├── Math.sol │ │ │ │ ├── SafeCast.sol │ │ │ │ └── SignedMath.sol │ │ │ │ └── structs │ │ │ │ ├── EnumerableMap.sol │ │ │ │ └── EnumerableSet.sol │ │ └── solidity-cborutils │ │ │ └── v2.0.0 │ │ │ └── CBOR.sol │ │ └── vrf │ │ ├── AuthorizedReceiver.sol │ │ ├── BatchBlockhashStore.sol │ │ ├── BatchVRFCoordinatorV2.sol │ │ ├── KeepersVRFConsumer.sol │ │ ├── VRF.sol │ │ ├── VRFConsumerBase.sol │ │ ├── VRFConsumerBaseV2.sol │ │ ├── VRFCoordinatorV2.sol │ │ ├── VRFOwner.sol │ │ ├── VRFRequestIDBase.sol │ │ ├── VRFTypes.sol │ │ ├── VRFV2Wrapper.sol │ │ ├── VRFV2WrapperConsumerBase.sol │ │ ├── dev │ │ ├── BatchVRFCoordinatorV2Plus.sol │ │ ├── BlockhashStore.sol │ │ ├── SubscriptionAPI.sol │ │ ├── TrustedBlockhashStore.sol │ │ ├── VRFConsumerBaseV2Plus.sol │ │ ├── VRFConsumerBaseV2Upgradeable.sol │ │ ├── VRFCoordinatorV2_5.sol │ │ ├── VRFSubscriptionBalanceMonitor.sol │ │ ├── VRFV2PlusWrapper.sol │ │ ├── VRFV2PlusWrapperConsumerBase.sol │ │ ├── interfaces │ │ │ ├── IVRFCoordinatorV2Plus.sol │ │ │ ├── IVRFCoordinatorV2PlusInternal.sol │ │ │ ├── IVRFCoordinatorV2PlusMigration.sol │ │ │ ├── IVRFMigratableConsumerV2Plus.sol │ │ │ ├── IVRFSubscriptionV2Plus.sol │ │ │ ├── IVRFV2PlusMigrate.sol │ │ │ └── IVRFV2PlusWrapper.sol │ │ ├── libraries │ │ │ └── VRFV2PlusClient.sol │ │ └── testhelpers │ │ │ ├── ExposedVRFCoordinatorV2_5.sol │ │ │ ├── VRFConsumerV2PlusUpgradeableExample.sol │ │ │ ├── VRFCoordinatorV2PlusUpgradedVersion.sol │ │ │ ├── VRFCoordinatorV2Plus_V2Example.sol │ │ │ ├── VRFMaliciousConsumerV2Plus.sol │ │ │ ├── VRFV2PlusConsumerExample.sol │ │ │ ├── VRFV2PlusExternalSubOwnerExample.sol │ │ │ ├── VRFV2PlusLoadTestWithMetrics.sol │ │ │ ├── VRFV2PlusMaliciousMigrator.sol │ │ │ ├── VRFV2PlusRevertingExample.sol │ │ │ ├── VRFV2PlusSingleConsumerExample.sol │ │ │ ├── VRFV2PlusWrapperConsumerExample.sol │ │ │ └── VRFV2PlusWrapperLoadTestConsumer.sol │ │ ├── interfaces │ │ ├── BlockhashStoreInterface.sol │ │ ├── IAuthorizedReceiver.sol │ │ ├── VRFCoordinatorV2Interface.sol │ │ └── VRFV2WrapperInterface.sol │ │ ├── mocks │ │ ├── VRFCoordinatorMock.sol │ │ └── VRFCoordinatorV2Mock.sol │ │ ├── test │ │ ├── BaseTest.t.sol │ │ ├── ChainSpecificUtil.t.sol │ │ ├── TrustedBlockhashStore.t.sol │ │ ├── VRFCoordinatorV2Mock.t.sol │ │ ├── VRFCoordinatorV2Plus_Migration.t.sol │ │ ├── VRFV2Plus.t.sol │ │ ├── VRFV2PlusSubscriptionAPI.t.sol │ │ ├── VRFV2PlusWrapper.t.sol │ │ └── VRFV2PlusWrapper_Migration.t.sol │ │ └── testhelpers │ │ ├── ChainSpecificUtilHelper.sol │ │ ├── VRFConsumer.sol │ │ ├── VRFConsumerV2.sol │ │ ├── VRFConsumerV2UpgradeableExample.sol │ │ ├── VRFCoordinatorTestV2.sol │ │ ├── VRFCoordinatorV2TestHelper.sol │ │ ├── VRFExternalSubOwnerExample.sol │ │ ├── VRFLoadTestExternalSubOwner.sol │ │ ├── VRFLoadTestOwnerlessConsumer.sol │ │ ├── VRFMaliciousConsumerV2.sol │ │ ├── VRFMockETHLINKAggregator.sol │ │ ├── VRFOwnerlessConsumerExample.sol │ │ ├── VRFRequestIDBaseTestHelper.sol │ │ ├── VRFSingleConsumerExample.sol │ │ ├── VRFSubscriptionBalanceMonitorExposed.sol │ │ ├── VRFTestHelper.sol │ │ ├── VRFV2LoadTestWithMetrics.sol │ │ ├── VRFV2OwnerTestConsumer.sol │ │ ├── VRFV2ProxyAdmin.sol │ │ ├── VRFV2RevertingExample.sol │ │ ├── VRFV2TransparentUpgradeableProxy.sol │ │ ├── VRFV2WrapperConsumerExample.sol │ │ ├── VRFV2WrapperLoadTestConsumer.sol │ │ ├── VRFV2WrapperOutOfGasConsumerExample.sol │ │ ├── VRFV2WrapperRevertingConsumerExample.sol │ │ ├── VRFV2WrapperUnderFundingConsumer.sol │ │ └── VRFv2Consumer.sol │ ├── env-enc │ ├── LICENSE │ ├── README.md │ ├── dist │ │ ├── EncryptedEnv.d.ts │ │ ├── EncryptedEnv.js │ │ ├── cli.d.ts │ │ ├── cli.js │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── runSetPasswordScripts.d.ts │ │ ├── runSetPasswordScripts.js │ │ └── scripts │ │ │ ├── setPassword.ps1 │ │ │ └── setPassword.sh │ └── package.json │ └── functions-toolkit │ ├── LICENSE │ ├── README.md │ ├── dist │ ├── ResponseListener.d.ts │ ├── ResponseListener.js │ ├── SecretsManager.d.ts │ ├── SecretsManager.js │ ├── SubscriptionManager.d.ts │ ├── SubscriptionManager.js │ ├── buildRequestCBOR.d.ts │ ├── buildRequestCBOR.js │ ├── decodeResult.d.ts │ ├── decodeResult.js │ ├── fetchRequestCommitment.d.ts │ ├── fetchRequestCommitment.js │ ├── index.d.ts │ ├── index.js │ ├── localFunctionsTestnet.d.ts │ ├── localFunctionsTestnet.js │ ├── offchain_storage │ │ ├── github.d.ts │ │ ├── github.js │ │ ├── index.d.ts │ │ └── index.js │ ├── simulateScript.browser.js │ ├── simulateScript │ │ ├── Functions.d.ts │ │ ├── Functions.js │ │ ├── deno-sandbox │ │ │ └── sandbox.ts │ │ ├── frontendAllowedModules.d.ts │ │ ├── frontendAllowedModules.js │ │ ├── frontendSimulateScript.d.ts │ │ ├── frontendSimulateScript.js │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── safePow.d.ts │ │ ├── safePow.js │ │ ├── simulateScript.d.ts │ │ └── simulateScript.js │ ├── simulationConfig.d.ts │ ├── simulationConfig.js │ ├── tdh2.d.ts │ ├── tdh2.js │ ├── types.d.ts │ ├── types.js │ └── v1_contract_sources │ │ ├── FunctionsCoordinator.d.ts │ │ ├── FunctionsCoordinator.js │ │ ├── FunctionsCoordinatorTestHelper.d.ts │ │ ├── FunctionsCoordinatorTestHelper.js │ │ ├── FunctionsRouter.d.ts │ │ ├── FunctionsRouter.js │ │ ├── LinkToken.d.ts │ │ ├── LinkToken.js │ │ ├── MockV3Aggregator.d.ts │ │ ├── MockV3Aggregator.js │ │ ├── TermsOfServiceAllowList.d.ts │ │ ├── TermsOfServiceAllowList.js │ │ ├── index.d.ts │ │ └── index.js │ └── package.json ├── networks.js ├── package.json ├── request-config.js ├── scripts ├── FunctionsConsumer.s.sol └── Simulate.js ├── src ├── Counter.sol └── FunctionsConsumer.sol ├── tasks ├── billing │ ├── add.js │ ├── create.js │ ├── fund.js │ └── index.js ├── consumer │ ├── deploy.js │ ├── index.js │ ├── read.js │ └── request.js ├── index.js └── utils │ ├── index.js │ ├── logger.js │ ├── network.js │ ├── price.js │ ├── prompt.js │ └── spin.js ├── test └── Counter.t.sol └── yarn.lock /.env.example: -------------------------------------------------------------------------------- 1 | OPENAI_KEY="" 2 | # ensure you add the prefix for your private key (0x) 3 | PRIVATE_KEY="0x" 4 | ETHERSCAN_API_KEY="" -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: workflow_dispatch 4 | 5 | env: 6 | FOUNDRY_PROFILE: ci 7 | 8 | jobs: 9 | check: 10 | strategy: 11 | fail-fast: true 12 | 13 | name: Foundry project 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | with: 18 | submodules: recursive 19 | 20 | - name: Install Foundry 21 | uses: foundry-rs/foundry-toolchain@v1 22 | with: 23 | version: nightly 24 | 25 | - name: Run Forge build 26 | run: | 27 | forge --version 28 | forge build --sizes 29 | id: build 30 | 31 | - name: Run Forge tests 32 | run: | 33 | forge test -vvv 34 | id: test 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Environment Variables 2 | .env 3 | .env.local 4 | .env.enc 5 | 6 | # Forge 7 | out 8 | cache 9 | broadcast 10 | 11 | # Dependency Directories 12 | node_modules/ 13 | 14 | # Misc. 15 | .DS_Store 16 | 17 | # Hardhat 18 | build -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | [submodule "lib/chainlink"] 5 | path = lib/chainlink 6 | url = https://github.com/smartcontractkit/chainlink -------------------------------------------------------------------------------- /docs/FOUNDRY.md: -------------------------------------------------------------------------------- 1 | ## Foundry 2 | 3 | **Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** 4 | 5 | Foundry consists of: 6 | 7 | - **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). 8 | - **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. 9 | - **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. 10 | - **Chisel**: Fast, utilitarian, and verbose solidity REPL. 11 | 12 | ## Documentation 13 | 14 | https://book.getfoundry.sh/ 15 | 16 | ## Usage 17 | 18 | ### Build 19 | 20 | ```shell 21 | $ forge build 22 | ``` 23 | 24 | ### Test 25 | 26 | ```shell 27 | $ forge test 28 | ``` 29 | 30 | ### Format 31 | 32 | ```shell 33 | $ forge fmt 34 | ``` 35 | 36 | ### Gas Snapshots 37 | 38 | ```shell 39 | $ forge snapshot 40 | ``` 41 | 42 | ### Anvil 43 | 44 | ```shell 45 | $ anvil 46 | ``` 47 | 48 | ### Deploy 49 | 50 | ```shell 51 | $ forge script script/Counter.s.sol:CounterScript --rpc-url --private-key 52 | ``` 53 | 54 | ### Cast 55 | 56 | ```shell 57 | $ cast 58 | ``` 59 | 60 | ### Help 61 | 62 | ```shell 63 | $ forge --help 64 | $ anvil --help 65 | $ cast --help 66 | ``` 67 | -------------------------------------------------------------------------------- /docs/INSTALL.md: -------------------------------------------------------------------------------- 1 | ### Installing Foundry 2 | ``` 3 | curl -L https://foundry.paradigm.xyz | bash 4 | ``` 5 | ### Installing Rust 6 | ``` 7 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 8 | ``` -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/AccessControllerInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "user", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "bytes", 11 | "name": "data", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "hasAccess", 16 | "outputs": [ 17 | { 18 | "internalType": "bool", 19 | "name": "", 20 | "type": "bool" 21 | } 22 | ], 23 | "stateMutability": "view", 24 | "type": "function" 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/AggregatorValidatorInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256", 6 | "name": "previousRoundId", 7 | "type": "uint256" 8 | }, 9 | { 10 | "internalType": "int256", 11 | "name": "previousAnswer", 12 | "type": "int256" 13 | }, 14 | { 15 | "internalType": "uint256", 16 | "name": "currentRoundId", 17 | "type": "uint256" 18 | }, 19 | { 20 | "internalType": "int256", 21 | "name": "currentAnswer", 22 | "type": "int256" 23 | } 24 | ], 25 | "name": "validate", 26 | "outputs": [ 27 | { 28 | "internalType": "bool", 29 | "name": "", 30 | "type": "bool" 31 | } 32 | ], 33 | "stateMutability": "nonpayable", 34 | "type": "function" 35 | } 36 | ] 37 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ArbitrumSequencerUptimeFeedInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bool", 6 | "name": "status", 7 | "type": "bool" 8 | }, 9 | { 10 | "internalType": "uint64", 11 | "name": "timestamp", 12 | "type": "uint64" 13 | } 14 | ], 15 | "name": "updateStatus", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/AuthorizedReceiverInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "getAuthorizedSenders", 5 | "outputs": [ 6 | { 7 | "internalType": "address[]", 8 | "name": "", 9 | "type": "address[]" 10 | } 11 | ], 12 | "stateMutability": "nonpayable", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [ 17 | { 18 | "internalType": "address", 19 | "name": "sender", 20 | "type": "address" 21 | } 22 | ], 23 | "name": "isAuthorizedSender", 24 | "outputs": [ 25 | { 26 | "internalType": "bool", 27 | "name": "", 28 | "type": "bool" 29 | } 30 | ], 31 | "stateMutability": "view", 32 | "type": "function" 33 | }, 34 | { 35 | "inputs": [ 36 | { 37 | "internalType": "address[]", 38 | "name": "senders", 39 | "type": "address[]" 40 | } 41 | ], 42 | "name": "setAuthorizedSenders", 43 | "outputs": [], 44 | "stateMutability": "nonpayable", 45 | "type": "function" 46 | } 47 | ] 48 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/AutomationBase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "OnlySimulatedBackend", 5 | "type": "error" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/AutomationCompatible.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "OnlySimulatedBackend", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "bytes", 11 | "name": "checkData", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "checkUpkeep", 16 | "outputs": [ 17 | { 18 | "internalType": "bool", 19 | "name": "upkeepNeeded", 20 | "type": "bool" 21 | }, 22 | { 23 | "internalType": "bytes", 24 | "name": "performData", 25 | "type": "bytes" 26 | } 27 | ], 28 | "stateMutability": "nonpayable", 29 | "type": "function" 30 | }, 31 | { 32 | "inputs": [ 33 | { 34 | "internalType": "bytes", 35 | "name": "performData", 36 | "type": "bytes" 37 | } 38 | ], 39 | "name": "performUpkeep", 40 | "outputs": [], 41 | "stateMutability": "nonpayable", 42 | "type": "function" 43 | } 44 | ] 45 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/AutomationCompatibleInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "checkData", 7 | "type": "bytes" 8 | } 9 | ], 10 | "name": "checkUpkeep", 11 | "outputs": [ 12 | { 13 | "internalType": "bool", 14 | "name": "upkeepNeeded", 15 | "type": "bool" 16 | }, 17 | { 18 | "internalType": "bytes", 19 | "name": "performData", 20 | "type": "bytes" 21 | } 22 | ], 23 | "stateMutability": "nonpayable", 24 | "type": "function" 25 | }, 26 | { 27 | "inputs": [ 28 | { 29 | "internalType": "bytes", 30 | "name": "performData", 31 | "type": "bytes" 32 | } 33 | ], 34 | "name": "performUpkeep", 35 | "outputs": [], 36 | "stateMutability": "nonpayable", 37 | "type": "function" 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/AutomationForwarderLogic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "getRegistry", 5 | "outputs": [ 6 | { 7 | "internalType": "contract IAutomationRegistryConsumer", 8 | "name": "", 9 | "type": "address" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [], 17 | "name": "typeAndVersion", 18 | "outputs": [ 19 | { 20 | "internalType": "string", 21 | "name": "", 22 | "type": "string" 23 | } 24 | ], 25 | "stateMutability": "view", 26 | "type": "function" 27 | }, 28 | { 29 | "inputs": [ 30 | { 31 | "internalType": "address", 32 | "name": "newRegistry", 33 | "type": "address" 34 | } 35 | ], 36 | "name": "updateRegistry", 37 | "outputs": [], 38 | "stateMutability": "nonpayable", 39 | "type": "function" 40 | } 41 | ] 42 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/AutomationUtils2_3.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "components": [ 6 | { 7 | "internalType": "uint256", 8 | "name": "fastGasWei", 9 | "type": "uint256" 10 | }, 11 | { 12 | "internalType": "uint256", 13 | "name": "linkUSD", 14 | "type": "uint256" 15 | }, 16 | { 17 | "internalType": "uint256[]", 18 | "name": "upkeepIds", 19 | "type": "uint256[]" 20 | }, 21 | { 22 | "internalType": "uint256[]", 23 | "name": "gasLimits", 24 | "type": "uint256[]" 25 | }, 26 | { 27 | "internalType": "bytes[]", 28 | "name": "triggers", 29 | "type": "bytes[]" 30 | }, 31 | { 32 | "internalType": "bytes[]", 33 | "name": "performDatas", 34 | "type": "bytes[]" 35 | } 36 | ], 37 | "internalType": "struct AutomationRegistryBase2_3.Report", 38 | "name": "", 39 | "type": "tuple" 40 | } 41 | ], 42 | "name": "_report", 43 | "outputs": [], 44 | "stateMutability": "nonpayable", 45 | "type": "function" 46 | } 47 | ] 48 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/BlockhashStore.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256", 6 | "name": "n", 7 | "type": "uint256" 8 | } 9 | ], 10 | "name": "getBlockhash", 11 | "outputs": [ 12 | { 13 | "internalType": "bytes32", 14 | "name": "", 15 | "type": "bytes32" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | }, 21 | { 22 | "inputs": [ 23 | { 24 | "internalType": "uint256", 25 | "name": "n", 26 | "type": "uint256" 27 | } 28 | ], 29 | "name": "store", 30 | "outputs": [], 31 | "stateMutability": "nonpayable", 32 | "type": "function" 33 | }, 34 | { 35 | "inputs": [], 36 | "name": "storeEarliest", 37 | "outputs": [], 38 | "stateMutability": "nonpayable", 39 | "type": "function" 40 | }, 41 | { 42 | "inputs": [ 43 | { 44 | "internalType": "uint256", 45 | "name": "n", 46 | "type": "uint256" 47 | }, 48 | { 49 | "internalType": "bytes", 50 | "name": "header", 51 | "type": "bytes" 52 | } 53 | ], 54 | "name": "storeVerifyHeader", 55 | "outputs": [], 56 | "stateMutability": "nonpayable", 57 | "type": "function" 58 | } 59 | ] 60 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/BlockhashStoreInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256", 6 | "name": "number", 7 | "type": "uint256" 8 | } 9 | ], 10 | "name": "getBlockhash", 11 | "outputs": [ 12 | { 13 | "internalType": "bytes32", 14 | "name": "", 15 | "type": "bytes32" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/Broken.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "string", 6 | "name": "reason", 7 | "type": "string" 8 | }, 9 | { 10 | "internalType": "int256", 11 | "name": "reason2", 12 | "type": "int256" 13 | } 14 | ], 15 | "name": "Unauthorized", 16 | "type": "error" 17 | }, 18 | { 19 | "inputs": [], 20 | "name": "revertSilently", 21 | "outputs": [], 22 | "stateMutability": "pure", 23 | "type": "function" 24 | }, 25 | { 26 | "inputs": [], 27 | "name": "revertWithCustomError", 28 | "outputs": [], 29 | "stateMutability": "pure", 30 | "type": "function" 31 | }, 32 | { 33 | "inputs": [ 34 | { 35 | "internalType": "string", 36 | "name": "message", 37 | "type": "string" 38 | } 39 | ], 40 | "name": "revertWithMessage", 41 | "outputs": [], 42 | "stateMutability": "pure", 43 | "type": "function" 44 | } 45 | ] 46 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ByteUtil.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "MalformedData", 5 | "type": "error" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/CallWithExactGas.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "NoContract", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [], 9 | "name": "NoGasForCallExactCheck", 10 | "type": "error" 11 | }, 12 | { 13 | "inputs": [], 14 | "name": "NotEnoughGasForCall", 15 | "type": "error" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/Chainable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "fallbackAddress", 7 | "type": "address" 8 | } 9 | ], 10 | "stateMutability": "nonpayable", 11 | "type": "constructor" 12 | }, 13 | { 14 | "stateMutability": "payable", 15 | "type": "fallback" 16 | }, 17 | { 18 | "inputs": [], 19 | "name": "fallbackTo", 20 | "outputs": [ 21 | { 22 | "internalType": "address", 23 | "name": "", 24 | "type": "address" 25 | } 26 | ], 27 | "stateMutability": "view", 28 | "type": "function" 29 | } 30 | ] 31 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ChainlinkClient.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": true, 7 | "internalType": "bytes32", 8 | "name": "id", 9 | "type": "bytes32" 10 | } 11 | ], 12 | "name": "ChainlinkCancelled", 13 | "type": "event" 14 | }, 15 | { 16 | "anonymous": false, 17 | "inputs": [ 18 | { 19 | "indexed": true, 20 | "internalType": "bytes32", 21 | "name": "id", 22 | "type": "bytes32" 23 | } 24 | ], 25 | "name": "ChainlinkFulfilled", 26 | "type": "event" 27 | }, 28 | { 29 | "anonymous": false, 30 | "inputs": [ 31 | { 32 | "indexed": true, 33 | "internalType": "bytes32", 34 | "name": "id", 35 | "type": "bytes32" 36 | } 37 | ], 38 | "name": "ChainlinkRequested", 39 | "type": "event" 40 | } 41 | ] 42 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/Chainlinked.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": true, 7 | "internalType": "bytes32", 8 | "name": "id", 9 | "type": "bytes32" 10 | } 11 | ], 12 | "name": "ChainlinkCancelled", 13 | "type": "event" 14 | }, 15 | { 16 | "anonymous": false, 17 | "inputs": [ 18 | { 19 | "indexed": true, 20 | "internalType": "bytes32", 21 | "name": "id", 22 | "type": "bytes32" 23 | } 24 | ], 25 | "name": "ChainlinkFulfilled", 26 | "type": "event" 27 | }, 28 | { 29 | "anonymous": false, 30 | "inputs": [ 31 | { 32 | "indexed": true, 33 | "internalType": "bytes32", 34 | "name": "id", 35 | "type": "bytes32" 36 | } 37 | ], 38 | "name": "ChainlinkRequested", 39 | "type": "event" 40 | } 41 | ] 42 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/Counter.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "AlwaysRevert", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [], 9 | "name": "alwaysRevert", 10 | "outputs": [], 11 | "stateMutability": "pure", 12 | "type": "function" 13 | }, 14 | { 15 | "inputs": [], 16 | "name": "alwaysRevertWithString", 17 | "outputs": [], 18 | "stateMutability": "pure", 19 | "type": "function" 20 | }, 21 | { 22 | "inputs": [], 23 | "name": "count", 24 | "outputs": [ 25 | { 26 | "internalType": "uint256", 27 | "name": "", 28 | "type": "uint256" 29 | } 30 | ], 31 | "stateMutability": "view", 32 | "type": "function" 33 | }, 34 | { 35 | "inputs": [], 36 | "name": "increment", 37 | "outputs": [ 38 | { 39 | "internalType": "uint256", 40 | "name": "", 41 | "type": "uint256" 42 | } 43 | ], 44 | "stateMutability": "nonpayable", 45 | "type": "function" 46 | }, 47 | { 48 | "inputs": [], 49 | "name": "reset", 50 | "outputs": [], 51 | "stateMutability": "nonpayable", 52 | "type": "function" 53 | } 54 | ] 55 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/CronReceiver.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [], 5 | "name": "Received1", 6 | "type": "event" 7 | }, 8 | { 9 | "anonymous": false, 10 | "inputs": [], 11 | "name": "Received2", 12 | "type": "event" 13 | }, 14 | { 15 | "inputs": [], 16 | "name": "handler1", 17 | "outputs": [], 18 | "stateMutability": "nonpayable", 19 | "type": "function" 20 | }, 21 | { 22 | "inputs": [], 23 | "name": "handler2", 24 | "outputs": [], 25 | "stateMutability": "nonpayable", 26 | "type": "function" 27 | }, 28 | { 29 | "inputs": [], 30 | "name": "revertHandler", 31 | "outputs": [], 32 | "stateMutability": "nonpayable", 33 | "type": "function" 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/CronUpkeepDelegate.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "UnknownFieldType", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "bytes", 11 | "name": "", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "checkUpkeep", 16 | "outputs": [ 17 | { 18 | "internalType": "bool", 19 | "name": "", 20 | "type": "bool" 21 | }, 22 | { 23 | "internalType": "bytes", 24 | "name": "", 25 | "type": "bytes" 26 | } 27 | ], 28 | "stateMutability": "view", 29 | "type": "function" 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/DelegateForwarderInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "target", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "bytes", 11 | "name": "data", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "forwardDelegate", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ENSResolver.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes32", 6 | "name": "node", 7 | "type": "bytes32" 8 | } 9 | ], 10 | "name": "addr", 11 | "outputs": [ 12 | { 13 | "internalType": "address", 14 | "name": "", 15 | "type": "address" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ERC165.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes4", 6 | "name": "interfaceId", 7 | "type": "bytes4" 8 | } 9 | ], 10 | "name": "supportsInterface", 11 | "outputs": [ 12 | { 13 | "internalType": "bool", 14 | "name": "", 15 | "type": "bool" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ExecutionPrevention.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "OnlySimulatedBackend", 5 | "type": "error" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/FeeManagerProxy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "payload", 7 | "type": "bytes" 8 | }, 9 | { 10 | "internalType": "bytes", 11 | "name": "parameterPayload", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "processFee", 16 | "outputs": [], 17 | "stateMutability": "payable", 18 | "type": "function" 19 | }, 20 | { 21 | "inputs": [ 22 | { 23 | "internalType": "bytes[]", 24 | "name": "payloads", 25 | "type": "bytes[]" 26 | }, 27 | { 28 | "internalType": "bytes", 29 | "name": "parameterPayload", 30 | "type": "bytes" 31 | } 32 | ], 33 | "name": "processFeeBulk", 34 | "outputs": [], 35 | "stateMutability": "payable", 36 | "type": "function" 37 | }, 38 | { 39 | "inputs": [ 40 | { 41 | "internalType": "contract IFeeManager", 42 | "name": "feeManager", 43 | "type": "address" 44 | } 45 | ], 46 | "name": "setFeeManager", 47 | "outputs": [], 48 | "stateMutability": "nonpayable", 49 | "type": "function" 50 | } 51 | ] 52 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ForwarderInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "target", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "bytes", 11 | "name": "data", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "forward", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/FunctionsClient.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "OnlyRouterCanFulfill", 5 | "type": "error" 6 | }, 7 | { 8 | "anonymous": false, 9 | "inputs": [ 10 | { 11 | "indexed": true, 12 | "internalType": "bytes32", 13 | "name": "id", 14 | "type": "bytes32" 15 | } 16 | ], 17 | "name": "RequestFulfilled", 18 | "type": "event" 19 | }, 20 | { 21 | "anonymous": false, 22 | "inputs": [ 23 | { 24 | "indexed": true, 25 | "internalType": "bytes32", 26 | "name": "id", 27 | "type": "bytes32" 28 | } 29 | ], 30 | "name": "RequestSent", 31 | "type": "event" 32 | }, 33 | { 34 | "inputs": [ 35 | { 36 | "internalType": "bytes32", 37 | "name": "requestId", 38 | "type": "bytes32" 39 | }, 40 | { 41 | "internalType": "bytes", 42 | "name": "response", 43 | "type": "bytes" 44 | }, 45 | { 46 | "internalType": "bytes", 47 | "name": "err", 48 | "type": "bytes" 49 | } 50 | ], 51 | "name": "handleOracleFulfillment", 52 | "outputs": [], 53 | "stateMutability": "nonpayable", 54 | "type": "function" 55 | } 56 | ] 57 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/FunctionsRequest.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "EmptyArgs", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [], 9 | "name": "EmptySecrets", 10 | "type": "error" 11 | }, 12 | { 13 | "inputs": [], 14 | "name": "EmptySource", 15 | "type": "error" 16 | }, 17 | { 18 | "inputs": [], 19 | "name": "NoInlineSecrets", 20 | "type": "error" 21 | }, 22 | { 23 | "inputs": [], 24 | "name": "REQUEST_DATA_VERSION", 25 | "outputs": [ 26 | { 27 | "internalType": "uint16", 28 | "name": "", 29 | "type": "uint16" 30 | } 31 | ], 32 | "stateMutability": "view", 33 | "type": "function" 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/GenericReceiver.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bool", 6 | "name": "toRevert", 7 | "type": "bool" 8 | } 9 | ], 10 | "stateMutability": "nonpayable", 11 | "type": "constructor" 12 | }, 13 | { 14 | "stateMutability": "nonpayable", 15 | "type": "fallback" 16 | }, 17 | { 18 | "inputs": [], 19 | "name": "s_toRevert", 20 | "outputs": [ 21 | { 22 | "internalType": "bool", 23 | "name": "", 24 | "type": "bool" 25 | } 26 | ], 27 | "stateMutability": "view", 28 | "type": "function" 29 | }, 30 | { 31 | "inputs": [ 32 | { 33 | "internalType": "bytes", 34 | "name": "err", 35 | "type": "bytes" 36 | } 37 | ], 38 | "name": "setErr", 39 | "outputs": [], 40 | "stateMutability": "nonpayable", 41 | "type": "function" 42 | }, 43 | { 44 | "inputs": [ 45 | { 46 | "internalType": "bool", 47 | "name": "toRevert", 48 | "type": "bool" 49 | } 50 | ], 51 | "name": "setRevert", 52 | "outputs": [], 53 | "stateMutability": "nonpayable", 54 | "type": "function" 55 | } 56 | ] 57 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IAccessController.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "user", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "bytes", 11 | "name": "data", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "hasAccess", 16 | "outputs": [ 17 | { 18 | "internalType": "bool", 19 | "name": "", 20 | "type": "bool" 21 | } 22 | ], 23 | "stateMutability": "view", 24 | "type": "function" 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IAggregatorProxy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "aggregator", 5 | "outputs": [ 6 | { 7 | "internalType": "address", 8 | "name": "", 9 | "type": "address" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IAuthorizedReceiver.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "getAuthorizedSenders", 5 | "outputs": [ 6 | { 7 | "internalType": "address[]", 8 | "name": "", 9 | "type": "address[]" 10 | } 11 | ], 12 | "stateMutability": "nonpayable", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [ 17 | { 18 | "internalType": "address", 19 | "name": "sender", 20 | "type": "address" 21 | } 22 | ], 23 | "name": "isAuthorizedSender", 24 | "outputs": [ 25 | { 26 | "internalType": "bool", 27 | "name": "", 28 | "type": "bool" 29 | } 30 | ], 31 | "stateMutability": "view", 32 | "type": "function" 33 | }, 34 | { 35 | "inputs": [ 36 | { 37 | "internalType": "address[]", 38 | "name": "senders", 39 | "type": "address[]" 40 | } 41 | ], 42 | "name": "setAuthorizedSenders", 43 | "outputs": [], 44 | "stateMutability": "nonpayable", 45 | "type": "function" 46 | } 47 | ] 48 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IERC165.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes4", 6 | "name": "interfaceId", 7 | "type": "bytes4" 8 | } 9 | ], 10 | "name": "supportsInterface", 11 | "outputs": [ 12 | { 13 | "internalType": "bool", 14 | "name": "", 15 | "type": "bool" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IERC677Receiver.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "sender", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "uint256", 11 | "name": "amount", 12 | "type": "uint256" 13 | }, 14 | { 15 | "internalType": "bytes", 16 | "name": "data", 17 | "type": "bytes" 18 | } 19 | ], 20 | "name": "onTokenTransfer", 21 | "outputs": [], 22 | "stateMutability": "nonpayable", 23 | "type": "function" 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IFunctionsClient.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes32", 6 | "name": "requestId", 7 | "type": "bytes32" 8 | }, 9 | { 10 | "internalType": "bytes", 11 | "name": "response", 12 | "type": "bytes" 13 | }, 14 | { 15 | "internalType": "bytes", 16 | "name": "err", 17 | "type": "bytes" 18 | } 19 | ], 20 | "name": "handleOracleFulfillment", 21 | "outputs": [], 22 | "stateMutability": "nonpayable", 23 | "type": "function" 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ILinkAvailable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "linkAvailableForPayment", 5 | "outputs": [ 6 | { 7 | "internalType": "int256", 8 | "name": "availableBalance", 9 | "type": "int256" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IMessageProvider.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": true, 7 | "internalType": "uint256", 8 | "name": "messageNum", 9 | "type": "uint256" 10 | }, 11 | { 12 | "indexed": false, 13 | "internalType": "bytes", 14 | "name": "data", 15 | "type": "bytes" 16 | } 17 | ], 18 | "name": "InboxMessageDelivered", 19 | "type": "event" 20 | }, 21 | { 22 | "anonymous": false, 23 | "inputs": [ 24 | { 25 | "indexed": true, 26 | "internalType": "uint256", 27 | "name": "messageNum", 28 | "type": "uint256" 29 | } 30 | ], 31 | "name": "InboxMessageDeliveredFromOrigin", 32 | "type": "event" 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IOffchainAggregator.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "requestNewRound", 5 | "outputs": [ 6 | { 7 | "internalType": "uint80", 8 | "name": "", 9 | "type": "uint80" 10 | } 11 | ], 12 | "stateMutability": "nonpayable", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IOptimismMintableERC20Minimal.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "bridge", 5 | "outputs": [ 6 | { 7 | "internalType": "address", 8 | "name": "", 9 | "type": "address" 10 | } 11 | ], 12 | "stateMutability": "nonpayable", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [], 17 | "name": "remoteToken", 18 | "outputs": [ 19 | { 20 | "internalType": "address", 21 | "name": "", 22 | "type": "address" 23 | } 24 | ], 25 | "stateMutability": "view", 26 | "type": "function" 27 | }, 28 | { 29 | "inputs": [ 30 | { 31 | "internalType": "bytes4", 32 | "name": "interfaceId", 33 | "type": "bytes4" 34 | } 35 | ], 36 | "name": "supportsInterface", 37 | "outputs": [ 38 | { 39 | "internalType": "bool", 40 | "name": "", 41 | "type": "bool" 42 | } 43 | ], 44 | "stateMutability": "view", 45 | "type": "function" 46 | } 47 | ] 48 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IOwnable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "acceptOwnership", 5 | "outputs": [], 6 | "stateMutability": "nonpayable", 7 | "type": "function" 8 | }, 9 | { 10 | "inputs": [], 11 | "name": "owner", 12 | "outputs": [ 13 | { 14 | "internalType": "address", 15 | "name": "", 16 | "type": "address" 17 | } 18 | ], 19 | "stateMutability": "nonpayable", 20 | "type": "function" 21 | }, 22 | { 23 | "inputs": [ 24 | { 25 | "internalType": "address", 26 | "name": "recipient", 27 | "type": "address" 28 | } 29 | ], 30 | "name": "transferOwnership", 31 | "outputs": [], 32 | "stateMutability": "nonpayable", 33 | "type": "function" 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ISemver.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "version", 5 | "outputs": [ 6 | { 7 | "internalType": "string", 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ITypeAndVersion.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "typeAndVersion", 5 | "outputs": [ 6 | { 7 | "internalType": "string", 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "stateMutability": "pure", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IVRFCoordinatorV2PlusMigration.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "encodedData", 7 | "type": "bytes" 8 | } 9 | ], 10 | "name": "onMigration", 11 | "outputs": [], 12 | "stateMutability": "payable", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IVRFMigratableConsumerV2Plus.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": false, 7 | "internalType": "address", 8 | "name": "vrfCoordinator", 9 | "type": "address" 10 | } 11 | ], 12 | "name": "CoordinatorSet", 13 | "type": "event" 14 | }, 15 | { 16 | "inputs": [ 17 | { 18 | "internalType": "address", 19 | "name": "vrfCoordinator", 20 | "type": "address" 21 | } 22 | ], 23 | "name": "setCoordinator", 24 | "outputs": [], 25 | "stateMutability": "nonpayable", 26 | "type": "function" 27 | } 28 | ] 29 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IVRFV2PlusMigrate.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256", 6 | "name": "subId", 7 | "type": "uint256" 8 | }, 9 | { 10 | "internalType": "address", 11 | "name": "newCoordinator", 12 | "type": "address" 13 | } 14 | ], 15 | "name": "migrate", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IVerifierProxy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "signedReport", 7 | "type": "bytes" 8 | } 9 | ], 10 | "name": "verify", 11 | "outputs": [ 12 | { 13 | "internalType": "bytes", 14 | "name": "verifierResponse", 15 | "type": "bytes" 16 | } 17 | ], 18 | "stateMutability": "nonpayable", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/IWERC20.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "deposit", 5 | "outputs": [], 6 | "stateMutability": "payable", 7 | "type": "function" 8 | }, 9 | { 10 | "inputs": [ 11 | { 12 | "internalType": "uint256", 13 | "name": "", 14 | "type": "uint256" 15 | } 16 | ], 17 | "name": "withdraw", 18 | "outputs": [], 19 | "stateMutability": "nonpayable", 20 | "type": "function" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/KeeperCompatibleTestHelper.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "OnlySimulatedBackend", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "bytes", 11 | "name": "", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "checkUpkeep", 16 | "outputs": [ 17 | { 18 | "internalType": "bool", 19 | "name": "", 20 | "type": "bool" 21 | }, 22 | { 23 | "internalType": "bytes", 24 | "name": "", 25 | "type": "bytes" 26 | } 27 | ], 28 | "stateMutability": "nonpayable", 29 | "type": "function" 30 | }, 31 | { 32 | "inputs": [ 33 | { 34 | "internalType": "bytes", 35 | "name": "", 36 | "type": "bytes" 37 | } 38 | ], 39 | "name": "performUpkeep", 40 | "outputs": [], 41 | "stateMutability": "nonpayable", 42 | "type": "function" 43 | }, 44 | { 45 | "inputs": [], 46 | "name": "verifyCannotExecute", 47 | "outputs": [], 48 | "stateMutability": "view", 49 | "type": "function" 50 | } 51 | ] 52 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/LinkTokenReceiver.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "getChainlinkToken", 5 | "outputs": [ 6 | { 7 | "internalType": "address", 8 | "name": "", 9 | "type": "address" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [ 17 | { 18 | "internalType": "address", 19 | "name": "sender", 20 | "type": "address" 21 | }, 22 | { 23 | "internalType": "uint256", 24 | "name": "amount", 25 | "type": "uint256" 26 | }, 27 | { 28 | "internalType": "bytes", 29 | "name": "data", 30 | "type": "bytes" 31 | } 32 | ], 33 | "name": "onTokenTransfer", 34 | "outputs": [], 35 | "stateMutability": "nonpayable", 36 | "type": "function" 37 | } 38 | ] 39 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MaliciousChainlinked.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": true, 7 | "internalType": "bytes32", 8 | "name": "id", 9 | "type": "bytes32" 10 | } 11 | ], 12 | "name": "ChainlinkCancelled", 13 | "type": "event" 14 | }, 15 | { 16 | "anonymous": false, 17 | "inputs": [ 18 | { 19 | "indexed": true, 20 | "internalType": "bytes32", 21 | "name": "id", 22 | "type": "bytes32" 23 | } 24 | ], 25 | "name": "ChainlinkFulfilled", 26 | "type": "event" 27 | }, 28 | { 29 | "anonymous": false, 30 | "inputs": [ 31 | { 32 | "indexed": true, 33 | "internalType": "bytes32", 34 | "name": "id", 35 | "type": "bytes32" 36 | } 37 | ], 38 | "name": "ChainlinkRequested", 39 | "type": "event" 40 | } 41 | ] 42 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MigratableKeeperRegistryInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256[]", 6 | "name": "upkeepIDs", 7 | "type": "uint256[]" 8 | }, 9 | { 10 | "internalType": "address", 11 | "name": "destination", 12 | "type": "address" 13 | } 14 | ], 15 | "name": "migrateUpkeeps", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | }, 20 | { 21 | "inputs": [ 22 | { 23 | "internalType": "bytes", 24 | "name": "encodedUpkeeps", 25 | "type": "bytes" 26 | } 27 | ], 28 | "name": "receiveUpkeeps", 29 | "outputs": [], 30 | "stateMutability": "nonpayable", 31 | "type": "function" 32 | }, 33 | { 34 | "inputs": [], 35 | "name": "upkeepTranscoderVersion", 36 | "outputs": [ 37 | { 38 | "internalType": "enum UpkeepFormat", 39 | "name": "version", 40 | "type": "uint8" 41 | } 42 | ], 43 | "stateMutability": "view", 44 | "type": "function" 45 | } 46 | ] 47 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MigratableKeeperRegistryInterfaceV2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256[]", 6 | "name": "upkeepIDs", 7 | "type": "uint256[]" 8 | }, 9 | { 10 | "internalType": "address", 11 | "name": "destination", 12 | "type": "address" 13 | } 14 | ], 15 | "name": "migrateUpkeeps", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | }, 20 | { 21 | "inputs": [ 22 | { 23 | "internalType": "bytes", 24 | "name": "encodedUpkeeps", 25 | "type": "bytes" 26 | } 27 | ], 28 | "name": "receiveUpkeeps", 29 | "outputs": [], 30 | "stateMutability": "nonpayable", 31 | "type": "function" 32 | }, 33 | { 34 | "inputs": [], 35 | "name": "upkeepVersion", 36 | "outputs": [ 37 | { 38 | "internalType": "uint8", 39 | "name": "version", 40 | "type": "uint8" 41 | } 42 | ], 43 | "stateMutability": "view", 44 | "type": "function" 45 | } 46 | ] 47 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MockAggregatorProxy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "_aggregator", 7 | "type": "address" 8 | } 9 | ], 10 | "stateMutability": "nonpayable", 11 | "type": "constructor" 12 | }, 13 | { 14 | "inputs": [], 15 | "name": "aggregator", 16 | "outputs": [ 17 | { 18 | "internalType": "address", 19 | "name": "", 20 | "type": "address" 21 | } 22 | ], 23 | "stateMutability": "view", 24 | "type": "function" 25 | }, 26 | { 27 | "inputs": [ 28 | { 29 | "internalType": "address", 30 | "name": "_aggregator", 31 | "type": "address" 32 | } 33 | ], 34 | "name": "updateAggregator", 35 | "outputs": [], 36 | "stateMutability": "nonpayable", 37 | "type": "function" 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MockArbGasInfo.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "getCurrentTxL1GasFees", 5 | "outputs": [ 6 | { 7 | "internalType": "uint256", 8 | "name": "", 9 | "type": "uint256" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [], 17 | "name": "getPricesInWei", 18 | "outputs": [ 19 | { 20 | "internalType": "uint256", 21 | "name": "", 22 | "type": "uint256" 23 | }, 24 | { 25 | "internalType": "uint256", 26 | "name": "", 27 | "type": "uint256" 28 | }, 29 | { 30 | "internalType": "uint256", 31 | "name": "", 32 | "type": "uint256" 33 | }, 34 | { 35 | "internalType": "uint256", 36 | "name": "", 37 | "type": "uint256" 38 | }, 39 | { 40 | "internalType": "uint256", 41 | "name": "", 42 | "type": "uint256" 43 | }, 44 | { 45 | "internalType": "uint256", 46 | "name": "", 47 | "type": "uint256" 48 | } 49 | ], 50 | "stateMutability": "view", 51 | "type": "function" 52 | } 53 | ] 54 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MockArbSys.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256", 6 | "name": "arbBlockNum", 7 | "type": "uint256" 8 | } 9 | ], 10 | "name": "arbBlockHash", 11 | "outputs": [ 12 | { 13 | "internalType": "bytes32", 14 | "name": "", 15 | "type": "bytes32" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | }, 21 | { 22 | "inputs": [], 23 | "name": "arbBlockNumber", 24 | "outputs": [ 25 | { 26 | "internalType": "uint256", 27 | "name": "", 28 | "type": "uint256" 29 | } 30 | ], 31 | "stateMutability": "view", 32 | "type": "function" 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MockOVMGasPriceOracle.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "_data", 7 | "type": "bytes" 8 | } 9 | ], 10 | "name": "getL1Fee", 11 | "outputs": [ 12 | { 13 | "internalType": "uint256", 14 | "name": "", 15 | "type": "uint256" 16 | } 17 | ], 18 | "stateMutability": "view", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MockOffchainAggregator.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": false, 7 | "internalType": "uint80", 8 | "name": "roundId", 9 | "type": "uint80" 10 | } 11 | ], 12 | "name": "RoundIdUpdated", 13 | "type": "event" 14 | }, 15 | { 16 | "inputs": [], 17 | "name": "requestNewRound", 18 | "outputs": [ 19 | { 20 | "internalType": "uint80", 21 | "name": "", 22 | "type": "uint80" 23 | } 24 | ], 25 | "stateMutability": "nonpayable", 26 | "type": "function" 27 | }, 28 | { 29 | "inputs": [], 30 | "name": "roundId", 31 | "outputs": [ 32 | { 33 | "internalType": "uint80", 34 | "name": "", 35 | "type": "uint80" 36 | } 37 | ], 38 | "stateMutability": "view", 39 | "type": "function" 40 | } 41 | ] 42 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/MultiSend.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "stateMutability": "nonpayable", 5 | "type": "constructor" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "bytes", 11 | "name": "transactions", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "multiSend", 16 | "outputs": [], 17 | "stateMutability": "payable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/OptimismSequencerUptimeFeedInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bool", 6 | "name": "status", 7 | "type": "bool" 8 | }, 9 | { 10 | "internalType": "uint64", 11 | "name": "timestamp", 12 | "type": "uint64" 13 | } 14 | ], 15 | "name": "updateStatus", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/Pausable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": false, 7 | "internalType": "address", 8 | "name": "account", 9 | "type": "address" 10 | } 11 | ], 12 | "name": "Paused", 13 | "type": "event" 14 | }, 15 | { 16 | "anonymous": false, 17 | "inputs": [ 18 | { 19 | "indexed": false, 20 | "internalType": "address", 21 | "name": "account", 22 | "type": "address" 23 | } 24 | ], 25 | "name": "Unpaused", 26 | "type": "event" 27 | }, 28 | { 29 | "inputs": [], 30 | "name": "paused", 31 | "outputs": [ 32 | { 33 | "internalType": "bool", 34 | "name": "", 35 | "type": "bool" 36 | } 37 | ], 38 | "stateMutability": "view", 39 | "type": "function" 40 | } 41 | ] 42 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/PoRAddressList.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256", 6 | "name": "startIndex", 7 | "type": "uint256" 8 | }, 9 | { 10 | "internalType": "uint256", 11 | "name": "endIndex", 12 | "type": "uint256" 13 | } 14 | ], 15 | "name": "getPoRAddressList", 16 | "outputs": [ 17 | { 18 | "internalType": "string[]", 19 | "name": "", 20 | "type": "string[]" 21 | } 22 | ], 23 | "stateMutability": "view", 24 | "type": "function" 25 | }, 26 | { 27 | "inputs": [], 28 | "name": "getPoRAddressListLength", 29 | "outputs": [ 30 | { 31 | "internalType": "uint256", 32 | "name": "", 33 | "type": "uint256" 34 | } 35 | ], 36 | "stateMutability": "view", 37 | "type": "function" 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/PointerInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "getAddress", 5 | "outputs": [ 6 | { 7 | "internalType": "address", 8 | "name": "", 9 | "type": "address" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/Proxy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "stateMutability": "payable", 4 | "type": "fallback" 5 | }, 6 | { 7 | "stateMutability": "payable", 8 | "type": "receive" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ReceiveEmitter.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": false, 7 | "internalType": "uint256", 8 | "name": "amount", 9 | "type": "uint256" 10 | }, 11 | { 12 | "indexed": false, 13 | "internalType": "uint256", 14 | "name": "newBalance", 15 | "type": "uint256" 16 | } 17 | ], 18 | "name": "FundsReceived", 19 | "type": "event" 20 | }, 21 | { 22 | "stateMutability": "payable", 23 | "type": "receive" 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ReceiveFallbackEmitter.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": false, 7 | "internalType": "uint256", 8 | "name": "amount", 9 | "type": "uint256" 10 | }, 11 | { 12 | "indexed": false, 13 | "internalType": "uint256", 14 | "name": "newBalance", 15 | "type": "uint256" 16 | } 17 | ], 18 | "name": "FundsReceived", 19 | "type": "event" 20 | }, 21 | { 22 | "stateMutability": "payable", 23 | "type": "fallback" 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ReceiveReverter.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "stateMutability": "payable", 4 | "type": "receive" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/Routable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "OnlyCallableByRouter", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [], 9 | "name": "OnlyCallableByRouterOwner", 10 | "type": "error" 11 | }, 12 | { 13 | "inputs": [], 14 | "name": "RouterMustBeSet", 15 | "type": "error" 16 | }, 17 | { 18 | "inputs": [], 19 | "name": "typeAndVersion", 20 | "outputs": [ 21 | { 22 | "internalType": "string", 23 | "name": "", 24 | "type": "string" 25 | } 26 | ], 27 | "stateMutability": "pure", 28 | "type": "function" 29 | } 30 | ] 31 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/ScrollSequencerUptimeFeedInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bool", 6 | "name": "status", 7 | "type": "bool" 8 | }, 9 | { 10 | "internalType": "uint64", 11 | "name": "timestamp", 12 | "type": "uint64" 13 | } 14 | ], 15 | "name": "updateStatus", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/SenderCreator.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes", 6 | "name": "initCode", 7 | "type": "bytes" 8 | } 9 | ], 10 | "name": "createSender", 11 | "outputs": [ 12 | { 13 | "internalType": "address", 14 | "name": "sender", 15 | "type": "address" 16 | } 17 | ], 18 | "stateMutability": "nonpayable", 19 | "type": "function" 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/SmartContractAccountFactory.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "DeploymentFailed", 5 | "type": "error" 6 | }, 7 | { 8 | "anonymous": false, 9 | "inputs": [ 10 | { 11 | "indexed": false, 12 | "internalType": "address", 13 | "name": "scaAddress", 14 | "type": "address" 15 | } 16 | ], 17 | "name": "ContractCreated", 18 | "type": "event" 19 | }, 20 | { 21 | "inputs": [ 22 | { 23 | "internalType": "bytes32", 24 | "name": "abiEncodedOwnerAddress", 25 | "type": "bytes32" 26 | }, 27 | { 28 | "internalType": "bytes", 29 | "name": "initCode", 30 | "type": "bytes" 31 | } 32 | ], 33 | "name": "deploySmartContractAccount", 34 | "outputs": [ 35 | { 36 | "internalType": "address", 37 | "name": "scaAddress", 38 | "type": "address" 39 | } 40 | ], 41 | "stateMutability": "payable", 42 | "type": "function" 43 | } 44 | ] 45 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/TypeAndVersionInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "typeAndVersion", 5 | "outputs": [ 6 | { 7 | "internalType": "string", 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "stateMutability": "pure", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/UpkeepReverter.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "OnlySimulatedBackend", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "bytes", 11 | "name": "data", 12 | "type": "bytes" 13 | } 14 | ], 15 | "name": "checkUpkeep", 16 | "outputs": [ 17 | { 18 | "internalType": "bool", 19 | "name": "callable", 20 | "type": "bool" 21 | }, 22 | { 23 | "internalType": "bytes", 24 | "name": "executedata", 25 | "type": "bytes" 26 | } 27 | ], 28 | "stateMutability": "view", 29 | "type": "function" 30 | }, 31 | { 32 | "inputs": [ 33 | { 34 | "internalType": "bytes", 35 | "name": "", 36 | "type": "bytes" 37 | } 38 | ], 39 | "name": "performUpkeep", 40 | "outputs": [], 41 | "stateMutability": "pure", 42 | "type": "function" 43 | } 44 | ] 45 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/UpkeepTranscoder.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "InvalidTranscoding", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "enum UpkeepFormat", 11 | "name": "fromVersion", 12 | "type": "uint8" 13 | }, 14 | { 15 | "internalType": "enum UpkeepFormat", 16 | "name": "toVersion", 17 | "type": "uint8" 18 | }, 19 | { 20 | "internalType": "bytes", 21 | "name": "encodedUpkeeps", 22 | "type": "bytes" 23 | } 24 | ], 25 | "name": "transcodeUpkeeps", 26 | "outputs": [ 27 | { 28 | "internalType": "bytes", 29 | "name": "", 30 | "type": "bytes" 31 | } 32 | ], 33 | "stateMutability": "view", 34 | "type": "function" 35 | }, 36 | { 37 | "inputs": [], 38 | "name": "typeAndVersion", 39 | "outputs": [ 40 | { 41 | "internalType": "string", 42 | "name": "", 43 | "type": "string" 44 | } 45 | ], 46 | "stateMutability": "view", 47 | "type": "function" 48 | } 49 | ] 50 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/UpkeepTranscoder3_0.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "InvalidTranscoding", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "enum UpkeepFormat", 11 | "name": "fromVersion", 12 | "type": "uint8" 13 | }, 14 | { 15 | "internalType": "enum UpkeepFormat", 16 | "name": "", 17 | "type": "uint8" 18 | }, 19 | { 20 | "internalType": "bytes", 21 | "name": "encodedUpkeeps", 22 | "type": "bytes" 23 | } 24 | ], 25 | "name": "transcodeUpkeeps", 26 | "outputs": [ 27 | { 28 | "internalType": "bytes", 29 | "name": "", 30 | "type": "bytes" 31 | } 32 | ], 33 | "stateMutability": "view", 34 | "type": "function" 35 | }, 36 | { 37 | "inputs": [], 38 | "name": "typeAndVersion", 39 | "outputs": [ 40 | { 41 | "internalType": "string", 42 | "name": "", 43 | "type": "string" 44 | } 45 | ], 46 | "stateMutability": "view", 47 | "type": "function" 48 | } 49 | ] 50 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/UpkeepTranscoder4_0.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "InvalidTranscoding", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "uint8", 11 | "name": "fromVersion", 12 | "type": "uint8" 13 | }, 14 | { 15 | "internalType": "uint8", 16 | "name": "", 17 | "type": "uint8" 18 | }, 19 | { 20 | "internalType": "bytes", 21 | "name": "encodedUpkeeps", 22 | "type": "bytes" 23 | } 24 | ], 25 | "name": "transcodeUpkeeps", 26 | "outputs": [ 27 | { 28 | "internalType": "bytes", 29 | "name": "", 30 | "type": "bytes" 31 | } 32 | ], 33 | "stateMutability": "view", 34 | "type": "function" 35 | }, 36 | { 37 | "inputs": [], 38 | "name": "typeAndVersion", 39 | "outputs": [ 40 | { 41 | "internalType": "string", 42 | "name": "", 43 | "type": "string" 44 | } 45 | ], 46 | "stateMutability": "view", 47 | "type": "function" 48 | } 49 | ] 50 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/UpkeepTranscoder5_0.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "InvalidTranscoding", 5 | "type": "error" 6 | }, 7 | { 8 | "inputs": [ 9 | { 10 | "internalType": "uint8", 11 | "name": "fromVersion", 12 | "type": "uint8" 13 | }, 14 | { 15 | "internalType": "uint8", 16 | "name": "toVersion", 17 | "type": "uint8" 18 | }, 19 | { 20 | "internalType": "bytes", 21 | "name": "encodedUpkeeps", 22 | "type": "bytes" 23 | } 24 | ], 25 | "name": "transcodeUpkeeps", 26 | "outputs": [ 27 | { 28 | "internalType": "bytes", 29 | "name": "", 30 | "type": "bytes" 31 | } 32 | ], 33 | "stateMutability": "view", 34 | "type": "function" 35 | }, 36 | { 37 | "inputs": [], 38 | "name": "typeAndVersion", 39 | "outputs": [ 40 | { 41 | "internalType": "string", 42 | "name": "", 43 | "type": "string" 44 | } 45 | ], 46 | "stateMutability": "view", 47 | "type": "function" 48 | } 49 | ] 50 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/UpkeepTranscoderInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "enum UpkeepFormat", 6 | "name": "fromVersion", 7 | "type": "uint8" 8 | }, 9 | { 10 | "internalType": "enum UpkeepFormat", 11 | "name": "toVersion", 12 | "type": "uint8" 13 | }, 14 | { 15 | "internalType": "bytes", 16 | "name": "encodedUpkeeps", 17 | "type": "bytes" 18 | } 19 | ], 20 | "name": "transcodeUpkeeps", 21 | "outputs": [ 22 | { 23 | "internalType": "bytes", 24 | "name": "", 25 | "type": "bytes" 26 | } 27 | ], 28 | "stateMutability": "view", 29 | "type": "function" 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/UpkeepTranscoderInterfaceV2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint8", 6 | "name": "fromVersion", 7 | "type": "uint8" 8 | }, 9 | { 10 | "internalType": "uint8", 11 | "name": "toVersion", 12 | "type": "uint8" 13 | }, 14 | { 15 | "internalType": "bytes", 16 | "name": "encodedUpkeeps", 17 | "type": "bytes" 18 | } 19 | ], 20 | "name": "transcodeUpkeeps", 21 | "outputs": [ 22 | { 23 | "internalType": "bytes", 24 | "name": "", 25 | "type": "bytes" 26 | } 27 | ], 28 | "stateMutability": "view", 29 | "type": "function" 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/VRFConsumerBase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bytes32", 6 | "name": "requestId", 7 | "type": "bytes32" 8 | }, 9 | { 10 | "internalType": "uint256", 11 | "name": "randomness", 12 | "type": "uint256" 13 | } 14 | ], 15 | "name": "rawFulfillRandomness", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/VRFConsumerBaseV2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "have", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "address", 11 | "name": "want", 12 | "type": "address" 13 | } 14 | ], 15 | "name": "OnlyCoordinatorCanFulfill", 16 | "type": "error" 17 | }, 18 | { 19 | "inputs": [ 20 | { 21 | "internalType": "uint256", 22 | "name": "requestId", 23 | "type": "uint256" 24 | }, 25 | { 26 | "internalType": "uint256[]", 27 | "name": "randomWords", 28 | "type": "uint256[]" 29 | } 30 | ], 31 | "name": "rawFulfillRandomWords", 32 | "outputs": [], 33 | "stateMutability": "nonpayable", 34 | "type": "function" 35 | } 36 | ] 37 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/VRFConsumerBaseV2Upgradeable.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "have", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "address", 11 | "name": "want", 12 | "type": "address" 13 | } 14 | ], 15 | "name": "OnlyCoordinatorCanFulfill", 16 | "type": "error" 17 | }, 18 | { 19 | "anonymous": false, 20 | "inputs": [ 21 | { 22 | "indexed": false, 23 | "internalType": "uint8", 24 | "name": "version", 25 | "type": "uint8" 26 | } 27 | ], 28 | "name": "Initialized", 29 | "type": "event" 30 | }, 31 | { 32 | "inputs": [ 33 | { 34 | "internalType": "uint256", 35 | "name": "requestId", 36 | "type": "uint256" 37 | }, 38 | { 39 | "internalType": "uint256[]", 40 | "name": "randomWords", 41 | "type": "uint256[]" 42 | } 43 | ], 44 | "name": "rawFulfillRandomWords", 45 | "outputs": [], 46 | "stateMutability": "nonpayable", 47 | "type": "function" 48 | } 49 | ] 50 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/VRFV2PlusClient.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "EXTRA_ARGS_V1_TAG", 5 | "outputs": [ 6 | { 7 | "internalType": "bytes4", 8 | "name": "", 9 | "type": "bytes4" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/VRFV2PlusMaliciousMigrator.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "_vrfCoordinator", 7 | "type": "address" 8 | } 9 | ], 10 | "stateMutability": "nonpayable", 11 | "type": "constructor" 12 | }, 13 | { 14 | "anonymous": false, 15 | "inputs": [ 16 | { 17 | "indexed": false, 18 | "internalType": "address", 19 | "name": "vrfCoordinator", 20 | "type": "address" 21 | } 22 | ], 23 | "name": "CoordinatorSet", 24 | "type": "event" 25 | }, 26 | { 27 | "inputs": [ 28 | { 29 | "internalType": "address", 30 | "name": "", 31 | "type": "address" 32 | } 33 | ], 34 | "name": "setCoordinator", 35 | "outputs": [], 36 | "stateMutability": "nonpayable", 37 | "type": "function" 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/VRFV2WrapperConsumerBase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256", 6 | "name": "_requestId", 7 | "type": "uint256" 8 | }, 9 | { 10 | "internalType": "uint256[]", 11 | "name": "_randomWords", 12 | "type": "uint256[]" 13 | } 14 | ], 15 | "name": "rawFulfillRandomWords", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/abi/v0.8/WithdrawalInterface.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "recipient", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "uint256", 11 | "name": "amount", 12 | "type": "uint256" 13 | } 14 | ], 15 | "name": "withdraw", 16 | "outputs": [], 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | }, 20 | { 21 | "inputs": [], 22 | "name": "withdrawable", 23 | "outputs": [ 24 | { 25 | "internalType": "uint256", 26 | "name": "", 27 | "type": "uint256" 28 | } 29 | ], 30 | "stateMutability": "view", 31 | "type": "function" 32 | } 33 | ] 34 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/Denominations.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | library Denominations { 6 | address public constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; 7 | address public constant BTC = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB; 8 | 9 | // Fiat currencies follow https://en.wikipedia.org/wiki/ISO_4217 10 | address public constant USD = address(840); 11 | address public constant GBP = address(826); 12 | address public constant EUR = address(978); 13 | address public constant JPY = address(392); 14 | address public constant KRW = address(410); 15 | address public constant CNY = address(156); 16 | address public constant AUD = address(36); 17 | address public constant CAD = address(124); 18 | address public constant CHF = address(756); 19 | address public constant ARS = address(32); 20 | address public constant PHP = address(608); 21 | address public constant NZD = address(554); 22 | address public constant SGD = address(702); 23 | address public constant NGN = address(566); 24 | address public constant ZAR = address(710); 25 | address public constant RUB = address(643); 26 | address public constant INR = address(356); 27 | address public constant BRL = address(986); 28 | } 29 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/AutomationBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | contract AutomationBase { 5 | error OnlySimulatedBackend(); 6 | 7 | /** 8 | * @notice method that allows it to be simulated via eth_call by checking that 9 | * the sender is the zero address. 10 | */ 11 | function _preventExecution() internal view { 12 | // solhint-disable-next-line avoid-tx-origin 13 | if (tx.origin != address(0) && tx.origin != address(0x1111111111111111111111111111111111111111)) { 14 | revert OnlySimulatedBackend(); 15 | } 16 | } 17 | 18 | /** 19 | * @notice modifier that allows it to be simulated via eth_call by checking 20 | * that the sender is the zero address. 21 | */ 22 | modifier cannotExecute() { 23 | _preventExecution(); 24 | _; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/AutomationCompatible.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {AutomationBase} from "./AutomationBase.sol"; 5 | import {AutomationCompatibleInterface} from "./interfaces/AutomationCompatibleInterface.sol"; 6 | 7 | abstract contract AutomationCompatible is AutomationBase, AutomationCompatibleInterface {} 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/AutomationCompatibleUtils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity 0.8.19; 3 | 4 | import {Log} from "./interfaces/ILogAutomation.sol"; 5 | import {IAutomationV21PlusCommon} from "./interfaces/IAutomationV21PlusCommon.sol"; 6 | 7 | contract AutomationCompatibleUtils { 8 | function _report(IAutomationV21PlusCommon.Report memory) external {} 9 | 10 | function _logTriggerConfig(IAutomationV21PlusCommon.LogTriggerConfig memory) external {} 11 | 12 | function _logTrigger(IAutomationV21PlusCommon.LogTrigger memory) external {} 13 | 14 | function _conditionalTrigger(IAutomationV21PlusCommon.ConditionalTrigger memory) external {} 15 | 16 | function _log(Log memory) external {} 17 | } 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/AutomationForwarderLogic.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.16; 3 | 4 | import {IAutomationRegistryConsumer} from "./interfaces/IAutomationRegistryConsumer.sol"; 5 | import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; 6 | 7 | contract AutomationForwarderLogic is ITypeAndVersion { 8 | IAutomationRegistryConsumer private s_registry; 9 | 10 | string public constant typeAndVersion = "AutomationForwarder 1.0.0"; 11 | 12 | /** 13 | * @notice updateRegistry is called by the registry during migrations 14 | * @param newRegistry is the registry that this forwarder is being migrated to 15 | */ 16 | function updateRegistry(address newRegistry) external { 17 | if (msg.sender != address(s_registry)) revert(); 18 | s_registry = IAutomationRegistryConsumer(newRegistry); 19 | } 20 | 21 | function getRegistry() external view returns (IAutomationRegistryConsumer) { 22 | return s_registry; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/ExecutionPrevention.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | abstract contract ExecutionPrevention { 5 | error OnlySimulatedBackend(); 6 | 7 | /** 8 | * @notice method that allows it to be simulated via eth_call by checking that 9 | * the sender is the zero address. 10 | */ 11 | function _preventExecution() internal view { 12 | // solhint-disable-next-line avoid-tx-origin 13 | if (tx.origin != address(0)) { 14 | revert OnlySimulatedBackend(); 15 | } 16 | } 17 | 18 | /** 19 | * @notice modifier that allows it to be simulated via eth_call by checking 20 | * that the sender is the zero address. 21 | */ 22 | modifier cannotExecute() { 23 | _preventExecution(); 24 | _; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/KeeperBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /** 3 | * @notice This is a deprecated interface. Please use AutomationBase directly. 4 | */ 5 | pragma solidity ^0.8.0; 6 | // solhint-disable-next-line no-unused-import 7 | import {AutomationBase as KeeperBase} from "./AutomationBase.sol"; 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/KeeperCompatible.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /** 3 | * @notice This is a deprecated interface. Please use AutomationCompatible directly. 4 | */ 5 | pragma solidity ^0.8.0; 6 | // solhint-disable-next-line no-unused-import 7 | import {AutomationCompatible as KeeperCompatible} from "./AutomationCompatible.sol"; 8 | // solhint-disable-next-line no-unused-import 9 | import {AutomationBase as KeeperBase} from "./AutomationBase.sol"; 10 | // solhint-disable-next-line no-unused-import 11 | import {AutomationCompatibleInterface as KeeperCompatibleInterface} from "./interfaces/AutomationCompatibleInterface.sol"; 12 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/UpkeepFormat.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @dev this struct is only maintained for backwards compatibility with MigratableKeeperRegistryInterface 7 | * it should be deprecated in the future in favor of MigratableKeeperRegistryInterfaceV2 8 | */ 9 | enum UpkeepFormat { 10 | V1, 11 | V2, 12 | V3 13 | } 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/chains/ChainModuleBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity 0.8.19; 3 | 4 | import {IChainModule} from "../interfaces/IChainModule.sol"; 5 | 6 | contract ChainModuleBase is IChainModule { 7 | uint256 private constant FIXED_GAS_OVERHEAD = 300; 8 | uint256 private constant PER_CALLDATA_BYTE_GAS_OVERHEAD = 0; 9 | 10 | function blockNumber() external view virtual returns (uint256) { 11 | return block.number; 12 | } 13 | 14 | function blockHash(uint256 n) external view virtual returns (bytes32) { 15 | if (n >= block.number || block.number - n > 256) { 16 | return ""; 17 | } 18 | return blockhash(n); 19 | } 20 | 21 | function getCurrentL1Fee() external view virtual returns (uint256) { 22 | return 0; 23 | } 24 | 25 | function getMaxL1Fee(uint256) external view virtual returns (uint256) { 26 | return 0; 27 | } 28 | 29 | function getGasOverhead() 30 | external 31 | view 32 | virtual 33 | returns (uint256 chainModuleFixedOverhead, uint256 chainModulePerByteOverhead) 34 | { 35 | return (FIXED_GAS_OVERHEAD, PER_CALLDATA_BYTE_GAS_OVERHEAD); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/dev/interfaces/v2_3/IWrappedNative.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; 5 | 6 | interface IWrappedNative is IERC20 { 7 | function deposit() external payable; 8 | 9 | function withdraw(uint256 wad) external; 10 | } 11 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/dev/v2_3/AutomationUtils2_3.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity 0.8.19; 3 | 4 | import {AutomationRegistryBase2_3} from "./AutomationRegistryBase2_3.sol"; 5 | 6 | /** 7 | * @notice this file exposes structs that are otherwise internal to the automation registry 8 | * doing this allows those structs to be encoded and decoded with type safety in offchain code 9 | * and tests because generated wrappers are made available 10 | */ 11 | 12 | contract AutomationUtils2_3 { 13 | /** 14 | * @dev this uses the v2.3 Report, which uses linkUSD instead of linkNative (as in v2.2 and prior). This should be used only in typescript tests. 15 | */ 16 | function _report(AutomationRegistryBase2_3.Report memory) external {} // 0xe65d6546 17 | } 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/interfaces/IAutomationForwarder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; 5 | import {IAutomationRegistryConsumer} from "./IAutomationRegistryConsumer.sol"; 6 | 7 | interface IAutomationForwarder is ITypeAndVersion { 8 | function forward(uint256 gasAmount, bytes memory data) external returns (bool success, uint256 gasUsed); 9 | 10 | function updateRegistry(address newRegistry) external; 11 | 12 | function getRegistry() external view returns (IAutomationRegistryConsumer); 13 | 14 | function getTarget() external view returns (address); 15 | } 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/interfaces/IAutomationRegistryConsumer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | /** 5 | * @notice IAutomationRegistryConsumer defines the LTS user-facing interface that we intend to maintain for 6 | * across upgrades. As long as users use functions from within this interface, their upkeeps will retain 7 | * backwards compatability across migrations. 8 | * @dev Functions can be added to this interface, but not removed. 9 | */ 10 | interface IAutomationRegistryConsumer { 11 | function getBalance(uint256 id) external view returns (uint96 balance); 12 | 13 | function getMinBalance(uint256 id) external view returns (uint96 minBalance); 14 | 15 | function cancelUpkeep(uint256 id) external; 16 | 17 | function pauseUpkeep(uint256 id) external; 18 | 19 | function unpauseUpkeep(uint256 id) external; 20 | 21 | function addFunds(uint256 id, uint96 amount) external; 22 | 23 | function withdrawFunds(uint256 id, address to) external; 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/interfaces/KeeperCompatibleInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /** 3 | * @notice This is a deprecated interface. Please use AutomationCompatibleInterface directly. 4 | */ 5 | pragma solidity ^0.8.0; 6 | // solhint-disable-next-line no-unused-import 7 | import {AutomationCompatibleInterface as KeeperCompatibleInterface} from "./AutomationCompatibleInterface.sol"; 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/interfaces/MigratableKeeperRegistryInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../UpkeepFormat.sol"; 6 | 7 | interface MigratableKeeperRegistryInterface { 8 | /** 9 | * @notice Migrates upkeeps from one registry to another, including LINK and upkeep params. 10 | * Only callable by the upkeep admin. All upkeeps must have the same admin. Can only migrate active upkeeps. 11 | * @param upkeepIDs ids of upkeeps to migrate 12 | * @param destination the address of the registry to migrate to 13 | */ 14 | function migrateUpkeeps(uint256[] calldata upkeepIDs, address destination) external; 15 | 16 | /** 17 | * @notice Called by other registries when migrating upkeeps. Only callable by other registries. 18 | * @param encodedUpkeeps abi encoding of upkeeps to import - decoded by the transcoder 19 | */ 20 | function receiveUpkeeps(bytes calldata encodedUpkeeps) external; 21 | 22 | /** 23 | * @notice Specifies the version of upkeep data that this registry requires in order to import 24 | */ 25 | function upkeepTranscoderVersion() external view returns (UpkeepFormat version); 26 | } 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/interfaces/MigratableKeeperRegistryInterfaceV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../UpkeepFormat.sol"; 6 | 7 | interface MigratableKeeperRegistryInterfaceV2 { 8 | /** 9 | * @notice Migrates upkeeps from one registry to another, including LINK and upkeep params. 10 | * Only callable by the upkeep admin. All upkeeps must have the same admin. Can only migrate active upkeeps. 11 | * @param upkeepIDs ids of upkeeps to migrate 12 | * @param destination the address of the registry to migrate to 13 | */ 14 | function migrateUpkeeps(uint256[] calldata upkeepIDs, address destination) external; 15 | 16 | /** 17 | * @notice Called by other registries when migrating upkeeps. Only callable by other registries. 18 | * @param encodedUpkeeps abi encoding of upkeeps to import - decoded by the transcoder 19 | */ 20 | function receiveUpkeeps(bytes calldata encodedUpkeeps) external; 21 | 22 | /** 23 | * @notice Specifies the version of upkeep data that this registry requires in order to import 24 | */ 25 | function upkeepVersion() external view returns (uint8 version); 26 | } 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | import "../UpkeepFormat.sol"; 4 | 5 | pragma solidity ^0.8.0; 6 | 7 | interface UpkeepTranscoderInterface { 8 | function transcodeUpkeeps( 9 | UpkeepFormat fromVersion, 10 | UpkeepFormat toVersion, 11 | bytes calldata encodedUpkeeps 12 | ) external view returns (bytes memory); 13 | } 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterfaceV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | interface UpkeepTranscoderInterfaceV2 { 6 | function transcodeUpkeeps( 7 | uint8 fromVersion, 8 | uint8 toVersion, 9 | bytes calldata encodedUpkeeps 10 | ) external view returns (bytes memory); 11 | } 12 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/interfaces/v1_2/KeeperRegistryInterface1_2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /** 3 | * @notice This is a deprecated interface. Please use AutomationRegistryInterface1_2 directly. 4 | */ 5 | pragma solidity ^0.8.0; 6 | // solhint-disable-next-line no-unused-import 7 | import {Config, State} from "./AutomationRegistryInterface1_2.sol"; 8 | // solhint-disable-next-line no-unused-import 9 | import {AutomationRegistryBaseInterface as KeeperRegistryBaseInterface} from "./AutomationRegistryInterface1_2.sol"; 10 | // solhint-disable-next-line no-unused-import 11 | import {AutomationRegistryInterface as KeeperRegistryInterface} from "./AutomationRegistryInterface1_2.sol"; 12 | // solhint-disable-next-line no-unused-import 13 | import {AutomationRegistryExecutableInterface as KeeperRegistryExecutableInterface} from "./AutomationRegistryInterface1_2.sol"; 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/mocks/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.6; 4 | 5 | contract KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock { 6 | event OwnershipTransferRequested(address indexed from, address indexed to); 7 | event OwnershipTransferred(address indexed from, address indexed to); 8 | 9 | function emitOwnershipTransferRequested(address from, address to) public { 10 | emit OwnershipTransferRequested(from, to); 11 | } 12 | 13 | function emitOwnershipTransferred(address from, address to) public { 14 | emit OwnershipTransferred(from, to); 15 | } 16 | 17 | bool public s_mockResult; 18 | bytes public s_mockPayload; 19 | uint256 public s_mockGas; 20 | 21 | // Function to set mock return data for the measureCheckGas function 22 | function setMeasureCheckGasResult(bool result, bytes memory payload, uint256 gas) external { 23 | s_mockResult = result; 24 | s_mockPayload = payload; 25 | s_mockGas = gas; 26 | } 27 | 28 | // Mock measureCheckGas function 29 | function measureCheckGas(uint256 id, address from) external returns (bool, bytes memory, uint256) { 30 | return (s_mockResult, s_mockPayload, s_mockGas); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/mocks/MockAggregator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.6; 3 | 4 | import {IOffchainAggregator} from "../HeartbeatRequester.sol"; 5 | 6 | contract MockAggregator is IOffchainAggregator { 7 | int256 public s_answer; 8 | bool public newRoundCalled; 9 | 10 | function setLatestAnswer(int256 answer) public { 11 | s_answer = answer; 12 | } 13 | 14 | function latestAnswer() public view returns (int256) { 15 | return s_answer; 16 | } 17 | 18 | function requestNewRound() external override returns (uint80) { 19 | newRoundCalled = true; 20 | return 1; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/mocks/MockAggregatorProxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.6; 3 | 4 | import {IAggregatorProxy} from "../HeartbeatRequester.sol"; 5 | 6 | contract MockAggregatorProxy is IAggregatorProxy { 7 | address internal s_aggregator; 8 | 9 | constructor(address _aggregator) { 10 | s_aggregator = _aggregator; 11 | } 12 | 13 | function updateAggregator(address _aggregator) external { 14 | s_aggregator = _aggregator; 15 | } 16 | 17 | function aggregator() external view override returns (address) { 18 | return s_aggregator; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/mocks/MockKeeperRegistry2_1.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.16; 3 | 4 | import "../interfaces/IAutomationRegistryConsumer.sol"; 5 | 6 | contract MockKeeperRegistry2_1 is IAutomationRegistryConsumer { 7 | uint96 balance; 8 | uint96 minBalance; 9 | 10 | constructor() {} 11 | 12 | function getBalance(uint256 id) external view override returns (uint96) { 13 | return balance; 14 | } 15 | 16 | function getMinBalance(uint256 id) external view override returns (uint96) { 17 | return minBalance; 18 | } 19 | 20 | function cancelUpkeep(uint256 id) external override {} 21 | 22 | function pauseUpkeep(uint256 id) external override {} 23 | 24 | function unpauseUpkeep(uint256 id) external override {} 25 | 26 | function updateCheckData(uint256 id, bytes calldata newCheckData) external {} 27 | 28 | function addFunds(uint256 id, uint96 amount) external override {} 29 | 30 | function withdrawFunds(uint256 id, address to) external override {} 31 | } 32 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/test/BaseTest.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "forge-std/Test.sol"; 5 | 6 | contract BaseTest is Test { 7 | address internal OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e; 8 | address internal constant STRANGER = address(999); 9 | 10 | function setUp() public virtual { 11 | vm.startPrank(OWNER); 12 | deal(OWNER, 1e20); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/test/StructFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.0; 3 | 4 | contract StructFactory { 5 | address internal OWNER; 6 | address internal constant STRANGER = address(999); 7 | } 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/testhelpers/KeeperConsumer.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.8.16; 2 | 3 | import "../interfaces/KeeperCompatibleInterface.sol"; 4 | import "../KeeperBase.sol"; 5 | 6 | contract KeeperConsumer is KeeperCompatibleInterface, KeeperBase { 7 | uint public counter; 8 | uint public immutable interval; 9 | uint public lastTimeStamp; 10 | 11 | constructor(uint updateInterval) public { 12 | interval = updateInterval; 13 | lastTimeStamp = block.timestamp; 14 | counter = 0; 15 | } 16 | 17 | function checkUpkeep( 18 | bytes calldata checkData 19 | ) external view override cannotExecute returns (bool upkeepNeeded, bytes memory performData) { 20 | return (true, checkData); 21 | } 22 | 23 | function performUpkeep(bytes calldata performData) external override { 24 | counter = counter + 1; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/testhelpers/PerformDataChecker.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.16; 3 | 4 | import "../interfaces/KeeperCompatibleInterface.sol"; 5 | 6 | contract PerformDataChecker is KeeperCompatibleInterface { 7 | uint256 public counter; 8 | bytes public s_expectedData; 9 | 10 | constructor(bytes memory expectedData) { 11 | s_expectedData = expectedData; 12 | } 13 | 14 | function setExpectedData(bytes calldata expectedData) external { 15 | s_expectedData = expectedData; 16 | } 17 | 18 | function checkUpkeep( 19 | bytes calldata checkData 20 | ) external view override returns (bool upkeepNeeded, bytes memory performData) { 21 | return (keccak256(checkData) == keccak256(s_expectedData), checkData); 22 | } 23 | 24 | function performUpkeep(bytes calldata performData) external override { 25 | if (keccak256(performData) == keccak256(s_expectedData)) { 26 | counter++; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/automation/testhelpers/UpkeepReverter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {AutomationCompatible} from "../AutomationCompatible.sol"; 5 | 6 | contract UpkeepReverter is AutomationCompatible { 7 | function checkUpkeep( 8 | bytes calldata data 9 | ) public view override cannotExecute returns (bool callable, bytes calldata executedata) { 10 | require(false, "!working"); 11 | return (true, data); 12 | } 13 | 14 | function performUpkeep(bytes calldata) external pure override { 15 | require(false, "!working"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/dev/v1_X/interfaces/IFunctionsClient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | /// @title Chainlink Functions client interface. 5 | interface IFunctionsClient { 6 | /// @notice Chainlink Functions response handler called by the Functions Router 7 | /// during fullilment from the designated transmitter node in an OCR round. 8 | /// @param requestId The requestId returned by FunctionsClient.sendRequest(). 9 | /// @param response Aggregated response from the request's source code. 10 | /// @param err Aggregated error either from the request's source code or from the execution pipeline. 11 | /// @dev Either response or error parameter will be set, but never both. 12 | function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external; 13 | } 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/dev/v1_X/interfaces/IOwnableFunctionsRouter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import {IFunctionsRouter} from "./IFunctionsRouter.sol"; 5 | import {IOwnable} from "../../../../shared/interfaces/IOwnable.sol"; 6 | 7 | /// @title Chainlink Functions Router interface with Ownability. 8 | interface IOwnableFunctionsRouter is IOwnable, IFunctionsRouter {} 9 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/interfaces/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BunsDev/functions-workshop/ff397b9999c016bfdc9bab76a69cc8f90b04db8e/lib/chainlink/contracts/src/v0.8/functions/interfaces/.gitkeep -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/tests/v1_X/BaseTest.t.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.19; 2 | 3 | import {Test} from "forge-std/Test.sol"; 4 | 5 | contract BaseTest is Test { 6 | bool private s_baseTestInitialized; 7 | 8 | uint256 internal OWNER_PRIVATE_KEY = 0x1; 9 | address internal OWNER_ADDRESS = vm.addr(OWNER_PRIVATE_KEY); 10 | 11 | uint256 internal STRANGER_PRIVATE_KEY = 0x2; 12 | address internal STRANGER_ADDRESS = vm.addr(STRANGER_PRIVATE_KEY); 13 | 14 | uint256 TX_GASPRICE_START = 3000000000; // 3 gwei 15 | 16 | uint72 constant JUELS_PER_LINK = 1e18; 17 | 18 | function setUp() public virtual { 19 | // BaseTest.setUp is often called multiple times from tests' setUp due to inheritance. 20 | if (s_baseTestInitialized) return; 21 | s_baseTestInitialized = true; 22 | // Set msg.sender and tx.origin to OWNER until stopPrank is called 23 | vm.startPrank(OWNER_ADDRESS, OWNER_ADDRESS); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/tests/v1_X/OCR2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | // ================================================================ 5 | // | OCR2Base | 6 | // ================================================================ 7 | 8 | /// @notice #constructor 9 | contract OCR2Base_Constructor {} 10 | 11 | /// @notice #checkConfigValid 12 | contract OCR2Base_CheckConfigValid {} 13 | 14 | /// @notice #latestConfigDigestAndEpoch 15 | contract OCR2Base_LatestConfigDigestAndEpoch {} 16 | 17 | /// @notice #setConfig 18 | contract OCR2Base_SetConfig {} 19 | 20 | /// @notice #configDigestFromConfigData 21 | contract OCR2Base_ConfigDigestFromConfigData {} 22 | 23 | /// @notice #latestConfigDetails 24 | contract OCR2Base_LatestConfigDetails {} 25 | 26 | /// @notice #transmitters 27 | contract OCR2Base_Transmitters {} 28 | 29 | /// @notice #_report 30 | contract OCR2Base__Report { 31 | // TODO: make contract internal function helper 32 | } 33 | 34 | /// @notice #requireExpectedMsgDataLength 35 | contract OCR2Base_RequireExpectedMsgDataLength {} 36 | 37 | /// @notice #transmit 38 | contract OCR2Base_Transmit {} 39 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/tests/v1_X/README.md: -------------------------------------------------------------------------------- 1 | ## Usage 2 | 3 | First set the foundry profile to Functions: 4 | ``` 5 | export FOUNDRY_PROFILE=functions 6 | ``` 7 | 8 | **To run tests use**: 9 | 10 | All Functions test files: 11 | ``` 12 | forge test -vvv 13 | ``` 14 | 15 | To run a specific file use: 16 | ``` 17 | forge test -vvv --mp src/v0.8/functions/tests/v1_X/[File Name].t.sol 18 | ``` 19 | 20 | **To see coverage**: 21 | First ensure that the correct files are being evaluated. For example, if only v0 contracts are, then temporarily change the Functions profile in `./foundry.toml`. 22 | 23 | ``` 24 | forge coverage --ir-minimum 25 | ``` -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/tests/v1_X/testhelpers/FunctionsClientHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import {FunctionsClientUpgradeHelper} from "./FunctionsClientUpgradeHelper.sol"; 5 | import {FunctionsResponse} from "../../../dev/v1_X/libraries/FunctionsResponse.sol"; 6 | 7 | /// @title Functions Client Test Harness 8 | /// @notice Contract to expose internal functions for testing purposes 9 | contract FunctionsClientHarness is FunctionsClientUpgradeHelper { 10 | constructor(address router) FunctionsClientUpgradeHelper(router) {} 11 | 12 | function getRouter_HARNESS() external view returns (address) { 13 | return address(i_functionsRouter); 14 | } 15 | 16 | function sendRequest_HARNESS( 17 | bytes memory data, 18 | uint64 subscriptionId, 19 | uint32 callbackGasLimit, 20 | bytes32 donId 21 | ) external returns (bytes32) { 22 | return super._sendRequest(data, subscriptionId, callbackGasLimit, donId); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/tests/v1_X/testhelpers/FunctionsRouterHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import {FunctionsRouter} from "../../../dev/v1_X/FunctionsRouter.sol"; 5 | 6 | /// @title Functions Router Test Harness 7 | /// @notice Contract to expose internal functions for testing purposes 8 | contract FunctionsRouterHarness is FunctionsRouter { 9 | constructor(address linkToken, Config memory config) FunctionsRouter(linkToken, config) {} 10 | 11 | function getMaxConsumers_HARNESS() external view returns (uint16) { 12 | return super._getMaxConsumers(); 13 | } 14 | 15 | function getSubscriptionDepositDetails_HARNESS() external view returns (uint16, uint72) { 16 | return super._getSubscriptionDepositDetails(); 17 | } 18 | 19 | function whenNotPaused_HARNESS() external view { 20 | return super._whenNotPaused(); 21 | } 22 | 23 | function onlyRouterOwner_HARNESS() external view { 24 | return super._onlyRouterOwner(); 25 | } 26 | 27 | function onlySenderThatAcceptedToS_HARNESS() external view { 28 | return super._onlySenderThatAcceptedToS(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | /// @title Chainlink Functions client interface. 5 | interface IFunctionsClient { 6 | /// @notice Chainlink Functions response handler called by the Functions Router 7 | /// during fullilment from the designated transmitter node in an OCR round. 8 | /// @param requestId The requestId returned by FunctionsClient.sendRequest(). 9 | /// @param response Aggregated response from the request's source code. 10 | /// @param err Aggregated error either from the request's source code or from the execution pipeline. 11 | /// @dev Either response or error parameter will be set, but never both. 12 | function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external; 13 | } 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IOwnableFunctionsRouter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import {IFunctionsRouter} from "./IFunctionsRouter.sol"; 5 | import {IOwnable} from "../../../shared/interfaces/IOwnable.sol"; 6 | 7 | /// @title Chainlink Functions Router interface with Ownability. 8 | interface IOwnableFunctionsRouter is IOwnable, IFunctionsRouter {} 9 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface ChainlinkRequestInterface { 5 | function oracleRequest( 6 | address sender, 7 | uint256 requestPrice, 8 | bytes32 serviceAgreementID, 9 | address callbackAddress, 10 | bytes4 callbackFunctionId, 11 | uint256 nonce, 12 | uint256 dataVersion, 13 | bytes calldata data 14 | ) external; 15 | 16 | function cancelOracleRequest( 17 | bytes32 requestId, 18 | uint256 payment, 19 | bytes4 callbackFunctionId, 20 | uint256 expiration 21 | ) external; 22 | } 23 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/interfaces/ENSInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface ENSInterface { 5 | // Logged when the owner of a node assigns a new owner to a subnode. 6 | event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); 7 | 8 | // Logged when the owner of a node transfers ownership to a new account. 9 | event Transfer(bytes32 indexed node, address owner); 10 | 11 | // Logged when the resolver for a node changes. 12 | event NewResolver(bytes32 indexed node, address resolver); 13 | 14 | // Logged when the TTL of a node changes 15 | event NewTTL(bytes32 indexed node, uint64 ttl); 16 | 17 | function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external; 18 | 19 | function setResolver(bytes32 node, address resolver) external; 20 | 21 | function setOwner(bytes32 node, address owner) external; 22 | 23 | function setTTL(bytes32 node, uint64 ttl) external; 24 | 25 | function owner(bytes32 node) external view returns (address); 26 | 27 | function resolver(bytes32 node) external view returns (address); 28 | 29 | function ttl(bytes32 node) external view returns (uint64); 30 | } 31 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/interfaces/FlagsInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface FlagsInterface { 5 | function getFlag(address) external view returns (bool); 6 | 7 | function getFlags(address[] calldata) external view returns (bool[] memory); 8 | 9 | function raiseFlag(address) external; 10 | 11 | function raiseFlags(address[] calldata) external; 12 | 13 | function lowerFlags(address[] calldata) external; 14 | 15 | function setRaisingAccessController(address) external; 16 | } 17 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/interfaces/OperatorInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {OracleInterface} from "./OracleInterface.sol"; 5 | import {ChainlinkRequestInterface} from "./ChainlinkRequestInterface.sol"; 6 | 7 | interface OperatorInterface is OracleInterface, ChainlinkRequestInterface { 8 | function operatorRequest( 9 | address sender, 10 | uint256 payment, 11 | bytes32 specId, 12 | bytes4 callbackFunctionId, 13 | uint256 nonce, 14 | uint256 dataVersion, 15 | bytes calldata data 16 | ) external; 17 | 18 | function fulfillOracleRequest2( 19 | bytes32 requestId, 20 | uint256 payment, 21 | address callbackAddress, 22 | bytes4 callbackFunctionId, 23 | uint256 expiration, 24 | bytes calldata data 25 | ) external returns (bool); 26 | 27 | function ownerTransferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success); 28 | 29 | function distributeFunds(address payable[] calldata receivers, uint256[] calldata amounts) external payable; 30 | } 31 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/interfaces/OracleInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface OracleInterface { 5 | function fulfillOracleRequest( 6 | bytes32 requestId, 7 | uint256 payment, 8 | address callbackAddress, 9 | bytes4 callbackFunctionId, 10 | uint256 expiration, 11 | bytes32 data 12 | ) external returns (bool); 13 | 14 | function withdraw(address recipient, uint256 amount) external; 15 | 16 | function withdrawable() external view returns (uint256); 17 | } 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/interfaces/PointerInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface PointerInterface { 5 | function getAddress() external view returns (address); 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/interfaces/TypeAndVersionInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | abstract contract TypeAndVersionInterface { 5 | function typeAndVersion() external pure virtual returns (string memory); 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/keystone/OCR3Capability.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.6; 3 | 4 | import {OCR2Base} from "../shared/ocr2/OCR2Base.sol"; 5 | 6 | // OCR2Base provides config management compatible with OCR3 7 | contract OCR3Capability is OCR2Base { 8 | error ReportingUnsupported(); 9 | 10 | constructor() OCR2Base(true) {} 11 | 12 | function typeAndVersion() external pure override returns (string memory) { 13 | return "Keystone 0.0.0"; 14 | } 15 | 16 | function _beforeSetConfig(uint8 _f, bytes memory _onchainConfig) internal override {} 17 | 18 | function _afterSetConfig(uint8 _f, bytes memory _onchainConfig) internal override {} 19 | 20 | function _validateReport( 21 | bytes32 /* configDigest */, 22 | uint40 /* epochAndRound */, 23 | bytes memory /* report */ 24 | ) internal pure override returns (bool) { 25 | return true; 26 | } 27 | 28 | function _report( 29 | uint256 /* initialGas */, 30 | address /* transmitter */, 31 | uint8 /* signerCount */, 32 | address[MAX_NUM_ORACLES] memory /* signers */, 33 | bytes calldata /* report */ 34 | ) internal virtual override { 35 | revert ReportingUnsupported(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/keystone/interfaces/IForwarder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | /// @title IForwarder - forwards keystone reports to a target 5 | interface IForwarder {} 6 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/CrossDomainDelegateForwarder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {CrossDomainOwnable} from "./CrossDomainOwnable.sol"; 5 | import {DelegateForwarderInterface} from "./interfaces/DelegateForwarderInterface.sol"; 6 | 7 | /** 8 | * @title CrossDomainDelegateForwarder - L1 xDomain account representation (with delegatecall support) 9 | * @notice L2 Contract which receives messages from a specific L1 address and transparently forwards them to the destination. 10 | * @dev Any other L2 contract which uses this contract's address as a privileged position, 11 | * can consider that position to be held by the `l1Owner` 12 | */ 13 | abstract contract CrossDomainDelegateForwarder is DelegateForwarderInterface, CrossDomainOwnable {} 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/CrossDomainForwarder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {CrossDomainOwnable} from "./CrossDomainOwnable.sol"; 5 | import {ForwarderInterface} from "./interfaces/ForwarderInterface.sol"; 6 | 7 | /** 8 | * @title CrossDomainForwarder - L1 xDomain account representation 9 | * @notice L2 Contract which receives messages from a specific L1 address and transparently forwards them to the destination. 10 | * @dev Any other L2 contract which uses this contract's address as a privileged position, 11 | * can consider that position to be held by the `l1Owner` 12 | */ 13 | abstract contract CrossDomainForwarder is ForwarderInterface, CrossDomainOwnable {} 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/interfaces/ArbitrumSequencerUptimeFeedInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface ArbitrumSequencerUptimeFeedInterface { 5 | function updateStatus(bool status, uint64 timestamp) external; 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/interfaces/CrossDomainOwnableInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | /// @title CrossDomainOwnableInterface - A contract with helpers for cross-domain contract ownership 5 | interface CrossDomainOwnableInterface { 6 | event L1OwnershipTransferRequested(address indexed from, address indexed to); 7 | 8 | event L1OwnershipTransferred(address indexed from, address indexed to); 9 | 10 | function l1Owner() external returns (address); 11 | 12 | function transferL1Ownership(address recipient) external; 13 | 14 | function acceptL1Ownership() external; 15 | } 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/interfaces/DelegateForwarderInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | /// @title DelegateForwarderInterface - forwards a delegatecall to a target, under some conditions 5 | interface DelegateForwarderInterface { 6 | /** 7 | * @notice forward delegatecalls the `target` with `data` 8 | * @param target contract address to be delegatecalled 9 | * @param data to send to target contract 10 | */ 11 | function forwardDelegate(address target, bytes memory data) external; 12 | } 13 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/interfaces/FlagsInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.6; 3 | 4 | interface FlagsInterface { 5 | function getFlag(address) external view returns (bool); 6 | 7 | function getFlags(address[] calldata) external view returns (bool[] memory); 8 | 9 | function raiseFlag(address) external; 10 | 11 | function raiseFlags(address[] calldata) external; 12 | 13 | function lowerFlag(address) external; 14 | 15 | function lowerFlags(address[] calldata) external; 16 | 17 | function setRaisingAccessController(address) external; 18 | 19 | function setLoweringAccessController(address) external; 20 | } 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/interfaces/ForwarderInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | /// @title ForwarderInterface - forwards a call to a target, under some conditions 5 | interface ForwarderInterface { 6 | /** 7 | * @notice forward calls the `target` with `data` 8 | * @param target contract address to be called 9 | * @param data to send to target contract 10 | */ 11 | function forward(address target, bytes memory data) external; 12 | } 13 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/interfaces/IArbitrumDelayedInbox.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {IInbox} from "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IInbox.sol"; 5 | 6 | /** 7 | * @notice This interface extends Arbitrum's IInbox interface to include 8 | * the calculateRetryableSubmissionFee. This new function was added as part 9 | * of Arbitrum's Nitro migration but was excluded from the IInbox interface. This setup 10 | * works for us as the team has added it as a public function to the IInbox proxy 11 | * contract's implementation 12 | */ 13 | interface IArbitrumDelayedInbox is IInbox { 14 | function calculateRetryableSubmissionFee(uint256 dataLength, uint256 baseFee) external view returns (uint256); 15 | } 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/interfaces/OptimismSequencerUptimeFeedInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface OptimismSequencerUptimeFeedInterface { 5 | function updateStatus(bool status, uint64 timestamp) external; 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/dev/interfaces/ScrollSequencerUptimeFeedInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.19; 3 | 4 | interface ScrollSequencerUptimeFeedInterface { 5 | function updateStatus(bool status, uint64 timestamp) external; 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/l2ep/test/mocks/optimism/MockOVMCrossDomainMessenger.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {iOVM_CrossDomainMessenger} from "../../../../vendor/@eth-optimism/contracts/v0.4.7/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_CrossDomainMessenger.sol"; 5 | 6 | import {Address} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/Address.sol"; 7 | 8 | contract MockOVMCrossDomainMessenger is iOVM_CrossDomainMessenger { 9 | address internal s_mockMessageSender; 10 | 11 | constructor(address sender) { 12 | s_mockMessageSender = sender; 13 | } 14 | 15 | function xDomainMessageSender() external view override returns (address) { 16 | return s_mockMessageSender; 17 | } 18 | 19 | function _setMockMessageSender(address sender) external { 20 | s_mockMessageSender = sender; 21 | } 22 | 23 | /** 24 | * Sends a cross domain message to the target messenger. 25 | * @param _target Target contract address. 26 | * @param _message Message to send to the target. 27 | */ 28 | function sendMessage(address _target, bytes calldata _message, uint32) external override { 29 | Address.functionCall(_target, _message, "sendMessage reverted"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/llo-feeds/libraries/Common.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.19; 3 | 4 | /* 5 | * @title Common 6 | * @author Michael Fletcher 7 | * @notice Common functions and structs 8 | */ 9 | library Common { 10 | // @notice The asset struct to hold the address of an asset and amount 11 | struct Asset { 12 | address assetAddress; 13 | uint256 amount; 14 | } 15 | 16 | // @notice Struct to hold the address and its associated weight 17 | struct AddressAndWeight { 18 | address addr; 19 | uint64 weight; 20 | } 21 | 22 | /** 23 | * @notice Checks if an array of AddressAndWeight has duplicate addresses 24 | * @param recipients The array of AddressAndWeight to check 25 | * @return bool True if there are duplicates, false otherwise 26 | */ 27 | function _hasDuplicateAddresses(Common.AddressAndWeight[] memory recipients) internal pure returns (bool) { 28 | for (uint256 i = 0; i < recipients.length; ) { 29 | for (uint256 j = i + 1; j < recipients.length; ) { 30 | if (recipients[i].addr == recipients[j].addr) { 31 | return true; 32 | } 33 | unchecked { 34 | ++j; 35 | } 36 | } 37 | unchecked { 38 | ++i; 39 | } 40 | } 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.19; 3 | 4 | import "../../interfaces/IFeeManager.sol"; 5 | 6 | contract FeeManagerProxy { 7 | IFeeManager internal i_feeManager; 8 | 9 | function processFee(bytes calldata payload, bytes calldata parameterPayload) public payable { 10 | i_feeManager.processFee{value: msg.value}(payload, parameterPayload, msg.sender); 11 | } 12 | 13 | function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload) public payable { 14 | i_feeManager.processFeeBulk{value: msg.value}(payloads, parameterPayload, msg.sender); 15 | } 16 | 17 | function setFeeManager(IFeeManager feeManager) public { 18 | i_feeManager = feeManager; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyConstructorTest.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity 0.8.19; 3 | 4 | import {BaseTest} from "./BaseVerifierTest.t.sol"; 5 | import {VerifierProxy} from "../../VerifierProxy.sol"; 6 | import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; 7 | 8 | contract VerifierProxyConstructorTest is BaseTest { 9 | function test_correctlySetsTheOwner() public { 10 | VerifierProxy proxy = new VerifierProxy(AccessControllerInterface(address(0))); 11 | assertEq(proxy.owner(), ADMIN); 12 | } 13 | 14 | function test_correctlySetsTheCorrectAccessControllerInterface() public { 15 | address accessControllerAddr = address(1234); 16 | VerifierProxy proxy = new VerifierProxy(AccessControllerInterface(accessControllerAddr)); 17 | assertEq(address(proxy.s_accessController()), accessControllerAddr); 18 | } 19 | 20 | function test_correctlySetsVersion() public { 21 | string memory version = s_verifierProxy.typeAndVersion(); 22 | assertEq(version, "VerifierProxy 2.0.0"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyInitializeVerifierTest.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity 0.8.19; 3 | 4 | import {BaseTest} from "./BaseVerifierTest.t.sol"; 5 | import {VerifierProxy} from "../../VerifierProxy.sol"; 6 | 7 | contract VerifierProxyInitializeVerifierTest is BaseTest { 8 | bytes32 latestDigest; 9 | 10 | function setUp() public override { 11 | BaseTest.setUp(); 12 | } 13 | 14 | function test_revertsIfNotOwner() public { 15 | changePrank(USER); 16 | vm.expectRevert("Only callable by owner"); 17 | s_verifierProxy.initializeVerifier(address(s_verifier)); 18 | } 19 | 20 | function test_revertsIfZeroAddress() public { 21 | vm.expectRevert(abi.encodeWithSelector(VerifierProxy.ZeroAddress.selector)); 22 | s_verifierProxy.initializeVerifier(address(0)); 23 | } 24 | 25 | function test_revertsIfVerifierAlreadyInitialized() public { 26 | s_verifierProxy.initializeVerifier(address(s_verifier)); 27 | vm.expectRevert(abi.encodeWithSelector(VerifierProxy.VerifierAlreadyInitialized.selector, address(s_verifier))); 28 | s_verifierProxy.initializeVerifier(address(s_verifier)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyTest.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity 0.8.19; 3 | 4 | import {BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; 5 | import {VerifierProxy} from "../../VerifierProxy.sol"; 6 | import {FeeManager} from "../../FeeManager.sol"; 7 | 8 | contract VerifierProxyInitializeVerifierTest is BaseTestWithConfiguredVerifierAndFeeManager { 9 | function test_setFeeManagerZeroAddress() public { 10 | vm.expectRevert(abi.encodeWithSelector(VerifierProxy.ZeroAddress.selector)); 11 | s_verifierProxy.setFeeManager(FeeManager(address(0))); 12 | } 13 | 14 | function test_setFeeManagerWhichDoesntHonourInterface() public { 15 | vm.expectRevert(abi.encodeWithSelector(VerifierProxy.FeeManagerInvalid.selector)); 16 | s_verifierProxy.setFeeManager(FeeManager(address(s_verifier))); 17 | } 18 | 19 | function test_setFeeManagerWhichDoesntHonourIERC165Interface() public { 20 | vm.expectRevert(); 21 | s_verifierProxy.setFeeManager(FeeManager(address(1))); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/mocks/MockAggregatorValidator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../shared/interfaces/AggregatorValidatorInterface.sol"; 5 | 6 | contract MockAggregatorValidator is AggregatorValidatorInterface { 7 | uint8 immutable id; 8 | 9 | constructor(uint8 id_) { 10 | id = id_; 11 | } 12 | 13 | event ValidateCalled( 14 | uint8 id, 15 | uint256 previousRoundId, 16 | int256 previousAnswer, 17 | uint256 currentRoundId, 18 | int256 currentAnswer 19 | ); 20 | 21 | function validate( 22 | uint256 previousRoundId, 23 | int256 previousAnswer, 24 | uint256 currentRoundId, 25 | int256 currentAnswer 26 | ) external override returns (bool) { 27 | emit ValidateCalled(id, previousRoundId, previousAnswer, currentRoundId, currentAnswer); 28 | return true; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/mocks/MockArbSys.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.6; 4 | 5 | /** 6 | * @dev this contract mocks the arbitrum precompiled ArbSys contract 7 | * https://developer.arbitrum.io/arbos/precompiles#ArbSys 8 | */ 9 | contract MockArbSys { 10 | function arbBlockNumber() public view returns (uint256) { 11 | return block.number; 12 | } 13 | 14 | function arbBlockHash(uint256 arbBlockNum) external view returns (bytes32) { 15 | return blockhash(arbBlockNum); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/mocks/MockOffchainAggregator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.6; 3 | 4 | contract MockOffchainAggregator { 5 | event RoundIdUpdated(uint80 roundId); 6 | 7 | uint80 public roundId; 8 | 9 | function requestNewRound() external returns (uint80) { 10 | roundId++; 11 | emit RoundIdUpdated(roundId); 12 | return roundId; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/operatorforwarder/dev/interfaces/AuthorizedReceiverInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface AuthorizedReceiverInterface { 5 | function isAuthorizedSender(address sender) external view returns (bool); 6 | 7 | function getAuthorizedSenders() external returns (address[] memory); 8 | 9 | function setAuthorizedSenders(address[] calldata senders) external; 10 | } 11 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/operatorforwarder/dev/interfaces/WithdrawalInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface WithdrawalInterface { 5 | // @notice transfer LINK held by the contract belonging to msg.sender to 6 | // another address 7 | // @param recipient is the address to send the LINK to 8 | // @param amount is the amount of LINK to send 9 | function withdraw(address recipient, uint256 amount) external; 10 | 11 | // @notice query the available amount of LINK to withdraw by msg.sender 12 | function withdrawable() external view returns (uint256); 13 | } 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/operatorforwarder/dev/test/testhelpers/BasicConsumer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {Consumer} from "./Consumer.sol"; 5 | 6 | contract BasicConsumer is Consumer { 7 | constructor(address _link, address _oracle, bytes32 _specId) { 8 | _setChainlinkToken(_link); 9 | _setChainlinkOracle(_oracle); 10 | s_specId = _specId; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/operatorforwarder/dev/test/testhelpers/ChainlinkClientHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ChainlinkClient} from "../../../../ChainlinkClient.sol"; 5 | 6 | contract ChainlinkClientHelper is ChainlinkClient { 7 | bytes4 public constant FULFILSELECTOR = this.fulfill.selector; 8 | 9 | constructor(address link) { 10 | _setChainlinkToken(link); 11 | } 12 | 13 | function sendRequest(address op, uint256 payment) external returns (bytes32) { 14 | return _sendChainlinkRequestTo(op, _buildOperatorRequest(bytes32(hex"10"), FULFILSELECTOR), payment); 15 | } 16 | 17 | function cancelRequest(bytes32 requestId, uint256 payment, uint256 expiration) external { 18 | _cancelChainlinkRequest(requestId, payment, this.fulfill.selector, expiration); 19 | } 20 | 21 | function fulfill(bytes32) external {} 22 | } 23 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/operatorforwarder/dev/test/testhelpers/EmptyOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ChainlinkRequestInterface} from "../../../../interfaces/ChainlinkRequestInterface.sol"; 5 | import {OracleInterface} from "../../../../interfaces/OracleInterface.sol"; 6 | 7 | /* solhint-disable no-empty-blocks */ 8 | contract EmptyOracle is ChainlinkRequestInterface, OracleInterface { 9 | function cancelOracleRequest(bytes32, uint256, bytes4, uint256) external override {} 10 | function fulfillOracleRequest(bytes32, uint256, address, bytes4, uint256, bytes32) external override returns (bool) {} 11 | function getAuthorizationStatus(address) external pure returns (bool) { 12 | return false; 13 | } 14 | function onTokenTransfer(address, uint256, bytes calldata) external pure {} 15 | function oracleRequest( 16 | address, 17 | uint256, 18 | bytes32, 19 | address, 20 | bytes4, 21 | uint256, 22 | uint256, 23 | bytes calldata 24 | ) external override {} 25 | function setFulfillmentPermission(address, bool) external {} 26 | function withdraw(address, uint256) external override {} 27 | function withdrawable() external view override returns (uint256) {} 28 | } 29 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/access/ConfirmedOwner.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ConfirmedOwnerWithProposal} from "./ConfirmedOwnerWithProposal.sol"; 5 | 6 | /// @title The ConfirmedOwner contract 7 | /// @notice A contract with helpers for basic contract ownership. 8 | contract ConfirmedOwner is ConfirmedOwnerWithProposal { 9 | constructor(address newOwner) ConfirmedOwnerWithProposal(newOwner, address(0)) {} 10 | } 11 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/access/OwnerIsCreator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ConfirmedOwner} from "./ConfirmedOwner.sol"; 5 | 6 | /// @title The OwnerIsCreator contract 7 | /// @notice A contract with helpers for basic contract ownership. 8 | contract OwnerIsCreator is ConfirmedOwner { 9 | constructor() ConfirmedOwner(msg.sender) {} 10 | } 11 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/access/SimpleReadAccessController.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {SimpleWriteAccessController} from "./SimpleWriteAccessController.sol"; 5 | 6 | /// @title SimpleReadAccessController 7 | /// @notice Gives access to: 8 | /// - any externally owned account (note that off-chain actors can always read 9 | /// any contract storage regardless of on-chain access control measures, so this 10 | /// does not weaken the access control while improving usability) 11 | /// - accounts explicitly added to an access list 12 | /// @dev SimpleReadAccessController is not suitable for access controlling writes 13 | /// since it grants any externally owned account access! See 14 | /// SimpleWriteAccessController for that. 15 | contract SimpleReadAccessController is SimpleWriteAccessController { 16 | /// @notice Returns the access of an address 17 | /// @param _user The address to query 18 | function hasAccess(address _user, bytes memory _calldata) public view virtual override returns (bool) { 19 | // solhint-disable-next-line avoid-tx-origin 20 | return super.hasAccess(_user, _calldata) || _user == tx.origin; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/AccessControllerInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface AccessControllerInterface { 5 | function hasAccess(address user, bytes calldata data) external view returns (bool); 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/AggregatorInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface AggregatorInterface { 5 | function latestAnswer() external view returns (int256); 6 | 7 | function latestTimestamp() external view returns (uint256); 8 | 9 | function latestRound() external view returns (uint256); 10 | 11 | function getAnswer(uint256 roundId) external view returns (int256); 12 | 13 | function getTimestamp(uint256 roundId) external view returns (uint256); 14 | 15 | event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt); 16 | 17 | event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); 18 | } 19 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV2V3Interface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {AggregatorInterface} from "./AggregatorInterface.sol"; 5 | import {AggregatorV3Interface} from "./AggregatorV3Interface.sol"; 6 | 7 | interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface {} 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface AggregatorV3Interface { 5 | function decimals() external view returns (uint8); 6 | 7 | function description() external view returns (string memory); 8 | 9 | function version() external view returns (uint256); 10 | 11 | function getRoundData( 12 | uint80 _roundId 13 | ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); 14 | 15 | function latestRoundData() 16 | external 17 | view 18 | returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); 19 | } 20 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/AggregatorValidatorInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface AggregatorValidatorInterface { 5 | function validate( 6 | uint256 previousRoundId, 7 | int256 previousAnswer, 8 | uint256 currentRoundId, 9 | int256 currentAnswer 10 | ) external returns (bool); 11 | } 12 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/IAccessController.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IAccessController { 5 | function hasAccess(address user, bytes calldata data) external view returns (bool); 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/IERC677Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.6; 3 | 4 | interface IERC677Receiver { 5 | function onTokenTransfer(address sender, uint256 amount, bytes calldata data) external; 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/IOwnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IOwnable { 5 | function owner() external returns (address); 6 | 7 | function transferOwnership(address recipient) external; 8 | 9 | function acceptOwnership() external; 10 | } 11 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/ITypeAndVersion.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface ITypeAndVersion { 5 | function typeAndVersion() external pure returns (string memory); 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/IWERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IWERC20 { 5 | function deposit() external payable; 6 | 7 | function withdraw(uint256) external; 8 | } 9 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface LinkTokenInterface { 5 | function allowance(address owner, address spender) external view returns (uint256 remaining); 6 | 7 | function approve(address spender, uint256 value) external returns (bool success); 8 | 9 | function balanceOf(address owner) external view returns (uint256 balance); 10 | 11 | function decimals() external view returns (uint8 decimalPlaces); 12 | 13 | function decreaseApproval(address spender, uint256 addedValue) external returns (bool success); 14 | 15 | function increaseApproval(address spender, uint256 subtractedValue) external; 16 | 17 | function name() external view returns (string memory tokenName); 18 | 19 | function symbol() external view returns (string memory tokenSymbol); 20 | 21 | function totalSupply() external view returns (uint256 totalTokensIssued); 22 | 23 | function transfer(address to, uint256 value) external returns (bool success); 24 | 25 | function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success); 26 | 27 | function transferFrom(address from, address to, uint256 value) external returns (bool success); 28 | } 29 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/mocks/WERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/ERC20.sol"; 5 | 6 | contract WERC20Mock is ERC20 { 7 | constructor() ERC20("WERC20Mock", "WERC") {} 8 | 9 | event Deposit(address indexed dst, uint256 wad); 10 | event Withdrawal(address indexed src, uint256 wad); 11 | 12 | receive() external payable { 13 | deposit(); 14 | } 15 | 16 | function deposit() public payable { 17 | _mint(msg.sender, msg.value); 18 | emit Deposit(msg.sender, msg.value); 19 | } 20 | 21 | function withdraw(uint256 wad) public { 22 | // solhint-disable-next-line gas-custom-errors, reason-string 23 | require(balanceOf(msg.sender) >= wad); 24 | _burn(msg.sender, wad); 25 | payable(msg.sender).transfer(wad); 26 | emit Withdrawal(msg.sender, wad); 27 | } 28 | 29 | function mint(address account, uint256 amount) external { 30 | _mint(account, amount); 31 | } 32 | 33 | function burn(address account, uint256 amount) external { 34 | _burn(account, amount); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/ocr2/README.md: -------------------------------------------------------------------------------- 1 | # OCR2 Rapid Prototype Contracts 2 | 3 | The contracts in this directory are to aid rapid prototyping of OCR2 based products. They abstract OCR2 config and boilerplate code so that specific logic can be implemented and tested quickly. They are not optimized or audited. 4 | 5 | Do not use these contracts in production. For actual production contracts, it is expected that most of the logic of these contracts will be folded directly into the application contract. -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/test/BaseTest.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.19; 3 | 4 | import "forge-std/Test.sol"; 5 | 6 | contract BaseTest is Test { 7 | bool private s_baseTestInitialized; 8 | address internal constant OWNER = 0x72da681452Ab957d1020c25fFaCA47B43980b7C3; 9 | address internal constant STRANGER = 0x02e7d5DD1F4dDbC9f512FfA01d30aa190Ae3edBb; 10 | 11 | // Fri May 26 2023 13:49:53 GMT+0000 12 | uint256 internal constant BLOCK_TIME = 1685108993; 13 | 14 | function setUp() public virtual { 15 | // BaseTest.setUp is often called multiple times from tests' setUp due to inheritance. 16 | if (s_baseTestInitialized) return; 17 | s_baseTestInitialized = true; 18 | 19 | vm.label(OWNER, "Owner"); 20 | vm.label(STRANGER, "Stranger"); 21 | 22 | // Set the sender to OWNER permanently 23 | vm.startPrank(OWNER); 24 | deal(OWNER, 1e20); 25 | 26 | // Set the block time to a constant known value 27 | vm.warp(BLOCK_TIME); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {LinkToken} from "../../token/ERC677/LinkToken.sol"; 5 | 6 | // This contract exists to mirror the functionality of the old token, which 7 | // always deployed with 1b tokens sent to the deployer. 8 | contract LinkTokenTestHelper is LinkToken { 9 | constructor() { 10 | _mint(msg.sender, 1e27); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/test/testhelpers/ConfirmedOwnerTestHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ConfirmedOwner} from "../../access/ConfirmedOwner.sol"; 5 | 6 | contract ConfirmedOwnerTestHelper is ConfirmedOwner { 7 | event Here(); 8 | 9 | constructor() ConfirmedOwner(msg.sender) {} 10 | 11 | function modifierOnlyOwner() public onlyOwner { 12 | emit Here(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/test/testhelpers/GenericReceiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | contract GenericReceiver { 5 | bool public s_toRevert; 6 | bytes private s_err; 7 | 8 | constructor(bool toRevert) { 9 | s_toRevert = toRevert; 10 | } 11 | 12 | function setRevert(bool toRevert) external { 13 | s_toRevert = toRevert; 14 | } 15 | 16 | function setErr(bytes memory err) external { 17 | s_err = err; 18 | } 19 | 20 | // solhint-disable-next-line payable-fallback 21 | fallback() external { 22 | if (s_toRevert) { 23 | bytes memory reason = s_err; 24 | assembly { 25 | revert(add(32, reason), mload(reason)) 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/token/ERC677/ERC677.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.0; 3 | 4 | import {IERC677} from "./IERC677.sol"; 5 | import {IERC677Receiver} from "../../interfaces/IERC677Receiver.sol"; 6 | 7 | import {ERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/ERC20.sol"; 8 | 9 | contract ERC677 is IERC677, ERC20 { 10 | constructor(string memory name, string memory symbol) ERC20(name, symbol) {} 11 | 12 | /// @inheritdoc IERC677 13 | function transferAndCall(address to, uint256 amount, bytes memory data) public returns (bool success) { 14 | super.transfer(to, amount); 15 | emit Transfer(msg.sender, to, amount, data); 16 | if (to.code.length > 0) { 17 | IERC677Receiver(to).onTokenTransfer(msg.sender, amount, data); 18 | } 19 | return true; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/token/ERC677/IERC677.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IERC677 { 5 | event Transfer(address indexed from, address indexed to, uint256 value, bytes data); 6 | 7 | /// @notice Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver 8 | /// @param to The address which you want to transfer to 9 | /// @param amount The amount of tokens to be transferred 10 | /// @param data bytes Additional data with no specified format, sent in call to `to` 11 | /// @return true unless throwing 12 | function transferAndCall(address to, uint256 amount, bytes memory data) external returns (bool); 13 | } 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/shared/token/ERC677/LinkToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {BurnMintERC677} from "./BurnMintERC677.sol"; 5 | 6 | contract LinkToken is BurnMintERC677 { 7 | constructor() BurnMintERC677("ChainLink Token", "LINK", 18, 1e27) {} 8 | } 9 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/Broken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | // Broken is a contract to aid debugging and testing reverting calls during development. 4 | contract Broken { 5 | error Unauthorized(string reason, int256 reason2); 6 | 7 | function revertWithCustomError() public pure { 8 | revert Unauthorized("param", 121); 9 | } 10 | 11 | function revertWithMessage(string memory message) public pure { 12 | require(false, message); 13 | } 14 | 15 | function revertSilently() public pure { 16 | require(false); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/Counter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract Counter { 6 | error AlwaysRevert(); 7 | 8 | uint256 public count = 0; 9 | 10 | function increment() public returns (uint256) { 11 | count += 1; 12 | return count; 13 | } 14 | 15 | function reset() public { 16 | count = 0; 17 | } 18 | 19 | function alwaysRevert() public pure { 20 | revert AlwaysRevert(); 21 | } 22 | 23 | function alwaysRevertWithString() public pure { 24 | revert("always revert"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/CronReceiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.6; 4 | 5 | contract CronReceiver { 6 | event Received1(); 7 | event Received2(); 8 | 9 | function handler1() external { 10 | emit Received1(); 11 | } 12 | 13 | function handler2() external { 14 | emit Received2(); 15 | } 16 | 17 | function revertHandler() external { 18 | revert("revert!"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/ERC20BalanceMonitorExposed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.6; 4 | 5 | import "../automation/upkeeps/ERC20BalanceMonitor.sol"; 6 | 7 | contract ERC20BalanceMonitorExposed is ERC20BalanceMonitor { 8 | constructor( 9 | address erc20TokenAddress, 10 | address keeperRegistryAddress, 11 | uint256 minWaitPeriod 12 | ) ERC20BalanceMonitor(erc20TokenAddress, keeperRegistryAddress, minWaitPeriod) {} 13 | 14 | function setLastTopUpXXXTestOnly(address target, uint56 lastTopUpTimestamp) external { 15 | s_targets[target].lastTopUpTimestamp = lastTopUpTimestamp; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/EthBalanceMonitorExposed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.6; 4 | 5 | import "../automation/upkeeps/EthBalanceMonitor.sol"; 6 | 7 | contract EthBalanceMonitorExposed is EthBalanceMonitor { 8 | constructor( 9 | address keeperRegistryAddress, 10 | uint256 minWaitPeriod 11 | ) EthBalanceMonitor(keeperRegistryAddress, minWaitPeriod) {} 12 | 13 | function setLastTopUpXXXTestOnly(address target, uint56 lastTopUpTimestamp) external { 14 | s_targets[target].lastTopUpTimestamp = lastTopUpTimestamp; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/FlagsTestHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../Flags.sol"; 5 | 6 | contract FlagsTestHelper { 7 | Flags public flags; 8 | 9 | constructor(address flagsContract) { 10 | flags = Flags(flagsContract); 11 | } 12 | 13 | function getFlag(address subject) external view returns (bool) { 14 | return flags.getFlag(subject); 15 | } 16 | 17 | function getFlags(address[] calldata subjects) external view returns (bool[] memory) { 18 | return flags.getFlags(subjects); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/Greeter.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | import "../shared/access/ConfirmedOwner.sol"; 4 | 5 | contract Greeter is ConfirmedOwner { 6 | string public greeting; 7 | 8 | constructor(address owner) ConfirmedOwner(owner) {} 9 | 10 | function setGreeting(string calldata _greeting) external onlyOwner { 11 | require(bytes(_greeting).length > 0, "Invalid greeting length"); 12 | greeting = _greeting; 13 | } 14 | 15 | function triggerRevert() external pure { 16 | require(false, "Greeter: revert triggered"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/KeeperCompatibleTestHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../automation/KeeperCompatible.sol"; 5 | 6 | contract KeeperCompatibleTestHelper is KeeperCompatible { 7 | function checkUpkeep(bytes calldata) external override returns (bool, bytes memory) {} 8 | 9 | function performUpkeep(bytes calldata) external override {} 10 | 11 | function verifyCannotExecute() public view cannotExecute {} 12 | } 13 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/LogEmitter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | contract LogEmitter { 5 | event Log1(uint256); 6 | event Log2(uint256 indexed); 7 | event Log3(string); 8 | event Log4(uint256 indexed, uint256 indexed); 9 | 10 | function EmitLog1(uint256[] memory v) public { 11 | for (uint256 i = 0; i < v.length; i++) { 12 | emit Log1(v[i]); 13 | } 14 | } 15 | 16 | function EmitLog2(uint256[] memory v) public { 17 | for (uint256 i = 0; i < v.length; i++) { 18 | emit Log2(v[i]); 19 | } 20 | } 21 | 22 | function EmitLog3(string[] memory v) public { 23 | for (uint256 i = 0; i < v.length; i++) { 24 | emit Log3(v[i]); 25 | } 26 | } 27 | 28 | function EmitLog4(uint256 v, uint256 w, uint256 c) public { 29 | for (uint256 i = 0; i < c; i++) { 30 | emit Log4(v, w); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/MockArbGasInfo.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.8.6; 2 | 3 | contract MockArbGasInfo { 4 | function getCurrentTxL1GasFees() external view returns (uint256) { 5 | return 1000000; 6 | } 7 | 8 | function getPricesInWei() external view returns (uint256, uint256, uint256, uint256, uint256, uint256) { 9 | return (0, 1000, 0, 0, 0, 0); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/MockETHLINKAggregator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "../shared/interfaces/AggregatorV3Interface.sol"; 5 | 6 | contract MockETHLINKAggregator is AggregatorV3Interface { 7 | int256 public answer; 8 | 9 | constructor(int256 _answer) public { 10 | answer = _answer; 11 | } 12 | 13 | function decimals() external view override returns (uint8) { 14 | return 18; 15 | } 16 | 17 | function description() external view override returns (string memory) { 18 | return "MockETHLINKAggregator"; 19 | } 20 | 21 | function version() external view override returns (uint256) { 22 | return 1; 23 | } 24 | 25 | function getRoundData( 26 | uint80 _roundId 27 | ) 28 | external 29 | view 30 | override 31 | returns (uint80 roundId, int256 ans, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) 32 | { 33 | return (1, answer, block.timestamp, block.timestamp, 1); 34 | } 35 | 36 | function latestRoundData() 37 | external 38 | view 39 | override 40 | returns (uint80 roundId, int256 ans, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) 41 | { 42 | return (1, answer, block.timestamp, block.timestamp, 1); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/MockOVMGasPriceOracle.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.8.6; 2 | 3 | contract MockOVMGasPriceOracle { 4 | function getL1Fee(bytes memory _data) public view returns (uint256) { 5 | return 2000000; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/MockOptimismL2CrossDomainMessenger.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.9; 3 | 4 | /* Interface Imports */ 5 | import {IL2CrossDomainMessenger} from "@eth-optimism/contracts/L2/messaging/IL2CrossDomainMessenger.sol"; 6 | 7 | contract MockOptimismL2CrossDomainMessenger is IL2CrossDomainMessenger { 8 | uint256 private s_nonce; 9 | address private s_sender; 10 | 11 | // slither-disable-next-line external-function 12 | function xDomainMessageSender() public view returns (address) { 13 | return s_sender; 14 | } 15 | 16 | function setSender(address newSender) external { 17 | s_sender = newSender; 18 | } 19 | 20 | function sendMessage(address _target, bytes memory _message, uint32 _gasLimit) public { 21 | emit SentMessage(_target, msg.sender, _message, s_nonce, _gasLimit); 22 | s_nonce++; 23 | } 24 | 25 | function relayMessage(address _target, address _sender, bytes memory _message, uint256 _messageNonce) external {} 26 | 27 | receive() external payable {} 28 | } 29 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/ReceiveEmitter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.6; 4 | 5 | contract ReceiveEmitter { 6 | event FundsReceived(uint256 amount, uint256 newBalance); 7 | 8 | receive() external payable { 9 | emit FundsReceived(msg.value, address(this).balance); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/ReceiveFallbackEmitter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.6; 4 | 5 | contract ReceiveFallbackEmitter { 6 | event FundsReceived(uint256 amount, uint256 newBalance); 7 | 8 | fallback() external payable { 9 | emit FundsReceived(msg.value, address(this).balance); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/ReceiveReverter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.6; 4 | 5 | contract ReceiveReverter { 6 | receive() external payable { 7 | revert("Can't send funds"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/tests/VRFLogEmitter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | contract VRFLogEmitter { 5 | event RandomWordsRequested( 6 | bytes32 indexed keyHash, 7 | uint256 requestId, 8 | uint256 preSeed, 9 | uint64 indexed subId, 10 | uint16 minimumRequestConfirmations, 11 | uint32 callbackGasLimit, 12 | uint32 numWords, 13 | address indexed sender 14 | ); 15 | event RandomWordsFulfilled(uint256 indexed requestId, uint256 outputSeed, uint96 payment, bool success); 16 | 17 | function emitRandomWordsRequested( 18 | bytes32 keyHash, 19 | uint256 requestId, 20 | uint256 preSeed, 21 | uint64 subId, 22 | uint16 minimumRequestConfirmations, 23 | uint32 callbackGasLimit, 24 | uint32 numWords, 25 | address sender 26 | ) public { 27 | emit RandomWordsRequested( 28 | keyHash, 29 | requestId, 30 | preSeed, 31 | subId, 32 | minimumRequestConfirmations, 33 | callbackGasLimit, 34 | numWords, 35 | sender 36 | ); 37 | } 38 | 39 | function emitRandomWordsFulfilled(uint256 requestId, uint256 outputSeed, uint96 payment, bool success) public { 40 | emit RandomWordsFulfilled(requestId, outputSeed, payment, success); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/transmission/dev/ERC-4337/SmartContractAccountFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract SmartContractAccountFactory { 5 | event ContractCreated(address scaAddress); 6 | 7 | error DeploymentFailed(); 8 | 9 | /// @dev Use create2 to deploy a new Smart Contract Account. 10 | /// @dev See EIP-1014 for more on CREATE2. 11 | /// TODO: Return the address of the Smart Contract Account even if it is already 12 | /// deployed. 13 | function deploySmartContractAccount( 14 | bytes32 abiEncodedOwnerAddress, 15 | bytes memory initCode 16 | ) external payable returns (address scaAddress) { 17 | assembly { 18 | scaAddress := create2( 19 | 0, // value - left at zero here 20 | add(0x20, initCode), // initialization bytecode 21 | mload(initCode), // length of initialization bytecode 22 | abiEncodedOwnerAddress // user-defined nonce to ensure unique SCA addresses 23 | ) 24 | } 25 | if (scaAddress == address(0)) { 26 | revert DeploymentFailed(); 27 | } 28 | 29 | emit ContractCreated(scaAddress); 30 | 31 | return scaAddress; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/transmission/dev/testhelpers/Greeter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | /// @dev Ownerless greeter contract. 5 | contract Greeter { 6 | string private s_greeting; 7 | 8 | function setGreeting(string memory greeting) external { 9 | s_greeting = greeting; 10 | } 11 | 12 | function getGreeting() external view returns (string memory) { 13 | return s_greeting; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/transmission/test/BaseTest.t.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | import {Test} from "forge-std/Test.sol"; 4 | 5 | contract BaseTest is Test { 6 | bool private s_baseTestInitialized; 7 | address internal constant OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e; 8 | 9 | function setUp() public virtual { 10 | // BaseTest.setUp is often called multiple times from tests' setUp due to inheritance. 11 | if (s_baseTestInitialized) return; 12 | s_baseTestInitialized = true; 13 | 14 | // Set msg.sender to OWNER until changePrank or stopPrank is called 15 | vm.startPrank(OWNER); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/@eth-optimism/contracts-bedrock/v0.16.2/src/universal/ISemver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | /// @title ISemver 5 | /// @notice ISemver is a simple contract for ensuring that contracts are 6 | /// versioned using semantic versioning. 7 | interface ISemver { 8 | /// @notice Getter for the semantic version of the contract. This is not 9 | /// meant to be used onchain but instead meant to be used by offchain 10 | /// tooling. 11 | /// @return Semver contract version as a string. 12 | function version() external view returns (string memory); 13 | } -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/@eth-optimism/contracts/v0.4.7/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_CrossDomainMessenger.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.7.6 <0.9.0; 3 | 4 | /** 5 | * @title iOVM_CrossDomainMessenger 6 | */ 7 | interface iOVM_CrossDomainMessenger { 8 | /********** 9 | * Events * 10 | **********/ 11 | 12 | event SentMessage(bytes message); 13 | event RelayedMessage(bytes32 msgHash); 14 | event FailedRelayedMessage(bytes32 msgHash); 15 | 16 | /************* 17 | * Variables * 18 | *************/ 19 | 20 | function xDomainMessageSender() external view returns (address); 21 | 22 | /******************** 23 | * Public Functions * 24 | ********************/ 25 | 26 | /** 27 | * Sends a cross domain message to the target messenger. 28 | * @param _target Target contract address. 29 | * @param _message Message to send to the target. 30 | * @param _gasLimit Gas limit for the provided message. 31 | */ 32 | function sendMessage(address _target, bytes calldata _message, uint32 _gasLimit) external; 33 | } 34 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/ENSResolver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | abstract contract ENSResolver { 5 | function addr(bytes32 node) public view virtual returns (address); 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2; 3 | 4 | interface IERC165 { 5 | /// @notice Query if a contract implements an interface 6 | /// @param interfaceID The interface identifier, as specified in ERC-165 7 | /// @dev Interface identification is specified in ERC-165. This function 8 | /// uses less than 30,000 gas. 9 | /// @return `true` if the contract implements `interfaceID` and 10 | /// `interfaceID` is not 0xffffffff, `false` otherwise 11 | function supportsInterface(bytes4 interfaceID) external view returns (bool); 12 | } 13 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IMessageProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | /* 4 | * Copyright 2021, Offchain Labs, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | // NOTICE: pragma change from original (^0.6.11) 20 | pragma solidity ^0.8.0; 21 | 22 | interface IMessageProvider { 23 | event InboxMessageDelivered(uint256 indexed messageNum, bytes data); 24 | 25 | event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); 26 | } 27 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/entrypoint/core/SenderCreator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity ^0.8.12; 3 | 4 | /** 5 | * helper contract for EntryPoint, to call userOp.initCode from a "neutral" address, 6 | * which is explicitly not the entryPoint itself. 7 | */ 8 | contract SenderCreator { 9 | 10 | /** 11 | * call the "initCode" factory to create and return the sender account address 12 | * @param initCode the initCode value from a UserOp. contains 20 bytes of factory address, followed by calldata 13 | * @return sender the returned address of the created account, or zero address on failure. 14 | */ 15 | function createSender(bytes calldata initCode) external returns (address sender) { 16 | address factory = address(bytes20(initCode[0 : 20])); 17 | bytes memory initCallData = initCode[20 :]; 18 | bool success; 19 | /* solhint-disable no-inline-assembly */ 20 | assembly { 21 | success := call(gas(), factory, 0, add(initCallData, 0x20), mload(initCallData), 0, 32) 22 | sender := mload(0) 23 | } 24 | if (!success) { 25 | sender = address(0); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Context.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Provides information about the current execution context, including the 8 | * sender of the transaction and its data. While these are generally available 9 | * via msg.sender and msg.data, they should not be accessed in such a direct 10 | * manner, since when dealing with meta-transactions the account sending and 11 | * paying for execution may not be the actual sender (as far as an application 12 | * is concerned). 13 | * 14 | * This contract is only required for intermediate, library-like contracts. 15 | */ 16 | abstract contract Context { 17 | function _msgSender() internal view virtual returns (address) { 18 | return msg.sender; 19 | } 20 | 21 | function _msgData() internal view virtual returns (bytes calldata) { 22 | return msg.data; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC165.sol"; -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/IERC20.sol"; -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/ERC20.sol"; 6 | 7 | // mock class using ERC20 8 | contract ERC20Mock is ERC20 { 9 | constructor( 10 | string memory name, 11 | string memory symbol, 12 | address initialAccount, 13 | uint256 initialBalance 14 | ) payable ERC20(name, symbol) { 15 | _mint(initialAccount, initialBalance); 16 | } 17 | 18 | function mint(address account, uint256 amount) public { 19 | _mint(account, amount); 20 | } 21 | 22 | function burn(address account, uint256 amount) public { 23 | _burn(account, amount); 24 | } 25 | 26 | function transferInternal( 27 | address from, 28 | address to, 29 | uint256 value 30 | ) public { 31 | _transfer(from, to, value); 32 | } 33 | 34 | function approveInternal( 35 | address owner, 36 | address spender, 37 | uint256 value 38 | ) public { 39 | _approve(owner, spender, value); 40 | } 41 | } -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC20.sol"; 7 | 8 | /** 9 | * @dev Interface for the optional metadata functions from the ERC20 standard. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | interface IERC20Metadata is IERC20 { 14 | /** 15 | * @dev Returns the name of the token. 16 | */ 17 | function name() external view returns (string memory); 18 | 19 | /** 20 | * @dev Returns the symbol of the token. 21 | */ 22 | function symbol() external view returns (string memory); 23 | 24 | /** 25 | * @dev Returns the decimals places of the token. 26 | */ 27 | function decimals() external view returns (uint8); 28 | } 29 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/utils/Context.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Provides information about the current execution context, including the 8 | * sender of the transaction and its data. While these are generally available 9 | * via msg.sender and msg.data, they should not be accessed in such a direct 10 | * manner, since when dealing with meta-transactions the account sending and 11 | * paying for execution may not be the actual sender (as far as an application 12 | * is concerned). 13 | * 14 | * This contract is only required for intermediate, library-like contracts. 15 | */ 16 | abstract contract Context { 17 | function _msgSender() internal view virtual returns (address) { 18 | return msg.sender; 19 | } 20 | 21 | function _msgData() internal view virtual returns (bytes calldata) { 22 | return msg.data; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/ERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC165.sol"; 7 | 8 | /** 9 | * @dev Implementation of the {IERC165} interface. 10 | * 11 | * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check 12 | * for the additional interface id that will be supported. For example: 13 | * 14 | * ```solidity 15 | * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { 16 | * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); 17 | * } 18 | * ``` 19 | * 20 | * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. 21 | */ 22 | abstract contract ERC165 is IERC165 { 23 | /** 24 | * @dev See {IERC165-supportsInterface}. 25 | */ 26 | function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { 27 | return interfaceId == type(IERC165).interfaceId; 28 | } 29 | } -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC165 standard, as defined in the 8 | * https://eips.ethereum.org/EIPS/eip-165[EIP]. 9 | * 10 | * Implementers can declare support of contract interfaces, which can then be 11 | * queried by others ({ERC165Checker}). 12 | * 13 | * For an implementation, see {ERC165}. 14 | */ 15 | interface IERC165 { 16 | /** 17 | * @dev Returns true if this contract implements the interface defined by 18 | * `interfaceId`. See the corresponding 19 | * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] 20 | * to learn more about how these ids are created. 21 | * 22 | * This function call must use less than 30 000 gas. 23 | */ 24 | function supportsInterface(bytes4 interfaceId) external view returns (bool); 25 | } -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/VRFTypes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.6; 3 | 4 | /** 5 | * @title VRFTypes 6 | * @notice The VRFTypes library is a collection of types that is required to fulfill VRF requests 7 | * on-chain. They must be ABI-compatible with the types used by the coordinator contracts. 8 | */ 9 | library VRFTypes { 10 | // ABI-compatible with VRF.Proof. 11 | // This proof is used for VRF V2 and V2Plus. 12 | struct Proof { 13 | uint256[2] pk; 14 | uint256[2] gamma; 15 | uint256 c; 16 | uint256 s; 17 | uint256 seed; 18 | address uWitness; 19 | uint256[2] cGammaWitness; 20 | uint256[2] sHashWitness; 21 | uint256 zInv; 22 | } 23 | 24 | // ABI-compatible with VRFCoordinatorV2.RequestCommitment. 25 | // This is only used for VRF V2. 26 | struct RequestCommitment { 27 | uint64 blockNum; 28 | uint64 subId; 29 | uint32 callbackGasLimit; 30 | uint32 numWords; 31 | address sender; 32 | } 33 | 34 | // ABI-compatible with VRFCoordinatorV2Plus.RequestCommitment. 35 | // This is only used for VRF V2Plus. 36 | struct RequestCommitmentV2Plus { 37 | uint64 blockNum; 38 | uint256 subId; 39 | uint32 callbackGasLimit; 40 | uint32 numWords; 41 | address sender; 42 | bytes extraArgs; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2PlusMigration.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | // Future versions of VRFCoordinatorV2Plus must implement IVRFCoordinatorV2PlusMigration 5 | // to support migrations from previous versions 6 | interface IVRFCoordinatorV2PlusMigration { 7 | /** 8 | * @notice called by older versions of coordinator for migration. 9 | * @notice only callable by older versions of coordinator 10 | * @notice supports transfer of native currency 11 | * @param encodedData - user data from older version of coordinator 12 | */ 13 | function onMigration(bytes calldata encodedData) external payable; 14 | } 15 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFMigratableConsumerV2Plus.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | /// @notice The IVRFMigratableConsumerV2Plus interface defines the 5 | /// @notice method required to be implemented by all V2Plus consumers. 6 | /// @dev This interface is designed to be used in VRFConsumerBaseV2Plus. 7 | interface IVRFMigratableConsumerV2Plus { 8 | event CoordinatorSet(address vrfCoordinator); 9 | 10 | /// @notice Sets the VRF Coordinator address 11 | /// @notice This method should only be callable by the coordinator or contract owner 12 | function setCoordinator(address vrfCoordinator) external; 13 | } 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFV2PlusMigrate.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | /// @notice This interface is implemented by all VRF V2+ coordinators that can 5 | /// @notice migrate subscription data to new coordinators. 6 | interface IVRFV2PlusMigrate { 7 | /** 8 | * @notice migrate the provided subscription ID to the provided VRF coordinator 9 | * @notice msg.sender must be the subscription owner and newCoordinator must 10 | * @notice implement IVRFCoordinatorV2PlusMigration. 11 | * @param subId the subscription ID to migrate 12 | * @param newCoordinator the vrf coordinator to migrate to 13 | */ 14 | function migrate(uint256 subId, address newCoordinator) external; 15 | } 16 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | // End consumer library. 5 | library VRFV2PlusClient { 6 | // extraArgs will evolve to support new features 7 | bytes4 public constant EXTRA_ARGS_V1_TAG = bytes4(keccak256("VRF ExtraArgsV1")); 8 | struct ExtraArgsV1 { 9 | bool nativePayment; 10 | } 11 | 12 | struct RandomWordsRequest { 13 | bytes32 keyHash; 14 | uint256 subId; 15 | uint16 requestConfirmations; 16 | uint32 callbackGasLimit; 17 | uint32 numWords; 18 | bytes extraArgs; 19 | } 20 | 21 | function _argsToBytes(ExtraArgsV1 memory extraArgs) internal pure returns (bytes memory bts) { 22 | return abi.encodeWithSelector(EXTRA_ARGS_V1_TAG, extraArgs); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusMaliciousMigrator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.0; 3 | 4 | import {IVRFMigratableConsumerV2Plus} from "../interfaces/IVRFMigratableConsumerV2Plus.sol"; 5 | import {IVRFCoordinatorV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; 6 | import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; 7 | 8 | contract VRFV2PlusMaliciousMigrator is IVRFMigratableConsumerV2Plus { 9 | IVRFCoordinatorV2Plus internal s_vrfCoordinator; 10 | 11 | constructor(address _vrfCoordinator) { 12 | s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator); 13 | } 14 | 15 | /** 16 | * @inheritdoc IVRFMigratableConsumerV2Plus 17 | */ 18 | function setCoordinator(address /* _vrfCoordinator */) public override { 19 | // try to re-enter, should revert 20 | // args don't really matter 21 | s_vrfCoordinator.requestRandomWords( 22 | VRFV2PlusClient.RandomWordsRequest({ 23 | keyHash: bytes32(0), 24 | subId: 0, 25 | requestConfirmations: 0, 26 | callbackGasLimit: 0, 27 | numWords: 0, 28 | extraArgs: "" 29 | }) 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/interfaces/BlockhashStoreInterface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface BlockhashStoreInterface { 5 | function getBlockhash(uint256 number) external view returns (bytes32); 6 | } 7 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/interfaces/IAuthorizedReceiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IAuthorizedReceiver { 5 | function isAuthorizedSender(address sender) external view returns (bool); 6 | 7 | function getAuthorizedSenders() external returns (address[] memory); 8 | 9 | function setAuthorizedSenders(address[] calldata senders) external; 10 | } 11 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/test/BaseTest.t.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | import {Test} from "forge-std/Test.sol"; 4 | 5 | contract BaseTest is Test { 6 | bool private s_baseTestInitialized; 7 | address internal constant OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e; 8 | 9 | function setUp() public virtual { 10 | // BaseTest.setUp is often called multiple times from tests' setUp due to inheritance. 11 | if (s_baseTestInitialized) return; 12 | s_baseTestInitialized = true; 13 | 14 | // Set msg.sender to OWNER until changePrank or stopPrank is called 15 | vm.startPrank(OWNER); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/ChainSpecificUtilHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ChainSpecificUtil} from "../../ChainSpecificUtil_v0_8_6.sol"; 5 | 6 | /// @dev A helper contract that exposes ChainSpecificUtil methods for testing 7 | contract ChainSpecificUtilHelper { 8 | function getBlockhash(uint64 blockNumber) external view returns (bytes32) { 9 | return ChainSpecificUtil._getBlockhash(blockNumber); 10 | } 11 | 12 | function getBlockNumber() external view returns (uint256) { 13 | return ChainSpecificUtil._getBlockNumber(); 14 | } 15 | 16 | function getCurrentTxL1GasFees(string memory txCallData) external view returns (uint256) { 17 | return ChainSpecificUtil._getCurrentTxL1GasFees(bytes(txCallData)); 18 | } 19 | 20 | function getL1CalldataGasCost(uint256 calldataSize) external view returns (uint256) { 21 | return ChainSpecificUtil._getL1CalldataGasCost(calldataSize); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/VRFConsumer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {VRFConsumerBase} from "../VRFConsumerBase.sol"; 5 | 6 | contract VRFConsumer is VRFConsumerBase { 7 | uint256 public randomnessOutput; 8 | bytes32 public requestId; 9 | 10 | constructor( 11 | address vrfCoordinator, 12 | address link 13 | ) 14 | // solhint-disable-next-line no-empty-blocks 15 | VRFConsumerBase(vrfCoordinator, link) 16 | { 17 | /* empty */ 18 | } 19 | 20 | function fulfillRandomness(bytes32 /* requestId */, uint256 randomness) internal override { 21 | randomnessOutput = randomness; 22 | requestId = requestId; 23 | } 24 | 25 | function doRequestRandomness(bytes32 keyHash, uint256 fee) external returns (bytes32) { 26 | return requestRandomness(keyHash, fee); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/VRFRequestIDBaseTestHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {VRFRequestIDBase} from "../VRFRequestIDBase.sol"; 5 | 6 | contract VRFRequestIDBaseTestHelper is VRFRequestIDBase { 7 | function makeVRFInputSeed_( 8 | bytes32 _keyHash, 9 | uint256 _userSeed, 10 | address _requester, 11 | uint256 _nonce 12 | ) public pure returns (uint256) { 13 | return makeVRFInputSeed(_keyHash, _userSeed, _requester, _nonce); 14 | } 15 | 16 | function makeRequestId_(bytes32 _keyHash, uint256 _vRFInputSeed) public pure returns (bytes32) { 17 | return makeRequestId(_keyHash, _vRFInputSeed); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/VRFSubscriptionBalanceMonitorExposed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.6; 4 | 5 | import {VRFSubscriptionBalanceMonitor} from "../dev/VRFSubscriptionBalanceMonitor.sol"; 6 | 7 | contract VRFSubscriptionBalanceMonitorExposed is VRFSubscriptionBalanceMonitor { 8 | constructor( 9 | address linkTokenAddress, 10 | address coordinatorAddress, 11 | address keeperRegistryAddress, 12 | uint256 minWaitPeriodSeconds 13 | ) VRFSubscriptionBalanceMonitor(linkTokenAddress, coordinatorAddress, keeperRegistryAddress, minWaitPeriodSeconds) {} 14 | 15 | function setLastTopUpXXXTestOnly(uint64 target, uint56 lastTopUpTimestamp) external { 16 | s_targets[target].lastTopUpTimestamp = lastTopUpTimestamp; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/VRFV2ProxyAdmin.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; 5 | 6 | contract VRFV2ProxyAdmin is ProxyAdmin { 7 | // Nothing here, this is just to generate the gethwrapper for tests. 8 | } 9 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/VRFV2TransparentUpgradeableProxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; 5 | 6 | contract VRFV2TransparentUpgradeableProxy is TransparentUpgradeableProxy { 7 | // Nothing special here, this is just to generate the gethwrapper for tests. 8 | constructor( 9 | address _logic, 10 | address admin_, 11 | bytes memory _data 12 | ) payable TransparentUpgradeableProxy(_logic, admin_, _data) {} 13 | } 14 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperOutOfGasConsumerExample.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.6; 3 | 4 | import {VRFV2WrapperConsumerBase} from "../VRFV2WrapperConsumerBase.sol"; 5 | import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; 6 | 7 | contract VRFV2WrapperOutOfGasConsumerExample is VRFV2WrapperConsumerBase, ConfirmedOwner { 8 | constructor( 9 | address _link, 10 | address _vrfV2Wrapper 11 | ) ConfirmedOwner(msg.sender) VRFV2WrapperConsumerBase(_link, _vrfV2Wrapper) {} 12 | 13 | function makeRequest( 14 | uint32 _callbackGasLimit, 15 | uint16 _requestConfirmations, 16 | uint32 _numWords 17 | ) external onlyOwner returns (uint256 requestId) { 18 | return requestRandomness(_callbackGasLimit, _requestConfirmations, _numWords); 19 | } 20 | 21 | function fulfillRandomWords(uint256 /* _requestId */, uint256[] memory /* _randomWords */) internal view override { 22 | while (gasleft() > 0) {} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperRevertingConsumerExample.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.6; 3 | 4 | import {VRFV2WrapperConsumerBase} from "../VRFV2WrapperConsumerBase.sol"; 5 | import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; 6 | 7 | contract VRFV2WrapperRevertingConsumerExample is VRFV2WrapperConsumerBase, ConfirmedOwner { 8 | constructor( 9 | address _link, 10 | address _vrfV2Wrapper 11 | ) ConfirmedOwner(msg.sender) VRFV2WrapperConsumerBase(_link, _vrfV2Wrapper) {} 12 | 13 | function makeRequest( 14 | uint32 _callbackGasLimit, 15 | uint16 _requestConfirmations, 16 | uint32 _numWords 17 | ) external onlyOwner returns (uint256 requestId) { 18 | return requestRandomness(_callbackGasLimit, _requestConfirmations, _numWords); 19 | } 20 | 21 | function fulfillRandomWords(uint256 /* _requestId */, uint256[] memory /* _randomWords */) internal pure override { 22 | revert("reverting example"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/chainlink/contracts/src/v0.8/vrf/testhelpers/VRFV2WrapperUnderFundingConsumer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; 5 | import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; 6 | import {VRFV2WrapperInterface} from "../interfaces/VRFV2WrapperInterface.sol"; 7 | 8 | contract VRFV2WrapperUnderFundingConsumer is ConfirmedOwner { 9 | LinkTokenInterface internal immutable LINK; 10 | VRFV2WrapperInterface internal immutable VRF_V2_WRAPPER; 11 | 12 | constructor(address _link, address _vrfV2Wrapper) ConfirmedOwner(msg.sender) { 13 | LINK = LinkTokenInterface(_link); 14 | VRF_V2_WRAPPER = VRFV2WrapperInterface(_vrfV2Wrapper); 15 | } 16 | 17 | function makeRequest(uint32 _callbackGasLimit, uint16 _requestConfirmations, uint32 _numWords) external onlyOwner { 18 | LINK.transferAndCall( 19 | address(VRF_V2_WRAPPER), 20 | // Pay less than the needed amount 21 | VRF_V2_WRAPPER.calculateRequestPrice(_callbackGasLimit) - 1, 22 | abi.encode(_callbackGasLimit, _requestConfirmations, _numWords) 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/chainlink/env-enc/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 SmartContract Chainlink Limited SEZC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/chainlink/env-enc/dist/EncryptedEnv.d.ts: -------------------------------------------------------------------------------- 1 | export default class EncryptedEnv { 2 | private password?; 3 | private envPath; 4 | private envVars; 5 | constructor(options?: { 6 | path?: string; 7 | }); 8 | setVars: () => Promise; 9 | removeVar: (name: string) => void; 10 | removeAll: () => void; 11 | viewVars: () => Promise; 12 | load: () => void; 13 | private resolveHome; 14 | private getHiddenInput; 15 | private isFileEmpty; 16 | private readEnvEncFile; 17 | private writeEnvEncFile; 18 | private encrypt; 19 | private decrypt; 20 | private isValidEnvVarName; 21 | private clearLine; 22 | } 23 | -------------------------------------------------------------------------------- /lib/chainlink/env-enc/dist/cli.d.ts: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env node 2 | export {}; 3 | -------------------------------------------------------------------------------- /lib/chainlink/env-enc/dist/index.d.ts: -------------------------------------------------------------------------------- 1 | import EncryptedEnv from './EncryptedEnv'; 2 | export declare let encryptedEnv: EncryptedEnv; 3 | export declare const config: (options?: { 4 | path?: string; 5 | }) => void; 6 | -------------------------------------------------------------------------------- /lib/chainlink/env-enc/dist/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = (this && this.__importDefault) || function (mod) { 3 | return (mod && mod.__esModule) ? mod : { "default": mod }; 4 | }; 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | exports.config = exports.encryptedEnv = void 0; 7 | const EncryptedEnv_1 = __importDefault(require("./EncryptedEnv")); 8 | const config = (options) => { 9 | exports.encryptedEnv = new EncryptedEnv_1.default(options); 10 | exports.encryptedEnv.load(); 11 | }; 12 | exports.config = config; 13 | -------------------------------------------------------------------------------- /lib/chainlink/env-enc/dist/runSetPasswordScripts.d.ts: -------------------------------------------------------------------------------- 1 | export declare const runShellScriptInSameTerminal: () => void; 2 | -------------------------------------------------------------------------------- /lib/chainlink/env-enc/dist/scripts/setPassword.ps1: -------------------------------------------------------------------------------- 1 | # script.ps1 2 | 3 | # Read the input from the user 4 | $INPUT_PASSWORD = Read-Host -Prompt "Enter the password (input will be hidden)" -AsSecureString 5 | 6 | # Convert SecureString to plain text 7 | $BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($INPUT_PASSWORD) 8 | $PLAINTEXT_PASSWORD = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) 9 | 10 | # Set the environment variable 11 | $env:ENV_ENC_PASSWORD = $PLAINTEXT_PASSWORD 12 | 13 | # Start a new PowerShell session to avoid storing the variable in history 14 | powershell.exe -NoLogo 15 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 SmartContract 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/ResponseListener.d.ts: -------------------------------------------------------------------------------- 1 | import type { providers } from 'ethers'; 2 | import { type FunctionsResponse } from './types'; 3 | export declare class ResponseListener { 4 | private functionsRouter; 5 | private provider; 6 | constructor({ provider, functionsRouterAddress, }: { 7 | provider: providers.Provider; 8 | functionsRouterAddress: string; 9 | }); 10 | listenForResponse(requestId: string, timeout?: number): Promise; 11 | listenForResponseFromTransaction(txHash: string, timeout?: number, confirmations?: number, checkInterval?: number): Promise; 12 | listenForResponses(subscriptionId: number | string, callback: (functionsResponse: FunctionsResponse) => any): void; 13 | stopListeningForResponses(): void; 14 | } 15 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/buildRequestCBOR.d.ts: -------------------------------------------------------------------------------- 1 | import type { FunctionsRequestParams } from './types'; 2 | export declare const buildRequestCBOR: (requestParams: FunctionsRequestParams) => string; 3 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/decodeResult.d.ts: -------------------------------------------------------------------------------- 1 | import { ReturnType } from './types'; 2 | export type DecodedResult = bigint | string; 3 | export declare const decodeResult: (resultHexstring: string, expectedReturnType: ReturnType) => DecodedResult; 4 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/fetchRequestCommitment.d.ts: -------------------------------------------------------------------------------- 1 | import type { RequestCommitmentFetchConfig, RequestCommitment } from './types'; 2 | export declare const fetchRequestCommitment: ({ requestId, provider, functionsRouterAddress, donId, toBlock, pastBlocksToSearch, }: RequestCommitmentFetchConfig) => Promise; 3 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './SubscriptionManager'; 2 | export * from './SecretsManager'; 3 | export * from './ResponseListener'; 4 | export * from './simulateScript'; 5 | export * from './localFunctionsTestnet'; 6 | export * from './decodeResult'; 7 | export * from './offchain_storage'; 8 | export * from './types'; 9 | export * from './buildRequestCBOR'; 10 | export * from './simulationConfig'; 11 | export * from './fetchRequestCommitment'; 12 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/localFunctionsTestnet.d.ts: -------------------------------------------------------------------------------- 1 | import { Wallet } from 'ethers'; 2 | import type { ServerOptions } from 'ganache'; 3 | import type { LocalFunctionsTestnet, FunctionsContracts } from './types'; 4 | export declare const startLocalFunctionsTestnet: (simulationConfigPath?: string, options?: ServerOptions, port?: number) => Promise; 5 | export declare const deployFunctionsOracle: (deployer: Wallet) => Promise; 6 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/offchain_storage/github.d.ts: -------------------------------------------------------------------------------- 1 | export declare const createGist: (githubApiToken: string, content: string) => Promise; 2 | export declare const deleteGist: (githubApiToken: string, gistURL: string) => Promise; 3 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/offchain_storage/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './github'; 2 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/offchain_storage/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | var desc = Object.getOwnPropertyDescriptor(m, k); 5 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6 | desc = { enumerable: true, get: function() { return m[k]; } }; 7 | } 8 | Object.defineProperty(o, k2, desc); 9 | }) : (function(o, m, k, k2) { 10 | if (k2 === undefined) k2 = k; 11 | o[k2] = m[k]; 12 | })); 13 | var __exportStar = (this && this.__exportStar) || function(m, exports) { 14 | for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); 15 | }; 16 | Object.defineProperty(exports, "__esModule", { value: true }); 17 | __exportStar(require("./github"), exports); 18 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/simulateScript/frontendAllowedModules.d.ts: -------------------------------------------------------------------------------- 1 | export type AllowedModules = 'buffer' | 'crypto' | 'querystring' | 'string_decoder' | 'url' | 'util'; 2 | export declare const safeRequire: (module: AllowedModules) => void; 3 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/simulateScript/frontendAllowedModules.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.safeRequire = void 0; 4 | const exhaustiveCheck = (module) => { 5 | throw Error(`Import of module ${module} not allowed`); 6 | }; 7 | const safeRequire = (module) => { 8 | switch (module) { 9 | case 'buffer': 10 | return require('buffer'); 11 | case 'crypto': 12 | return require('crypto'); 13 | case 'querystring': 14 | return require('querystring'); 15 | case 'string_decoder': 16 | return require('string_decoder'); 17 | case 'url': 18 | return require('url'); 19 | case 'util': 20 | return require('util'); 21 | default: 22 | exhaustiveCheck(module); 23 | } 24 | }; 25 | exports.safeRequire = safeRequire; 26 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/simulateScript/frontendSimulateScript.d.ts: -------------------------------------------------------------------------------- 1 | type Hexstring = `0x${string}`; 2 | interface SimulationParams { 3 | source: string; 4 | secrets?: Record; 5 | args?: string[]; 6 | maxHttpRequests?: number; 7 | maxResponseBytes?: number; 8 | maxExecutionDurationMs?: number; 9 | } 10 | export declare const simulateScript: ({ source, secrets, args, maxHttpRequests, maxResponseBytes, maxExecutionDurationMs, }: SimulationParams) => Promise<{ 11 | result?: `0x${string}` | undefined; 12 | error?: Error | undefined; 13 | capturedStdout?: string | undefined; 14 | }>; 15 | export {}; 16 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/simulateScript/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './simulateScript'; 2 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/simulateScript/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | var desc = Object.getOwnPropertyDescriptor(m, k); 5 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6 | desc = { enumerable: true, get: function() { return m[k]; } }; 7 | } 8 | Object.defineProperty(o, k2, desc); 9 | }) : (function(o, m, k, k2) { 10 | if (k2 === undefined) k2 = k; 11 | o[k2] = m[k]; 12 | })); 13 | var __exportStar = (this && this.__exportStar) || function(m, exports) { 14 | for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); 15 | }; 16 | Object.defineProperty(exports, "__esModule", { value: true }); 17 | __exportStar(require("./simulateScript"), exports); 18 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/simulateScript/safePow.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * safePow performs exponentiation with BigInts in browser safe mode as opposed to: 3 | * - `Math.pow`, which doesn't currently support BigInts. 4 | * - `**` operator which might get transpiled to Math.pow by browser VM or build tools like swc. 5 | * 6 | * Method supports integer numbers and bigints. 7 | */ 8 | export declare const safePow: (base: bigint | number, exponent: bigint | number) => bigint; 9 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/simulateScript/simulateScript.d.ts: -------------------------------------------------------------------------------- 1 | import type { SimulationInput, SimulationResult } from '../types'; 2 | export declare const simulateScript: ({ source, secrets, args, bytesArgs, maxOnChainResponseBytes, maxExecutionTimeMs, maxMemoryUsageMb, numAllowedQueries, maxQueryDurationMs, maxQueryUrlLength, maxQueryRequestBytes, maxQueryResponseBytes, }: SimulationInput) => Promise; 3 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/tdh2.d.ts: -------------------------------------------------------------------------------- 1 | export function encrypt(pub: any, msg: any): string; 2 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/v1_contract_sources/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './FunctionsCoordinator'; 2 | export * from './FunctionsRouter'; 3 | export * from './LinkToken'; 4 | export * from './FunctionsCoordinatorTestHelper'; 5 | export * from './MockV3Aggregator'; 6 | export * from './TermsOfServiceAllowList'; 7 | -------------------------------------------------------------------------------- /lib/chainlink/functions-toolkit/dist/v1_contract_sources/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | var desc = Object.getOwnPropertyDescriptor(m, k); 5 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6 | desc = { enumerable: true, get: function() { return m[k]; } }; 7 | } 8 | Object.defineProperty(o, k2, desc); 9 | }) : (function(o, m, k, k2) { 10 | if (k2 === undefined) k2 = k; 11 | o[k2] = m[k]; 12 | })); 13 | var __exportStar = (this && this.__exportStar) || function(m, exports) { 14 | for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); 15 | }; 16 | Object.defineProperty(exports, "__esModule", { value: true }); 17 | __exportStar(require("./FunctionsCoordinator"), exports); 18 | __exportStar(require("./FunctionsRouter"), exports); 19 | __exportStar(require("./LinkToken"), exports); 20 | __exportStar(require("./FunctionsCoordinatorTestHelper"), exports); 21 | __exportStar(require("./MockV3Aggregator"), exports); 22 | __exportStar(require("./TermsOfServiceAllowList"), exports); 23 | -------------------------------------------------------------------------------- /scripts/FunctionsConsumer.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity >=0.7.0; 3 | 4 | import "lib/forge-std/src/Script.sol"; 5 | import "src/FunctionsConsumer.sol"; 6 | 7 | contract FunctionsConsumerScript is Script { 8 | 9 | function run() external { 10 | uint deployerPrivateKey = vm.envUint("PRIVATE_KEY"); 11 | vm.startBroadcast(deployerPrivateKey); 12 | 13 | // REFER TO DOCS FOR UP-TO-DATE ADDRESSES 14 | // https://docs.chain.link/chainlink-functions/supported-networks 15 | address ROUTER_ADDRESS = 0xb83E47C2bC239B3bf370bc41e1459A34b41238D0; // ETH SEPOLIA 16 | bytes32 DON_ID = 0x66756e2d657468657265756d2d7365706f6c69612d3100000000000000000000; // ETH SEPOLIA 17 | 18 | FunctionsConsumer functionsConsumer = new FunctionsConsumer( 19 | ROUTER_ADDRESS, // address router, 20 | DON_ID // bytes32 _donId 21 | ); 22 | 23 | // silences warning. 24 | functionsConsumer; 25 | 26 | vm.stopBroadcast(); 27 | } 28 | } -------------------------------------------------------------------------------- /scripts/Simulate.js: -------------------------------------------------------------------------------- 1 | const process = require("process") 2 | const path = require("path") 3 | // const fs = require("fs") 4 | const { simulateScript, decodeResult } = require("@chainlink/functions-toolkit") 5 | require("@chainlink/env-enc").config(); 6 | 7 | const simulate = async () => { 8 | // @dev Update this to point to your desired request config file. 9 | const requestConfigPath = path.join(process.cwd(), "request-config.js") 10 | console.log(`Using Functions request config file ${requestConfigPath}\n`) 11 | const requestConfig = require(requestConfigPath); 12 | 13 | // simulate: JavaScript execution locally. 14 | const { responseBytesHexstring, errorString, capturedTerminalOutput } = await simulateScript(requestConfig) 15 | console.log(`${capturedTerminalOutput}\n`) 16 | if (responseBytesHexstring) { 17 | console.log( 18 | `Response returned by script during local simulation: ${decodeResult( 19 | responseBytesHexstring, 20 | requestConfig.expectedReturnType 21 | ).toString()}\n` 22 | ) 23 | } 24 | if (errorString) { 25 | console.log(`Error returned by simulated script:\n${errorString}\n`) 26 | } 27 | }; 28 | 29 | simulate().catch((err) => { 30 | console.log("\nError running source simulator: ", err); 31 | }); -------------------------------------------------------------------------------- /src/Counter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.7.0; 3 | 4 | contract Counter { 5 | uint256 public number; 6 | 7 | function setNumber(uint256 newNumber) public { 8 | number = newNumber; 9 | } 10 | 11 | function increment() public { 12 | number++; 13 | } 14 | } -------------------------------------------------------------------------------- /tasks/billing/add.js: -------------------------------------------------------------------------------- 1 | const { SubscriptionManager } = require("@chainlink/functions-toolkit") 2 | const { networks } = require("../../networks") 3 | 4 | task("func-sub-add", "Adds a consumer contract to the Functions billing subscription") 5 | .addParam("subid", "Subscription ID") 6 | .addParam("contract", "Address of the Functions consumer contract to authorize for billing") 7 | .setAction(async (taskArgs) => { 8 | const consumerAddress = taskArgs.contract 9 | const subscriptionId = parseInt(taskArgs.subid) 10 | 11 | const signer = await ethers.getSigner() 12 | const linkTokenAddress = networks[network.name]["linkToken"] 13 | const functionsRouterAddress = networks[network.name]["functionsRouter"] 14 | const txOptions = { confirmations: networks[network.name].confirmations } 15 | 16 | const sm = new SubscriptionManager({ signer, linkTokenAddress, functionsRouterAddress }) 17 | await sm.initialize() 18 | 19 | console.log(`\nAdding ${consumerAddress} to subscription ${subscriptionId}...`) 20 | const addConsumerTx = await sm.addConsumer({ subscriptionId, consumerAddress, txOptions }) 21 | console.log(`Added consumer contract ${consumerAddress} in Tx: ${addConsumerTx.transactionHash}`) 22 | }) 23 | -------------------------------------------------------------------------------- /tasks/billing/index.js: -------------------------------------------------------------------------------- 1 | exports.create = require("./create") 2 | exports.fund = require("./fund") 3 | exports.add = require("./add") 4 | -------------------------------------------------------------------------------- /tasks/consumer/index.js: -------------------------------------------------------------------------------- 1 | exports.deployConsumer = require("./deploy.js") 2 | exports.requestData = require("./read.js") 3 | exports.requestData = require("./request.js") 4 | -------------------------------------------------------------------------------- /tasks/index.js: -------------------------------------------------------------------------------- 1 | exports.Consumer = require("./consumer") 2 | exports.Billing = require("./billing") 3 | -------------------------------------------------------------------------------- /tasks/utils/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require("./network.js"), 3 | ...require("./price.js"), 4 | ...require("./prompt.js"), 5 | ...require("./spin.js"), 6 | ...require("./logger.js"), 7 | } 8 | -------------------------------------------------------------------------------- /tasks/utils/logger.js: -------------------------------------------------------------------------------- 1 | const { Console } = require("console") 2 | const { Transform } = require("stream") 3 | 4 | function table(input) { 5 | // @see https://stackoverflow.com/a/67859384 6 | const ts = new Transform({ 7 | transform(chunk, enc, cb) { 8 | cb(null, chunk) 9 | }, 10 | }) 11 | const logger = new Console({ stdout: ts }) 12 | logger.table(input) 13 | const table = (ts.read() || "").toString() 14 | let result = "" 15 | for (let row of table.split(/[\r\n]+/)) { 16 | let r = row.replace(/[^┬]*┬/, "┌") 17 | r = r.replace(/^├─*┼/, "├") 18 | r = r.replace(/│[^│]*/, "") 19 | r = r.replace(/^└─*┴/, "└") 20 | r = r.replace(/'/g, " ") 21 | result += `${r}\n` 22 | } 23 | console.log(result) 24 | } 25 | 26 | const logger = { table } 27 | 28 | module.exports = { 29 | logger, 30 | } 31 | -------------------------------------------------------------------------------- /tasks/utils/network.js: -------------------------------------------------------------------------------- 1 | const BASE_URLS = { 2 | 1: "https://etherscan.io/", 3 | 137: "https://polygonscan.com/", 4 | 43114: "https://snowtrace.io/", 5 | 80001: "https://mumbai.polygonscan.com/", 6 | 11155111: "https://sepolia.etherscan.io/", 7 | 43113: "https://testnet.snowtrace.io/", 8 | 421614: "https://sepolia.arbiscan.io/", 9 | 42161: "https://arbiscan.io/", 10 | 84532: "https://sepolia.basescan.org/", 11 | 11155420: "https://sepolia-optimistic.etherscan.io/", 12 | } 13 | 14 | /** 15 | * Returns the Etherscan API domain for a given chainId. 16 | * 17 | * @param chainId Ethereum chain ID 18 | */ 19 | function getEtherscanURL(chainId) { 20 | const idNotFound = !Object.keys(BASE_URLS).includes(chainId.toString()) 21 | if (idNotFound) { 22 | throw new Error("Invalid chain Id") 23 | } 24 | return BASE_URLS[chainId] 25 | } 26 | 27 | module.exports = { 28 | getEtherscanURL, 29 | } 30 | -------------------------------------------------------------------------------- /tasks/utils/prompt.js: -------------------------------------------------------------------------------- 1 | const readline = require("readline") 2 | const chalk = require("chalk") 3 | 4 | function ask(query) { 5 | const rl = readline.createInterface({ 6 | input: process.stdin, 7 | output: process.stdout, 8 | }) 9 | 10 | return new Promise((resolve) => 11 | rl.question(query, (ans) => { 12 | rl.close() 13 | resolve(ans) 14 | }) 15 | ) 16 | } 17 | 18 | async function prompt(query) { 19 | if (!process.env.SKIP_PROMPTS) { 20 | if (query) console.log(`${query}\n`) 21 | const reply = await ask(`${chalk.green("Continue?")} Enter (y) Yes / (n) No\n`) 22 | if (reply.toLowerCase() !== "y" && reply.toLowerCase() !== "yes") { 23 | console.log("Aborted.") 24 | process.exit(1) 25 | } 26 | } 27 | } 28 | 29 | // async function promptId(query) { 30 | // if (!process.env.SKIP_PROMPTS) { 31 | // if (query) console.log(`${query}\n`) 32 | // const reply = await ask(`${chalk.green("Continue?")} Enter (y) Yes / (n) No\n`) 33 | // if (reply.toLowerCase() !== "y" && reply.toLowerCase() !== "yes") { 34 | // console.log("Aborted.") 35 | // process.exit(1) 36 | // } 37 | // } 38 | // } 39 | 40 | module.exports = { 41 | ask, 42 | prompt, 43 | // promptId, 44 | } 45 | -------------------------------------------------------------------------------- /tasks/utils/spin.js: -------------------------------------------------------------------------------- 1 | const ora = require("ora") 2 | 3 | function spin(config = {}) { 4 | const spinner = ora({ spinner: "dots2", ...config }) 5 | spinner.start() 6 | return spinner 7 | } 8 | 9 | module.exports = { 10 | spin, 11 | } 12 | -------------------------------------------------------------------------------- /test/Counter.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.13; 3 | 4 | import {Test, console} from "lib/forge-std/src/Test.sol"; 5 | import {Counter} from "../src/Counter.sol"; 6 | 7 | contract CounterTest is Test { 8 | Counter public counter; 9 | 10 | function setUp() public { 11 | counter = new Counter(); 12 | counter.setNumber(0); 13 | } 14 | 15 | function test_Increment() public { 16 | counter.increment(); 17 | assertEq(counter.number(), 1); 18 | } 19 | 20 | function testFuzz_SetNumber(uint256 x) public { 21 | counter.setNumber(x); 22 | assertEq(counter.number(), x); 23 | } 24 | } 25 | --------------------------------------------------------------------------------