Smart Contracts Sharing Common Data
This article discusses why and how some Solidity smart contracts share common data.
There are many possible models of interaction between multiple smart contracts. In the example for this article, we consider a simple Producer to Consumer model, so that we can focus on the theme of sharing common data:
For example, the Producer could be a bank providing mortgage products. The Consumer could be the auditing department.
The Producer and Consumer model may be required because:
- the Producer and Consumer work at different rates
- the Producer and Consumer work on different timelines
- the Producer and Consumer are different contracts, developed by different teams or at different times
- a host of other reasons
In this model, the Producer will produce a data object which is sent to the Consumer to consume when they are ready to do so. That is, the two smart contracts must handle the same data object, but at different times.