-
Notifications
You must be signed in to change notification settings - Fork 0
/
mint.sol
33 lines (25 loc) · 806 Bytes
/
mint.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// I'm a comment!
// SPDX-License-Identifier: MIT
pragma solidity ^0.8;
// pragma solidity ^0.8.0;
// pragma solidity >=0.8.0 <0.9.0;
contract SimpleStorage {
uint256 myFavoriteNumber ;
struct Person {
uint256 favoriteNumber;
string name;
}
// uint256[] public anArray;
Person[] public listOfPeople;
mapping(string => uint256) public nameToFavoriteNumber;
function store(uint256 _favoriteNumber) public {
myFavoriteNumber = _favoriteNumber;
}
function retrieve() public view returns (uint256) {
return myFavoriteNumber;
}
function addPerson(string memory _name, uint256 _favoriteNumber) public {
listOfPeople.push(Person(_favoriteNumber, _name));
nameToFavoriteNumber[_name] = _favoriteNumber;
}
}