Created
September 28, 2018 00:41
-
-
Save dev-yohan/9ae71fa119a30983faed80dd33b37205 to your computer and use it in GitHub Desktop.
Mapping address to DNI in solidity
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