My point is that in his wisdom, Epicurus may have not considered that most people in his time or ours don't negotiate the terms of the social compact.
Epicurus didn't say anything about a "social compact". He talked about justice and laws. Justice is defined by agreement. Laws can be just (if they result from agreement), or unjust (if not).
Where is the agreement in your examples?