Notwithstanding § 47-22-69, the fact that a corporation is without capacity or power to do an act or to make or receive a conveyance or transfer of real or personal property may be asserted in a proceeding by a member or a director against the corporation to enjoin the doing or continuation of unauthorized acts, or the transfer of real or personal property by or to the corporation. If the unauthorized acts or transfer sought to be enjoined are being, or are to be, performed pursuant to any contract to which the corporation is a party, the court may, if all of the parties to the contract are parties to the proceeding and if it deems the same to be equitable, set aside and enjoin the performance of such contract, and in so doing may allow to the corporation or the other parties to the contract, as the case may be, compensation for the loss or damage sustained by either of them which may result from the action of the court in setting aside and enjoining the performance of such contract, but anticipated profits to be derived from the performance of the contract shall not be awarded by the court as a loss or damage sustained.
SDCL 47-22-70