Skip to content

Commit 874c2d3

Browse files
frangioAmxxernestognw
authored
Use explicit imports (#4399)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: ernestognw <ernestognw@gmail.com>
1 parent d6a8b2c commit 874c2d3

File tree

176 files changed

+428
-379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+428
-379
lines changed

.changeset/orange-apes-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openzeppelin-solidity': major
3+
---
4+
5+
Switched to using explicit Solidity import statements. Some previously available symbols may now have to be separately imported.

.solhint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"modifier-name-mixedcase": "error",
1010
"private-vars-leading-underscore": "error",
1111
"var-name-mixedcase": "error",
12-
"imports-on-top": "error"
12+
"imports-on-top": "error",
13+
"no-global-import": "error"
1314
}
1415
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Once installed, you can use the contracts in the library by importing them:
4848
```solidity
4949
pragma solidity ^0.8.19;
5050
51-
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
51+
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
5252
5353
contract MyCollectible is ERC721 {
5454
constructor() ERC721("MyCollectible", "MCO") {

contracts/access/AccessControl.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
pragma solidity ^0.8.19;
55

6-
import "./IAccessControl.sol";
7-
import "../utils/Context.sol";
8-
import "../utils/Strings.sol";
9-
import "../utils/introspection/ERC165.sol";
6+
import {IAccessControl} from "./IAccessControl.sol";
7+
import {Context} from "../utils/Context.sol";
8+
import {Strings} from "../utils/Strings.sol";
9+
import {ERC165} from "../utils/introspection/ERC165.sol";
1010

1111
/**
1212
* @dev Contract module that allows children to implement role-based access

contracts/access/AccessControlDefaultAdminRules.sol

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
pragma solidity ^0.8.19;
55

6-
import "./AccessControl.sol";
7-
import "./IAccessControlDefaultAdminRules.sol";
8-
import "../utils/math/SafeCast.sol";
9-
import "../interfaces/IERC5313.sol";
6+
import {AccessControl, IAccessControl} from "./AccessControl.sol";
7+
import {IAccessControlDefaultAdminRules} from "./IAccessControlDefaultAdminRules.sol";
8+
import {SafeCast} from "../utils/math/SafeCast.sol";
9+
import {Math} from "../utils/math/Math.sol";
10+
import {IERC5313} from "../interfaces/IERC5313.sol";
1011

1112
/**
1213
* @dev Extension of {AccessControl} that allows specifying special rules to manage

contracts/access/AccessControlEnumerable.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
pragma solidity ^0.8.19;
55

6-
import "./IAccessControlEnumerable.sol";
7-
import "./AccessControl.sol";
8-
import "../utils/structs/EnumerableSet.sol";
6+
import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol";
7+
import {AccessControl} from "./AccessControl.sol";
8+
import {EnumerableSet} from "../utils/structs/EnumerableSet.sol";
99

1010
/**
1111
* @dev Extension of {AccessControl} that allows enumerating the members of each role.

contracts/access/IAccessControlDefaultAdminRules.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
pragma solidity ^0.8.19;
55

6-
import "./IAccessControl.sol";
6+
import {IAccessControl} from "./IAccessControl.sol";
77

88
/**
99
* @dev External interface of AccessControlDefaultAdminRules declared to support ERC165 detection.

contracts/access/IAccessControlEnumerable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
pragma solidity ^0.8.19;
55

6-
import "./IAccessControl.sol";
6+
import {IAccessControl} from "./IAccessControl.sol";
77

88
/**
99
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.

contracts/access/Ownable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
pragma solidity ^0.8.19;
55

6-
import "../utils/Context.sol";
6+
import {Context} from "../utils/Context.sol";
77

88
/**
99
* @dev Contract module which provides a basic access control mechanism, where

contracts/access/Ownable2Step.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
pragma solidity ^0.8.19;
55

6-
import "./Ownable.sol";
6+
import {Ownable} from "./Ownable.sol";
77

88
/**
99
* @dev Contract module which provides access control mechanism, where

0 commit comments

Comments
 (0)