If the United States under any act of congress or under rules and regulations adopted by the secretary of the interior, shall be willing to guarantee the interest upon bonds of any irrigation district, or shall be willing to receive bonds of any such district in payment of, or as security for payment upon, any contract of the United States, then the United States shall have all the remedies given by law to a bondholder, and, in cases of payment under any guaranty, the United States shall be subrogated to all the rights and remedies of the bondholder to the extent of any such payment; and the United States, or its proper department officers, may make such rules and regulations as may be necessary for the purpose of insuring the carrying out of any plan or project which may have been approved by them as the basis of any guaranty.