Skip to content

Commit

Permalink
Merge branch 'main' into ccip-guide-multiple-messages
Browse files Browse the repository at this point in the history
  • Loading branch information
khadni authored Sep 11, 2024
2 parents 8eb1f4e + b5d137b commit b44bd4f
Show file tree
Hide file tree
Showing 27 changed files with 190 additions and 107 deletions.
2 changes: 1 addition & 1 deletion public/samples/CCIP/Messenger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ contract Messenger is CCIPReceiver, OwnerIsCreator {
Client.EVM2AnyMessage({
receiver: abi.encode(_receiver), // ABI-encoded receiver address
data: abi.encode(_text), // ABI-encoded string
tokenAmounts: new Client.EVMTokenAmount[](0), // Empty array aas no tokens are transferred
tokenAmounts: new Client.EVMTokenAmount[](0), // Empty array as no tokens are transferred
extraArgs: Client._argsToBytes(
// Additional arguments, setting gas limit
Client.EVMExtraArgsV1({gasLimit: 200_000})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ contract ProgrammableDefensiveTokenTransfers is CCIPReceiver, OwnerIsCreator {

/// @notice Sends data and transfer tokens to receiver on the destination chain.
/// @notice Pay for fees in native gas.
/// @dev Assumes your contract has sufficient native gas like ETH on Ethereum or MATIC on Polygon.
/// @dev Assumes your contract has sufficient native gas like ETH on Ethereum or POL on Polygon.
/// @param _destinationChainSelector The identifier (aka selector) for the destination blockchain.
/// @param _receiver The address of the recipient on the destination blockchain.
/// @param _text The string data to be sent.
Expand Down
2 changes: 1 addition & 1 deletion public/samples/CCIP/ProgrammableTokenTransfers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ contract ProgrammableTokenTransfers is CCIPReceiver, OwnerIsCreator {

/// @notice Sends data and transfer tokens to receiver on the destination chain.
/// @notice Pay for fees in native gas.
/// @dev Assumes your contract has sufficient native gas like ETH on Ethereum or MATIC on Polygon.
/// @dev Assumes your contract has sufficient native gas like ETH on Ethereum or POL on Polygon.
/// @param _destinationChainSelector The identifier (aka selector) for the destination blockchain.
/// @param _receiver The address of the recipient on the destination blockchain.
/// @param _text The string data to be sent.
Expand Down
4 changes: 2 additions & 2 deletions public/samples/CCIP/TokenTransferor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ contract TokenTransferor is OwnerIsCreator {
}

/// @notice Transfer tokens to receiver on the destination chain.
/// @notice Pay in native gas such as ETH on Ethereum or MATIC on Polgon.
/// @notice Pay in native gas such as ETH on Ethereum or POL on Polgon.
/// @notice the token must be in the list of supported tokens.
/// @notice This function can only be called by the owner.
/// @dev Assumes your contract has sufficient native gas like ETH on Ethereum or MATIC on Polygon.
/// @dev Assumes your contract has sufficient native gas like ETH on Ethereum or POL on Polygon.
/// @param _destinationChainSelector The identifier (aka selector) for the destination blockchain.
/// @param _receiver The address of the recipient on the destination blockchain.
/// @param _token token address.
Expand Down
6 changes: 3 additions & 3 deletions src/components/QuickLinks/data/productChainLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const productChainLinks: ProductChainLinks = {
fantom: "/chainlink-automation/overview/supported-networks#fantom",
"gnosis-chain": "/chainlink-automation/overview/supported-networks#gnosis-chain-xdai",
optimism: "/chainlink-automation/overview/supported-networks#optimism",
polygon: "/chainlink-automation/overview/supported-networks#polygon-matic",
polygon: "/chainlink-automation/overview/supported-networks#polygon",
},
},
VRF: {
Expand All @@ -106,7 +106,7 @@ export const productChainLinks: ProductChainLinks = {
"bnb-chain": "/vrf/v2-5/supported-networks#bnb-chain",
ethereum: "/vrf/v2-5/supported-networks#ethereum-mainnet",
fantom: "/vrf/v2/subscription/supported-networks#fantom-mainnet",
polygon: "/vrf/v2-5/supported-networks#polygon-matic-mainnet",
polygon: "/vrf/v2-5/supported-networks#polygon-mainnet",
},
},
linkTokenContracts: {
Expand All @@ -127,7 +127,7 @@ export const productChainLinks: ProductChainLinks = {
moonriver: "/resources/link-token-contracts#moonriver",
optimism: "/resources/link-token-contracts#optimism",
polygonzkevm: "/resources/link-token-contracts#polygon-zkevm",
polygon: "/resources/link-token-contracts#polygon-matic",
polygon: "/resources/link-token-contracts#polygon",
scroll: "/resources/link-token-contracts#scroll",
solana: "/resources/link-token-contracts#solana",
wemix: "/resources/link-token-contracts#wemix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ th {
.stickyHeader {
position: sticky;
top: 0;
z-index: 2;
z-index: 4;
background-color: var(--gray-100);
border-bottom: 2px solid var(--gray-200);
}
Expand Down
42 changes: 42 additions & 0 deletions src/config/data/ccip/v1_2_0/mainnet/lanes.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,13 @@
"rate": "900000000000000"
}
},
"WETH": {
"rateLimiterConfig": {
"capacity": "114000000000000000000",
"isEnabled": true,
"rate": "32000000000000000"
}
},
"USD+": {
"rateLimiterConfig": {
"capacity": "200000000000",
Expand Down Expand Up @@ -1462,6 +1469,13 @@
"rate": "900000000000000"
}
},
"WETH": {
"rateLimiterConfig": {
"capacity": "114000000000000000000",
"isEnabled": true,
"rate": "32000000000000000"
}
},
"USD+": {
"rateLimiterConfig": {
"capacity": "200000000000",
Expand Down Expand Up @@ -1576,6 +1590,13 @@
"rate": "23140000000000000000"
}
},
"WETH": {
"rateLimiterConfig": {
"capacity": "114000000000000000000",
"isEnabled": true,
"rate": "32000000000000000"
}
},
"zunUSD": {
"rateLimiterConfig": {
"capacity": "250000000000000000000000",
Expand Down Expand Up @@ -1754,6 +1775,13 @@
"rate": "900000000000000"
}
},
"WETH": {
"rateLimiterConfig": {
"capacity": "114000000000000000000",
"isEnabled": true,
"rate": "32000000000000000"
}
},
"USD+": {
"rateLimiterConfig": {
"capacity": "200000000000",
Expand Down Expand Up @@ -2159,6 +2187,13 @@
"rate": "23140000000000000000"
}
},
"WETH": {
"rateLimiterConfig": {
"capacity": "114000000000000000000",
"isEnabled": true,
"rate": "32000000000000000"
}
},
"zunUSD": {
"rateLimiterConfig": {
"capacity": "250000000000000000000000",
Expand Down Expand Up @@ -2927,6 +2962,13 @@
"rate": "900000000000000"
}
},
"WETH": {
"rateLimiterConfig": {
"capacity": "114000000000000000000",
"isEnabled": true,
"rate": "32000000000000000"
}
},
"USD+": {
"rateLimiterConfig": {
"capacity": "200000000000",
Expand Down
10 changes: 5 additions & 5 deletions src/config/data/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@
}
},
"POLYGON": {
"title": "Polygon (Matic)",
"title": "Polygon",
"icon": "/assets/chains/polygon.svg",
"chains": {
"POLYGON_MAINNET": {
"chainId": 137,
"title": "Polygon mainnet",
"explorer": "https://polygonscan.com",
"nativeCurrency": {
"name": "MATIC",
"symbol": "MATIC",
"name": "POL",
"symbol": "POL",
"decimals": 18
}
},
Expand All @@ -70,8 +70,8 @@
"title": "Amoy testnet",
"explorer": "https://amoy.polygonscan.com/",
"nativeCurrency": {
"name": "MATIC",
"symbol": "MATIC",
"name": "POL",
"symbol": "POL",
"decimals": 18
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/content/ccip/api-reference/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct EVM2AnyMessage {
| receiver | bytes | Receiver address. Use `abi.encode(sender)` to encode the address to _bytes_. |
| data | bytes | Payload sent within the CCIP message. |
| tokenAmounts | Client.EVMTokenAmount[] | Tokens and their amounts in the source chain representation. |
| feeToken | address | Address of feeToken. Set `address(0)` to pay in native gas tokens such as ETH on Ethereum or MATIC on Polygon. |
| feeToken | address | Address of feeToken. Set `address(0)` to pay in native gas tokens such as ETH on Ethereum or POL on Polygon. |
| extraArgs | bytes | Users fill in the [EVMExtraArgsV1 struct](#evmextraargsv1) then encode it to bytes using the [\_argsToBytes function](#_argstobytes) |

### EVM_EXTRA_ARGS_V1_TAG
Expand Down
2 changes: 1 addition & 1 deletion src/content/ccip/concepts/manual-execution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ When manual execution is initiated, a Merkle proof is generated for the message

1. **Can anyone execute a transaction on the CCIP explorer even if they are not the initiator of the transaction?**

Yes, any EOA can manually execute a CCIP message that is eligible for manual execution. However, the executing account must have sufficient native gas tokens (such as ETH on Ethereum or MATIC on Polygon) to cover the gas costs associated with the delivery of the CCIP message.
Yes, any EOA can manually execute a CCIP message that is eligible for manual execution. However, the executing account must have sufficient native gas tokens (such as ETH on Ethereum or POL on Polygon) to cover the gas costs associated with the delivery of the CCIP message.

<br />

Expand Down
2 changes: 1 addition & 1 deletion src/content/chainlink-automation/guides/migrate-to-v2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Automation 2.1 upkeeps are called from a unique forwarder per upkeep and not fro

### Update programmatic upkeeps

Note that migration moves upkeeps from one registry to another. If you interact with your upkeep programatically using Solidity or other interfaces, you must update your code to make sure that you are referencing the correct registry and registrar for your migrated upkeeps:
Note that migration moves upkeeps from one registry to another. If you interact with your upkeep programmatically using Solidity or other interfaces, you must update your code to make sure that you are referencing the correct registry and registrar for your migrated upkeeps:

- Update the registry and registrar addresses.
- Ensure you use the latest version of the ABI for the registry and registrar.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ There is no registration fee or other fees for any offchain computation.

### Fee calculation example

An upkeep transaction was [performed](https://polygonscan.com/tx/0x19309782e15952c90dcadcc02cbf34f331daaeee369d3e3acca43bade02af105) on _Polygon mainnet_. It used _110,051_ gas at a gas price of _182,723,799,380 wei_. The node operator percentage on Polygon was _70%_ at the time of this transaction, and this fee [varies by network](/chainlink-automation/overview/supported-networks). The LINK/MATIC exchange rate for this transaction was _7,308,290,731,273,610,000 wei_. The upkeep's LINK balance was reduced by a fee of _0.008077 LINK_. The preceding information and calculation can be found in the table below:
An upkeep transaction was [performed](https://polygonscan.com/tx/0x19309782e15952c90dcadcc02cbf34f331daaeee369d3e3acca43bade02af105) on _Polygon mainnet_. It used _110,051_ gas at a gas price of _182,723,799,380 wei_. The node operator percentage on Polygon was _70%_ at the time of this transaction, and this fee [varies by network](/chainlink-automation/overview/supported-networks). The LINK/POL exchange rate for this transaction was _7,308,290,731,273,610,000 wei_. The upkeep's LINK balance was reduced by a fee of _0.008077 LINK_. The preceding information and calculation can be found in the table below:

| Variable | Description | Value |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Handle the StreamsLookup upkeep [error codes](/chainlink-automation/guides/strea

You can view the registry or user's upkeep address on [Etherscan](https://etherscan.io/) to view transaction history. There are three types of information you can find on Etherscan:

- **All transactions on registry**: This shows all the perform upkeeps on the registry. You can view a specific `perfomUpkeep` transaction to debug more.
- **All transactions on registry**: This shows all the perform upkeeps on the registry. You can view a specific `performUpkeep` transaction to debug more.
- **Specific `performUpkeep` transaction**: By diving deep in the logs, you can check the upkeep ID within the UpkeepPerformed log.
- **Target's internal transactions**: For a particular target contract, you can view its internal transactions which contains `performUpkeep` transactions for that contract by using the registry address as the filter for _from_ address. _Note_: internal transactions are only visible on Etherscan.

Expand Down
2 changes: 1 addition & 1 deletion src/content/chainlink-functions/resources/billing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Gas cost calculation includes the following variables:
- Callback gas limit: The maximum amount of gas that can be used to call the `handleOracleFulfillment` callback function of the consumer contract in order to provide the response. See the [Cost Simulation](#cost-simulation-reservation) section.
- Gas overhead: The amount of gas used by the FunctionsRouter and FunctionsCoordinator contracts. It is an estimate of the total gas cost of fulfilling a request.
- Native to LINK translation: Your subscription balance can be billed only in LINK tokens.
- Translate the network's native gas tokens to LINK: The total gas cost in _native_ units is translated using the correct [Price Feed](/data-feeds/price-feeds/addresses). For example, on Sepolia, the translation uses the ETH/LINK Price Feed, and on Polygon, the translation uses the MATIC/LINK Price Feed.
- Translate the network's native gas tokens to LINK: The total gas cost in _native_ units is translated using the correct [Price Feed](/data-feeds/price-feeds/addresses). For example, on Sepolia, the translation uses the ETH/LINK Price Feed, and on Polygon, the translation uses POL/LINK Price Feed.
- Fallback Wei to LINK ratio: In the unlikely event that the _Native to LINK_ price data feed is unavailable, the fallback translation is used. You can find this ratio by running the `getConfig` function in the FunctionsCoordinator contract. See the [Supported Networks](/chainlink-functions/supported-networks) page to find the contract addresses for each network.

### Cost simulation (reservation)
Expand Down
6 changes: 3 additions & 3 deletions src/content/quickstarts/functions-demo-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ for updates about future testnet support on Polygon.

## Overview

The [Chainlink Functions Demo App](https://github.com/smartcontractkit/chainlink-functions-demo-app) is designed to run on the Mumbai testnet (Polygon). It uses [Chainlink Functions](/chainlink-functions). The functionality allows users to donate MATIC to their favorite GitHub creators. Authors of those repositories can then claim their donations. Donations are made in an amount of MATIC per amount of Stars the repository has.
The [Chainlink Functions Demo App](https://github.com/smartcontractkit/chainlink-functions-demo-app) is designed to run on the Mumbai testnet (Polygon). It uses [Chainlink Functions](/chainlink-functions). The functionality allows users to donate POL to their favorite GitHub creators. Authors of those repositories can then claim their donations. Donations are made in an amount of POL per amount of Stars the repository has.

Chainlink Functions is used to determine the total donation amount by multiplying the MATIC amount by the star count. There's no back-end involved in the whole donation process.
Chainlink Functions is used to determine the total donation amount by multiplying the POL amount by the star count. There's no back-end involved in the whole donation process.

<Aside type="caution" title="Disclaimer">
This tutorial represents an example of using a Chainlink product or service and is provided to help you understand how
Expand All @@ -41,7 +41,7 @@ Before you start this tutorial, complete the following items:
- If you are new to smart contract development, learn how to [Deploy Your First Smart Contract](/getting-started/deploy-your-first-contract).
- Set up a cryptocurrency wallet such as [MetaMask](https://metamask.io/).
- To deploy this contract on testnets, ensure the deployer account has testnet ERC-677 LINK. Use the [LINK faucet](https://faucets.chain.link/) to retrieve testnet LINK.
- Get testnet MATIC from [faucet.polygon.technology](https://faucet.polygon.technology) to pay for your onchain transactions.
- Get testnet POL from [faucet.polygon.technology](https://faucet.polygon.technology) to pay for your onchain transactions.
- Get at least 2 ERC-677 testnet LINK from [faucets.chain.link/mumbai](https://faucets.chain.link/mumbai).
- Install [Node.js](https://nodejs.org/en/download).
- Install pnpm: `npm install -g pnpm`
Expand Down
10 changes: 5 additions & 5 deletions src/content/resources/link-token-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ Testnet LINK is available at [faucets.chain.link/bnb-chain-testnet](https://fauc
| Decimals | 18 |
| Network status | [bscscan.freshstatus.io](https://bscscan.freshstatus.io/) |

## Polygon (Matic)
## Polygon

### Polygon mainnet

MATIC is used to pay for transactions on Polygon. You can use the [Polygon Bridge](https://wallet.polygon.technology/polygon/bridge/) to transfer tokens to Polygon Mainnet and then use [Polygon Gas Swap](https://wallet.polygon.technology/polygon/gas-swap/) to swap supported tokens to MATIC.
POL is used to pay for transactions on Polygon. You can use the [Polygon Bridge](https://wallet.polygon.technology/polygon/bridge/) to transfer tokens to Polygon Mainnet and then use [Polygon Gas Swap](https://wallet.polygon.technology/polygon/gas-swap/) to swap supported tokens to POL.

<Aside type="caution" title="ERC-677 LINK on Polygon">

The LINK provided by the [Polygon (Matic) Bridge](https://wallet.polygon.technology/polygon/bridge/) is not ERC-677 compatible, so you cannot use it with Chainlink services or oracle nodes. Use the [**Chainlink PegSwap service**](https://pegswap.chain.link/) to convert bridged LINK to the official ERC-677 LINK token on Polygon.
The LINK provided by the [Polygon Bridge](https://wallet.polygon.technology/polygon/bridge/) is not ERC-677 compatible, so you cannot use it with Chainlink services or oracle nodes. Use the [**Chainlink PegSwap service**](https://pegswap.chain.link/) to convert bridged LINK to the official ERC-677 LINK token on Polygon.

Watch the [Moving Chainlink Cross-Chains](https://www.youtube.com/watch?v=WKvIGkBWRUA) video to learn more.

Expand All @@ -118,9 +118,9 @@ Watch the [Moving Chainlink Cross-Chains](https://www.youtube.com/watch?v=WKvIGk

### Amoy testnet

Testnet MATIC is used to pay for transactions on Polygon Amoy.
Testnet POL is used to pay for transactions on Polygon Amoy.

Testnet MATIC and LINK are available at [faucets.chain.link/polygon-amoy](https://faucets.chain.link/polygon-amoy).
Testnet POL and LINK are available at [faucets.chain.link/polygon-amoy](https://faucets.chain.link/polygon-amoy).

| Parameter | Value |
| :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
Loading

0 comments on commit b44bd4f

Please sign in to comment.