{
    "Function": "crossChain",
    "File": "contracts/GovNFT.sol",
    "Parent Contracts": [
        "contracts/interfaces/IGovNFT.sol",
        "contracts/utils/MetaContext.sol",
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "contracts/interfaces/ILayerZeroReceiver.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol",
        "node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol",
        "node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "ILayerZeroEndpoint",
        "ILayerZeroEndpoint"
    ],
    "Internal Calls": [
        "_msgSender",
        "require(bool,string)",
        "_burn",
        "abi.encode()",
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "_msgSender",
        "ownerOf",
        "mload(uint256)",
        "abi.encodePacked()"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function crossChain(\n        uint16 _dstChainId,\n        bytes memory _destination,\n        address _to,\n        uint256[] memory tokenId\n    ) public payable {\n        require(tokenId.length > 0, \"Not bridging\");\n        for (uint i=0; i<tokenId.length; i++) {\n            require(_msgSender() == ownerOf(tokenId[i]), \"Not the owner\");\n            // burn NFT\n            _burn(tokenId[i]);\n        }\n        address targetAddress;\n        assembly {\n            targetAddress := mload(add(_destination, 20))\n        }\n        require(isTrustedAddress[_dstChainId][targetAddress], \"!Trusted\");\n        bytes memory payload = abi.encode(_to, tokenId);\n        // encode adapterParams to specify more gas for the destination\n        uint16 version = 1;\n        uint256 _gas = 500_000 + gas*tokenId.length;\n        bytes memory adapterParams = abi.encodePacked(version, _gas);\n        (uint256 messageFee, ) = endpoint.estimateFees(\n            _dstChainId,\n            address(this),\n            payload,\n            false,\n            adapterParams\n        );\n        require(\n            msg.value >= messageFee,\n            \"Must send enough value to cover messageFee\"\n        );\n        endpoint.send{value: msg.value}(\n            _dstChainId,\n            _destination,\n            payload,\n            payable(_msgSender()),\n            address(0x0),\n            adapterParams\n        );\n    }"
}