| Algorithm 1 Enterprise Register | |
| Input: EnterpiseType, EnterpriseEA | |
| Output: An event declaring the enterprise has been registered | |
|
Data: EnterpiseType is the type of agricultural supply chain enterprise EnterpriseEA is the Ethereum Address of the enterprise to be registered | |
| 1. | if FunctionCaller is not Government Regulatorthen |
| 2. | Display an error notification “Only regulator can operate!” |
| 3. | end |
| 4. | else |
| 5. | if EnterpriseType is.ProductionEnterprise then |
| 6. | producers[addr] = true |
| 7. | else if EnterpriseType is ProcessingEnterprise then |
| 8. | processors[addr] = true |
| 9. | else if EnterpriseType is LogisticEnterprise then |
| 10. | logistics[addr] = true |
| 11. | else if EnterpriseType is SalesEnterprise then |
| 12. | seller[addr] = true |
| 13. | end |
| 14. | end |