Skip to content

Instantly share code, notes, and snippets.

@subhodi
Created April 9, 2018 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subhodi/5ac59d371c2e6993cffd36b237ac4e21 to your computer and use it in GitHub Desktop.
Save subhodi/5ac59d371c2e6993cffd36b237ac4e21 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.18;
contract demo {
mapping(uint => uint) public map;
event Finished();
function seedMap(uint _start, uint _end) public {
for(uint i=_start;i<_end;i++) {
map[i] = i;
}
}
function open(uint _key, uint _value) public {
map[_key] = _value;
Finished();
}
function query(uint _key) constant returns(uint) {
return map[_key];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment