In 1848 Mexico ceded California to the United States and 1845–1855 marked the years of the gold rush, bringing in white immigrants to California. Indians became the major and immediate source of labor for mining. In those 10 years the Indian population decreased by two-thirds and in order to craft California's own code of labor, An Act for the Government and Protection of Indians was passed in 1850 which "legally" curtailed the rights of Indians. Within this Act, Indian children could be obtained for indenture, convicted Indians could be hired out of jail and Indians could not testify for or against whites. 24,000 to 27,000 California Native Americans were took as forced laborers by settlers including 4,000 to 7,000 children; Between 1851 and 1852, three Indian commissioners negotiated treaties with the Indians and eventually eighteen were written, allocating 7.5% of the state as Indian reservations. The United States Senate rejected these treaties and about a year later in 1853, the government designed its own five reservations. These reservations had very poor living conditions and displaced many of the Indians from their native lands. This led many Indians to abandon reservations and resort to raiding California towns. Multiple massacres occurred during these years.