Upon the motion of the legislative body or upon recommendation of the agency, the legislative body of the community may, by ordinance, order the deactivation of an agency by declaring that there is no need for an agency to function in the community, if the agency has no outstanding bonded indebtedness, no other unpaid loans, indebtedness, or advances, and no legally binding contractual obligations with persons or entities other than the community, unless the community assumes the bonded indebtedness, unpaid loans, indebtedness, and advances, and legally binding contractual obligations. A legislative body shall not adopt an ordinance declaring that there is no need for the agency, if in one or more project areas, the agency has not complied with subdivision (a) of Section 33333.8. An ordinance of a legislative body declaring there is no need for an agency to function in the community shall be subject to referendum as prescribed by law for the ordinances of the legislative body.