code: public static boolean isOpReturn(Script script) {
          List<ScriptChunk> chunks = script.chunks;
          return chunks.size() > 0 && chunks.get(0).equalsOpCode(ScriptOpCodes.OP_RETURN);
      }
docs: Returns whether this script is using OP_RETURN to store arbitrary data.