```\n// mTOFT.sol\n\nfunction wrap(address _fromAddress, address _toAddress, uint256 _amount)\n        external\n        payable \n        whenNotPaused\n        nonReentrant\n        returns (uint256 minted)\n    {\n        // rest of code\n     \n        uint256 feeAmount = _checkAndExtractFees(_amount);\n        if (erc20 == address(0)) {\n            _wrapNative(_toAddress, _amount, feeAmount);\n        } else { \n            if (msg.value > 0) revert mTOFT_NotNative();\n            _wrap(_fromAddress, _toAddress, _amount, feeAmount);\n        }\n\n        return _amount - feeAmount;\n    } \n```\n