{
    "Function": "_getRelayerFee",
    "File": "contracts/mocks/LZEndpointMock.sol",
    "Parent Contracts": [
        "contracts/OFT/interfaces/ILayerZeroEndpoint.sol",
        "contracts/OFT/interfaces/ILayerZeroUserApplicationConfig.sol"
    ],
    "High-Level Calls": [
        "LzLib"
    ],
    "Internal Calls": [
        "require(bool,string)"
    ],
    "Library Calls": [
        "decodeAdapterParams"
    ],
    "Low-Level Calls": [],
    "Code": "function _getRelayerFee(\n        uint16, /* _dstChainId */\n        uint16, /* _outboundProofType */\n        address, /* _userApplication */\n        uint _payloadSize,\n        bytes memory _adapterParams\n    ) internal view returns (uint) {\n        (uint16 txType, uint extraGas, uint dstNativeAmt, ) = LzLib.decodeAdapterParams(_adapterParams);\n        uint totalRemoteToken; // = baseGas + extraGas + requiredNativeAmount\n        if (txType == 2) {\n            require(relayerFeeConfig.dstNativeAmtCap >= dstNativeAmt, \"LayerZeroMock: dstNativeAmt too large \");\n            totalRemoteToken += dstNativeAmt;\n        }\n        // remoteGasTotal = dstGasPriceInWei * (baseGas + extraGas)\n        uint remoteGasTotal = relayerFeeConfig.dstGasPriceInWei * (relayerFeeConfig.baseGas + extraGas);\n        totalRemoteToken += remoteGasTotal;\n\n        // tokenConversionRatio = dstPrice / localPrice\n        // basePrice = totalRemoteToken * tokenConversionRatio\n        uint basePrice = (totalRemoteToken * relayerFeeConfig.dstPriceRatio) / 10**10;\n\n        // pricePerByte = (dstGasPriceInWei * gasPerBytes) * tokenConversionRatio\n        uint pricePerByte = (relayerFeeConfig.dstGasPriceInWei * relayerFeeConfig.gasPerByte * relayerFeeConfig.dstPriceRatio) / 10**10;\n\n        return basePrice + _payloadSize * pricePerByte;\n    }"
}