After spending only about three weeks on the market, Affleck’s mansion has gone under contract.