One who gains a thing by fraud, accident, mistake, undue influence, the violation of a trust or other wrongful act, is, unless he has some other and better right thereto, an implied trustee of the thing gained for the benefit of the person who would otherwise have had it.
SDCL 55-1-8