Merge branch 'master'

This commit is contained in:
Hadrien Croubois
2021-01-26 18:58:15 +01:00
99 changed files with 2517 additions and 15875 deletions

View File

@ -199,7 +199,7 @@ library EnumerableSet {
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
@ -209,14 +209,14 @@ library EnumerableSet {
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
@ -237,7 +237,7 @@ library EnumerableSet {
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
return address(uint160(uint256(_at(set._inner, index))));
}