A few weeks before he was shot and killed last month, the 20-year-old rapper XXXTentacion was on the phone with the record executive who had taken the first chance on him, hammering out a contract for his much-anticipated next release.

Since barreling into the mainstream last year, XXXTentacion had become one of rap’s biggest and most controversial new stars, with a No. 1 album and a fervent congregation of young fans. At the same time, disturbing allegations of abuse had made him a potentially toxic business partner, especially after Spotify briefly banned his music from its playlists under a short-lived “hateful conduct” policy.

Yet even with the Spotify scandal still dampening his business, XXXTentacion signed a new agreement with Empire, an independent music company that last summer had released his first album, “17.” The latest deal, for XXXTentacion’s third official release, was worth about $10 million, according to three people briefed on the terms — a rich sum for a young artist, but also only the latest sign of a heated market for online rap stars.

Ghazi Shami, the founder of Empire, said that XXXTentacion — a prolific creator who started his career posting tracks by the dozen to the streaming site SoundCloud — had finished “a significant amount of material” for the new record, but there were no firm plans for its release. (Mr. Shami declined to comment on the size of the deal.)