diff --git a/public/samples/ChainlinkFunctions/AutomatedFunctionsConsumerExample.sol b/public/samples/ChainlinkFunctions/AutomatedFunctionsConsumerExample.sol index bea0f98f7df..84cf0827a23 100644 --- a/public/samples/ChainlinkFunctions/AutomatedFunctionsConsumerExample.sol +++ b/public/samples/ChainlinkFunctions/AutomatedFunctionsConsumerExample.sol @@ -50,7 +50,7 @@ contract AutomatedFunctionsConsumerExample is FunctionsClient, ConfirmedOwner { /// @notice Update the request settings /// @dev Only callable by the owner of the contract - /// @param _request The new encoded CBOR request to be set. The request is encoded off-chain + /// @param _request The new encoded CBOR request to be set. The request is encoded offchain /// @param _subscriptionId The new subscription ID to be set /// @param _gasLimit The new gas limit to be set /// @param _donID The new job ID to be set diff --git a/public/samples/ChainlinkFunctions/CustomAutomatedFunctionsConsumerExample.sol b/public/samples/ChainlinkFunctions/CustomAutomatedFunctionsConsumerExample.sol index 6b2b47cf006..519523200c7 100644 --- a/public/samples/ChainlinkFunctions/CustomAutomatedFunctionsConsumerExample.sol +++ b/public/samples/ChainlinkFunctions/CustomAutomatedFunctionsConsumerExample.sol @@ -87,7 +87,7 @@ contract CustomAutomatedFunctionsConsumerExample is /// @notice Update the request settings /// @dev Only callable by the owner of the contract - /// @param _request The new encoded CBOR request to be set. The request is encoded off-chain + /// @param _request The new encoded CBOR request to be set. The request is encoded offchain /// @param _subscriptionId The new subscription ID to be set /// @param _gasLimit The new gas limit to be set /// @param _donID The new job ID to be set diff --git a/public/samples/DataStreams/StreamsUpkeep.sol b/public/samples/DataStreams/StreamsUpkeep.sol index 403f758e948..9642ef925d3 100644 --- a/public/samples/DataStreams/StreamsUpkeep.sol +++ b/public/samples/DataStreams/StreamsUpkeep.sol @@ -44,7 +44,7 @@ contract StreamsUpkeep is ILogAutomation, StreamsLookupCompatibleInterface { uint32 observationsTimestamp; // Latest timestamp for which price is applicable uint192 nativeFee; // Base cost to validate a transaction using the report, denominated in the chain’s native token (WETH/ETH) uint192 linkFee; // Base cost to validate a transaction using the report, denominated in LINK - uint32 expiresAt; // Latest timestamp where the report can be verified on-chain + uint32 expiresAt; // Latest timestamp where the report can be verified onchain int192 price; // DON consensus median price, carried to 8 decimal places } @@ -54,7 +54,7 @@ contract StreamsUpkeep is ILogAutomation, StreamsLookupCompatibleInterface { uint32 observationsTimestamp; // Latest timestamp for which price is applicable uint192 nativeFee; // Base cost to validate a transaction using the report, denominated in the chain’s native token (WETH/ETH) uint192 linkFee; // Base cost to validate a transaction using the report, denominated in LINK - uint32 expiresAt; // Latest timestamp where the report can be verified on-chain + uint32 expiresAt; // Latest timestamp where the report can be verified onchain int192 price; // DON consensus median price, carried to 8 decimal places int192 bid; // Simulated price impact of a buy order up to the X% depth of liquidity utilisation int192 ask; // Simulated price impact of a sell order up to the X% depth of liquidity utilisation @@ -101,7 +101,7 @@ contract StreamsUpkeep is ILogAutomation, StreamsLookupCompatibleInterface { // The Data Streams report bytes is passed here. // extraData is context data from feed lookup process. // Your contract may include logic to further process this data. - // This method is intended only to be simulated off-chain by Automation. + // This method is intended only to be simulated offchain by Automation. // The data returned will then be passed by Automation into performUpkeep function checkCallback( bytes[] calldata values, @@ -110,7 +110,7 @@ contract StreamsUpkeep is ILogAutomation, StreamsLookupCompatibleInterface { return (true, abi.encode(values, extraData)); } - // function will be performed on-chain + // function will be performed onchain function performUpkeep(bytes calldata performData) external { // Decode the performData bytes passed in by CL Automation. // This contains the data returned by your implementation in checkCallback(). diff --git a/public/samples/Functions/adding-functions-to-projects/docs-source-example.js b/public/samples/Functions/adding-functions-to-projects/docs-source-example.js index 4dbe04c9753..49b8cf6ba3d 100644 --- a/public/samples/Functions/adding-functions-to-projects/docs-source-example.js +++ b/public/samples/Functions/adding-functions-to-projects/docs-source-example.js @@ -3,7 +3,7 @@ // Expects a different consumer contract than FunctionsConsumer.sol. // Modify your consumer contract before using this example. -// Arguments can be provided when a request is initiated on-chain and used in the request source code as shown below +// Arguments can be provided when a request is initiated onchain and used in the request source code as shown below const coinGeckoCoinId = args[0] const coinPaprikaCoinId = args[1] const badApiCoinId = args[2] diff --git a/public/samples/Functions/adding-functions-to-projects/example-source.js b/public/samples/Functions/adding-functions-to-projects/example-source.js index fd7c53778f1..fcf7246090f 100644 --- a/public/samples/Functions/adding-functions-to-projects/example-source.js +++ b/public/samples/Functions/adding-functions-to-projects/example-source.js @@ -5,7 +5,7 @@ // Refer to https://github.com/smartcontractkit/functions-hardhat-starter-kit#javascript-code -// Arguments can be provided when a request is initated on-chain and used in the request source code as shown below +// Arguments can be provided when a request is initated onchain and used in the request source code as shown below const fromSymbol = args[0] const toSymbol = args[1] diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index e4014117234..2c1adcf5380 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -94,11 +94,11 @@ export const SIDEBAR: Partial> = { url: "data-feeds/solana", }, { - title: "Using Data Feeds Off-Chain", + title: "Using Data Feeds Offchain", url: "data-feeds/solana/using-data-feeds-off-chain", }, { - title: "Using Data Feeds On-Chain", + title: "Using Data Feeds Onchain", url: "data-feeds/solana/using-data-feeds-solana", }, ], @@ -171,7 +171,7 @@ export const SIDEBAR: Partial> = { url: "architecture-overview/architecture-decentralized-model?parent=dataFeeds", }, { - title: "Off-Chain Reporting", + title: "Offchain Reporting", url: "architecture-overview/off-chain-reporting?parent=dataFeeds", }, ], @@ -278,7 +278,7 @@ export const SIDEBAR: Partial> = { url: "architecture-overview/architecture-decentralized-model?parent=dataStreams", }, { - title: "Off-Chain Reporting", + title: "Offchain Reporting", url: "architecture-overview/off-chain-reporting?parent=dataStreams", }, ], @@ -445,7 +445,7 @@ export const SIDEBAR: Partial> = { url: "architecture-overview/architecture-decentralized-model?parent=automation", }, { - title: "Off-Chain Reporting", + title: "Offchain Reporting", url: "architecture-overview/off-chain-reporting?parent=automation", }, ], @@ -636,7 +636,7 @@ export const SIDEBAR: Partial> = { url: "architecture-overview/architecture-decentralized-model?parent=chainlinkFunctions", }, { - title: "Off-Chain Reporting", + title: "Offchain Reporting", url: "architecture-overview/off-chain-reporting?parent=chainlinkFunctions", }, ], @@ -790,7 +790,7 @@ export const SIDEBAR: Partial> = { url: "architecture-overview/architecture-decentralized-model?parent=vrf", }, { - title: "Off-Chain Reporting", + title: "Offchain Reporting", url: "architecture-overview/off-chain-reporting?parent=vrf", }, ], @@ -976,7 +976,7 @@ export const SIDEBAR: Partial> = { url: "architecture-overview/architecture-decentralized-model?parent=ccip", }, { - title: "Off-Chain Reporting", + title: "Offchain Reporting", url: "architecture-overview/off-chain-reporting?parent=ccip", }, ], @@ -1277,7 +1277,7 @@ export const SIDEBAR: Partial> = { url: "architecture-overview/architecture-decentralized-model", }, { - title: "Off-Chain Reporting", + title: "Offchain Reporting", url: "architecture-overview/off-chain-reporting", }, ], diff --git a/src/content/any-api/api-reference.mdx b/src/content/any-api/api-reference.mdx index 36a96805422..c4832f9e5c5 100644 --- a/src/content/any-api/api-reference.mdx +++ b/src/content/any-api/api-reference.mdx @@ -360,7 +360,7 @@ function expectResponseFor(bytes32 _requestId) @@ -379,7 +379,7 @@ In case an oracle node does not respond, it may be necessary to retrieve the LIN The default expiration for a request is five minutes, after which it can be cancelled. The cancellation must be sent by the address which was specified as the callback location of the contract. -For the sake of efficient gas usage, only a hash of the request's parameters are stored on-chain. In order to validate the terms of the request and that it can be calculated, the request parameters must be provided. Additionally, cancellation must be called by the address which the callback would otherwise have been called on. +For the sake of efficient gas usage, only a hash of the request's parameters are stored onchain. In order to validate the terms of the request and that it can be calculated, the request parameters must be provided. Additionally, cancellation must be called by the address which the callback would otherwise have been called on. `cancelChainlinkRequest` emits a [ChainlinkCancelled](#chainlinkcancelled) event. @@ -560,7 +560,7 @@ library Chainlink { The Chainlink Request struct encapsulates all of the fields needed for a Chainlink request and its corresponding response callback. -The Chainlink protocol aims to be flexible and not restrict application developers. The Solidity Chainlink Request model is a great example of that. It is exceptionally flexible, given the limitations of Solidity. The request can contain an arbitrary amount of keys and values to be passed off-chain to the oracles for each request. It does so by converting the parameters into CBOR, and then storing them in a buffer. This allows for any number of parameters all of different types to be encoded on-chain. +The Chainlink protocol aims to be flexible and not restrict application developers. The Solidity Chainlink Request model is a great example of that. It is exceptionally flexible, given the limitations of Solidity. The request can contain an arbitrary amount of keys and values to be passed offchain to the oracles for each request. It does so by converting the parameters into CBOR, and then storing them in a buffer. This allows for any number of parameters all of different types to be encoded onchain. The request's ID is generated by hashing the sender's address and the request's nonce. This scheme ensures that only the requester can generate their request ID, and no other contract can trigger a response from an oracle with that ID. New requests whose IDs match an unfulfilled request ID will not be accepted by the oracle. @@ -745,7 +745,7 @@ function setBuffer( ) ``` -Set the CBOR payload directly on the request object, avoiding the cost of encoding the parameters in CBOR. This can be helpful when reading the bytes from storage or having them passed in from off-chain where they were pre-encoded. +Set the CBOR payload directly on the request object, avoiding the cost of encoding the parameters in CBOR. This can be helpful when reading the bytes from storage or having them passed in from offchain where they were pre-encoded. {/* prettier-ignore */} ```solidity @@ -762,6 +762,6 @@ function requestPrice(bytes _cbor) diff --git a/src/content/any-api/get-request/examples/existing-job-request.mdx b/src/content/any-api/get-request/examples/existing-job-request.mdx index 106e27d55e8..ebeef7fe7c1 100644 --- a/src/content/any-api/get-request/examples/existing-job-request.mdx +++ b/src/content/any-api/get-request/examples/existing-job-request.mdx @@ -30,7 +30,7 @@ Using an _existing_ Oracle Job makes your smart contract code more succinct. Thi ## Example -In [Single Word Response Example](/any-api/get-request/examples/single-word-response), the example contract code declared which URL to use, where to find the data in the response, and how to convert it so that it can be represented on-chain. +In [Single Word Response Example](/any-api/get-request/examples/single-word-response), the example contract code declared which URL to use, where to find the data in the response, and how to convert it so that it can be represented onchain. This example uses an existing job that is pre-configured to make requests to get [the gas price](https://docs.etherscan.io/api-endpoints/gas-tracker#get-gas-oracle). Using specialized jobs makes your contracts succinct and more simple. diff --git a/src/content/any-api/getting-started.mdx b/src/content/any-api/getting-started.mdx index d097cfd3561..8684a3cc8a3 100644 --- a/src/content/any-api/getting-started.mdx +++ b/src/content/any-api/getting-started.mdx @@ -4,7 +4,7 @@ date: Last Modified title: "Getting Started with Any API" excerpt: "Calling APIs from Smart Contracts" whatsnext: - { "Learn how to bring data on-chain and do off-chain computation using Chainlink Functions": "/chainlink-functions" } + { "Learn how to bring data onchain and do offchain computation using Chainlink Functions": "/chainlink-functions" } metadata: image: "/files/04b8e56-cl.png" --- @@ -33,7 +33,7 @@ The request and receive cycle describes how a smart contract requests data from For contracts that use [Chainlink VRF](/vrf), you request randomness from a VRF oracle and then await the response. The fulfillment function is already given to us from the `VRFConsumerBase` contract, so oracles already know where to send the response to. However, with API calls, the contract itself _defines_ which function it wants to receive the response to. -Before creating any code, you should understand how Oracle jobs can get data on-chain. +Before creating any code, you should understand how Oracle jobs can get data onchain. ## What are jobs? diff --git a/src/content/any-api/introduction.mdx b/src/content/any-api/introduction.mdx index c8e9240325b..8070413acc9 100644 --- a/src/content/any-api/introduction.mdx +++ b/src/content/any-api/introduction.mdx @@ -30,7 +30,7 @@ import { Aside } from "@components" documentation](/chainlink-functions) to learn more. -**Connecting to any API** with Chainlink enables your contracts to access to _any_ external data source through our decentralized oracle network. We understand making smart contracts compatible with off-chain data adds to the complexity of building smart contracts. We created a framework with minimal requirements, yet unbounded flexibility, so developers can focus more on the functionality of smart contracts rather than what feeds them. Chainlink’s decentralized oracle network provides smart contracts with the ability to push and pull data, facilitating the interoperability between on-chain and off-chain applications. +**Connecting to any API** with Chainlink enables your contracts to access to _any_ external data source through our decentralized oracle network. We understand making smart contracts compatible with offchain data adds to the complexity of building smart contracts. We created a framework with minimal requirements, yet unbounded flexibility, so developers can focus more on the functionality of smart contracts rather than what feeds them. Chainlink’s decentralized oracle network provides smart contracts with the ability to push and pull data, facilitating the interoperability between onchain and offchain applications. Whether your contract requires sports results, the latest weather, or any other publicly available data, the [Chainlink contract library](https://github.com/smartcontractkit/chainlink/tree/master/contracts) provides the tools required for your contract to consume it. @@ -42,9 +42,9 @@ If your smart contracts need access to price feed data, try using [Chainlink Dat -### Requesting off-chain data +### Requesting offchain data -Outlined below are multiple ways developers can connect smart contracts to off-chain data feeds. Click a request type to learn more about it: +Outlined below are multiple ways developers can connect smart contracts to offchain data feeds. Click a request type to learn more about it: | Request Type | Description | | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | diff --git a/src/content/architecture-overview/architecture-decentralized-model.mdx b/src/content/architecture-overview/architecture-decentralized-model.mdx index f91951cb99d..eb87f47acec 100644 --- a/src/content/architecture-overview/architecture-decentralized-model.mdx +++ b/src/content/architecture-overview/architecture-decentralized-model.mdx @@ -5,7 +5,7 @@ title: "Decentralized Data Model" whatsnext: { "Using Data Feeds": "/data-feeds/price-feeds/", - "Off-Chain Reporting": "/architecture-overview/off-chain-reporting/", + "Offchain Reporting": "/architecture-overview/off-chain-reporting/", } metadata: title: "Chainlink Decentralised Data Model" @@ -19,9 +19,9 @@ This page describes how data aggregation is applied to produce Chainlink Data Fe ## Data Aggregation -Each data feed is updated by multiple, independent Chainlink oracle operators. The [AccessControlledOffchainAggregator](https://github.com/smartcontractkit/libocr/blob/master/contract/AccessControlledOffchainAggregator.sol) aggregates the data on-chain. +Each data feed is updated by multiple, independent Chainlink oracle operators. The [AccessControlledOffchainAggregator](https://github.com/smartcontractkit/libocr/blob/master/contract/AccessControlledOffchainAggregator.sol) aggregates the data onchain. -Off-Chain Reporting (OCR) further enhances the aggregation process. To learn more about OCR and how it works, see the [Off-Chain Reporting](/architecture-overview/off-chain-reporting) page. +Offchain Reporting (OCR) further enhances the aggregation process. To learn more about OCR and how it works, see the [Offchain Reporting](/architecture-overview/off-chain-reporting) page. @@ -56,21 +56,21 @@ AggregatorV3Interface feed = AggregatorV3Interface(address); return feed.latestRoundData(); ``` -Off-chain applications can also consume data feeds. See the Javascript and Python example code on the [Using Data Feeds](/data-feeds/price-feeds) page to learn more. +Offchain applications can also consume data feeds. See the Javascript and Python example code on the [Using Data Feeds](/data-feeds/price-feeds) page to learn more. ### Proxy -Proxy contracts are on-chain proxies that point to the aggregator for a particular data feed. Using proxies enables the underlying aggregator to be upgraded without any service interruption to consuming contracts. +Proxy contracts are onchain proxies that point to the aggregator for a particular data feed. Using proxies enables the underlying aggregator to be upgraded without any service interruption to consuming contracts. Proxy contracts can vary from one data feed to another, but the [`AggregatorProxy.sol` contract](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.7/dev/AggregatorProxy.sol) on Github is a common example. ### Aggregator -An aggregator is the contract that receives periodic data updates from the oracle network. Aggregators store aggregated data on-chain so that consumers can retrieve it and act upon it within the same transaction. +An aggregator is the contract that receives periodic data updates from the oracle network. Aggregators store aggregated data onchain so that consumers can retrieve it and act upon it within the same transaction. You can access this data using the Data Feed address and the [`AggregatorV3Interface` contract](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol). Aggregators receive updates from the oracle network only when the **Deviation Threshold** or **Heartbeat Threshold** triggers an update during an aggregation round. The first condition that is met triggers an update to the data. -- Deviation Threshold: A new aggregation round starts when a node identifies that the off-chain values deviate by more than the defined deviation threshold from the on-chain value. Individual nodes monitor one or more data providers for each feed. +- Deviation Threshold: A new aggregation round starts when a node identifies that the off-chain values deviate by more than the defined deviation threshold from the onchain value. Individual nodes monitor one or more data providers for each feed. - Heartbeat Threshold: A new aggregation round starts after a specified amount of time from the last update. diff --git a/src/content/architecture-overview/architecture-overview.mdx b/src/content/architecture-overview/architecture-overview.mdx index c0e35c4447d..8db16505ef4 100644 --- a/src/content/architecture-overview/architecture-overview.mdx +++ b/src/content/architecture-overview/architecture-overview.mdx @@ -6,7 +6,7 @@ whatsnext: { "Basic Request Model": "/architecture-overview/architecture-request-model/", "Decentralized Data Model": "/architecture-overview/architecture-decentralized-model/", - "Off-Chain Reporting": "/architecture-overview/off-chain-reporting/", + "Offchain Reporting": "/architecture-overview/off-chain-reporting/", } metadata: title: "Data Feeds Architecture" @@ -16,18 +16,18 @@ metadata: Chainlink connects smart contracts with external data using its decentralized oracle network. Chainlink API requests are handled 1:1 by an oracle. -The [Basic Request Model](/architecture-overview/architecture-request-model) describes the on-chain architecture of requesting data from a single oracle source. +The [Basic Request Model](/architecture-overview/architecture-request-model) describes the onchain architecture of requesting data from a single oracle source. To learn how to make a GET request using a single oracle, see [Make a GET Request](/any-api/get-request/introduction). ## Decentralized Data Model -For a more robust and trustworthy answer, you can aggregate data from many oracles. With on-chain aggregation, data is aggregated from a decentralized network of independent oracle nodes. This architecture is applied to Chainlink Data Feeds, which can aggregate data such as asset price data. +For a more robust and trustworthy answer, you can aggregate data from many oracles. With onchain aggregation, data is aggregated from a decentralized network of independent oracle nodes. This architecture is applied to Chainlink Data Feeds, which can aggregate data such as asset price data. The [Decentralized Data Model](/architecture-overview/architecture-decentralized-model) describes how data is aggregated, and how consumer contracts can retrieve this data. -## Off-Chain Reporting +## Offchain Reporting -Off-Chain Reporting (OCR) is an improvement on the decentralization and scalability of Chainlink networks. With our Off-Chain Reporting aggregators, all nodes communicate using a peer to peer network. During the communication process, a lightweight consensus algorithm runs where each node reports its price observation and signs it. A single aggregate transaction is then transmitted, which saves a significant amount of gas. +Offchain Reporting (OCR) is an improvement on the decentralization and scalability of Chainlink networks. With our Offchain Reporting aggregators, all nodes communicate using a peer to peer network. During the communication process, a lightweight consensus algorithm runs where each node reports its price observation and signs it. A single aggregate transaction is then transmitted, which saves a significant amount of gas. -To learn more about OCR and how it works, see the [Off-Chain Reporting](/architecture-overview/off-chain-reporting) page. +To learn more about OCR and how it works, see the [Offchain Reporting](/architecture-overview/off-chain-reporting) page. diff --git a/src/content/architecture-overview/architecture-request-model.mdx b/src/content/architecture-overview/architecture-request-model.mdx index b819175650e..1e24846cd5a 100644 --- a/src/content/architecture-overview/architecture-request-model.mdx +++ b/src/content/architecture-overview/architecture-request-model.mdx @@ -6,7 +6,7 @@ whatsnext: { "Make a GET Request": "/any-api/get-request/introduction/", "Decentralized Data Model": "/architecture-overview/architecture-decentralized-model/", - "Off-Chain Reporting": "/architecture-overview/off-chain-reporting/", + "Offchain Reporting": "/architecture-overview/off-chain-reporting/", } metadata: title: "Chainlink Basic Request Model" @@ -36,7 +36,7 @@ Learn more about [ERC-677 and the LINK token](/resources/link-token-contracts). ### Oracle Contract -[`Oracle` contracts](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.6/Oracle.sol) are owned by oracle node operators, which run alongside off-chain oracle nodes. +[`Oracle` contracts](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.6/Oracle.sol) are owned by oracle node operators, which run alongside offchain oracle nodes. #### Request @@ -48,15 +48,15 @@ The client contract that initiates this cycle must create a request with the fol To learn about how to find oracles to suit your needs, see [Find Existing Jobs](/any-api/find-oracle). -Oracle contracts are responsible for handling on-chain requests made through the LINK token, by implementing `onTokenTransfer` as a `LinkTokenReceiver`. Upon execution of this function, the oracle contract **emits an `OracleRequest` event** containing information about the request. This event is crucial, as it is monitored by the off-chain oracle node which acts upon it. +Oracle contracts are responsible for handling onchain requests made through the LINK token, by implementing `onTokenTransfer` as a `LinkTokenReceiver`. Upon execution of this function, the oracle contract **emits an `OracleRequest` event** containing information about the request. This event is crucial, as it is monitored by the offchain oracle node which acts upon it. #### Fulfillment For fulfillment, the oracle contract has a `fulfillOracleRequest` function which is used by the node to fulfill a request once it has the result of the job. This function returns the result to the `ChainlinkClient` using the callback function defined in the original request. -### Off-Chain Oracle Node +### Offchain Oracle Node -The off-chain oracle node is responsible for listening for events emitted by its corresponding on-chain smart contract. Once it detects an `OracleRequest` event, it uses the data emitted to perform a job. +The offchain oracle node is responsible for listening for events emitted by its corresponding onchain smart contract. Once it detects an `OracleRequest` event, it uses the data emitted to perform a job. The most common job type for a Node is to make a GET request to an API, retrieve some data from it, parse the response, convert the result into blockchain compatible data, then submit it in a transaction back to the oracle contract, using the `fulfillOracleRequest` function. diff --git a/src/content/architecture-overview/off-chain-reporting.mdx b/src/content/architecture-overview/off-chain-reporting.mdx index c9eebf43d68..0c06896073d 100644 --- a/src/content/architecture-overview/off-chain-reporting.mdx +++ b/src/content/architecture-overview/off-chain-reporting.mdx @@ -1,7 +1,7 @@ --- section: global date: Last Modified -title: "Off-Chain Reporting" +title: "Offchain Reporting" whatsnext: { "Using Data Feeds": "/data-feeds/price-feeds/" } metadata: image: "/files/fb73165-cl.png" @@ -9,11 +9,11 @@ metadata: import { Aside } from "@components" -Off-Chain Reporting (OCR) is a significant step towards increasing the decentralization and scalability of Chainlink networks. See the [OCR Protocol Paper](https://research.chain.link/ocr.pdf) for a technical deep dive. +Offchain Reporting (OCR) is a significant step towards increasing the decentralization and scalability of Chainlink networks. See the [OCR Protocol Paper](https://research.chain.link/ocr.pdf) for a technical deep dive. -For Off-Chain Reporting aggregators, all nodes communicate using a peer to peer network. During the communication process, a lightweight consensus algorithm runs where each node reports its data observation and signs it. A single aggregate transaction is then transmitted, which saves a significant amount of gas. +For Offchain Reporting aggregators, all nodes communicate using a peer to peer network. During the communication process, a lightweight consensus algorithm runs where each node reports its data observation and signs it. A single aggregate transaction is then transmitted, which saves a significant amount of gas. -The report contained in the aggregate transaction is signed by a quorum of oracles and contains all oracles' observations. By validating the report on-chain and checking the quorum's signatures on-chain, we preserve the trustlessness properties of Chainlink oracle networks. +The report contained in the aggregate transaction is signed by a quorum of oracles and contains all oracles' observations. By validating the report onchain and checking the quorum's signatures onchain, we preserve the trustlessness properties of Chainlink oracle networks. ## What is OCR? @@ -25,18 +25,18 @@ The report contained in the aggregate transaction is signed by a quorum of oracl fees and all effort the carrier associates with transporting 9 fewer boxes. -The OCR protocol allows nodes to aggregate their observations into a single report off-chain using a secure P2P network. A single node then submits a transaction with the aggregated report to the chain. Each report consists of many nodes' observations and has to be signed by a quorum of nodes. These signatures are verified on-chain. +The OCR protocol allows nodes to aggregate their observations into a single report offchain using a secure P2P network. A single node then submits a transaction with the aggregated report to the chain. Each report consists of many nodes' observations and has to be signed by a quorum of nodes. These signatures are verified onchain. Submitting only one transaction per round achieves the following benefits: - Overall network congestion from Chainlink oracle networks is reduced dramatically - Individual node operators spend far less on gas costs - Node networks are more scalable because data feeds can accommodate more nodes -- Data feeds can be updated in a more timely manner since each round needn't wait for multiple transactions to be confirmed before a price is confirmed on-chain. +- Data feeds can be updated in a more timely manner since each round needn't wait for multiple transactions to be confirmed before a price is confirmed onchain. ## How does OCR work? -Protocol execution happens mostly off-chain over a peer to peer network between Chainlink nodes. The nodes regularly elect a new leader node that drives the rest of the protocol. +Protocol execution happens mostly offchain over a peer to peer network between Chainlink nodes. The nodes regularly elect a new leader node that drives the rest of the protocol. The leader regularly requests followers to provide freshly signed observations and aggregates them into a report. It then sends this report back to the followers and asks them to verify the report's validity. If a quorum of followers approves the report by sending a signed copy back to the leader, the leader assembles a final report with the quorum's signatures and broadcasts it to all followers. diff --git a/src/content/ccip/architecture.mdx b/src/content/ccip/architecture.mdx index b8d36099b09..cd15e45cc78 100644 --- a/src/content/ccip/architecture.mdx +++ b/src/content/ccip/architecture.mdx @@ -54,7 +54,7 @@ The figure below outlines the different components involved in a cross-chain tra -### On-chain components +### Onchain components #### Router @@ -101,7 +101,7 @@ Token pools provide rate limiting, which is a security feature enabling token is The Risk Management contract maintains the list of Risk Management node addresses that are allowed to bless or curse. The contract also holds the quorum logic for blessing a committed Merkle Root and cursing CCIP on a destination blockchain. Read the [Risk Management Network Concepts](/ccip/concepts#risk-management-network) section to learn more. -### Off-chain Components +### Offchain Components #### Committing DON diff --git a/src/content/ccip/best-practices.mdx b/src/content/ccip/best-practices.mdx index 61eca49b101..25684a0ed46 100644 --- a/src/content/ccip/best-practices.mdx +++ b/src/content/ccip/best-practices.mdx @@ -49,7 +49,7 @@ To estimate the accurate gas limit for your destination contract, consider the f ## Using `extraArgs` -The purpose of `extraArgs` is to allow compatibility with future CCIP upgrades. To get this benefit, make sure that `extraArgs` is mutable in production deployments. This allows you to build it off-chain and pass it in a call to a function or store it in a variable that you can update on-demand. +The purpose of `extraArgs` is to allow compatibility with future CCIP upgrades. To get this benefit, make sure that `extraArgs` is mutable in production deployments. This allows you to build it offchain and pass it in a call to a function or store it in a variable that you can update on-demand. If `extraArgs` are left empty, a default of _200000_ `gasLimit` will be set. diff --git a/src/content/ccip/concepts.mdx b/src/content/ccip/concepts.mdx index f4862512379..d76fa692879 100644 --- a/src/content/ccip/concepts.mdx +++ b/src/content/ccip/concepts.mdx @@ -33,7 +33,7 @@ To learn more, read about [blockchain interoperability](https://chain.link/educa ## Finality -**Finality** is the assurance that past transactions included on-chain are extremely difficult or impossible to revert. If the parameters for finality are properly set, the likelihood of reversibility is extremely low. For CCIP, source chain finality is the main factor that determines the end-to-end elapsed time for CCIP to send a message from one chain to another. +**Finality** is the assurance that past transactions included onchain are extremely difficult or impossible to revert. If the parameters for finality are properly set, the likelihood of reversibility is extremely low. For CCIP, source chain finality is the main factor that determines the end-to-end elapsed time for CCIP to send a message from one chain to another. Finality varies across different networks. Some networks offer instant finality and others require multiple confirmations. These time differences are set to ensure the security of CCIP and its users. Finality is crucial for token transfers because funds are locked and not reorganized once they are released onto the destination chain. In this scenario, finality ensures that funds on the destination chain are available only after they have been successfully committed on the source chain. @@ -43,16 +43,16 @@ A Chainlink CCIP _lane_ is a distinct pathway between a source and a destination ## Decentralized Oracle Network (DON) -Chainlink Decentralized Oracle Networks, or **DONs**, run [Chainlink OCR2](/architecture-overview/off-chain-reporting). The protocol runs in rounds during which an observed data value might be agreed upon. The output of this process results in a _report_ which is attested to by a quorum of participants. The report is then _transmitted_ on-chain by one of the participants. No single participant is responsible for transmitting on every round, and all of them will attempt to do so in a round-robin fashion until a transmission has taken place. In the context of CCIP, a [lane](#lane) contains two OCR DON committees that monitor transactions between a source and destination blockchain: the **Committing DON** and **Executing DON**. Read the [Architecture page](/ccip/architecture) to learn more. +Chainlink Decentralized Oracle Networks, or **DONs**, run [Chainlink OCR2](/architecture-overview/off-chain-reporting). The protocol runs in rounds during which an observed data value might be agreed upon. The output of this process results in a _report_ which is attested to by a quorum of participants. The report is then _transmitted_ onchain by one of the participants. No single participant is responsible for transmitting on every round, and all of them will attempt to do so in a round-robin fashion until a transmission has taken place. In the context of CCIP, a [lane](#lane) contains two OCR DON committees that monitor transactions between a source and destination blockchain: the **Committing DON** and **Executing DON**. Read the [Architecture page](/ccip/architecture) to learn more. ## Risk Management Network -The Risk Management Network is built using off-chain and on-chain components: +The Risk Management Network is built using offchain and onchain components: -- **[Off-chain](#off-chain-risk-management-node):** Several Risk Management nodes continually monitor all supported chains against abnormal activities -- **[On-chain](#on-chain-risk-management-contract):** One Risk Management contract per supported CCIP chain +- **[Offchain](#offchain-risk-management-node):** Several Risk Management nodes continually monitor all supported chains against abnormal activities +- **[onchain](#onchain-risk-management-contract):** One Risk Management contract per supported CCIP chain -### Off-chain Risk Management node +### Offchain Risk Management node The Risk Management Network is a secondary validation service parallel to the primary CCIP system. It doesn't run the same codebase as the [DON](#decentralized-oracle-network-don) to mitigate against security vulnerabilities that might affect the DON's codebase. The Risk Management Network has two main modes of operation: @@ -65,7 +65,7 @@ The Risk Management Network has two main modes of operation: - **Execution safety violation:** A message is executed on the destination chain without any matching transaction being on the source chain. Double executions fall into this category since the executing DON can only execute a message once. -### On-chain Risk Management contract +### Onchain Risk Management contract There is one Risk Management contract for each supported destination chain. The Risk Management contract maintains a group of nodes authorized to participate in the Risk Management blessing/cursing. diff --git a/src/content/ccip/getting-started.mdx b/src/content/ccip/getting-started.mdx index a0262ee0ded..0388a55c41b 100644 --- a/src/content/ccip/getting-started.mdx +++ b/src/content/ccip/getting-started.mdx @@ -197,7 +197,7 @@ The `sendMessage` function completes several operations: This example is simplified for learning purposes. For production code, use the following best practices: - Do not hardcode `extraArgs`: To simplify the example, `extraArgs` are hardcoded in the contract. The recommendation - is to make sure `extraArgs` is mutable. For example, you can build `extraArgs` off-chain and pass it in your functions call + is to make sure `extraArgs` is mutable. For example, you can build `extraArgs` offchain and pass it in your functions call or store it in a storage variable that you can update on demand. Thus, you can make sure `extraArgs` remains backward compatible for future CCIP upgrades. - Validate the destination chain. diff --git a/src/content/ccip/index.mdx b/src/content/ccip/index.mdx index b4fa9356137..e6762904832 100644 --- a/src/content/ccip/index.mdx +++ b/src/content/ccip/index.mdx @@ -44,7 +44,7 @@ The _Chainlink Cross-Chain Interoperability Protocol (CCIP)_ provides these capa Chainlink CCIP provides a single simple interface through which dApps and web3 entrepreneurs can securely meet all their cross-chain needs. You can use CCIP to transfer data, tokens, or both data and tokens across chains. -Given the [inherent risks of cross-chain interoperability](/resources/bridge-risks), CCIP is built with a security-first mindset. Some security features include a [Risk Management Network](/ccip/concepts#risk-management-network) that monitors for malicious activity, decentralized oracle computation from a wide range of high-quality node operators with verifiable on-chain performance histories, and the off-chain reporting ([OCR](/architecture-overview/off-chain-reporting)) protocol, which already secures significant value on several mainnet blockchains. +Given the [inherent risks of cross-chain interoperability](/resources/bridge-risks), CCIP is built with a security-first mindset. Some security features include a [Risk Management Network](/ccip/concepts#risk-management-network) that monitors for malicious activity, decentralized oracle computation from a wide range of high-quality node operators with verifiable onchain performance histories, and the offchain reporting ([OCR](/architecture-overview/off-chain-reporting)) protocol, which already secures significant value on several mainnet blockchains. diff --git a/src/content/ccip/tutorials/cross-chain-tokens-from-eoa.mdx b/src/content/ccip/tutorials/cross-chain-tokens-from-eoa.mdx index fb20a80df02..433b5721b3a 100644 --- a/src/content/ccip/tutorials/cross-chain-tokens-from-eoa.mdx +++ b/src/content/ccip/tutorials/cross-chain-tokens-from-eoa.mdx @@ -75,7 +75,7 @@ In this tutorial, you will use Chainlink CCIP to transfer tokens directly from y - `POLYGON_MUMBAI_RPC_URL`: Set a URL for the _Polygon Mumbai_ testnet. You can sign up for a personal endpoint from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node provider service. - - `PRIVATE_KEY`: Find the private key for your testnet wallet. If you use MetaMask, follow the instructions to [Export a Private Key](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key).**Note**: The off-chain script uses your private key to sign any transactions you make such as transferring tokens. + - `PRIVATE_KEY`: Find the private key for your testnet wallet. If you use MetaMask, follow the instructions to [Export a Private Key](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key).**Note**: The offchain script uses your private key to sign any transactions you make such as transferring tokens. ```shell npx env-enc set diff --git a/src/content/chainlink-automation/concepts/automation-concepts.mdx b/src/content/chainlink-automation/concepts/automation-concepts.mdx index 046e9d53e43..045e6763104 100644 --- a/src/content/chainlink-automation/concepts/automation-concepts.mdx +++ b/src/content/chainlink-automation/concepts/automation-concepts.mdx @@ -20,10 +20,10 @@ Before you explore how Chainlink Automation works on the [architecture](/chainli ## Upkeeps and triggers -These are the jobs or tasks that you execute on-chain. For example, you can call a smart contract function if a specific set of conditions are met. These specific conditions are called _triggers_. There are currently three types of triggers that the Chainlink Automation Network supports including: +These are the jobs or tasks that you execute onchain. For example, you can call a smart contract function if a specific set of conditions are met. These specific conditions are called _triggers_. There are currently three types of triggers that the Chainlink Automation Network supports including: - [**Time-based trigger**](/chainlink-automation/guides/job-scheduler): Use a [time-based trigger](/chainlink-automation/guides/job-scheduler) to execute your function according to a time schedule. This feature is also called the Job Scheduler and it is a throwback to the Ethereum Alarm Clock. Time-based trigger contracts do not need to be [compatible](/chainlink-automation/guides/compatible-contracts) with the `AutomationCompatibleInterface` contract. -- [**Custom logic trigger**](/chainlink-automation/guides/register-upkeep): Use a [custom logic trigger](/chainlink-automation/guides/register-upkeep) to provide custom solidity logic that Automation Nodes evaluate (off-chain) to determine when to execute your function on-chain. Your contract must meet the requirements to be [compatible](/chainlink-automation/guides/compatible-contracts) with the `AutomationCompatibleInterface` contract. Custom logic examples include checking the balance on a contract, only executing limit orders when their levels are met, any one of our [coded examples](/chainlink-automation/util-overview), and many more. +- [**Custom logic trigger**](/chainlink-automation/guides/register-upkeep): Use a [custom logic trigger](/chainlink-automation/guides/register-upkeep) to provide custom solidity logic that Automation Nodes evaluate (offchain) to determine when to execute your function onchain. Your contract must meet the requirements to be [compatible](/chainlink-automation/guides/compatible-contracts) with the `AutomationCompatibleInterface` contract. Custom logic examples include checking the balance on a contract, only executing limit orders when their levels are met, any one of our [coded examples](/chainlink-automation/util-overview), and many more. - [**Log trigger**](/chainlink-automation/guides/log-trigger): Use log data as both trigger and input. Your contract must meet the requirements to be [compatible](/chainlink-automation/guides/compatible-contracts) with the `AutomationCompatibleInterface` contract. ## Automation nodes diff --git a/src/content/chainlink-automation/concepts/best-practice.mdx b/src/content/chainlink-automation/concepts/best-practice.mdx index aec642fdcab..7319879884b 100644 --- a/src/content/chainlink-automation/concepts/best-practice.mdx +++ b/src/content/chainlink-automation/concepts/best-practice.mdx @@ -22,7 +22,7 @@ If your upkeep performs **sensitive** functions in your protocol, consider using ### Verify Data Streams reports fetched with StreamsLookup -If your upkeep uses [StreamsLookup](/chainlink-automation/reference/automation-interfaces#streamslookupcompatibleinterface), ensure you use the [verification interface](/data-streams/reference/interfaces) to verify your reports on-chain. +If your upkeep uses [StreamsLookup](/chainlink-automation/reference/automation-interfaces#streamslookupcompatibleinterface), ensure you use the [verification interface](/data-streams/reference/interfaces) to verify your reports onchain. ### Avoid "flickering" custom logic upkeeps diff --git a/src/content/chainlink-automation/guides/compatible-contracts.mdx b/src/content/chainlink-automation/guides/compatible-contracts.mdx index ae46c995957..745a4cac794 100644 --- a/src/content/chainlink-automation/guides/compatible-contracts.mdx +++ b/src/content/chainlink-automation/guides/compatible-contracts.mdx @@ -29,7 +29,7 @@ A contract is Automation-compatible when it follows a specified interface that a The interface you use will depend on the type of trigger you want to use: - If you want a log event to trigger your upkeep, use the [`ILogAutomation`](/chainlink-automation/reference/automation-interfaces/#ilogautomation) interface. -- If you want to use on-chain state in a custom calculation to trigger your upkeep, use [`AutomationCompatibleInterface`](/chainlink-automation/reference/automation-interfaces/#automationcompatibleinterface) interface. +- If you want to use onchain state in a custom calculation to trigger your upkeep, use [`AutomationCompatibleInterface`](/chainlink-automation/reference/automation-interfaces/#automationcompatibleinterface) interface. - If you want to call a function just based on time, you don't need an interface. Consider instead using a [time-based upkeep](/chainlink-automation/guides/job-scheduler). - If you want to use Automation with Data Streams, use [`StreamsLookupCompatibleInterface`](/chainlink-automation/reference/automation-interfaces/#streamslookupcompatibleinterface) interface. @@ -41,10 +41,10 @@ Custom logic Automation compatible contracts must meet the following requirement - Import `AutomationCompatible.sol`. You can refer to the [Chainlink Contracts](https://github.com/smartcontractkit/chainlink/tree/develop/contracts/src) on GitHub to find the latest version. - Use the [`AutomationCompatibleInterface`](/chainlink-automation/reference/automation-interfaces) from the library to ensure your `checkUpkeep` and `performUpkeep` function definitions match the definitions expected by the Chainlink Automation Network. -- Include a `checkUpkeep` function that contains the logic that will be executed off-chain to see if `performUpkeep` should be executed. `checkUpkeep` can use on-chain data and a specified `checkData` parameter to perform complex calculations off-chain and then send the result to `performUpkeep` as `performData`. -- Include a `performUpkeep` function that will be executed on-chain when `checkUpkeep` returns `true`. +- Include a `checkUpkeep` function that contains the logic that will be executed offchain to see if `performUpkeep` should be executed. `checkUpkeep` can use onchain data and a specified `checkData` parameter to perform complex calculations offchain and then send the result to `performUpkeep` as `performData`. +- Include a `performUpkeep` function that will be executed onchain when `checkUpkeep` returns `true`. -Use these elements to create a compatible contract that will automatically increment a counter after every `updateInterval` seconds. After you register the contract as an upkeep, the Chainlink Automation Network frequently simulates your `checkUpkeep` off-chain to determine if the `updateInterval` time has passed since the last increment (timestamp). When `checkUpkeep` returns true, the Chainlink Automation Network calls `performUpkeep` on-chain and increments the counter. This cycle repeats until the upkeep is cancelled or runs out of funding. +Use these elements to create a compatible contract that will automatically increment a counter after every `updateInterval` seconds. After you register the contract as an upkeep, the Chainlink Automation Network frequently simulates your `checkUpkeep` offchain to determine if the `updateInterval` time has passed since the last increment (timestamp). When `checkUpkeep` returns true, the Chainlink Automation Network calls `performUpkeep` onchain and increments the counter. This cycle repeats until the upkeep is cancelled or runs out of funding. diff --git a/src/content/chainlink-automation/guides/flexible-upkeeps.mdx b/src/content/chainlink-automation/guides/flexible-upkeeps.mdx index 5264f4985e9..e1120727cfa 100644 --- a/src/content/chainlink-automation/guides/flexible-upkeeps.mdx +++ b/src/content/chainlink-automation/guides/flexible-upkeeps.mdx @@ -33,7 +33,7 @@ Chainlink Automation is supported on several [networks](/chainlink-automation/ov -## Problem: On-chain computation leads to high gas fees +## Problem: Onchain computation leads to high gas fees In the guide for [Creating Compatible Contracts](/chainlink-automation/guides/compatible-contracts), you deployed a basic [counter contract](/chainlink-automation/guides/compatible-contracts/#example-automation-compatible-contract-using-custom-logic-trigger) and verified that the counter increments every 30 seconds. However, more complex use cases can require looping over arrays or performing expensive computation. This leads to expensive gas fees and can increase the premium that end-users have to pay to use your dApp. To illustrate this, deploy an example contract that maintains internal balances. @@ -87,9 +87,9 @@ Run this example to compare the gas fees: 1. Deploy the contract using Remix on the [supported testnet](/chainlink-automation/overview/supported-networks) of your choice. -1. Withdraw 100 at 10,100,300,350,500,600,670,700,900. Pass `100,[10,100,300,350,500,600,670,700,900]` to the withdraw function the same way that you did for the [previous example](#problem-on-chain-computation-leads-to-high-gas-fees). +1. Withdraw 100 at 10,100,300,350,500,600,670,700,900. Pass `100,[10,100,300,350,500,600,670,700,900]` to the withdraw function the same way that you did for the [previous example](#problem-onchain-computation-leads-to-high-gas-fees). -1. Register three upkeeps for your contract as explained [here](/chainlink-automation/guides/register-upkeep). Because the Automation Nodes handle much of the computation off-chain, a gas limit of 200,000 is sufficient. For each registration, pass the following `checkData` values to specify which balance indexes the registration will monitor. **Note**: You must remove any breaking line when copying the values. +1. Register three upkeeps for your contract as explained [here](/chainlink-automation/guides/register-upkeep). Because the Automation Nodes handle much of the computation offchain, a gas limit of 200,000 is sufficient. For each registration, pass the following `checkData` values to specify which balance indexes the registration will monitor. **Note**: You must remove any breaking line when copying the values. | Upkeep Name | CheckData(base16) | Remark: calculated using [`abi.encode()`](https://docs.soliditylang.org/en/develop/abi-spec.html#strict-encoding-mode) | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | diff --git a/src/content/chainlink-automation/guides/register-upkeep-in-contract.mdx b/src/content/chainlink-automation/guides/register-upkeep-in-contract.mdx index 5448f4f366c..b054b71d2a4 100644 --- a/src/content/chainlink-automation/guides/register-upkeep-in-contract.mdx +++ b/src/content/chainlink-automation/guides/register-upkeep-in-contract.mdx @@ -55,7 +55,7 @@ Depending on the trigger you are using, the `triggerConfig` will be different. B #### Parameters -For upkeeps with triggers using on-chain state only, the following parameters are needed: +For upkeeps with triggers using onchain state only, the following parameters are needed: #### Code sample diff --git a/src/content/chainlink-automation/guides/register-upkeep.mdx b/src/content/chainlink-automation/guides/register-upkeep.mdx index d6d19c39072..d4a82e06e7e 100644 --- a/src/content/chainlink-automation/guides/register-upkeep.mdx +++ b/src/content/chainlink-automation/guides/register-upkeep.mdx @@ -52,7 +52,7 @@ Select **Custom Logic** trigger. ## Using Custom Logic Triggers -Provide the address of your [compatible contract](/chainlink-automation/guides/compatible-contracts). You do not need to verify the contract on-chain, but it must be [compatible](/chainlink-automation/guides/compatible-contracts) with the `AutomationCompatibleInterface` contract. +Provide the address of your [compatible contract](/chainlink-automation/guides/compatible-contracts). You do not need to verify the contract onchain, but it must be [compatible](/chainlink-automation/guides/compatible-contracts) with the `AutomationCompatibleInterface` contract. ## Entering Upkeep Details diff --git a/src/content/chainlink-automation/overview/automation-economics.mdx b/src/content/chainlink-automation/overview/automation-economics.mdx index 3c9ba95d94a..85f94893d8d 100644 --- a/src/content/chainlink-automation/overview/automation-economics.mdx +++ b/src/content/chainlink-automation/overview/automation-economics.mdx @@ -9,13 +9,13 @@ whatsnext: { "Automation Architecture": "/chainlink-automation/concepts/automati ## Cost of using Chainlink Automation -Chainlink Automation only requires an execution fee for transactions on-chain. This fee includes the transaction cost, a node operator percentage fee (refer to the formula below), and a small fixed gas overhead accounting for gas between the network and the registry. The percentage fee compensates the Automation Network for monitoring and performing your upkeep. The Automation percentage fee varies by chain and is listed on our [Supported Networks](/chainlink-automation/overview/supported-networks) page. +Chainlink Automation only requires an execution fee for transactions onchain. This fee includes the transaction cost, a node operator percentage fee (refer to the formula below), and a small fixed gas overhead accounting for gas between the network and the registry. The percentage fee compensates the Automation Network for monitoring and performing your upkeep. The Automation percentage fee varies by chain and is listed on our [Supported Networks](/chainlink-automation/overview/supported-networks) page. **Formula for Registry v1.2** FeeLINK = [tx.gasPriceNative WEI * (gasUsed + gasOverhead) * (1 + premium%)]/[LINK/NativeRate in WEI] -There is no registration fee or other fees for any off-chain computation. +There is no registration fee or other fees for any offchain computation. ### Fee Calculation Example @@ -24,7 +24,7 @@ An upkeep transaction was [performed](https://polygonscan.com/tx/0x19309782e1595 | Variable | Description | Value | | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | | tx.gasPriceNative WEI | Gas price of the transaction | 182, 723, 799,380 | -| gasUsed | Gas used for performUpkeep calculated in solidity | 110,051 | +| gasUsed | Gas used for performUpkeep calculated in solidity | 110,051 | | gasOverhead | Fixed gas amount used for transaction call from node to Registry | 80,000 | | premium% | Current premium on Polygon which can be found on the [Supported Networks page](/chainlink-automation/overview/supported-networks) | 70% | | LINK/NativeRate in WEI | Exchange rate fetched from Chainlink Oracle | 7,308,290,731,273,610,000 | @@ -33,9 +33,9 @@ An upkeep transaction was [performed](https://polygonscan.com/tx/0x19309782e1595 ## How funding works -Upkeeps have a LINK (ERC-677) balance. Every time an on-chain transaction is performed for your upkeep, its LINK balance will be reduced by the LINK fee. +Upkeeps have a LINK (ERC-677) balance. Every time an onchain transaction is performed for your upkeep, its LINK balance will be reduced by the LINK fee. -Your upkeep's balance must exceed the [minimum balance](#minimum-balance). If this requirement is not met, the Automation Network will not perform on-chain transactions. You can add funds using the [Chainlink Automation App](https://automation.chain.link/) or by directly calling the `addFunds()` function on the `AutomationRegistry` contract. Anyone can call the `addFunds()` function. +Your upkeep's balance must exceed the [minimum balance](#minimum-balance). If this requirement is not met, the Automation Network will not perform onchain transactions. You can add funds using the [Chainlink Automation App](https://automation.chain.link/) or by directly calling the `addFunds()` function on the `AutomationRegistry` contract. Anyone can call the `addFunds()` function. ## Withdrawing funds diff --git a/src/content/chainlink-automation/overview/automation-release-notes.mdx b/src/content/chainlink-automation/overview/automation-release-notes.mdx index 5f6900e0694..300a93940fa 100644 --- a/src/content/chainlink-automation/overview/automation-release-notes.mdx +++ b/src/content/chainlink-automation/overview/automation-release-notes.mdx @@ -31,7 +31,7 @@ whatsnext: Automation 2.0 is now live on Ethereum, Binance Smart Chain, Polygon, Avalanche, Arbitrum, and Optimism. Automation 2.0 features include: -- **Verifiable compute**: The Automation DON now leverages a consensus mechanism, via Chainlink OCR3, to give you cryptographically verified compute. Save up to 90% of on-chain gas costs by off-loading compute intensive tasks to the Automation DON. +- **Verifiable compute**: The Automation DON now leverages a consensus mechanism, via Chainlink OCR3, to give you cryptographically verified compute. Save up to 90% of onchain gas costs by off-loading compute intensive tasks to the Automation DON. - **Log triggers**: Natively use log data in your smart contracts with [log triggers](/chainlink-automation/guides/log-trigger). Unlock new connection possibilities. @@ -75,7 +75,7 @@ Keepers Registry v1.2 launched on Ethereum, Binance Smart Chain, Polygon, Avalan - **Configurable upkeeps**: You can now edit the gas limit of your upkeep to easily customize your upkeep to fit your needs without having to create a new upkeep. -- **Off-chain compute improvements**: The off-chain compute sequence is improved for higher-fidelity representation of the gas and logic before transactions are submitted on-chain. This helps to reduce reverts and reduce fees. +- **Offchain compute improvements**: The offchain compute sequence is improved for higher-fidelity representation of the gas and logic before transactions are submitted onchain. This helps to reduce reverts and reduce fees. - **Minimum spend requirement**: As part of the mission to continuously enhance the security of the Chainlink Network for all participants, each registered upkeep will have a minimum spend requirement of 0.1 LINK, in aggregate across all transactions for the upkeep, to discourage network spam. Note that an _upkeep_ is the automation job itself. It is not a transaction. Each upkeep can have thousands of transactions. If an upkeep has not spent more than 0.1 LINK across all transactions at the time of cancellation, then 0.1 LINK will be retained for the network. If more than 0.1 LINK has been spent by an upkeep, the full remaining balance of the upkeep will be withdrawable when the upkeep is canceled. diff --git a/src/content/chainlink-automation/overview/getting-started.mdx b/src/content/chainlink-automation/overview/getting-started.mdx index e12e6e89bf9..ef8f8ec0fe0 100644 --- a/src/content/chainlink-automation/overview/getting-started.mdx +++ b/src/content/chainlink-automation/overview/getting-started.mdx @@ -19,7 +19,7 @@ import { Tabs } from "@components/Tabs" Chainlink Automation will reliably execute smart contract functions using a variety of triggers. Explore the examples below to see how Chainlink Automation works for each type of trigger. Before you begin, you will need an active cryptocurrency wallet such as Metamask. - **Time-based trigger**: Use a time-based trigger to execute your function according to a time schedule. -- **Custom logic trigger**: Use a custom logic trigger to provide custom solidity logic that Automation Nodes evaluate (off-chain) to determine when to execute your function on-chain. +- **Custom logic trigger**: Use a custom logic trigger to provide custom solidity logic that Automation Nodes evaluate (offchain) to determine when to execute your function onchain. - **Log trigger**: Use log data as both trigger and input. ## Try out Chainlink Automation @@ -61,7 +61,7 @@ Click the tabs below to use Chainlink Automation with each type of trigger: - **Increment a counter using custom logic stored on-chain.** + **Increment a counter using custom logic stored onchain.** 1. Navigate to the [Chainlink Automation app](https://automation.chain.link/) and connect to **Arbitrum Sepolia** in the top dropdown menu. @@ -69,7 +69,7 @@ Click the tabs below to use Chainlink Automation with each type of trigger: 3. Click **Register new Upkeep** and select **Custom logic** trigger. - 4. Under _Target contract address_, enter `0xC3d3656868594db09abD410821c9F9ab9812B4d1`. This contract uses logic stored on-chain and on-chain state to determine when to perform, incrementing a counter. It is an example of an Automation-compatible contract and can be read [here](https://sepolia.arbiscan.io/address/0x6C0AAAeBcDb6F5D03759B8BF14b47BE491755530#readContract). Click **Next**. + 4. Under _Target contract address_, enter `0xC3d3656868594db09abD410821c9F9ab9812B4d1`. This contract uses logic stored onchain and onchain state to determine when to perform, incrementing a counter. It is an example of an Automation-compatible contract and can be read [here](https://sepolia.arbiscan.io/address/0x6C0AAAeBcDb6F5D03759B8BF14b47BE491755530#readContract). Click **Next**. @@ -88,7 +88,7 @@ Click the tabs below to use Chainlink Automation with each type of trigger: - **Increment an on-chain counter using a log as trigger.** + **Increment an onchain counter using a log as trigger.** 1. Navigate to the [Chainlink Automation app](https://automation.chain.link/) and connect to **Arbitrum Sepolia** in the top dropdown menu. diff --git a/src/content/chainlink-automation/overview/supported-networks.mdx b/src/content/chainlink-automation/overview/supported-networks.mdx index c7215b114c1..f959a2f3346 100644 --- a/src/content/chainlink-automation/overview/supported-networks.mdx +++ b/src/content/chainlink-automation/overview/supported-networks.mdx @@ -57,10 +57,10 @@ If you are interested in using Chainlink Automation but need it on a different b - **Payment Premium %** (`paymentPremiumPPB`): This percentage premium compensates the Chainlink Automation Network for monitoring and performing your upkeep. Every time a transaction is submitted for your upkeep, your LINK balance is reduced by the transaction cost plus this percentage premium. - **Flat Fee Micro Link** (`flatFeeMicroLink`): A flat fee charged per transaction on all testnets and Optimism Mainnet. - **Maximum Check Data Size** (`maxCheckDataSize`): The maximum size, in bytes, that can be sent to your `checkUpkeep` function. -- **Check Gas Limit** (`checkGasLimit`): The maximum amount of gas that can be used by your `checkUpkeep` function for off-chain computation. -- **Perform Gas Limit** (`performGasLimit`): The maximum amount of gas that can be used by the client contract's `performUpkeep` function for the on-chain transaction. You can set an upper limit on your upkeep during registration, but this number must not exceed the `maxPerformGas` on the `Registry`. +- **Check Gas Limit** (`checkGasLimit`): The maximum amount of gas that can be used by your `checkUpkeep` function for offchain computation. +- **Perform Gas Limit** (`performGasLimit`): The maximum amount of gas that can be used by the client contract's `performUpkeep` function for the onchain transaction. You can set an upper limit on your upkeep during registration, but this number must not exceed the `maxPerformGas` on the `Registry`. - **maximum Perform Data Size** (`maxPerformDataSize`): The maximum size in bytes that can be sent to your `performUpkeep` function. -- **Gas Ceiling Multiplier** (`gasCeilingMultiplier`): Establishes a ceiling for the maximum price based on the on-chain fast gas feed. +- **Gas Ceiling Multiplier** (`gasCeilingMultiplier`): Establishes a ceiling for the maximum price based on the onchain fast gas feed. - **Minimum Upkeep Spend (LINK)**: The minimum amount of LINK an upkeep must spend over its lifetime. If the lifetime (or total) upkeep spend is below this amount, then at cancellation this amount will be held back. ## Configurations diff --git a/src/content/chainlink-automation/reference/automation-interfaces.mdx b/src/content/chainlink-automation/reference/automation-interfaces.mdx index 5be29c25a76..88905085804 100644 --- a/src/content/chainlink-automation/reference/automation-interfaces.mdx +++ b/src/content/chainlink-automation/reference/automation-interfaces.mdx @@ -16,7 +16,7 @@ import ChainlinkAutomation from "@features/chainlink-automation/common/Chainlink Your Automation-compatible contracts may use the following interfaces. You can find them in the [Chainlink repository](https://github.com/smartcontractkit/chainlink/tree/develop/contracts/src/v0.8/automation). To understand how to implement these contracts, visit the [Compatible Contracts page](/chainlink-automation/guides/compatible-contracts). - If you want a log event to trigger your upkeep, use the [`ILogAutomation`](#ilogautomation) interface. -- If you want to use on-chain state (excluding logs) in a custom calculation to trigger your upkeep, use [`AutomationCompatibleInterface`](#automationcompatibleinterface) interface. +- If you want to use onchain state (excluding logs) in a custom calculation to trigger your upkeep, use [`AutomationCompatibleInterface`](#automationcompatibleinterface) interface. - If you want to call a function just based on time, consider using a [time-based upkeep](/chainlink-automation/guides/job-scheduler). - If you want to use Automation with Data Streams, use [`StreamsLookupCompatibleInterface`](#streamslookupcompatibleinterface) interface. @@ -28,14 +28,14 @@ Your Automation-compatible contracts may use the following interfaces. You can f Custom logic upkeeps need to use the [`AutomationCompatibleInterface.sol`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol) interface. Click on one of the functions below to understand its parameters and limits. -| Function Name | Description | -| --------------- | -------------------------------------------------------------------------------------- | -| `checkUpkeep` | Runs off-chain to determine if the `performUpkeep` function should be called on-chain. | -| `performUpkeep` | Contains the logic that should be executed on-chain when `checkUpkeep` returns true. | +| Function Name | Description | +| --------------- | ------------------------------------------------------------------------------------ | +| `checkUpkeep` | Runs offchain to determine if the `performUpkeep` function should be called onchain. | +| `performUpkeep` | Contains the logic that should be executed onchain when `checkUpkeep` returns true. | ### checkUpkeep function -This view function contains the logic that runs off-chain during every block as an [`eth_call`](https://eth.wiki/json-rpc/API#eth_call) to determine if `performUpkeep` should be executed on-chain. To reduce on-chain gas usage, attempt to do your gas intensive calculations off-chain in `checkUpkeep` and pass the result to `performUpkeep` on-chain. It is a best practice to import the [`AutomationCompatible.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/AutomationCompatible.sol) contract and use the `cannotExecute` modifier to ensure that the method can be used only for simulation purposes. +This view function contains the logic that runs offchain during every block as an [`eth_call`](https://eth.wiki/json-rpc/API#eth_call) to determine if `performUpkeep` should be executed onchain. To reduce onchain gas usage, attempt to do your gas intensive calculations offchain in `checkUpkeep` and pass the result to `performUpkeep` onchain. It is a best practice to import the [`AutomationCompatible.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/AutomationCompatible.sol) contract and use the `cannotExecute` modifier to ensure that the method can be used only for simulation purposes. ```solidity function checkUpkeep( @@ -51,7 +51,7 @@ Below are the parameters and return values of the `checkUpkeep` function. Click **Return Values:** -- `upkeepNeeded`: Boolean that when True will trigger the on-chain `performUpkeep` call. +- `upkeepNeeded`: Boolean that when True will trigger the onchain `performUpkeep` call. - `performData`: Bytes that will be used as input parameter when calling `performUpkeep`. If you would like to encode data to decode later, try `abi.encode`. #### checkData @@ -62,7 +62,7 @@ You can pass information into your `checkUpkeep` function from your [upkeep regi Tips on using `checkData`: -- **Managing unbounded upkeeps**: Limit the problem set of your on-chain execution by creating a range bound for your upkeep to check and perform. This allows you to keep within predefined gas limits, which creates a predictable upper bound gas cost on your transactions. Break apart your problem into multiple upkeep registrations to limit the scope of work. +- **Managing unbounded upkeeps**: Limit the problem set of your onchain execution by creating a range bound for your upkeep to check and perform. This allows you to keep within predefined gas limits, which creates a predictable upper bound gas cost on your transactions. Break apart your problem into multiple upkeep registrations to limit the scope of work. **Example**: You could create an upkeep for each subset of addresses that you want to service. The ranges could be 0 to 49, 50 to 99, and 100 to 149. @@ -72,13 +72,13 @@ Tips on using `checkData`: #### performData -The response from `checkUpkeep` is passed to the `performUpkeep` function as `performData`. This allows you to perform complex and gas intensive calculations as a simulation off-chain and only pass the needed data on-chain. +The response from `checkUpkeep` is passed to the `performUpkeep` function as `performData`. This allows you to perform complex and gas intensive calculations as a simulation offchain and only pass the needed data onchain. -You can create a highly flexible off-chain computation infrastructure that can perform precise actions on-chain by using `checkData` and `performData`. Both of these computations are entirely programmable. +You can create a highly flexible offchain computation infrastructure that can perform precise actions onchain by using `checkData` and `performData`. Both of these computations are entirely programmable. ### performUpkeep function for custom logic triggers -When `checkUpkeep` returns `upkeepNeeded == true`, the Automation node broadcasts a transaction to the blockchain to execute your `performUpkeep` function on-chain with `performData` as an input. +When `checkUpkeep` returns `upkeepNeeded == true`, the Automation node broadcasts a transaction to the blockchain to execute your `performUpkeep` function onchain with `performData` as an input. Ensure that your `performUpkeep` is _idempotent_. Your `performUpkeep` function should change state such that `checkUpkeep` will not return `true` for the same subset of work once said work is complete. Otherwise the Upkeep will remain eligible and result in multiple performances by the Chainlink Automation Network on the exactly same subset of work. As a best practice, always check conditions for your upkeep at the start of your `performUpkeep` function. @@ -92,9 +92,9 @@ function performUpkeep(bytes calldata performData) external override; #### performData -You can perform complex and broad off-chain computation, then execute on-chain state changes on a subset that meets your conditions. This can be done by passing the appropriate inputs within `performData` based on the results from your `checkUpkeep`. This pattern can greatly reduce your on-chain gas usage by narrowing the scope of work intelligently in your own Solidity code. +You can perform complex and broad offchain computation, then execute onchain state changes on a subset that meets your conditions. This can be done by passing the appropriate inputs within `performData` based on the results from your `checkUpkeep`. This pattern can greatly reduce your onchain gas usage by narrowing the scope of work intelligently in your own Solidity code. -- **Identify a list of addresses that require work**: You might have a number of addresses that you are validating for conditions before your contract takes an action. Doing this on-chain can be expensive. Filter the list of addresses by validating the necessary conditions within your `checkUpkeep` function. Then, pass the addresses that meet the condition through the `performData` function. +- **Identify a list of addresses that require work**: You might have a number of addresses that you are validating for conditions before your contract takes an action. Doing this onchain can be expensive. Filter the list of addresses by validating the necessary conditions within your `checkUpkeep` function. Then, pass the addresses that meet the condition through the `performData` function. For example, if you have a "top up" contract that ensures several hundred account balances never decrease below a threshold, pass the list of accounts that meet the conditions so that the `performUpkeep` function validates and tops up only a small subset of the accounts. - **Identify the subset of states that must be updated**: If your contract maintains complicated objects such as arrays and structs, or stores a lot of data, you should read through your storage objects within your `checkUpkeep` and run your proprietary logic to determine if they require updates or maintenance. After that is complete, you can pass the known list of objects that require updates through the `performData` function. diff --git a/src/content/chainlink-automation/tutorials/counting-dnft.mdx b/src/content/chainlink-automation/tutorials/counting-dnft.mdx index feb7c970c8b..5495ff9504a 100644 --- a/src/content/chainlink-automation/tutorials/counting-dnft.mdx +++ b/src/content/chainlink-automation/tutorials/counting-dnft.mdx @@ -15,7 +15,7 @@ import { Aside, CodeSample } from "@components" View the template [here](https://github.com/smartcontractkit/smart-contract-examples/tree/main/counting-svg). -This repository houses an example that automates counting with a dynamic SVG. The main contract is `counting-svg.sol` which is automated to create an entirely on-chain SVG. +This repository houses an example that automates counting with a dynamic SVG. The main contract is `counting-svg.sol` which is automated to create an entirely onchain SVG. ```solidity // SPDX-License-Identifier: MIT diff --git a/src/content/chainlink-functions/api-reference/functions-request.mdx b/src/content/chainlink-functions/api-reference/functions-request.mdx index 7b44125d7f2..3d171d1f272 100644 --- a/src/content/chainlink-functions/api-reference/functions-request.mdx +++ b/src/content/chainlink-functions/api-reference/functions-request.mdx @@ -175,10 +175,10 @@ Adds Remote user encrypted secrets to a Request #### Parameters -| Name | Type | Description | -| ------------------------- | ------------------------------- | ---------------------------------------------------------------------- | -| self | struct FunctionsRequest.Request | The initialized request | -| encryptedSecretsReference | bytes | Encrypted comma-separated string of URLs pointing to off-chain secrets | +| Name | Type | Description | +| ------------------------- | ------------------------------- | --------------------------------------------------------------------- | +| self | struct FunctionsRequest.Request | The initialized request | +| encryptedSecretsReference | bytes | Encrypted comma-separated string of URLs pointing to offchain secrets | ### addDONHostedSecrets diff --git a/src/content/chainlink-functions/api-reference/javascript-source.mdx b/src/content/chainlink-functions/api-reference/javascript-source.mdx index 40adaea0be7..2a99ee809f0 100644 --- a/src/content/chainlink-functions/api-reference/javascript-source.mdx +++ b/src/content/chainlink-functions/api-reference/javascript-source.mdx @@ -59,7 +59,7 @@ The Functions library includes several encoding functions, which are useful for | `Functions.encodeInt256` | Integer | 32-byte `Buffer` | Converts an integer to a 32-byte `Buffer` for an `int256` in Solidity. | | `Functions.encodeString` | String | `Buffer` | Converts a string to a `Buffer` for a `string` type in Solidity. | -**Note**: Using these encoding functions is optional. The source code must return a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) which represents the `bytes` that are returned on-chain. +**Note**: Using these encoding functions is optional. The source code must return a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) which represents the `bytes` that are returned onchain. ```javascript const myArr = new Uint8Array(ARRAY_LENGTH) diff --git a/src/content/chainlink-functions/getting-started.mdx b/src/content/chainlink-functions/getting-started.mdx index 47411b70bd8..18085d44d6d 100644 --- a/src/content/chainlink-functions/getting-started.mdx +++ b/src/content/chainlink-functions/getting-started.mdx @@ -16,7 +16,7 @@ import { Tabs } from "@components/Tabs" import ChainlinkFunctions from "@features/chainlink-functions/common/ChainlinkFunctions.astro" import { YouTube } from "@astro-community/astro-embed-youtube" -Learn how to make requests to the Chainlink Functions Decentralized Oracle Network (DON) and make any computation or API calls off-chain. Chainlink Functions is available on several blockchains (see the [supported networks page](/chainlink-functions/supported-networks)), but this guide uses Polygon Mumbai to simplify access to testnet funds. Complete the following tasks to get started with Chainlink Functions: +Learn how to make requests to the Chainlink Functions Decentralized Oracle Network (DON) and make any computation or API calls offchain. Chainlink Functions is available on several blockchains (see the [supported networks page](/chainlink-functions/supported-networks)), but this guide uses Polygon Mumbai to simplify access to testnet funds. Complete the following tasks to get started with Chainlink Functions: - Set up your web3 wallet and fund it with testnet tokens. - Simulate a Chainlink Functions on the [Chainlink Functions @@ -28,7 +28,7 @@ Learn how to make requests to the Chainlink Functions Decentralized Oracle Netwo ## Simulation -Before making a Chainlink Functions request from your smart contract, it is always a good practice to simulate the source code off-chain to make any adjustments or corrections. +Before making a Chainlink Functions request from your smart contract, it is always a good practice to simulate the source code offchain to make any adjustments or corrections. 1. Open the [Functions playground](https://functions.chain.link/playground). 1. Copy and paste the following source code into the playground's code block. diff --git a/src/content/chainlink-functions/index.mdx b/src/content/chainlink-functions/index.mdx index 4dde05e1bc3..9f4144e1f65 100644 --- a/src/content/chainlink-functions/index.mdx +++ b/src/content/chainlink-functions/index.mdx @@ -20,7 +20,7 @@ Chainlink Functions is available on mainnet only as a BETA preview to ensure tha Chainlink Functions provides your smart contracts access to trust-minimized compute infrastructure, allowing you to fetch data from APIs and perform custom computation. Your smart contract sends source code in a request to a [Decentralized Oracle Network (DON)](/chainlink-functions/resources/concepts), and each node in the DON executes the code in a serverless environment. The DON then aggregates all the independent return values from each execution and sends the final result back to your smart contract. -Chainlink Functions eliminates the need for you to manage your own Chainlink node and provides decentralized off-chain computation and consensus, ensuring that a minority of the network cannot manipulate the response sent back to your smart contract. +Chainlink Functions eliminates the need for you to manage your own Chainlink node and provides decentralized offchain computation and consensus, ensuring that a minority of the network cannot manipulate the response sent back to your smart contract. Furthermore, Chainlink Functions allows you to include secret values in your request that are encrypted using threshold encryption. These values can only be decrypted via a multi-party decryption process, meaning that every node can only decrypt the secrets with participation from other DON nodes. This feature can provide API keys or other sensitive values to your source code, enabling access to APIs that require authentication. @@ -44,7 +44,7 @@ Chainlink Functions enables a variety of use cases. Use Chainlink Functions to: - Connect to any public data. For example, you can connect your smart contracts to weather statistics for parametric insurance or real-time sports results for Dynamic NFTs. - Connect to public data and transform it before consumption. You could calculate Twitter sentiment after reading data from the Twitter API, or derive asset prices after reading price data from [Chainlink Price Feeds](/data-feeds/price-feeds). - Connect to a password-protected data source; from IoT devices like smartwatches to enterprise resource planning systems. -- Connect to an external decentralized database, such as IPFS, to facilitate off-chain processes for a dApp or build a low-cost governance voting system. +- Connect to an external decentralized database, such as IPFS, to facilitate offchain processes for a dApp or build a low-cost governance voting system. - Connect to your Web2 application and build complex hybrid smart contracts. - Fetch data from almost any Web2 system such as AWS S3, Firebase, or Google Cloud Storage. diff --git a/src/content/chainlink-functions/resources/architecture.mdx b/src/content/chainlink-functions/resources/architecture.mdx index 0b664dfe1bd..bfcd7f3c94c 100644 --- a/src/content/chainlink-functions/resources/architecture.mdx +++ b/src/content/chainlink-functions/resources/architecture.mdx @@ -14,7 +14,7 @@ import { Aside, ClickToZoom } from "@components" ## Request and Receive Data -This model is similar to the [Basic Request Model](/architecture-overview/architecture-request-model): The consumer contract initiates the cycle by sending a request to the [FunctionsRouter contract](https://github.com/smartcontractkit/chainlink/blob/9f19654c086e8e92720d935d217536c8a5600c08/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsRouter.sol). Oracle nodes watch for events emitted by the [FunctionsCoordinator contract](https://github.com/smartcontractkit/chainlink/blob/9f19654c086e8e92720d935d217536c8a5600c08/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsCoordinator.sol) and run the computation off-chain. Finally, oracle nodes use the [Chainlink OCR](/architecture-overview/off-chain-reporting) protocol to aggregate all the returned before passing the single aggregated response back to the consumer contract via a callback function. +This model is similar to the [Basic Request Model](/architecture-overview/architecture-request-model): The consumer contract initiates the cycle by sending a request to the [FunctionsRouter contract](https://github.com/smartcontractkit/chainlink/blob/9f19654c086e8e92720d935d217536c8a5600c08/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsRouter.sol). Oracle nodes watch for events emitted by the [FunctionsCoordinator contract](https://github.com/smartcontractkit/chainlink/blob/9f19654c086e8e92720d935d217536c8a5600c08/contracts/src/v0.8/functions/dev/v1_0_0/FunctionsCoordinator.sol) and run the computation offchain. Finally, oracle nodes use the [Chainlink OCR](/architecture-overview/off-chain-reporting) protocol to aggregate all the returned before passing the single aggregated response back to the consumer contract via a callback function. Chainlink Functions is a self-service solution. You must ensure that the data sources or APIs specified in requests @@ -46,7 +46,7 @@ To run the example: node examples/3-custom-response/request.js ``` - The script runs your function in a sandbox environment before making an on-chain transaction: + The script runs your function in a sandbox environment before making an onchain transaction: ```text $ node examples/3-custom-response/request.js diff --git a/src/content/chainlink-functions/tutorials/api-multiple-calls.mdx b/src/content/chainlink-functions/tutorials/api-multiple-calls.mdx index fe6ca1fdba8..398ed1d42a9 100644 --- a/src/content/chainlink-functions/tutorials/api-multiple-calls.mdx +++ b/src/content/chainlink-functions/tutorials/api-multiple-calls.mdx @@ -7,7 +7,7 @@ title: "Call Multiple Data Sources" import { Aside } from "@components" import ChainlinkFunctions from "@features/chainlink-functions/common/ChainlinkFunctions.astro" -This tutorial shows you how make multiple API calls from your smart contract to a Decentralized Oracle Network. After [OCR](/chainlink-functions/resources/architecture) completes off-chain computation and aggregation, the DON returns the asset price to your smart contract. This example returns the `BTC/USD` price. +This tutorial shows you how make multiple API calls from your smart contract to a Decentralized Oracle Network. After [OCR](/chainlink-functions/resources/architecture) completes offchain computation and aggregation, the DON returns the asset price to your smart contract. This example returns the `BTC/USD` price. This guide assumes that you know how to build HTTP requests and how to use secrets. Read the [API query parameters](/chainlink-functions/tutorials/api-query-parameters) and [API use secrets](/chainlink-functions/tutorials/api-use-secrets) guides before you follow the example in this document. To build a decentralized asset price, send a request to the DON to fetch the price from many different API providers. Then, calculate the median price. The API providers in this example are: @@ -64,7 +64,7 @@ To run the example: node examples/8-multiple-apis/request.js ``` - The script runs your function in a sandbox environment before making an on-chain transaction: + The script runs your function in a sandbox environment before making an onchain transaction: ```text $ node examples/8-multiple-apis/request.js @@ -115,7 +115,7 @@ To run the example: - Your request was successfully sent to Chainlink Functions. The transaction in this example is [0xb53e0e598fa97d0b74d9b6895230a2686f44a62666877efdd78961c2282857ba](https://mumbai.polygonscan.com/tx/0xb53e0e598fa97d0b74d9b6895230a2686f44a62666877efdd78961c2282857ba) and the request ID is `0x489b0cf659152ff19807ee7a4325828dc17eb1a38eb97c1ca840815dc2e02575`. - The DON successfully fulfilled your request. The total cost was: `0.000039224977086446 LINK`. - - The consumer contract received a response in `bytes` with a value of `0x0000000000000000000000000000000000000000000000000000000000273a45`. Decoding it off-chain to `uint256` gives you a result: `2570821`. The median BTC price is 25708.21 USD. + - The consumer contract received a response in `bytes` with a value of `0x0000000000000000000000000000000000000000000000000000000000273a45`. Decoding it offchain to `uint256` gives you a result: `2570821`. The median BTC price is 25708.21 USD. ## Examine the code diff --git a/src/content/chainlink-functions/tutorials/api-post-data.mdx b/src/content/chainlink-functions/tutorials/api-post-data.mdx index 2b66e952b67..6495424a5ac 100644 --- a/src/content/chainlink-functions/tutorials/api-post-data.mdx +++ b/src/content/chainlink-functions/tutorials/api-post-data.mdx @@ -7,7 +7,7 @@ title: "POST Data to an API" import { Aside } from "@components" import ChainlinkFunctions from "@features/chainlink-functions/common/ChainlinkFunctions.astro" -This tutorial shows you how to send a request to a Decentralized Oracle Network to call the [Countries information GraphQL API](https://trevorblades.github.io/countries/queries/continent). After [OCR](/chainlink-functions/resources/architecture) completes off-chain computation and aggregation, it returns the name, capital, and currency for the specified country to your smart contract. Because the endpoint is a GraphQL API, write a function that sends a GraphQL query in a [POST HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST). +This tutorial shows you how to send a request to a Decentralized Oracle Network to call the [Countries information GraphQL API](https://trevorblades.github.io/countries/queries/continent). After [OCR](/chainlink-functions/resources/architecture) completes offchain computation and aggregation, it returns the name, capital, and currency for the specified country to your smart contract. Because the endpoint is a GraphQL API, write a function that sends a GraphQL query in a [POST HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST).