Verified contractPartialMIT
CCIPFacet
Address0xe7c2a8abced933e58c1425c160023948c43eb99f
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.18
- Same code
Only this contract
Details
- Compiler
- solc 0.8.18+commit.87f61d96
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- paris
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 18,521,562
- Creation transaction
- 0x1afd1f47c2…615be46549
34 files
The source code is large: one file is shown at a time. Choose a file in the list.
- src/facets/CCIPFacet.solmain1.32 KB
- lib/chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol4.76 KB
- lib/chainlink/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol1.1 KB
- lib/chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol6.88 KB
- lib/forge-std/lib/ds-test/src/test.sol20.5 KB
- lib/forge-std/src/Base.sol1.79 KB
- lib/forge-std/src/StdAssertions.sol13.67 KB
- lib/forge-std/src/StdChains.sol11.12 KB
- lib/forge-std/src/StdCheats.sol31.45 KB
- lib/forge-std/src/StdError.sol1.01 KB
- lib/forge-std/src/StdInvariant.sol3.51 KB
- lib/forge-std/src/StdJson.sol6.28 KB
- lib/forge-std/src/StdMath.sol1.36 KB
- lib/forge-std/src/StdStorage.sol13.79 KB
- lib/forge-std/src/StdStyle.sol10.46 KB
- lib/forge-std/src/StdUtils.sol10.52 KB
- lib/forge-std/src/Test.sol1.16 KB
- lib/forge-std/src/Vm.sol37.15 KB
- lib/forge-std/src/console.sol66.69 KB
- lib/forge-std/src/console2.sol69.68 KB
- lib/forge-std/src/interfaces/IMulticall3.sol2.19 KB
- lib/forge-std/src/safeconsole.sol397.9 KB
- lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol4.88 KB
- lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol853 B
- node_modules/@chainlink/contracts-ccip/src/v0.8/ccip/interfaces/IRouterClient.sol1.83 KB
- node_modules/@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol1.55 KB
- src/interfaces/IDiamondCut.sol1.33 KB
- src/interfaces/IERC1155.sol5.28 KB
- src/interfaces/IERC165.sol538 B
- src/interfaces/IERC721.sol4.96 KB
- src/libraries/LibAppStorage.sol1.95 KB
- src/libraries/LibCCIP.sol4.45 KB
- src/libraries/LibDiamond.sol12.96 KB
- src/libraries/LibTokenManager.sol1.22 KB
src/facets/CCIPFacet.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Client} from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol";
import {IRouterClient} from "@chainlink/contracts-ccip/src/v0.8/ccip/interfaces/IRouterClient.sol";
import {Modifiers} from "../libraries/LibAppStorage.sol";
import {LibCCIP} from "../libraries/LibCCIP.sol";
import {LibTokenManager} from "../libraries/LibTokenManager.sol";
import {console} from "forge-std/Test.sol";
contract CCIPFacet is Modifiers {
uint8 private constant SEND_TOKEN_ACTION = 1;
/**
* @notice Receives a CCIP (Cross-Chain Interoperability Protocol) message and triggers the appropriate action.
* @dev This function decodes the CCIP message and based on the action, triggers the corresponding functionality.
* Currently, it supports the SEND_TOKEN_ACTION which triggers the sendToken functionality.
* @param any2EvmMessage The CCIP message received.
*/
function ccipReceive(Client.Any2EVMMessage calldata any2EvmMessage) external {
(, bytes memory actionPayload) = LibCCIP.handleReceiveMessage(any2EvmMessage);
(uint8 action, bytes memory payload) = abi.decode(actionPayload, (uint8, bytes));
if (action == SEND_TOKEN_ACTION) {
LibTokenManager.sendToken(payload);
}
}
}
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "paris",
"remappings": [
":@chainlink/contracts-ccip/=node_modules/@chainlink/contracts-ccip/",
":@chainlink/contracts/=lib/chainlink/contracts/",
":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
":Arachnid/solidity-stringutils/=lib/solidity-stringutils/",
":chainlink/=lib/chainlink/",
":ds-test/=lib/forge-std/lib/ds-test/src/",
":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
":forge-std/=lib/forge-std/src/",
":foundry-devops/=lib/foundry-devops/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/",
":openzeppelin/=lib/openzeppelin-contracts/contracts/",
":solidity-stringutils/=lib/solidity-stringutils/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.