* Upgrade to latest solhint rc * Add private-vars-leading-underscore linter rule * Add leading underscore to GSNRecipient constants * Remove leading underscore from ERC165Checker functions * Add leading underscore to multiple private constants * Fix linter errors in mocks * Add leading underscore to ERC777's ERC1820 registry * Add changelog entry
38 lines
904 B
Solidity
38 lines
904 B
Solidity
pragma solidity ^0.6.0;
|
|
|
|
import "../utils/EnumerableSet.sol";
|
|
|
|
contract EnumerableSetMock{
|
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
|
|
event TransactionResult(bool result);
|
|
|
|
EnumerableSet.AddressSet private _set;
|
|
|
|
function contains(address value) public view returns (bool) {
|
|
return _set.contains(value);
|
|
}
|
|
|
|
function add(address value) public {
|
|
bool result = _set.add(value);
|
|
emit TransactionResult(result);
|
|
}
|
|
|
|
function remove(address value) public {
|
|
bool result = _set.remove(value);
|
|
emit TransactionResult(result);
|
|
}
|
|
|
|
function enumerate() public view returns (address[] memory) {
|
|
return _set.enumerate();
|
|
}
|
|
|
|
function length() public view returns (uint256) {
|
|
return _set.length();
|
|
}
|
|
|
|
function get(uint256 index) public view returns (address) {
|
|
return _set.get(index);
|
|
}
|
|
}
|