Created
February 21, 2020 06:51
-
-
Save ashokslsk/7c313bceb363d8aad9bc2c87176311af to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.18+commit.9cf6e910.js&optimize=true&gist=
This file contains 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
pragma solidity ^0.4.18; | |
contract VideoProvider { | |
struct UserInfo { | |
uint Age; | |
bool AgeRestriction; | |
} | |
mapping (string => UserInfo) AllUsers; | |
function SetUserInfo(string _Name, uint _Age) public { | |
AllUsers[_Name].Age = _Age; | |
if (AllUsers[_Name].Age >= 18) {AllUsers[_Name].AgeRestriction = false; | |
} | |
else AllUsers[_Name].AgeRestriction = true; | |
} | |
function GetUserInfo(string _Name) public view returns (uint,bool) { | |
return (AllUsers[_Name].Age,AllUsers[_Name].AgeRestriction); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment