Skip to content

Instantly share code, notes, and snippets.

@dev-yohan
Last active September 28, 2018 00:42
Show Gist options
  • Save dev-yohan/323e2a5fd12f665a58c85046c93f4b7c to your computer and use it in GitHub Desktop.
Save dev-yohan/323e2a5fd12f665a58c85046c93f4b7c to your computer and use it in GitHub Desktop.
Mapping addresses
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