Adhere to naming convention (#2150)
* 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
This commit is contained in:
@ -19,7 +19,7 @@ library ERC165Checker {
|
||||
/**
|
||||
* @dev Returns true if `account` supports the {IERC165} interface,
|
||||
*/
|
||||
function _supportsERC165(address account) internal view returns (bool) {
|
||||
function supportsERC165(address account) internal view returns (bool) {
|
||||
// Any contract that implements ERC165 must explicitly indicate support of
|
||||
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
|
||||
return _supportsERC165Interface(account, _INTERFACE_ID_ERC165) &&
|
||||
@ -32,9 +32,9 @@ library ERC165Checker {
|
||||
*
|
||||
* See {IERC165-supportsInterface}.
|
||||
*/
|
||||
function _supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
|
||||
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
|
||||
// query support of both ERC165 as per the spec and support of _interfaceId
|
||||
return _supportsERC165(account) &&
|
||||
return supportsERC165(account) &&
|
||||
_supportsERC165Interface(account, interfaceId);
|
||||
}
|
||||
|
||||
@ -47,9 +47,9 @@ library ERC165Checker {
|
||||
*
|
||||
* See {IERC165-supportsInterface}.
|
||||
*/
|
||||
function _supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
|
||||
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
|
||||
// query support of ERC165 itself
|
||||
if (!_supportsERC165(account)) {
|
||||
if (!supportsERC165(account)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ library ERC165Checker {
|
||||
* identifier interfaceId, false otherwise
|
||||
* @dev Assumes that account contains a contract that supports ERC165, otherwise
|
||||
* the behavior of this method is undefined. This precondition can be checked
|
||||
* with the `supportsERC165` method in this library.
|
||||
* with {supportsERC165}.
|
||||
* Interface identification is specified in ERC-165.
|
||||
*/
|
||||
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
|
||||
|
||||
@ -11,7 +11,7 @@ import "./IERC1820Implementer.sol";
|
||||
* registration to be complete.
|
||||
*/
|
||||
contract ERC1820Implementer is IERC1820Implementer {
|
||||
bytes32 constant private ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
|
||||
bytes32 constant private _ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
|
||||
|
||||
mapping(bytes32 => mapping(address => bool)) private _supportedInterfaces;
|
||||
|
||||
@ -19,7 +19,7 @@ contract ERC1820Implementer is IERC1820Implementer {
|
||||
* See {IERC1820Implementer-canImplementInterfaceForAddress}.
|
||||
*/
|
||||
function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view override returns (bytes32) {
|
||||
return _supportedInterfaces[interfaceHash][account] ? ERC1820_ACCEPT_MAGIC : bytes32(0x00);
|
||||
return _supportedInterfaces[interfaceHash][account] ? _ERC1820_ACCEPT_MAGIC : bytes32(0x00);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user