By David Stires

(FORTUNE Magazine) – SLEAZY DEALS, DUBIOUS ACCOUNTING practices, and now a federal investigation--Krispy Kreme, what happened!? Ever since issuing its first-ever profit warning in May, the doughnut maker--which we dubbed the "hottest brand in the land" in a July 2003 cover story--has taken a series of beatings. The latest: In October the company said the Securities and Exchange Commission had upgraded its informal inquiry to a formal probe.

The problem seems to be with the franchises Krispy Kreme began reacquiring a few years ago from owners who wanted to exit the business. Krispy Kreme decided to book most of the purchase price as an intangible asset called "reacquired franchise rights," which it doesn't amortize, or write-down over time. Management has said that its accounting reflects its belief that reacquired franchise rights have "indefinite lives." But critics charge that this gooses profits, and doesn't reflect the cost of the stores on its balance sheet.

Accounting experts say it's unclear whether Krispy Kreme's method violates Generally Accepted Accounting Principles, or GAAP. Camelback Research Alliance, an independent research firm in Scottsdale, recently surveyed 18 franchise operators. Of the four that reported reacquired franchise rights, all amortized those costs over time. Krispy Kreme's methods are "definitely not conservative," says Camelback analyst Rob Miceli.

Then there are the shady deals. Krispy Kreme didn't disclose that a California franchise it repurchased earlier this year was partly owned by CEO Scott Livengood's ex-wife. Her stake was valued at $1.5 million. While executives aren't required to disclose transactions with former spouses, Livengood could be in trouble if the deal was made as part of a settlement or in lieu of alimony.

A more troubling transaction is the 2003 deal in which the chain bought back six stores in Dallas and Shreveport, La., that were partly owned by Krispy Kreme's former chairman and a current director, Joseph McAleer. It paid a total of $67 million, or $11 million per store--which is more than three times what it paid for many other shops. Says David Gourevitch, a former SEC enforcement attorney: "At some point a transaction is not remotely reasonable, and it approximates a gift or payoff." Worst-case scenario: The SEC could impose fines and require some officials to step down. (A spokeswoman says the company is fully cooperating with the SEC.)

The SEC probe couldn't have come at a worse time. Profits have plunged, the stock has lost about 75% of its value in the last year, and Livengood has reduced the number of planned new-store openings in 2005 to 75 from 120. Given the company's tumbling profits and hyperaggressive accounting, investors should expect restatements and a big write-down at year's end when Krispy Kreme's auditor, PricewaterhouseCoopers, performs its annual goodwill-impairment test. In other words, Krispy Kreme's outlook has gone from bittersweet to decidedly sour. -- David Stires