{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/cgp/test/AxelarDepositService.sol",
    "Parent Contracts": [
        "contracts/cgp/interfaces/IAxelarDepositService.sol",
        "contracts/cgp/test/DepositServiceBase.sol",
        "contracts/cgp/interfaces/IDepositServiceBase.sol",
        "contracts/cgp/util/Upgradable.sol",
        "contracts/cgp/interfaces/IUpgradable.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract AxelarDepositService is Upgradable, DepositServiceBase, IAxelarDepositService {\n    using SafeTokenTransfer for IERC20;\n    using SafeNativeTransfer for address;\n\n    // This public storage for ERC20 token intended to be refunded.\n    // It triggers the DepositReceiver/ReceiverImplementation to switch into a refund mode.\n    // Address is stored and deleted withing the same refund transaction.\n    address public refundToken;\n\n    address public immutable receiverImplementation;\n    address public immutable refundIssuer;\n\n    constructor(\n        address gateway_,\n        string memory wrappedSymbol_,\n        address refundIssuer_\n    ) DepositServiceBase(gateway_, wrappedSymbol_) {\n        if (refundIssuer_ == address(0)) revert InvalidAddress();\n\n        refundIssuer = refundIssuer_;\n        receiverImplementation = address(new ReceiverImplementation(gateway_, wrappedSymbol_));\n    }\n\n    // @dev This method is meant to be called directly by user to send native token cross-chain\n    function sendNative(string calldata destinationChain, string calldata destinationAddress) external payable {\n        address wrappedTokenAddress = wrappedToken();\n        uint256 amount = msg.value;\n\n        if (amount == 0) revert NothingDeposited();\n\n        // Wrapping the native currency and into WETH-like token\n        IWETH9(wrappedTokenAddress).deposit{ value: amount }();\n        // Not doing safe approval as gateway will revert anyway if approval fails\n        // We expect allowance to always be 0 at this point\n        IWETH9(wrappedTokenAddress).approve(gateway, amount);\n        // Sending the token trough the gateway\n        IAxelarGateway(gateway).sendToken(destinationChain, destinationAddress, wrappedSymbol(), amount);\n    }\n\n    // @dev Generates a deposit address for sending an ERC20 token cross-chain\n    function addressForTokenDeposit(\n        bytes32 salt,\n        address refundAddress,\n        string calldata destinationChain,\n        string calldata destinationAddress,\n        string calldata tokenSymbol\n    ) external view returns (address) {\n        return\n            _depositAddress(\n                salt,\n                abi.encodeWithSelector(\n                    ReceiverImplementation.receiveAndSendToken.selector,\n                    refundAddress,\n                    destinationChain,\n                    destinationAddress,\n                    tokenSymbol\n                ),\n                refundAddress\n            );\n    }\n\n    // @dev Generates a deposit address for sending native currency cross-chain\n    function addressForNativeDeposit(\n        bytes32 salt,\n        address refundAddress,\n        string calldata destinationChain,\n        string calldata destinationAddress\n    ) public view returns (address) {\n        return\n            _depositAddress(\n                salt,\n                abi.encodeWithSelector(\n                    ReceiverImplementation.receiveAndSendNative.selector,\n                    refundAddress,\n                    destinationChain,\n                    destinationAddress\n                ),\n                refundAddress\n            );\n    }\n\n    // @dev Generates a deposit address for unwrapping WETH-like token into native currency\n    function addressForNativeUnwrap(\n        bytes32 salt,\n        address refundAddress,\n        address recipient\n    ) external view returns (address) {\n        return\n            _depositAddress(\n                salt,\n                abi.encodeWithSelector(ReceiverImplementation.receiveAndUnwrapNative.selector, refundAddress, recipient),\n                refundAddress\n            );\n    }\n\n    // @dev Receives ERC20 token from the deposit address and sends it cross-chain\n    function sendTokenDeposit(\n        bytes32 salt,\n        address refundAddress,\n        string calldata destinationChain,\n        string calldata destinationAddress,\n        string calldata tokenSymbol\n    ) external {\n        // NOTE: `DepositReceiver` is destroyed in the same runtime context that it is deployed.\n        new DepositReceiver{ salt: salt }(\n            abi.encodeWithSelector(\n                ReceiverImplementation.receiveAndSendToken.selector,\n                refundAddress,\n                destinationChain,\n                destinationAddress,\n                tokenSymbol\n            ),\n            refundAddress\n        );\n    }\n\n    // @dev Refunds ERC20 tokens from the deposit address if they don't match the intended token\n    // Only refundAddress can refund the token that was intended to go cross-chain (if not sent yet)\n    function refundTokenDeposit(\n        bytes32 salt,\n        address refundAddress,\n        string calldata destinationChain,\n        string calldata destinationAddress,\n        string calldata tokenSymbol,\n        address[] calldata refundTokens\n    ) external {\n        address intendedToken = IAxelarGateway(gateway).tokenAddresses(tokenSymbol);\n\n        uint256 tokensLength = refundTokens.length;\n        for (uint256 i; i < tokensLength; ++i) {\n            // Allowing only the refundAddress to refund the intended token\n            if (refundTokens[i] == intendedToken && msg.sender != refundAddress) continue;\n\n            // Saving to public storage to be accessed by the DepositReceiver\n            refundToken = refundTokens[i];\n            // NOTE: `DepositReceiver` is destroyed in the same runtime context that it is deployed.\n            new DepositReceiver{ salt: salt }(\n                abi.encodeWithSelector(\n                    ReceiverImplementation.receiveAndSendToken.selector,\n                    refundAddress,\n                    destinationChain,\n                    destinationAddress,\n                    tokenSymbol\n                ),\n                refundAddress\n            );\n        }\n\n        refundToken = address(0);\n    }\n\n    // @dev Receives native currency, wraps it into WETH-like token and sends cross-chain\n    function sendNativeDeposit(\n        bytes32 salt,\n        address refundAddress,\n        string calldata destinationChain,\n        string calldata destinationAddress\n    ) external {\n        // NOTE: `DepositReceiver` is destroyed in the same runtime context that it is deployed.\n        new DepositReceiver{ salt: salt }(\n            abi.encodeWithSelector(\n                ReceiverImplementation.receiveAndSendNative.selector,\n                refundAddress,\n                destinationChain,\n                destinationAddress\n            ),\n            refundAddress\n        );\n    }\n\n    // @dev Refunds ERC20 tokens from the deposit address after the native deposit was sent\n    // Only refundAddress can refund the native currency intended to go cross-chain (if not sent yet)\n    function refundNativeDeposit(\n        bytes32 salt,\n        address refundAddress,\n        string calldata destinationChain,\n        string calldata destinationAddress,\n        address[] calldata refundTokens\n    ) external {\n        // Allowing only the refundAddress to refund the native currency\n        if (addressForNativeDeposit(salt, refundAddress, destinationChain, destinationAddress).balance > 0 && msg.sender != refundAddress)\n            return;\n\n        uint256 tokensLength = refundTokens.length;\n        for (uint256 i; i < tokensLength; ++i) {\n            refundToken = refundTokens[i];\n            // NOTE: `DepositReceiver` is destroyed in the same runtime context that it is deployed.\n            new DepositReceiver{ salt: salt }(\n                abi.encodeWithSelector(\n                    ReceiverImplementation.receiveAndSendNative.selector,\n                    refundAddress,\n                    destinationChain,\n                    destinationAddress\n                ),\n                refundAddress\n            );\n        }\n\n        refundToken = address(0);\n    }\n\n    // @dev Receives WETH-like token, unwraps and send native currency to the recipient\n    function nativeUnwrap(\n        bytes32 salt,\n        address refundAddress,\n        address payable recipient\n    ) external {\n        // NOTE: `DepositReceiver` is destroyed in the same runtime context that it is deployed.\n        new DepositReceiver{ salt: salt }(\n            abi.encodeWithSelector(ReceiverImplementation.receiveAndUnwrapNative.selector, refundAddress, recipient),\n            refundAddress\n        );\n    }\n\n    // @dev Refunds ERC20 tokens from the deposit address except WETH-like token\n    // Only refundAddress can refund the WETH-like token intended to be unwrapped (if not yet)\n    function refundNativeUnwrap(\n        bytes32 salt,\n        address refundAddress,\n        address payable recipient,\n        address[] calldata refundTokens\n    ) external {\n        address wrappedTokenAddress = wrappedToken();\n\n        uint256 tokensLength = refundTokens.length;\n        for (uint256 i; i < tokensLength; ++i) {\n            // Allowing only the refundAddress to refund the intended WETH-like token\n            if (refundTokens[i] == wrappedTokenAddress && msg.sender != refundAddress) continue;\n\n            refundToken = refundTokens[i];\n            // NOTE: `DepositReceiver` is destroyed in the same runtime context that it is deployed.\n            new DepositReceiver{ salt: salt }(\n                abi.encodeWithSelector(ReceiverImplementation.receiveAndUnwrapNative.selector, refundAddress, recipient),\n                refundAddress\n            );\n        }\n\n        refundToken = address(0);\n    }\n\n    function refundLockedAsset(\n        address receiver,\n        address token,\n        uint256 amount\n    ) external {\n        if (msg.sender != refundIssuer) revert NotRefundIssuer();\n        if (receiver == address(0)) revert InvalidAddress();\n        if (amount == 0) revert InvalidAmount();\n\n        if (token == address(0)) {\n            receiver.safeNativeTransfer(amount);\n        } else {\n            IERC20(token).safeTransfer(receiver, amount);\n        }\n    }\n\n    function _depositAddress(\n        bytes32 salt,\n        bytes memory delegateData,\n        address refundAddress\n    ) internal view returns (address) {\n        /* Convert a hash which is bytes32 to an address which is 20-byte long\n        according to https://docs.soliditylang.org/en/v0.8.9/control-structures.html?highlight=create2#salted-contract-creations-create2 */\n        return\n            address(\n                uint160(\n                    uint256(\n                        keccak256(\n                            abi.encodePacked(\n                                hex'ff',\n                                address(this),\n                                salt,\n                                // Encoding delegateData and refundAddress as constructor params\n                                keccak256(abi.encodePacked(type(DepositReceiver).creationCode, abi.encode(delegateData, refundAddress)))\n                            )\n                        )\n                    )\n                )\n            );\n    }\n\n    function contractId() external pure returns (bytes32) {\n        return keccak256('axelar-deposit-service');\n    }\n}"
}