-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyMapping.sol
29 lines (23 loc) · 934 Bytes
/
MyMapping.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
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
contract MyMapping {
mapping(uint => bool) public myUintBoolMapping;
mapping(address => uint) public myAddressUintMapping;
mapping(uint => mapping(uint => bool)) public myUintUintBoolMapping;
mapping(uint => bool) myPrivateUintBoolMapping;
function setMyUintBoolValue(uint _myUint) public {
myUintBoolMapping[_myUint] = true;
}
function setMyAddressUintValue(uint _myUint) public {
myAddressUintMapping[msg.sender] = _myUint;
}
function setMyUintUintBoolValue(uint _myUint1, uint _myUint2) public {
myUintUintBoolMapping[_myUint1][_myUint2] = true;
}
function setMyPrivateUintBoolValue(uint _myUint) public {
myPrivateUintBoolMapping[_myUint] = true;
}
function getMyPrivateUintBoolValue(uint _myUint) public view returns(bool) {
return myPrivateUintBoolMapping[_myUint];
}
}