Generalized exchange and social dilemmas