Skip to content

Commit 7df0bd3

Browse files
committed
improve linter settings
Signed-off-by: Jun Kimura <[email protected]>
1 parent 352dc59 commit 7df0bd3

12 files changed

+380
-46
lines changed

.solhint.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"rules": {
33
"no-unused-vars": "error",
4+
"no-unused-import": "error",
5+
"imports-on-top": "error",
6+
"no-global-import": "error",
47
"const-name-snakecase": "error",
58
"contract-name-camelcase": "error",
69
"event-name-camelcase": "error",
710
"func-name-mixedcase": "error",
811
"func-param-name-mixedcase": "error",
912
"modifier-name-mixedcase": "error",
10-
"var-name-mixedcase": "error",
11-
"imports-on-top": "error"
13+
"var-name-mixedcase": "error"
1214
}
1315
}

contracts/apps/20-transfer/ERC20Token.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.9;
33

4-
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4+
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
55

66
contract ERC20Token is ERC20 {
77
constructor(string memory name, string memory symbol, uint256 initSupply) ERC20(name, symbol) {

contracts/apps/20-transfer/ICS20Bank.sol

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.9;
33

4-
import "@openzeppelin/contracts/utils/Context.sol";
5-
import "@openzeppelin/contracts/access/AccessControl.sol";
6-
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
7-
import "@openzeppelin/contracts/utils/Address.sol";
8-
import "./ICS20Lib.sol";
9-
import "./IICS20Bank.sol";
4+
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
5+
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
6+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
7+
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
8+
import {ICS20Lib} from "./ICS20Lib.sol";
9+
import {IICS20Bank} from "./IICS20Bank.sol";
1010

1111
contract ICS20Bank is Context, AccessControl, IICS20Bank {
1212
using Address for address;

contracts/apps/20-transfer/ICS20Lib.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.9;
33

4-
import "@openzeppelin/contracts/utils/Strings.sol";
4+
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
55

66
library ICS20Lib {
77
/**

contracts/apps/20-transfer/ICS20Transfer.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.9;
33

4-
import "../commons/IBCAppBase.sol";
5-
import "../../core/26-router/IIBCModule.sol";
6-
import "../../proto/Channel.sol";
7-
import "./ICS20Lib.sol";
8-
import "solidity-bytes-utils/contracts/BytesLib.sol";
4+
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
5+
import {IBCAppBase} from "../commons/IBCAppBase.sol";
6+
import {IIBCModule} from "../../core/26-router/IIBCModule.sol";
7+
import {Channel, Packet} from "../../proto/Channel.sol";
8+
import {ICS20Lib} from "./ICS20Lib.sol";
99

1010
abstract contract ICS20Transfer is IBCAppBase {
1111
using BytesLib for bytes;

contracts/apps/20-transfer/ICS20TransferBank.sol

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.9;
33

4-
import "./ICS20Transfer.sol";
5-
import "./IICS20Bank.sol";
6-
import "../../core/25-handler/IIBCHandler.sol";
7-
import "solidity-bytes-utils/contracts/BytesLib.sol";
4+
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
5+
import {Height} from "../../proto/Client.sol";
6+
import {IIBCHandler} from "../../core/25-handler/IIBCHandler.sol";
7+
import {ICS20Transfer} from "./ICS20Transfer.sol";
8+
import {IICS20Bank} from "./IICS20Bank.sol";
9+
import {ICS20Lib} from "./ICS20Lib.sol";
810

911
contract ICS20TransferBank is ICS20Transfer {
1012
using BytesLib for bytes;

contracts/apps/commons/IBCAppBase.sol

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.9;
33

4-
import "@openzeppelin/contracts/utils/Context.sol";
5-
import "../../core/26-router/IIBCModule.sol";
4+
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
5+
import {Packet} from "../../proto/Channel.sol";
6+
import {IIBCModule} from "../../core/26-router/IIBCModule.sol";
67

78
/**
89
* @dev Base contract of the IBC App protocol

contracts/clients/IBFT2Client.sol

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.9;
33

4-
import "../core/02-client/ILightClient.sol";
5-
import "../core/02-client/IBCHeight.sol";
6-
import "../core/25-handler/IIBCHandler.sol";
7-
import "../proto/Client.sol";
4+
import {ILightClient, ConsensusStateUpdate, ClientStatus} from "../core/02-client/ILightClient.sol";
5+
import {IBCHeight} from "../core/02-client/IBCHeight.sol";
6+
import {IIBCHandler} from "../core/25-handler/IIBCHandler.sol";
7+
import {Height} from "../proto/Client.sol";
88
import {
99
IbcLightclientsIbft2V1ClientState as ClientState,
1010
IbcLightclientsIbft2V1ConsensusState as ConsensusState,
1111
IbcLightclientsIbft2V1Header as Header
1212
} from "../proto/IBFT2.sol";
1313
import {GoogleProtobufAny as Any} from "../proto/GoogleProtobufAny.sol";
14-
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
15-
import "solidity-bytes-utils/contracts/BytesLib.sol";
16-
import "solidity-rlp/contracts/RLPReader.sol";
17-
import "solidity-mpt/src/MPTProof.sol";
14+
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
15+
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
16+
import {RLPReader} from "solidity-rlp/contracts/RLPReader.sol";
17+
import {MPTProof} from "solidity-mpt/src/MPTProof.sol";
1818

1919
// please see docs/ibft2-light-client.md for client spec
2020
contract IBFT2Client is ILightClient {

contracts/clients/MockClient.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.9;
33

4-
import "../core/02-client/ILightClient.sol";
5-
import "../core/02-client/IBCHeight.sol";
6-
import "../core/25-handler/IIBCHandler.sol";
7-
import "../proto/Client.sol";
4+
import {ILightClient, ConsensusStateUpdate, ClientStatus} from "../core/02-client/ILightClient.sol";
5+
import {IBCHeight} from "../core/02-client/IBCHeight.sol";
6+
import {IIBCHandler} from "../core/25-handler/IIBCHandler.sol";
7+
import {Height} from "../proto/Client.sol";
88
import {
99
IbcLightclientsMockV1ClientState as ClientState,
1010
IbcLightclientsMockV1ConsensusState as ConsensusState,
1111
IbcLightclientsMockV1Header as Header
1212
} from "../proto/MockClient.sol";
1313
import {GoogleProtobufAny as Any} from "../proto/GoogleProtobufAny.sol";
14-
import "solidity-bytes-utils/contracts/BytesLib.sol";
14+
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
1515

1616
// MockClient implements https://github.com/datachainlab/ibc-mock-client
1717
// WARNING: This client is intended to be used for testing purpose. Therefore, it is not generally available in a production, except in a fully trusted environment.

contracts/core/25-handler/IIBCQuerier.sol

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import {Height} from "../../proto/Client.sol";
55
import {ConnectionEnd} from "../../proto/Connection.sol";
66
import {Channel} from "../../proto/Channel.sol";
77
import {IBCChannelLib} from "../04-channel/IBCChannelLib.sol";
8-
import {IBCHost} from "../24-host/IBCHost.sol";
9-
import {IBCCommitment} from "../24-host/IBCCommitment.sol";
108

119
interface IIBCQuerier {
1210
function getClientByType(string calldata clientType) external view returns (address);

0 commit comments

Comments
 (0)