AugurProject / augur-core

Augur v1 - Smart Contracts [DEPRECATED]
https://www.augur.net
GNU General Public License v3.0
594 stars 133 forks source link

Some possible inconsistency in Map.sol #724

Closed wlamos closed 6 years ago

wlamos commented 6 years ago
For a map data structure, it should satisfy:

for every (key, value), if _add(key, value)_ returns true, we should have _contains(key)_ return true.

 But in this implementation, if value is 0, the above property is not satisfied. 
nuevoalex commented 6 years ago

@wlamos That's fair. You're suggesting we add a require(_value != bytes32(0)) in the add method, right?

wlamos commented 6 years ago

Yes.

adrake33 commented 6 years ago

Added ClubHouse ticket for this: https://app.clubhouse.io/augur/story/16250/add-require-statement-to-map-add-for-consistency

adrake33 commented 6 years ago

Closing, as this has been added to v2 of the contracts.