How to write a watertight supply chain contract