//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.18; pragma experimental ABIEncoderV2; contract Inventory { struct Asset { string name; string location; string owner; } uint itemCount; Asset[] assets; function Inventory() public { address admin = msg.sender; itemCount = 0; } function getNumberAssets() constant public returns (uint items) { return itemCount; } function addAsset(string n, string l, string o) { assets.push(Asset(n,l,o)); itemCount++; } function listAssets() public constant returns(string assetList) { string r = ""; for(uint i = 0; i <= itemCount; i++) { r += assets[i].name + "\t" + assets[i].location + "\t" + assets[i].owner + "\n\r"; } return r; } }
0.4.24