Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Created March 31, 2020 16:21
Show Gist options
  • Save agoiabel/f664ab137d7b4d8758d1115d6f4acb42 to your computer and use it in GitHub Desktop.
Save agoiabel/f664ab137d7b4d8758d1115d6f4acb42 to your computer and use it in GitHub Desktop.
pragma solidity ^0.5.3;
contract Mapping {
mapping(address => uint) balances;
function manipulateMap() external {
balances[msg.sender] = 100; //assign a value;
balances[msg.sender] //read a value;
balances[unknown_key] //will return the default value of the type, i.e 0 for uint
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment