Skip to content

Commit a911e78

Browse files
committed
update
1 parent 1696843 commit a911e78

File tree

11 files changed

+4677
-2180
lines changed

11 files changed

+4677
-2180
lines changed

package-lock.json

Lines changed: 4647 additions & 2156 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,23 @@
6363
"@chainlink/design-system": "^0.2.8",
6464
"@chainlink/local": "0.2.5-beta.0",
6565
"@chainlink/solana-sdk": "^0.2.2",
66-
"@metamask/providers": "^20.0.0",
66+
"@metamask/providers": "^22.1.0",
6767
"@nanostores/preact": "^0.5.2",
6868
"@nanostores/react": "^0.8.4",
6969
"@openzeppelin/contracts": "^4.9.6",
7070
"astro": "^5.13.5",
71-
"@solana-program/compute-budget": "^0.8.0",
72-
"@solana-program/system": "^0.7.0",
73-
"@solana-program/token": "^0.5.1",
74-
"@solana-program/token-2022": "^0.4.2",
75-
"@solana/addresses": "^2.3.0",
76-
"@solana/instructions": "^2.3.0",
77-
"@solana/keys": "^2.3.0",
78-
"@solana/kit": "^2.3.0",
79-
"@solana/react": "^2.3.0",
80-
"@solana/rpc-types": "^2.3.0",
81-
"@solana/transaction-messages": "^2.3.0",
82-
"@solana/transactions": "^2.3.0",
71+
"@solana-program/compute-budget": "^0.9.0",
72+
"@solana-program/system": "^0.8.0",
73+
"@solana-program/token": "^0.6.0",
74+
"@solana-program/token-2022": "^0.5.0",
75+
"@solana/addresses": "^3.0.2",
76+
"@solana/instructions": "^3.0.2",
77+
"@solana/keys": "^3.0.2",
78+
"@solana/kit": "^3.0.2",
79+
"@solana/react": "^3.0.2",
80+
"@solana/rpc-types": "^3.0.2",
81+
"@solana/transaction-messages": "^3.0.2",
82+
"@solana/transactions": "^3.0.2",
8383
"@solana/wallet-adapter-base": "^0.9.27",
8484
"@solana/wallet-adapter-react": "^0.15.39",
8585
"@solana/wallet-adapter-react-ui": "^0.9.39",

src/content/ccip/tutorials/evm/manual-execution.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ This tutorial is similar to the [programmable token transfers example](/ccip/tut
3737
1. You should understand how to write, compile, deploy, and fund a smart contract. If you need to brush up on the basics, read this [tutorial](/quickstarts/deploy-your-first-contract), which will guide you through using the [Solidity programming language](https://soliditylang.org/), interacting with the [MetaMask wallet](https://metamask.io) and working within the [Remix Development Environment](https://remix.ethereum.org/).
3838
1. Your account must have some AVAX and LINK tokens on _Avalanche Fuji_ and ETH tokens on _Ethereum Sepolia_. Learn how to [Acquire testnet LINK](/resources/acquire-link).
3939
1. Check the [CCIP Directory](/ccip/directory) to confirm that the tokens you will transfer are supported for your lane. In this example, you will transfer tokens from _Avalanche Fuji_ to _Ethereum Sepolia_ so check the list of supported tokens [here](/ccip/directory/testnet/chain/avalanche-fuji-testnet).
40-
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#mint-test-tokens). Following this guide, you should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
40+
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#evm-chains). Following this guide, you should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
4141
1. Learn how to [fund your contract](/resources/fund-your-contract). This guide shows how to fund your contract in LINK, but you can use the same guide for funding your contract with any ERC20 tokens as long as they appear in the list of tokens in MetaMask.
4242
1. Follow the previous tutorial: [_Transfer Tokens with Data_](/ccip/tutorials/evm/programmable-token-transfers) to learn how to make programmable token transfers using CCIP.
4343
1. Create a free account on [Tenderly](https://tenderly.co/). You will use Tenderly to investigate the failed execution of the receiver contract.

src/content/ccip/tutorials/evm/offchain/ccip-tools/transfer-tokens-from-eoa.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ In this tutorial, you will use Chainlink CCIP to transfer tokens directly from y
4646

4747
1. Check the [CCIP Directory](/ccip/directory) to confirm that the tokens you will transfer are supported for your lane. In this example, you will transfer tokens from _Avalanche Fuji_ to _Ethereum Sepolia_ so check the list of supported tokens [here](/ccip/directory/testnet/chain/avalanche-fuji-testnet). Alternatively, you can use the [Get Supported Tokens](/ccip/tutorials/evm/offchain/ccip-tools/get-supported-tokens) tutorial to retrieve the list of supported tokens programmatically.
4848

49-
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#mint-test-tokens). After following this guide, your [EOA (Externally Owned Account)](https://ethereum.org/en/developers/docs/accounts/#types-of-account) should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
49+
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#evm-chains). After following this guide, your [EOA (Externally Owned Account)](https://ethereum.org/en/developers/docs/accounts/#types-of-account) should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
5050

5151
1. In a terminal, clone the [ccip-tools-ts repository](https://github.com/smartcontractkit/ccip-tools-ts) and change to the `ccip-tools-ts` directory.
5252

src/content/ccip/tutorials/evm/offchain/transfer-tokens-from-eoa.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ In this tutorial, you will use Chainlink CCIP to transfer tokens directly from y
4646

4747
1. Check the [CCIP Directory](/ccip/directory) to confirm that the tokens you will transfer are supported for your lane. In this example, you will transfer tokens from _Avalanche Fuji_ to _Ethereum Sepolia_ so check the list of supported tokens [here](/ccip/directory/testnet/chain/avalanche-fuji-testnet).
4848

49-
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#mint-test-tokens). After following this guide, your [EOA (Externally Owned Account)](https://ethereum.org/en/developers/docs/accounts/#types-of-account) should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
49+
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#evm-chains). After following this guide, your [EOA (Externally Owned Account)](https://ethereum.org/en/developers/docs/accounts/#types-of-account) should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
5050

5151
1. In a terminal, clone the [smart-contract-examples repository](https://github.com/smartcontractkit/smart-contract-examples) and change to the `smart-contract-examples/ccip/offchain/javascript` directory.
5252

src/content/ccip/tutorials/evm/programmable-token-transfers-defensive.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This tutorial extends the [programmable token transfers example](/ccip/tutorials
3434
1. You should understand how to write, compile, deploy, and fund a smart contract. If you need to brush up on the basics, read this [tutorial](/quickstarts/deploy-your-first-contract), which will guide you through using the [Solidity programming language](https://soliditylang.org/), interacting with the [MetaMask wallet](https://metamask.io) and working within the [Remix Development Environment](https://remix.ethereum.org/).
3535
1. Your account must have some AVAX and LINK tokens on _Avalanche Fuji_ and ETH tokens on _Ethereum Sepolia_. Learn how to [Acquire testnet LINK](/resources/acquire-link).
3636
1. Check the [CCIP Directory](/ccip/directory) to confirm that the tokens you will transfer are supported for your lane. In this example, you will transfer tokens from _Avalanche Fuji_ to _Ethereum Sepolia_ so check the list of supported tokens [here](/ccip/directory/testnet/chain/avalanche-fuji-testnet).
37-
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#mint-test-tokens). Following this guide, you should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
37+
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#evm-chains). Following this guide, you should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
3838
1. Learn how to [fund your contract](/resources/fund-your-contract). This guide shows how to fund your contract in LINK, but you can use the same guide for funding your contract with any ERC20 tokens as long as they appear in the list of tokens in MetaMask.
3939
1. Follow the previous tutorial: [_Transfer Tokens with Data_](/ccip/tutorials/evm/programmable-token-transfers) to learn how to make programmable token transfers using CCIP.
4040

src/content/ccip/tutorials/evm/programmable-token-transfers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ In this tutorial, you will use Chainlink CCIP to transfer tokens and arbitrary d
4040
1. You should understand how to write, compile, deploy, and fund a smart contract. If you need to brush up on the basics, read this [tutorial](/quickstarts/deploy-your-first-contract), which will guide you through using the [Solidity programming language](https://soliditylang.org/), interacting with the [MetaMask wallet](https://metamask.io) and working within the [Remix Development Environment](https://remix.ethereum.org/).
4141
1. Your account must have some AVAX and LINK tokens on _Avalanche Fuji_ and ETH tokens on _Ethereum Sepolia_. Learn how to [Acquire testnet LINK](/resources/acquire-link).
4242
1. Check the [CCIP Directory](/ccip/directory) to confirm that the tokens you will transfer are supported for your lane. In this example, you will transfer tokens from _Avalanche Fuji_ to _Ethereum Sepolia_ so check the list of supported tokens [here](/ccip/directory/testnet/chain/avalanche-fuji-testnet).
43-
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#mint-test-tokens). Following this guide, you should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
43+
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#evm-chains). Following this guide, you should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
4444
1. Learn how to [fund your contract](/resources/fund-your-contract). This guide shows how to fund your contract in LINK, but you can use the same guide for funding your contract with any ERC20 tokens as long as they appear in the list of tokens in MetaMask.
4545
1. Follow the previous tutorial: [_Transfer tokens_](/ccip/tutorials/evm/transfer-tokens-from-contract).
4646

src/content/ccip/tutorials/evm/transfer-tokens-from-contract.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ In this tutorial, you will use Chainlink CCIP to transfer tokens from a smart co
3939

4040
1. Your account must have some AVAX and LINK tokens on _Avalanche Fuji_. Learn how to [Acquire testnet LINK](/resources/acquire-link).
4141
1. Check the [CCIP Directory](/ccip/directory) to confirm that the tokens you will transfer are supported for your lane. In this example, you will transfer tokens from _Avalanche Fuji_ to _Ethereum Sepolia_ so check the list of supported tokens [here](/ccip/directory/testnet/chain/avalanche-fuji-testnet).
42-
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#mint-test-tokens). Following this guide, you should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
42+
1. Learn how to [acquire CCIP test tokens](/ccip/test-tokens#evm-chains). Following this guide, you should have CCIP-BnM tokens, and CCIP-BnM should appear in the list of your tokens in MetaMask.
4343
1. Learn how to [fund your contract](/resources/fund-your-contract). This guide shows how to fund your contract in LINK, but you can use the same guide to fund your contract with any ERC20 tokens as long as they appear in the list of tokens in MetaMask.
4444

4545
## Tutorial
4646

4747
<CcipCommon callout="useSimulator" />
4848

49-
In this tutorial, you will transfer [CCIP-BnM](/ccip/test-tokens#tokens) tokens from a contract on Avalanche Fuji to an account on Ethereum Sepolia. First, you will pay [CCIP fees in LINK](#transfer-tokens-and-pay-in-link), then you will pay [CCIP fees in native gas](#transfer-tokens-and-pay-in-native). The destination account can be an [EOA (Externally Owned Account)](https://ethereum.org/en/developers/docs/accounts/#types-of-account) or a smart contract. Moreover, the example shows how to transfer CCIP-BnM tokens, but you can re-use the same example to transfer other tokens as long as they are supported for your [lane](/ccip/concepts/architecture/key-concepts#lane).
49+
In this tutorial, you will transfer [CCIP-BnM](/ccip/test-tokens#about-ccip-test-tokens) tokens from a contract on Avalanche Fuji to an account on Ethereum Sepolia. First, you will pay [CCIP fees in LINK](#transfer-tokens-and-pay-in-link), then you will pay [CCIP fees in native gas](#transfer-tokens-and-pay-in-native). The destination account can be an [EOA (Externally Owned Account)](https://ethereum.org/en/developers/docs/accounts/#types-of-account) or a smart contract. Moreover, the example shows how to transfer CCIP-BnM tokens, but you can re-use the same example to transfer other tokens as long as they are supported for your [lane](/ccip/concepts/architecture/key-concepts#lane).
5050

5151
<CodeSample src="samples/CCIP/TokenTransferor.sol" />
5252

src/lib/solana/domain/transaction/services/manager.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
type AccountInfoBase,
1616
type AccountInfoWithBase64EncodedData,
1717
} from "@solana/kit"
18+
import { assertIsTransactionWithinSizeLimit, assertIsSendableTransaction } from "@solana/transactions"
1819
import type { IRpcContext } from "../../../infrastructure/rpc/types.ts"
1920
import type { Logger } from "@lib/logging/index.js"
2021
import { TransactionBuilder } from "./builder.ts"
@@ -99,6 +100,8 @@ export class TransactionManager {
99100
})
100101

101102
try {
103+
assertIsTransactionWithinSizeLimit(signedTransaction)
104+
assertIsSendableTransaction(signedTransaction)
102105
await sendAndConfirm(signedTransaction, {
103106
commitment: this.rpcContext.commitment,
104107
minContextSlot: context.slot, // Race-free confirmation
@@ -134,6 +137,8 @@ export class TransactionManager {
134137
)
135138
signature = getSignatureFromTransaction(retrySignedTransaction)
136139

140+
assertIsTransactionWithinSizeLimit(retrySignedTransaction)
141+
assertIsSendableTransaction(retrySignedTransaction)
137142
await sendAndConfirm(retrySignedTransaction, {
138143
commitment: this.rpcContext.commitment,
139144
minContextSlot: freshContext.slot,

src/lib/solana/network-analysis/core/cost-estimator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
getCompiledTransactionMessageDecoder,
1111
getCompiledTransactionMessageEncoder,
1212
} from "@solana/transaction-messages"
13-
import type { FullySignedTransaction, TransactionMessageBytesBase64 } from "@solana/transactions"
13+
import type { FullySignedTransaction, Transaction, TransactionMessageBytesBase64 } from "@solana/transactions"
1414
import {
1515
type TransactionCostBreakdown,
1616
type TransactionPreferences,
@@ -53,7 +53,7 @@ export class TransactionCostEstimator {
5353
* @throws Error when RPC methods fail or transaction is invalid
5454
*/
5555
async estimateTransactionCost(
56-
transaction: FullySignedTransaction,
56+
transaction: FullySignedTransaction & Transaction,
5757
feeMarketAnalysis: FeeMarketAnalysisResult,
5858
preferences: TransactionPreferences = DEFAULT_TRANSACTION_PREFERENCES,
5959
requestId?: string
@@ -309,7 +309,7 @@ export class TransactionCostEstimator {
309309
* @returns Estimated compute units required
310310
*/
311311
private estimateComputeUnitsRequired(
312-
transaction: FullySignedTransaction,
312+
transaction: FullySignedTransaction & Transaction,
313313
preferences: TransactionPreferences
314314
): number {
315315
// Base estimation - will be refined with actual simulation

0 commit comments

Comments
 (0)