As used in this section, “federal government” means the United States and includes any and all agencies of the United States. The irrigation district may contract with the federal government, whereby the federal government will pay the whole or part of the cost of the project or will perform the whole or any part of the work connected with the project, which contract may include any specific terms required by act of congress or federal regulation as a condition for the participation of the federal government. The irrigation district may also contract with the state or any agency of the state or with any person in respect to any matter connected with the construction, operation, or maintenance of any irrigation works or for providing new means of water supply or the improvement of the existing water supply for the lands within the irrigation district. All contracts and agreements executed under this section shall be subject to the approval of the department. Such a contract or agreement or anything in consequence of such a contract or agreement shall not in any manner infringe upon or invade the state’s public trust in its waters.