Skip to content

Commit

Permalink
Merge branch 'main' into contracts-1-1-1-release
Browse files Browse the repository at this point in the history
  • Loading branch information
dwightjl committed May 9, 2024
2 parents b5ca79a + 3638065 commit a822aa0
Show file tree
Hide file tree
Showing 65 changed files with 174 additions and 213 deletions.
1 change: 1 addition & 0 deletions src/components/Tabs/Tabs.module.css
Expand Up @@ -18,6 +18,7 @@
font-weight: var(--font-weight-medium);
text-align: center;
padding: var(--space-2x) var(--space-3x);
margin-bottom: var(--space-3x);
outline-offset: 2px;
}

Expand Down
54 changes: 27 additions & 27 deletions src/content/any-api/api-reference.mdx

Large diffs are not rendered by default.

Expand Up @@ -60,7 +60,7 @@ The response should be similar to the following:
]
```

Fetch the _id_ of the first element. To consume an API, your contract must import [ChainlinkClient.sol](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct named `Chainlink.Request`, which your contract can use to build the API request. The request must include the following parameters:
Fetch the _id_ of the first element. To consume an API, your contract must import [ChainlinkClient.sol](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct named `Chainlink.Request`, which your contract can use to build the API request. The request must include the following parameters:

- Link token address
- Oracle address
Expand Down
Expand Up @@ -59,7 +59,7 @@ The response should be similar to the following:
```

For this example, we created a job that leverages the [EtherScan External Adapter](https://github.com/smartcontractkit/external-adapters-js/tree/develop/packages/sources/etherscan) to fetch the _SafeGasPrice_ , _ProposeGasPrice_ and _FastGasPrice_. You can learn more about External Adapters [here](/chainlink-nodes/external-adapters/external-adapters).
To consume an API, your contract must import [ChainlinkClient.sol](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct named `Chainlink.Request`, which your contract can use to build the API request. The request must include the following parameters:
To consume an API, your contract must import [ChainlinkClient.sol](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct named `Chainlink.Request`, which your contract can use to build the API request. The request must include the following parameters:

- Link token address
- Oracle address
Expand Down
Expand Up @@ -46,7 +46,7 @@ The response should be similar to the following:
}
```

Fetch the value of _image_. To consume an API, your contract must import [ChainlinkClient.sol](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct named `Chainlink.Request`, which your contract can use to build the API request. The request must include the following parameters:
Fetch the value of _image_. To consume an API, your contract must import [ChainlinkClient.sol](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct named `Chainlink.Request`, which your contract can use to build the API request. The request must include the following parameters:

- Link token address
- Oracle address
Expand Down
Expand Up @@ -50,7 +50,7 @@ The response should be similar to the following:
```

The request above shows how to get the price of _ETH_ against _BTC_. Now let say we want the price of _ETH_ against several currencies: _BTC_, _USD_, and _EUR_. Our contract will have to support receiving multiple responses.
To consume an API with multiple responses, your contract should inherit from [ChainlinkClient](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct called `Chainlink.Request`, which your contract should use to build the API request. The request should include the following parameters:
To consume an API with multiple responses, your contract should inherit from [ChainlinkClient](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct called `Chainlink.Request`, which your contract should use to build the API request. The request should include the following parameters:

- Link token address
- Oracle address
Expand Down
Expand Up @@ -71,7 +71,7 @@ The response should be similar to the following example:
}
```

To consume an API with multiple responses, your contract must import [ChainlinkClient](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct called `Chainlink.Request`, which your contract should use to build the API request. The request should include the following parameters:
To consume an API with multiple responses, your contract must import [ChainlinkClient](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/ChainlinkClient.sol). This contract exposes a struct called `Chainlink.Request`, which your contract should use to build the API request. The request should include the following parameters:

- Link token address
- Oracle address
Expand Down
2 changes: 1 addition & 1 deletion src/content/any-api/testnet-oracles.mdx
Expand Up @@ -21,7 +21,7 @@ To retrieve the LINK token address or get faucet details for your testnet of cho

## Operator Contracts

Testnet [Operator contracts](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/operatorforwarder/dev/Operator.sol) are deployed and maintained on the following networks:
Testnet [Operator contracts](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/operatorforwarder/Operator.sol) are deployed and maintained on the following networks:

| Testnet | Oracle Address |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
Expand Up @@ -47,7 +47,7 @@ To learn how to create a consumer contract that uses an existing data feed, read

### Consumer

A Consumer contract is any contract that uses Chainlink Data Feeds to consume aggregated data. Consumer contracts must reference the correct [`AggregatorV3Interface`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol) contract and call one of the exposed functions.
A Consumer contract is any contract that uses Chainlink Data Feeds to consume aggregated data. Consumer contracts must reference the correct [`AggregatorV3Interface`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol) contract and call one of the exposed functions.

{/* prettier-ignore */}
```solidity
Expand All @@ -62,13 +62,13 @@ Offchain applications can also consume data feeds. See the Javascript and Python

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/master/contracts/src/v0.7/dev/AggregatorProxy.sol) on Github is a common example.
Proxy contracts can vary from one data feed to another, but the [`EACAggregatorProxy.sol` contract](https://github.com/smartcontractkit/chainlink/blob/contracts-v1.0.0/contracts/src/v0.6/EACAggregatorProxy.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 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/master/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol).
You can access this data using the Data Feed address and the [`AggregatorV3Interface` contract](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/shared/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.

Expand Down
Expand Up @@ -22,7 +22,7 @@ All source code is open source and available in the [Chainlink Github repository

### ChainlinkClient

[`ChainlinkClient`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/ChainlinkClient.sol) is a parent contract that enables smart contracts to consume data from oracles. It's available in the Chainlink smart contract library which can be [installed using the latest package managers](/resources/create-a-chainlinked-project).
[`ChainlinkClient`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/ChainlinkClient.sol) is a parent contract that enables smart contracts to consume data from oracles. It's available in the Chainlink smart contract library which can be [installed using the latest package managers](/resources/create-a-chainlinked-project).

The client constructs and makes a request to a known Chainlink oracle through the `transferAndCall` function, implemented by the LINK token. This request contains encoded information that is required for the cycle to succeed. In the `ChainlinkClient` contract, this call is initiated with a call to `sendChainlinkRequestTo`.

Expand All @@ -36,7 +36,7 @@ Learn more about [ERC-677 and the LINK token](/resources/link-token-contracts).

### Operator Contract

[`Operator` contracts](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/operatorforwarder/dev/Operator.sol) are owned by oracle node operators, which run alongside offchain oracle nodes.
[`Operator` contracts](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/operatorforwarder/Operator.sol) are owned by oracle node operators, which run alongside offchain oracle nodes.

#### Request

Expand All @@ -48,7 +48,7 @@ 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).

Operator contracts are responsible for handling onchain requests made through the LINK token, by implementing `onTokenTransfer` as a <a href="https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/operatorforwarder/dev/LinkTokenReceiver.sol">`LinkTokenReceiver`</a>. Upon execution of this function, the operator 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.
Operator contracts are responsible for handling onchain requests made through the LINK token, by implementing `onTokenTransfer` as a <a href="https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/operatorforwarder/LinkTokenReceiver.sol">`LinkTokenReceiver`</a>. Upon execution of this function, the operator 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

Expand Down
2 changes: 1 addition & 1 deletion src/content/chainlink-automation/guides/log-trigger.mdx
Expand Up @@ -78,7 +78,7 @@ Select **Log Trigger**.
Your upkeeps will be protected against logs that are emitted during a reorg.
</Aside>

1. **Provide the address of your [Automation-compatible contract](/chainlink-automation/guides/compatible-contracts)** that you want to automate. In this case, we will paste the address of `CountWithLog.sol`. This contract must follow the format of the [ILogAutomation interface](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/interfaces/ILogAutomation.sol) to ensure Automation nodes can interact with your contract as expected.
1. **Provide the address of your [Automation-compatible contract](/chainlink-automation/guides/compatible-contracts)** that you want to automate. In this case, we will paste the address of `CountWithLog.sol`. This contract must follow the format of the [ILogAutomation interface](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/interfaces/ILogAutomation.sol) to ensure Automation nodes can interact with your contract as expected.

<ClickToZoom src="/images/automation/log_trig_1_upkeep_address.png" />

Expand Down
Expand Up @@ -9,25 +9,25 @@ whatsnext: { "Automation Architecture": "/chainlink-automation/concepts/automati

Automation Nodes use the following contracts. You can find them in the [Chainlink repository](https://github.com/smartcontractkit/chainlink/tree/develop/contracts/src/v0.8/automation). For details about how to use them, visit the [Creating Compatible Contracts](/chainlink-automation/guides/compatible-contracts) guide. To understand the logic behind these contracts, visit the [Architecture](/chainlink-automation/concepts/automation-architecture) page.

- [`AutomationCompatible.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/AutomationCompatible.sol): Imports the following contracts:
- [`AutomationBase.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/AutomationBase.sol): Enables the use of the `cannotExecute` modifier. Import this contract if you need for this modifier. See the [`checkUpkeep` function](/chainlink-automation/reference/automation-interfaces#checkupkeep-function) for details.
- [`AutomationCompatibleInterface.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol): The interface to be implemented in order to make your contract compatible. Import this contract for type safety.
- [`AutomationCompatible.sol`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/AutomationCompatible.sol): Imports the following contracts:
- [`AutomationBase.sol`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/AutomationBase.sol): Enables the use of the `cannotExecute` modifier. Import this contract if you need for this modifier. See the [`checkUpkeep` function](/chainlink-automation/reference/automation-interfaces#checkupkeep-function) for details.
- [`AutomationCompatibleInterface.sol`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol): The interface to be implemented in order to make your contract compatible. Import this contract for type safety.

## AutomationRegistry.sol

[`AutomationRegistry2_1.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/v2_1/KeeperRegistry2_1.sol): The registry contract that tracks all registered Upkeeps and the Automation Nodes that can perform them. _Note_: As Chainlink Automation continues adding new functionalities, a new **Automation Registry** is deployed and the contract address may change.
[`AutomationRegistry2_1.sol`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/v2_1/KeeperRegistry2_1.sol): The registry contract that tracks all registered Upkeeps and the Automation Nodes that can perform them. _Note_: As Chainlink Automation continues adding new functionalities, a new **Automation Registry** is deployed and the contract address may change.

## AutomationRegistrar.sol

[`AutomationRegistrar2_1.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/v2_1/AutomationRegistrar2_1.sol): The Registrar contract governs the registration of new Upkeeps on the associated `AutomationRegistry` contract. Users who want to register Upkeeps by directly calling the deployed contract have to call the Transfer-and-Call function on the respective ERC-677 LINK contract configured on the Registrar and ensure they pass the correct encoded function call and inputs.
[`AutomationRegistrar2_1.sol`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/v2_1/AutomationRegistrar2_1.sol): The Registrar contract governs the registration of new Upkeeps on the associated `AutomationRegistry` contract. Users who want to register Upkeeps by directly calling the deployed contract have to call the Transfer-and-Call function on the respective ERC-677 LINK contract configured on the Registrar and ensure they pass the correct encoded function call and inputs.

## UpkeepTranscoder.sol

[`UpkeepTranscode4_0.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol) allows the conversion of upkeep data from previous Automation registry versions 1.2, 1.3, and 2.0 to registry 2.1.
[`UpkeepTranscode4_0.sol`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/v2_1/UpkeepTranscoder4_0.sol) allows the conversion of upkeep data from previous Automation registry versions 1.2, 1.3, and 2.0 to registry 2.1.

## AutomationForwarder.sol

[`AutomationForwarder.sol`](https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/automation/v2_1/AutomationForwarder.sol) is a relayer that sits between the registry and the customer's target contract. The purpose of the forwarder is to give customers a consistent address to authorize against that stays consistent between migrations. The Forwarder also exposes the registry address, so that users who want to programatically interact with the registry can do so. The `forward` function in this contract is called by the registry and forwards the call to the target.
[`AutomationForwarder.sol`](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/automation/AutomationForwarder.sol) is a relayer that sits between the registry and the customer's target contract. The purpose of the forwarder is to give customers a consistent address to authorize against that stays consistent between migrations. The Forwarder also exposes the registry address, so that users who want to programmatically interact with the registry can do so. The `forward` function in this contract is called by the registry and forwards the call to the target.

## CronUpkeepFactory.sol

Expand Down

0 comments on commit a822aa0

Please sign in to comment.