Created
December 5, 2017 22:23
-
-
Save alecchampaign/4b1b54d182014c38fd8c91d92f41939d to your computer and use it in GitHub Desktop.
Smart contract for logging into a front-end with public address
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
pragma solidity ^0.4.18; | |
contract login { | |
address creator; | |
struct account { | |
bytes32 username; | |
bool admin; | |
} | |
mapping(address => account) accounts; | |
function login() public { | |
creator = msg.sender; | |
accounts[creator].admin = true; | |
} | |
function addUser (bytes32 _username) public { | |
accounts[msg.sender].username = _username; | |
accounts[msg.sender].admin = false; | |
} | |
function signIn () public { | |
require(msg.sender) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment