Files
proxmox/docs/CCIPWETH9Bridge_standard_json_generated.json

28 lines
14 KiB
JSON
Raw Normal View History

{
"language": "Solidity",
"sources": {
"CCIPWETH9Bridge.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n// contracts/ccip/IRouterClient.sol\n\n/**\n * @title Chainlink CCIP Router Client Interface\n * @notice Interface for Chainlink CCIP Router Client\n * @dev This interface is based on Chainlink CCIP Router Client specification\n */\ninterface IRouterClient {\n /// @notice Represents the router's fee token\n enum TokenAmountType {\n Fiat,\n Native\n }\n\n /// @notice Represents a token amount and its type\n struct TokenAmount {\n address token;\n uint256 amount;\n TokenAmountType amountType;\n }\n\n /// @notice Represents a CCIP message\n struct EVM2AnyMessage {\n bytes receiver;\n bytes data;\n TokenAmount[] tokenAmounts;\n address feeToken;\n bytes extraArgs;\n }\n\n /// @notice Represents a CCIP message with source chain information\n struct Any2EVMMessage {\n bytes32 messageId;\n uint64 sourceChainSelector;\n bytes sender;\n bytes data;\n TokenAmount[] tokenAmounts;\n }\n\n /// @notice Emitted when a message is sent\n event MessageSent(\n bytes32 indexed messageId,\n uint64 indexed destinationChainSelector,\n address indexed sender,\n bytes receiver,\n bytes data,\n TokenAmount[] tokenAmounts,\n address feeToken,\n bytes extraArgs\n );\n\n /// @notice Emitted when a message is received\n event MessageReceived(\n bytes32 indexed messageId,\n uint64 indexed sourceChainSelector,\n address indexed sender,\n bytes data,\n TokenAmount[] tokenAmounts\n );\n\n /// @notice Sends a message to a destination chain\n /// @param destinationChainSelector The chain selector of the destination chain\n /// @param message The message to send\n /// @return messageId The ID of the sent message\n /// @return fees The fees required for the message\n /// @dev If feeToken is zero address, fees are paid in native token (ETH) via msg.value\n function ccipSend(\n uint64 destinationChainSelector,\n EVM2AnyMessage memory message\n ) external payable returns (bytes32 messageId, uint256 fees);\n\n /// @notice Gets the fee for sending a message\n /// @param destinationChainSelector The chain selector of the destination chain\n /// @param message The message to send\n /// @return fee The fee required for the message\n function getFee(\n uint64 destinationChainSelector,\n EVM2AnyMessage memory message\n ) external view returns (uint256 fee);\n\n /// @notice Gets the supported tokens for a destination chain\n /// @param destinationChainSelector The chain selector of the destination chain\n /// @return tokens The list of supported tokens\n function getSupportedTokens(\n uint64 destinationChainSelector\n ) external view returns (address[] memory tokens);\n}\n\n// contracts/ccip/CCIPWETH9Bridge.sol\n\n// Minimal IERC20 interface for ERC20 tokens (WETH9 and LINK)\ninterface IERC20 {\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n function transfer(address to, uint256 amount) external returns (bool);\n function approve(address spender, uint256 amount) external returns (bool);\n function balanceOf(address account) external view returns (uint256);\n}\n\n/**\n * @title CCIP WETH9 Bridge\n * @notice Cross-chain WETH9 transfer bridge using Chainlink CCIP\n * @dev Enables users to send WETH9 tokens across chains via CCIP\n */\ncontract CCIPWETH9Bridge {\n \n IRouterClient public immutable ccipRouter;\n address public immutable weth9; // WETH9 contract address\n address public feeToken; // LINK token address\n address public admin;\n \n // Destination chain configurations\n struct DestinationChain {\n uint64 chainSelector;\n address receiverBridge; // Address of corresponding bridge on destination chain\n bool enabled;\n }\n \n mapping(uint64
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"evmVersion": "london",
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.bytecode.sourceMap",
"evm.deployedBytecode.sourceMap"
]
}
}
}
}