// SPDX-License-Identifier: MIT //version solidity pragma solidity ^0.6.0; //defining contract contract simplestorage { // this will get initialized to 0 (because nothing set) uint256 favoriteNumber; bool favoriteBool; struct People { uint256 favoriteNumber; string name; } // array making People[] public people; //mapp string to uint256 so fav number(uint256) is connected to string(name) mapping(string => uint256) public nameToFavoriteNumber; function store(uint256 _favoriteNumber) public { favoriteNumber = _favoriteNumber; uint256 test = 4; } // view, pure -> reading of the blockchain no statechange so not making an transaction function retrieve() public view returns(uint256){ return favoriteNumber; } function addPerson(string memory _name, uint256 _favoriteNumber) public{ people.push(People(_favoriteNumber, _name)); nameToFavoriteNumber[_name] = _favoriteNumber; } }
0.6.10