Manufacturer

Git Source

Author: Anonymous

This contract manages the receipt and creation of commodities by a manufacturer

State Variables

manufacturerRawMaterials

Track the raw materials owned by manufacturers

Mapping of manufacturer's address to array of RawMaterial contract addresses

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

manufacturerCommodities

Track the commodities produced by manufacturers

Mapping of manufacturer's address to array of Commodity contract addresses

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

Functions

manufacturerReceivedPackage

Function called when a manufacturer receives a package of raw materials

function manufacturerReceivedPackage(address _addr, address _manufacturerAddress) public;

Parameters

NameTypeDescription
_addraddressThe address of the RawMaterial contract
_manufacturerAddressaddressThe address of the manufacturer

manufacturerCreatesCommodity

Function called when a manufacturer creates a new commodity

function manufacturerCreatesCommodity(
    address _manufacturerAddr,
    bytes32 _description,
    address[] memory _rawAddr,
    uint256 _quantity,
    address[] memory _transporterAddr,
    address _recieverAddr,
    uint256 RcvrType
) public;

Parameters

NameTypeDescription
_manufacturerAddraddressThe address of the manufacturer
_descriptionbytes32The description of the commodity
_rawAddraddress[]The array of addresses of raw materials used for the commodity
_quantityuint256The quantity of the commodity
_transporterAddraddress[]The array of addresses of transporters for the commodity
_recieverAddraddressThe address of the receiver of the commodity
RcvrTypeuint256The type of the receiver (encoded as a uint256)