Distributor

Git Source

Author: Tinotenda Joe

This contract manages commodities received by distributor and their transfer

State Variables

CommoditysAtDistributor

Track commodities at distributor's address

Mapping of distributor's address to array of commodity addresses

mapping(address => address[]) public CommoditysAtDistributor;

CommodityDtoC

Track transfer of commodities from distributor to finalConsumer

Mapping of distributor's address to array of CommodityD_C contract addresses

mapping(address => address[]) public CommodityDtoC;

CommodityDtoCTxContract

Track individual commodity transfer contracts

Mapping of commodity address to CommodityD_C contract address

mapping(address => address) public CommodityDtoCTxContract;

Functions

commodityRecievedAtDistributor

Function to be called when a commodity is received at the distributor

function commodityRecievedAtDistributor(address _address, address cid) public;

Parameters

NameTypeDescription
_addressaddressThe address of the commodity
cidaddressThe identifier for the commodity

transferCommodityDtoC

Function to transfer commodity from distributor to finalConsumer

function transferCommodityDtoC(address _address, address transporter, address receiver) public;

Parameters

NameTypeDescription
_addressaddressThe address of the commodity
transporteraddressThe transporter's address
receiveraddressThe receiver or finalConsumer's address