This brings to mind the specific characteristics of a contract, and why few (if any) of what we would consider to be an oath, of the type apparently contemplated by the OP, would qualify as a contract and be enforceable under such terms.
A contract presupposes an exchange, usually goods or services for money, or for other goods or services. There are burdens of delivery on both sides of the contract. There are, of course, unequal burdens (e.g. those terms-of-service agreements that say “we agree to provide you with this product, and in turn you agree to abide by the following 97 pages of microscopic legalese”), but both parties are required to follow through on some sort of obligation.
The typical oath, however, burdens only one party. “I, insert name here, promise to observe the following rules and protocols, full stop.” In cases where the oath is a precondition for membership in some organization, you could argue that there is an exchange, to wit, the organization is agreeing to allow you to join the group, but that, it seems to me, is a fairly intangible deliverable, and besides it’s usually accompanied by dues and fees.
The point is, when we think of an oath, it generally constitutes, in large part if not entirely, a one-way promise on the part of the oath taker. And for that reason, I don’t see any reasonable way it could be considered enforceable as a form of contract law.
As noted elsewhere in the thread, there are certainly organizations, such as the military, that formalize the oath in such a way as to create a legally enforceable standard. But they’re certainly the exception to the norm.