Skip to content

Commit 6c50c71

Browse files
frangioAmxx
andauthored
Add support for EIP-7201 namespaces (#127)
Co-authored-by: Hadrien Croubois <[email protected]>
1 parent 497a8d1 commit 6c50c71

29 files changed

+2474
-238
lines changed

contracts/namespaces.sol

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity ^0.8.20;
3+
4+
contract C1 {
5+
}
6+
7+
contract C2 {
8+
event B();
9+
10+
struct A { uint z; }
11+
12+
uint constant C = 3;
13+
// a
14+
uint x;
15+
// b
16+
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
17+
uint immutable y = 2;
18+
uint private z;
19+
20+
string private s1 = "";
21+
22+
function f() public {
23+
z = 3;
24+
}
25+
26+
function g() public {
27+
}
28+
}
29+
30+
contract C3 {
31+
address private x;
32+
}
33+
34+
contract C4 {
35+
address private x;
36+
constructor() {
37+
x = msg.sender;
38+
}
39+
}
40+
41+
contract C5 {
42+
address private x = msg.sender;
43+
}
44+
45+
contract C6 {
46+
}
47+
48+
contract C7 {
49+
uint x; // a comment
50+
51+
uint y;
52+
// a separate comment
53+
}
54+
55+
contract C8 {
56+
address private x;
57+
address private y = address(this);
58+
59+
constructor() {
60+
x = msg.sender;
61+
}
62+
}

hardhat.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const { internalTask } = require('hardhat/config');
22
const { TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT } = require('hardhat/builtin-tasks/task-names');
33

4+
require('hardhat-ignore-warnings');
5+
46
internalTask(TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT, async (args, hre, runSuper) => {
57
const input = await runSuper();
68
input.settings.outputSelection['*']['*'].push('storageLayout');
@@ -9,6 +11,7 @@ internalTask(TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT, async (args, hre, runSupe
911

1012
module.exports = {
1113
solidity: {
12-
compilers: [{ version: '0.6.7' }, { version: '0.8.8' }],
14+
compilers: ['0.6.7', '0.8.8', '0.8.20'].map(version => ({ version })),
1315
},
16+
warnings: 'off',
1417
};

0 commit comments

Comments
 (0)