hardhat 3.15.0 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.js +13 -11
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.js.map +1 -1
- package/package.json +1 -1
- package/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.ts +13 -11
- package/templates/01-node-test-runner-viem/package.json +1 -1
- package/templates/02-mocha-ethers/package.json +1 -1
- package/templates/03-minimal/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# hardhat
|
|
2
2
|
|
|
3
|
+
## 3.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#8597](https://github.com/NomicFoundation/hardhat/pull/8597) [`6684224`](https://github.com/NomicFoundation/hardhat/commit/6684224124c48fe84904797f3c2d0c715014e64c) Thanks [@kanej](https://github.com/kanej)! - Added slang-solx compiler support as a Hardhat plugin.
|
|
8
|
+
|
|
3
9
|
## 3.15.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CollectedStruct } from "./ast-walker.js";
|
|
2
2
|
export declare const SELECTED_CONFLICT_REMEDIATION = "Rename one of the structs, or scope your `test.solidity.eip712Types.include` / `exclude` globs in `hardhat.config.ts` so that only one of them is selected.";
|
|
3
|
-
export declare const DEPENDENCY_CONFLICT_REMEDIATION = "Rename one of the structs so the name has a single definition. The clashing name is pulled in as a dependency of a selected struct,
|
|
3
|
+
export declare const DEPENDENCY_CONFLICT_REMEDIATION = "Rename one of the structs so the name has a single definition. The clashing name is pulled in as a dependency of a selected struct, but none of its definitions is in a selected source, so you can also resolve the conflict with your `test.solidity.eip712Types.include` / `exclude` globs in `hardhat.config.ts`: include the source containing the canonical definition so it wins the clash, or deselect the struct that depends on it if you don't need it.";
|
|
4
4
|
/**
|
|
5
5
|
* Produces the flat list of canonical EIP-712 type strings expected by EDR.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalize.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/solidity-test/eip712/canonicalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,eAAO,MAAM,6BAA6B,gKACqH,CAAC;AAEhK,eAAO,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"canonicalize.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/solidity-test/eip712/canonicalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,eAAO,MAAM,6BAA6B,gKACqH,CAAC;AAEhK,eAAO,MAAM,+BAA+B,ucAC0Z,CAAC;AAEvc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,eAAe,EAAE,EAC1B,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,GAC3B,MAAM,EAAE,CAuCV"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HardhatError } from "@nomicfoundation/hardhat-errors";
|
|
2
2
|
export const SELECTED_CONFLICT_REMEDIATION = "Rename one of the structs, or scope your `test.solidity.eip712Types.include` / `exclude` globs in `hardhat.config.ts` so that only one of them is selected.";
|
|
3
|
-
export const DEPENDENCY_CONFLICT_REMEDIATION = "Rename one of the structs so the name has a single definition. The clashing name is pulled in as a dependency of a selected struct,
|
|
3
|
+
export const DEPENDENCY_CONFLICT_REMEDIATION = "Rename one of the structs so the name has a single definition. The clashing name is pulled in as a dependency of a selected struct, but none of its definitions is in a selected source, so you can also resolve the conflict with your `test.solidity.eip712Types.include` / `exclude` globs in `hardhat.config.ts`: include the source containing the canonical definition so it wins the clash, or deselect the struct that depends on it if you don't need it.";
|
|
4
4
|
/**
|
|
5
5
|
* Produces the flat list of canonical EIP-712 type strings expected by EDR.
|
|
6
6
|
*
|
|
@@ -174,12 +174,14 @@ function transitiveDeps(root, byName) {
|
|
|
174
174
|
* - Both sides selected: throw immediately — genuinely ambiguous which to
|
|
175
175
|
* emit.
|
|
176
176
|
* - Current side non-selected: defer; the stored definition keeps the name.
|
|
177
|
-
* Throw only if the name
|
|
178
|
-
* transitive deps), since then which copy got
|
|
179
|
-
* iteration order.
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* run
|
|
177
|
+
* Throw only if the name has no selected definition AND is reachable from
|
|
178
|
+
* a selected struct (its transitive deps), since only then which copy got
|
|
179
|
+
* inlined would depend on iteration order. A name with a selected
|
|
180
|
+
* definition always resolves to it deterministically (selected structs
|
|
181
|
+
* come first), so a non-selected struct that shares a name with a
|
|
182
|
+
* selected one never aborts the run — even when that name is also a
|
|
183
|
+
* dependency of another selected struct. Names unreachable from the
|
|
184
|
+
* selected set are likewise silently deduped (first wins).
|
|
183
185
|
*/
|
|
184
186
|
function indexByName(structs, selectedSources, selectedNames) {
|
|
185
187
|
const byName = new Map();
|
|
@@ -214,9 +216,9 @@ function indexByName(structs, selectedSources, selectedNames) {
|
|
|
214
216
|
}
|
|
215
217
|
// Non-selected side, so the stored definition (selected if the name has
|
|
216
218
|
// one, since selected sources come first) keeps the name. Defer: throw
|
|
217
|
-
// later only if the name
|
|
218
|
-
// name with a selected
|
|
219
|
-
// must not abort.
|
|
219
|
+
// later only if the name has no selected definition and is reachable from
|
|
220
|
+
// a selected struct. Sharing a name with a selected definition or an
|
|
221
|
+
// unreferenced struct is harmless and must not abort.
|
|
220
222
|
if (!deferredConflicts.has(struct.name)) {
|
|
221
223
|
deferredConflicts.set(struct.name, {
|
|
222
224
|
firstSource: sourceByName.get(struct.name) ?? "<unknown>",
|
|
@@ -227,7 +229,7 @@ function indexByName(structs, selectedSources, selectedNames) {
|
|
|
227
229
|
if (deferredConflicts.size > 0) {
|
|
228
230
|
const reachable = reachableFromSelected(byName, selectedNames);
|
|
229
231
|
for (const [name, sources] of deferredConflicts) {
|
|
230
|
-
if (reachable.has(name)) {
|
|
232
|
+
if (reachable.has(name) && !selectedNames.has(name)) {
|
|
231
233
|
throw new HardhatError(HardhatError.ERRORS.CORE.SOLIDITY_TESTS.EIP712_DUPLICATE_STRUCT_NAME, { name, ...sources, remediation: DEPENDENCY_CONFLICT_REMEDIATION });
|
|
232
234
|
}
|
|
233
235
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalize.js","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/solidity-test/eip712/canonicalize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAC,MAAM,6BAA6B,GACxC,6JAA6J,CAAC;AAEhK,MAAM,CAAC,MAAM,+BAA+B,GAC1C,
|
|
1
|
+
{"version":3,"file":"canonicalize.js","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/solidity-test/eip712/canonicalize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAC,MAAM,6BAA6B,GACxC,6JAA6J,CAAC;AAEhK,MAAM,CAAC,MAAM,+BAA+B,GAC1C,ocAAoc,CAAC;AAEvc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAA0B,EAC1B,eAA4B;IAE5B,6EAA6E;IAC7E,6EAA6E;IAC7E,kCAAkC;IAClC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IACxC,KAAK,MAAM,MAAM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I,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,SAAS;QACX,CAAC;QAED,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEpB,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,MAAuB;IAChD,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CACjC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,eAAe,IAAI,CAAC,CAAC,IAAI,EAAE,CAChD,CAAC;IAEF,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hardhat",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"description": "Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.",
|
|
5
5
|
"homepage": "https://hardhat.org",
|
|
6
6
|
"repository": {
|
|
@@ -6,7 +6,7 @@ export const SELECTED_CONFLICT_REMEDIATION =
|
|
|
6
6
|
"Rename one of the structs, or scope your `test.solidity.eip712Types.include` / `exclude` globs in `hardhat.config.ts` so that only one of them is selected.";
|
|
7
7
|
|
|
8
8
|
export const DEPENDENCY_CONFLICT_REMEDIATION =
|
|
9
|
-
"Rename one of the structs so the name has a single definition. The clashing name is pulled in as a dependency of a selected struct,
|
|
9
|
+
"Rename one of the structs so the name has a single definition. The clashing name is pulled in as a dependency of a selected struct, but none of its definitions is in a selected source, so you can also resolve the conflict with your `test.solidity.eip712Types.include` / `exclude` globs in `hardhat.config.ts`: include the source containing the canonical definition so it wins the clash, or deselect the struct that depends on it if you don't need it.";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Produces the flat list of canonical EIP-712 type strings expected by EDR.
|
|
@@ -220,12 +220,14 @@ function transitiveDeps(
|
|
|
220
220
|
* - Both sides selected: throw immediately — genuinely ambiguous which to
|
|
221
221
|
* emit.
|
|
222
222
|
* - Current side non-selected: defer; the stored definition keeps the name.
|
|
223
|
-
* Throw only if the name
|
|
224
|
-
* transitive deps), since then which copy got
|
|
225
|
-
* iteration order.
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* run
|
|
223
|
+
* Throw only if the name has no selected definition AND is reachable from
|
|
224
|
+
* a selected struct (its transitive deps), since only then which copy got
|
|
225
|
+
* inlined would depend on iteration order. A name with a selected
|
|
226
|
+
* definition always resolves to it deterministically (selected structs
|
|
227
|
+
* come first), so a non-selected struct that shares a name with a
|
|
228
|
+
* selected one never aborts the run — even when that name is also a
|
|
229
|
+
* dependency of another selected struct. Names unreachable from the
|
|
230
|
+
* selected set are likewise silently deduped (first wins).
|
|
229
231
|
*/
|
|
230
232
|
function indexByName(
|
|
231
233
|
structs: CollectedStruct[],
|
|
@@ -276,9 +278,9 @@ function indexByName(
|
|
|
276
278
|
|
|
277
279
|
// Non-selected side, so the stored definition (selected if the name has
|
|
278
280
|
// one, since selected sources come first) keeps the name. Defer: throw
|
|
279
|
-
// later only if the name
|
|
280
|
-
// name with a selected
|
|
281
|
-
// must not abort.
|
|
281
|
+
// later only if the name has no selected definition and is reachable from
|
|
282
|
+
// a selected struct. Sharing a name with a selected definition or an
|
|
283
|
+
// unreferenced struct is harmless and must not abort.
|
|
282
284
|
if (!deferredConflicts.has(struct.name)) {
|
|
283
285
|
deferredConflicts.set(struct.name, {
|
|
284
286
|
firstSource: sourceByName.get(struct.name) ?? "<unknown>",
|
|
@@ -290,7 +292,7 @@ function indexByName(
|
|
|
290
292
|
if (deferredConflicts.size > 0) {
|
|
291
293
|
const reachable = reachableFromSelected(byName, selectedNames);
|
|
292
294
|
for (const [name, sources] of deferredConflicts) {
|
|
293
|
-
if (reachable.has(name)) {
|
|
295
|
+
if (reachable.has(name) && !selectedNames.has(name)) {
|
|
294
296
|
throw new HardhatError(
|
|
295
297
|
HardhatError.ERRORS.CORE.SOLIDITY_TESTS.EIP712_DUPLICATE_STRUCT_NAME,
|
|
296
298
|
{ name, ...sources, remediation: DEPENDENCY_CONFLICT_REMEDIATION },
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "A TypeScript Hardhat project using Node Test Runner and Viem",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"hardhat": "workspace:^3.
|
|
8
|
+
"hardhat": "workspace:^3.16.0",
|
|
9
9
|
"@nomicfoundation/hardhat-toolbox-viem": "workspace:^5.0.7",
|
|
10
10
|
"@nomicfoundation/hardhat-ignition": "workspace:^3.1.8",
|
|
11
11
|
"@types/node": "^22.8.5",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "A TypeScript Hardhat project using Mocha and Ethers.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"hardhat": "workspace:^3.
|
|
8
|
+
"hardhat": "workspace:^3.16.0",
|
|
9
9
|
"@nomicfoundation/hardhat-toolbox-mocha-ethers": "workspace:^3.0.7",
|
|
10
10
|
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.15",
|
|
11
11
|
"@nomicfoundation/hardhat-ignition": "workspace:^3.1.8",
|