Skip to content

Commit

Permalink
Update linter
Browse files Browse the repository at this point in the history
  • Loading branch information
nventuro committed Jan 28, 2020
1 parent 8474f1c commit 70cddaa
Show file tree
Hide file tree
Showing 29 changed files with 108 additions and 359 deletions.
3 changes: 2 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"separate-by-one-line-in-contract": "off",
"two-lines-top-level-separator": "off",
"mark-callable-contracts": "off",
"compiler-version": ["error", "^0.5.0"]
"no-empty-blocks": "off",
"compiler-version": ["error", "^0.6.0"]
}
}
1 change: 0 additions & 1 deletion contracts/GSN/Context.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks

function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
Expand Down
4 changes: 1 addition & 3 deletions contracts/GSN/GSNRecipientERC20Fee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ contract GSNRecipientERC20Fee is GSNRecipient {
contract __unstable__ERC20PrimaryAdmin is ERC20, ERC20Detailed, Secondary {
uint256 private constant UINT256_MAX = 2**256 - 1;

constructor(string memory name, string memory symbol, uint8 decimals) public ERC20Detailed(name, symbol, decimals) {
// solhint-disable-previous-line no-empty-blocks
}
constructor(string memory name, string memory symbol, uint8 decimals) public ERC20Detailed(name, symbol, decimals) { }

// The primary account (GSNRecipientERC20Fee) can mint tokens
function mint(address account, uint256 amount) public onlyPrimary {
Expand Down
8 changes: 2 additions & 6 deletions contracts/GSN/GSNRecipientSignature.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ contract GSNRecipientSignature is GSNRecipient {
}
}

function _preRelayedCall(bytes memory) internal virtual override returns (bytes32) {
// solhint-disable-previous-line no-empty-blocks
}
function _preRelayedCall(bytes memory) internal virtual override returns (bytes32) { }

function _postRelayedCall(bytes memory, bool, uint256, bytes32) internal virtual override {
// solhint-disable-previous-line no-empty-blocks
}
function _postRelayedCall(bytes memory, bool, uint256, bytes32) internal virtual override { }
}
3 changes: 2 additions & 1 deletion contracts/mocks/AddressImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ contract AddressImpl {
Address.sendValue(receiver, amount);
}

receive () external payable { } // sendValue's tests require the contract to hold Ether
// sendValue's tests require the contract to hold Ether
receive () external payable { }
}
4 changes: 1 addition & 3 deletions contracts/mocks/CapperRoleMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ contract CapperRoleMock is CapperRole {
_removeCapper(account);
}

function onlyCapperMock() public view onlyCapper {
// solhint-disable-previous-line no-empty-blocks
}
function onlyCapperMock() public view onlyCapper { }
}
4 changes: 1 addition & 3 deletions contracts/mocks/ERC165/ERC165NotSupported.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pragma solidity ^0.6.0;

contract ERC165NotSupported {
// solhint-disable-previous-line no-empty-blocks
}
contract ERC165NotSupported { }
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20DetailedMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ contract ERC20DetailedMock is ERC20, ERC20Detailed {
public
ERC20Detailed(name, symbol, decimals)
{
// solhint-disable-previous-line no-empty-blocks

}
}
4 changes: 1 addition & 3 deletions contracts/mocks/ERC20MetadataMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import "../token/ERC20/ERC20.sol";
import "../drafts/ERC1046/ERC20Metadata.sol";

contract ERC20MetadataMock is ERC20, ERC20Metadata {
constructor (string memory tokenURI) public ERC20Metadata(tokenURI) {
// solhint-disable-previous-line no-empty-blocks
}
constructor (string memory tokenURI) public ERC20Metadata(tokenURI) { }

function setTokenURI(string memory tokenURI) public {
_setTokenURI(tokenURI);
Expand Down
4 changes: 1 addition & 3 deletions contracts/mocks/ERC20MintableMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ pragma solidity ^0.6.0;
import "../token/ERC20/ERC20Mintable.sol";
import "./MinterRoleMock.sol";

contract ERC20MintableMock is ERC20Mintable, MinterRoleMock {
// solhint-disable-previous-line no-empty-blocks
}
contract ERC20MintableMock is ERC20Mintable, MinterRoleMock { }
4 changes: 1 addition & 3 deletions contracts/mocks/ERC721FullMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import "../token/ERC721/ERC721Burnable.sol";
* checking token existence, removal of a token from an address
*/
contract ERC721FullMock is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable {
constructor (string memory name, string memory symbol) public ERC721Mintable() ERC721Full(name, symbol) {
// solhint-disable-previous-line no-empty-blocks
}
constructor (string memory name, string memory symbol) public ERC721Mintable() ERC721Full(name, symbol) { }

function exists(uint256 tokenId) public view returns (bool) {
return _exists(tokenId);
Expand Down
1 change: 0 additions & 1 deletion contracts/mocks/ERC721GSNRecipientMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import "../GSN/GSNRecipientSignature.sol";
*/
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature {
constructor(address trustedSigner) public GSNRecipientSignature(trustedSigner) { }
// solhint-disable-previous-line no-empty-blocks

function mint(uint256 tokenId) public {
_mint(_msgSender(), tokenId);
Expand Down
4 changes: 1 addition & 3 deletions contracts/mocks/ERC721MintableBurnableImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import "../token/ERC721/ERC721Burnable.sol";
* @title ERC721MintableBurnableImpl
*/
contract ERC721MintableBurnableImpl is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable {
constructor () public ERC721Mintable() ERC721Full("Test", "TEST") {
// solhint-disable-previous-line no-empty-blocks
}
constructor () public ERC721Mintable() ERC721Full("Test", "TEST") { }

function _afterTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Full, ERC721Metadata) {
super._afterTokenTransfer(from, to, tokenId);
Expand Down
4 changes: 1 addition & 3 deletions contracts/mocks/GSNRecipientERC20FeeMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import "../GSN/GSNRecipient.sol";
import "../GSN/GSNRecipientERC20Fee.sol";

contract GSNRecipientERC20FeeMock is GSNRecipient, GSNRecipientERC20Fee {
constructor(string memory name, string memory symbol) public GSNRecipientERC20Fee(name, symbol) {
// solhint-disable-previous-line no-empty-blocks
}
constructor(string memory name, string memory symbol) public GSNRecipientERC20Fee(name, symbol) { }

function mint(address account, uint256 amount) public {
_mint(account, amount);
Expand Down
8 changes: 2 additions & 6 deletions contracts/mocks/GSNRecipientMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ contract GSNRecipientMock is ContextMock, GSNRecipient {
return (0, "");
}

function _preRelayedCall(bytes memory) internal override returns (bytes32) {
// solhint-disable-previous-line no-empty-blocks
}
function _preRelayedCall(bytes memory) internal override returns (bytes32) { }

function _postRelayedCall(bytes memory, bool, uint256, bytes32) internal override {
// solhint-disable-previous-line no-empty-blocks
}
function _postRelayedCall(bytes memory, bool, uint256, bytes32) internal override { }

function upgradeRelayHub(address newRelayHub) public {
return _upgradeRelayHub(newRelayHub);
Expand Down
4 changes: 1 addition & 3 deletions contracts/mocks/GSNRecipientSignatureMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import "../GSN/GSNRecipient.sol";
import "../GSN/GSNRecipientSignature.sol";

contract GSNRecipientSignatureMock is GSNRecipient, GSNRecipientSignature {
constructor(address trustedSigner) public GSNRecipientSignature(trustedSigner) {
// solhint-disable-previous-line no-empty-blocks
}
constructor(address trustedSigner) public GSNRecipientSignature(trustedSigner) { }

event MockFunctionCalled();

Expand Down
4 changes: 1 addition & 3 deletions contracts/mocks/MinterRoleMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ contract MinterRoleMock is MinterRole {
_removeMinter(account);
}

function onlyMinterMock() public view onlyMinter {
// solhint-disable-previous-line no-empty-blocks
}
function onlyMinterMock() public view onlyMinter { }
}
4 changes: 1 addition & 3 deletions contracts/mocks/OwnableMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ pragma solidity ^0.6.0;

import "../ownership/Ownable.sol";

contract OwnableMock is Ownable {
// solhint-disable-previous-line no-empty-blocks
}
contract OwnableMock is Ownable { }
4 changes: 1 addition & 3 deletions contracts/mocks/PauserRoleMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ contract PauserRoleMock is PauserRole {
_removePauser(account);
}

function onlyPauserMock() public view onlyPauser {
// solhint-disable-previous-line no-empty-blocks
}
function onlyPauserMock() public view onlyPauser { }
}
4 changes: 1 addition & 3 deletions contracts/mocks/PullPaymentMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import "../payment/PullPayment.sol";

// mock class using PullPayment
contract PullPaymentMock is PullPayment {
constructor () public payable {
// solhint-disable-previous-line no-empty-blocks
}
constructor () public payable { }

// test helper function to call asyncTransfer
function callTransfer(address dest, uint256 amount) public {
Expand Down
4 changes: 1 addition & 3 deletions contracts/mocks/SecondaryMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ pragma solidity ^0.6.0;
import "../ownership/Secondary.sol";

contract SecondaryMock is Secondary {
function onlyPrimaryMock() public view onlyPrimary {
// solhint-disable-previous-line no-empty-blocks
}
function onlyPrimaryMock() public view onlyPrimary { }
}
4 changes: 1 addition & 3 deletions contracts/mocks/SignerRoleMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ contract SignerRoleMock is SignerRole {
_removeSigner(account);
}

function onlySignerMock() public view onlySigner {
// solhint-disable-previous-line no-empty-blocks
}
function onlySignerMock() public view onlySigner { }
}
4 changes: 1 addition & 3 deletions contracts/mocks/WhitelistAdminRoleMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ contract WhitelistAdminRoleMock is WhitelistAdminRole {
_removeWhitelistAdmin(account);
}

function onlyWhitelistAdminMock() public view onlyWhitelistAdmin {
// solhint-disable-previous-line no-empty-blocks
}
function onlyWhitelistAdminMock() public view onlyWhitelistAdmin { }
}
4 changes: 1 addition & 3 deletions contracts/mocks/WhitelistedRoleMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ pragma solidity ^0.6.0;
import "../access/roles/WhitelistedRole.sol";

contract WhitelistedRoleMock is WhitelistedRole {
function onlyWhitelistedMock() public view onlyWhitelisted {
// solhint-disable-previous-line no-empty-blocks
}
function onlyWhitelistedMock() public view onlyWhitelisted { }
}
4 changes: 1 addition & 3 deletions contracts/token/ERC721/ERC721Full.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import "./ERC721Metadata.sol";
* See https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721Full is ERC721Enumerable, ERC721Metadata {
constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) {
// solhint-disable-previous-line no-empty-blocks
}
constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) { }

function _afterTokenTransfer(address from, address to, uint256 tokenId)
virtual
Expand Down
4 changes: 1 addition & 3 deletions contracts/token/ERC721/IERC721Full.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ import "./IERC721Metadata.sol";
* @title ERC-721 Non-Fungible Token Standard, full implementation interface
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
abstract contract IERC721Full is IERC721, IERC721Enumerable, IERC721Metadata {
// solhint-disable-previous-line no-empty-blocks
}
abstract contract IERC721Full is IERC721, IERC721Enumerable, IERC721Metadata { }
2 changes: 1 addition & 1 deletion contracts/utils/Address.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ library Address {
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");

// solhint-disable-next-line avoid-call-value
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
Expand Down
Loading

0 comments on commit 70cddaa

Please sign in to comment.