Skip to content

Instantly share code, notes, and snippets.

@omgbbqhaxx
Created April 18, 2018 22:22
Show Gist options
  • Select an option

  • Save omgbbqhaxx/7ce9ea77019d64f44ce089d35178ae63 to your computer and use it in GitHub Desktop.

Select an option

Save omgbbqhaxx/7ce9ea77019d64f44ce089d35178ae63 to your computer and use it in GitHub Desktop.
address[] public sellers;
mapping (address => uint256) public arrayIndexes;
function addAddress(address _addr) public {
uint id = sellers.length;
arrayIndexes[_addr] = id;
sellers.push(_addr);
}
function removeAddress(address _addr) public {
uint id = arrayIndexes[_addr];
delete sellers[id];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment