# Examples

## Localhost examples with Foundry and Hardhat

You can check our current examples for reference:

* [Unsafe Token And Data Transfer Test in Foundry](https://github.com/smartcontractkit/chainlink-local/blob/main/test/smoke/ccip/UnsafeTokenAndDataTransfer.t.sol)
* [Unsafe Token And Data Transfer Test in Hardhat](https://github.com/smartcontractkit/chainlink-local/blob/main/test/smoke/ccip/UnsafeTokenAndDataTransfer.spec.ts)
* [Unsafe Token And Data Transfer Script in Hardhat](https://github.com/smartcontractkit/chainlink-local/blob/main/scripts/examples/UnsafeTokenAndDataTransfer.ts)
* [Unsafe Token Transfer With Native Coin Test in Foundry](https://github.com/smartcontractkit/chainlink-local/blob/main/test/smoke/ccip/PayWithNative.t.sol)
* [Ping Pong example Test in Foundry (Reply cross-chain messages)](https://github.com/smartcontractkit/chainlink-local/blob/main/test/smoke/ccip/PingPong.t.sol)

And also recreated test examples in Foundry from the [Official Chainlink Documentation](https://docs.chain.link/ccip):

* [Token Transferor](https://github.com/smartcontractkit/chainlink-local/blob/main/test/smoke/ccip/TokenTransferor.t.sol)
* [Programmable Token Transfers](https://github.com/smartcontractkit/chainlink-local/blob/main/test/smoke/ccip/ProgrammableTokenTransfers.t.sol)
* [Programmable Token Transfers - Defensive Example](https://github.com/smartcontractkit/chainlink-local/blob/main/test/smoke/ccip/ProgrammableDefensiveTokenTransfers.t.sol)

## Forking examples with Foundry:

User must provide `ETHEREUM_SEPOLIA_RPC_URL` and `ARBITRUM_SEPOLIA_RPC_URL`.

* [Ping Pong example Fork Test in Foundry (Reply cross-chain messages)](https://github.com/smartcontractkit/chainlink-local/blob/main/test/e2e/ccip/PingPongFork.t.sol)
* [Token Transferor Fork Test in Foundry](https://github.com/smartcontractkit/chainlink-local/blob/main/test/e2e/ccip/TokenTransferorFork.t.sol)

## Forking examples with Hardhat:

User must provide `ETHEREUM_SEPOLIA_RPC_URL` and `ARBITRUM_SEPOLIA_RPC_URL`.

* [Unsafe Token And Data Transfer Fork Script in Hardhat](https://github.com/smartcontractkit/chainlink-local/blob/main/scripts/examples/UnsafeTokenAndDataTransferFork.ts)

To run this example, you must git clone [https://github.com/smartcontractkit/chainlink-local](https://github.com/smartcontractkit/chainlink-local) repository first and then:

1. In the first terminal window run: `npx hardhat node`
2. In the second terminal window run: `npx hardhat run ./scripts/examples/UnsafeTokenAndDataTransferFork.ts --network localhost`
