Treaty contracts are entered into by two or more states. They are not the direct source of International Law. However under certain circumstances treaty contracts may lead to the formation of International law.

As for example:

In case of recurrence of treaties between different states laying down a similar rule.

Such treaties may form International law, if rule laid down in these treaties is accepted by large number of states subsequently. Rule of ‘free ships-free goods’ which provides that enemy goods carried on a neutral vessel are generally immune from belligerent action, first mentioned in 1650 between Spain and United Province. After acceptance by large number of States, it became rule of International Law.