This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "IoTDataStorage.sol": { | |
| "__sources__": { | |
| "IoTDataStorage.sol": { | |
| "content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.0;\r\n\r\ncontract IoTDataStorage {\r\n\r\n struct IoTData {\r\n uint256 timestamp;\r\n string memberId;\r\n uint256 bmi;\r\n uint256 bodyFat;\r\n string bmiCategory;\r\n }\r\n\r\n IoTData[] public records;\r\n\r\n address public owner;\r\n\r\n modifier onlyOwner() {\r\n require(msg.sender == owner, \"Not authorized\");\r\n _;\r\n }\r\n\r\n constructor() {\r\n owner = msg.sender;\r\n }\r\n\r\n function storeData(\r\n string memory _memberId,\r\n uint256 _bmi,\r\n uint256 _bodyFat,\r\n string memory _bmiCategory\r\n ) public onlyOwner {\r\n\r\n records.push(\r\n IoTData(\r\n block.timestamp,\r\n _memberId,\r\n _bmi,\r\n _bodyFat,\r\n _bmiCategory\r\n |