We characterize the set of Walrasian allocations of an economy as the set of allocations which can be supported by abstract equilibria that satisfy a recontracting condition which reflects the idea that agents can freely trade with each other. An alternative (and weaker) recontracting condition characterizes the core. The results are extended to production economies by extending the definition of the recontracting condition to include the possibility of agents to recontract with firms. However, no optimization requirement is imposed on firms. In pure exchange economies, an abstract equilibrium is a feasible allocation and a list of choice sets, one for each agent, that satisfy the following conditions: an agent's choice set is a subset of the commodity space that includes his endowment; and each agent's equilibrium bundle is a maximal element in his choice set, with respect to his preferences. The recontracting condition requires that any agent can buy bundles from any other agent's choice set by offering the other agent a bundle he prefers to his equilibrium bundle.