Neither a trustee nor any of his agents may take part in any transaction concerning the trust in which he or anyone for whom he acts as agent has an interest, present or contingent, adverse to that of his beneficiary, except as follows:
(1) When the beneficiary does have the capacity to contract and, with a full knowledge of the motives of the trustee and of all other facts concerning the transaction which might affect his own decision and without the use of any influence on the part of the trustee, permits the trustee to do so;(2) When the beneficiary does not have the capacity to contract but the circuit court, upon the like information of the facts, grants the like permission;(3) When some of the beneficiaries have the capacity to contract and some do not have it and the former grant permission for themselves and the circuit court for the latter in the manner above prescribed; or(4) When the instrument creating the trust expressly grants permission to the trustee to buy, sell or lease property for the trust from or to the trust. SDC 1939, § 59.0108; SL 1981, ch 354, § 1.