Last active
September 28, 2018 00:42
-
-
Save dev-yohan/323e2a5fd12f665a58c85046c93f4b7c to your computer and use it in GitHub Desktop.
Mapping addresses
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.25; | |
contract MappingAddress { | |
mapping(address => uint256) public balance_by_id; | |
function assignDni(uint256 _dni) public { | |
balance_by_id[msg.sender] = _dni; | |
} | |
function getDni(address _address) public view returns(uint256) { | |
return (uint256)(balance_by_id[_address]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment