Abstract A sustainable supply chain management strategy reduces risks and meets environmental, economic and social objectives by integrating environmental and financial practices. In an ever-changing environment, supply chains have become vulnerable at many levels. In a global supply chain, carefully tracing a product is of great importance to avoid future problems. This paper describes a self-updating smart contract, which includes data validation, for tracing global supply chains using blockchains. Our proposal uses a machine learning model to detect anomalies on traceable data, which helps supply chain operators detect anomalous behavior at any point in the chain in real time. Hyperledger Caliper has been used to evaluate our proposal, and obtained a combined average throughput of 184 transactions per second and an average latency of 0.41 seconds, ensuring that our proposal does not negatively impact supply chain processes while improving supply chain management through data anomaly detection.