I am using solidity 0.5.0 when i compile code i am throwing exception as
Explicit type conversion not allowed from "bytes32" to "address".
code is working fine in remix IDE
and my code is as
function orderItem(uint _itemid,string memory _itemname ) public returns(address){
address uniqueId = address(sha256(msg.sender,'block.timestamp'));
packagemapping[uniqueId].isuidgenerated = true;
packagemapping[uniqueId].itemid = _itemid;
packagemapping[uniqueId].itemname = _itemname;
packagemapping[uniqueId].transactionstatus = " Your package is ordered and is under processing ";
packagemapping[uniqueId].orderstatus = 1;
packagemapping[uniqueId].customer = msg.sender;
packagemapping[uniqueId].ordertime = "block.timestamp";
return uniqueId;
}
error line: address uniqueId = address(sha256(msg.sender,'block.timestamp'));
Best Answer
Also, why
'block.timestamp'
is in quotes? Maybe it should be: