Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sumitpatel93/f870480f7ebb077b9499463bdeb5c631 to your computer and use it in GitHub Desktop.
Save sumitpatel93/f870480f7ebb077b9499463bdeb5c631 to your computer and use it in GitHub Desktop.
product.sol
pragma solidity ^0.4.18;
contract UploadDetails {
struct Product {
uint amount;
string Name;
uint date;
string userName;
}
mapping (address => Product) product;
address[] public userAccts;
function setProduct(address _address, uint _amount, string _Name, uint _date, string _userName) public {
var Details = product[_address];
Details.amount = _amount;
Details.Name = _Name;
Details.date = _date;
Details.userName = _userName;
userAccts.push(_address) -1;
}
function getProduct() view public returns(address[]) {
return userAccts;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment