Back when my uncle was in the army, they stored all their weapons dry so the oils wouldn't trap all the dust. So I guess the attic is ok as long as you store it try, or in a gun case or something.
I believe the heat cycling (heating + cooling + condensation) in an attic acts on guns the same way auto exhaust acts on a car's exhaust system.