[California Civil Code section 1556][1] states "All persons are capable of contracting, except minors, persons of unsound mind, and persons deprived of civil rights", so that would go beyond just capital felons. Montana [says the same thing][2], as does [Idaho][3] and [South Dakota][4]. Oklahoma law ([15 O.S. §11][5]) is a bit more complex

> All persons are capable of contracting, except minors, persons of
> unsound mind, and persons deprived of civil rights, however, persons
> sentenced to imprisonment under the Department of Corrections for any
> term, during confinement under said sentence, may make employment
> contracts, subject to the approval of the Director of the Department
> of Corrections, when this benefits the vocational training or release
> preparation of the prisoner; provided however, such persons during
> confinement shall not be eligible to receive benefits under the
> unemployment compensation law.

There may be jurisdictional differences: I can't find any statutory provision along these lines for Washington state.

  [1]: http://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=CIV&sectionNum=1556
  [2]: http://leg.mt.gov/bills/mca/title_0280/chapter_0020/part_0020/section_0010/0280-0020-0020-0010.html
  [3]: https://legislature.idaho.gov/statutesrules/idstat/title29/t29ch1/sect29-101/
  [4]: http://sdlegislature.gov/Statutes/Codified_Laws/DisplayStatute.aspx?Type=Statute&Statute=53-2-1
  [5]: http://www.oklegislature.gov/osstatuestitle.html