Skip to content

Commit 25e7a6c

Browse files
committed
enforce presence of pragma statements
1 parent 0051895 commit 25e7a6c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

contracts/utils/StorageUtilsMock.sol

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// SPDX-License-Identifier: MIT
22

3+
pragma solidity ^0.8.20;
4+
35
import { Ownable } from '../access/ownable/Ownable.sol';
46
import { StorageUtils } from './StorageUtils.sol';
57

test/pragma.ts

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ describe('Pragma statements', () => {
2020
const versions = new Set();
2121

2222
for (const file of files) {
23+
if (file.content.versionPragmas.length === 0) {
24+
throw new Error(
25+
`Missing pragma statement for file: ${file.sourceName}`,
26+
);
27+
}
28+
2329
for (const version of file.content.versionPragmas) {
2430
versions.add(version);
2531
}

0 commit comments

Comments
 (0)