OpenZeppelin Contracts is a library for secure smart contract development.
This report presents the forensic synthetic code analysis of OpenZeppelin/openzeppelin-contracts, a Solidity project with 27,234 GitHub stars. SynthScan v2.0 examined 67,873 lines of code across 393 source files, recording 72 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 5.6 places this repository in the Low AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 72 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | test/account/extensions/ERC7821.behavior.js | 53 | await expect(this.ethers.predeploy.entrypoint.v09.getNonce(this.mock.target, 0)).to.eventually.equal(0); | CODE |
| CRITICAL | test/account/extensions/ERC7821.behavior.js | 54 | await expect(this.ethers.predeploy.entrypoint.v09.handleOps([operation.packed], this.beneficiary)) | CODE |
| CRITICAL | test/account/extensions/ERC7821.behavior.js | 75 | await expect(this.ethers.predeploy.entrypoint.v09.handleOps([operation.packed], this.beneficiary)).to.revert( | CODE |
| CRITICAL | test/account/extensions/ERC7821.behavior.js | 99 | await expect(this.ethers.predeploy.entrypoint.v09.handleOps([operation.packed], this.beneficiary)) | CODE |
| CRITICAL | test/account/extensions/ERC7821.behavior.js | 112 | this.ethers.predeploy.entrypoint.v09.handleOps([operation.packed], this.beneficiary), | CODE |
| CRITICAL | test/account/extensions/ERC7821.behavior.js | 135 | const tx = this.ethers.predeploy.entrypoint.v09.handleOps([operation.packed], this.beneficiary); | CODE |
| CRITICAL | test/account/paymaster/PaymasterERC20.test.js | 272 | const postOpError = ethers.predeploy.entrypoint.v09.interface.parseError(postOpRevertReason); | CODE |
| CRITICAL⚡ | test/account/paymaster/Paymaster.behavior.js | 45 | await expect(this.ethers.predeploy.entrypoint.v09.getNonce(this.account, 0n)).to.eventually.equal(0n); | CODE |
| CRITICAL⚡ | test/account/paymaster/Paymaster.behavior.js | 46 | await expect(this.ethers.predeploy.entrypoint.v09.balanceOf(this.paymaster)).to.eventually.equal(deposit); | CODE |
| CRITICAL⚡ | test/account/paymaster/Paymaster.behavior.js | 49 | const handleOpsTx = this.ethers.predeploy.entrypoint.v09.handleOps([signedUserOp.packed], this.receiver); | CODE |
| CRITICAL⚡ | test/account/paymaster/Paymaster.behavior.js | 57 | await expect(this.ethers.predeploy.entrypoint.v09.getNonce(this.account, 0n)).to.eventually.equal(1n); | CODE |
| CRITICAL⚡ | test/account/paymaster/Paymaster.behavior.js | 58 | await expect(this.ethers.predeploy.entrypoint.v09.balanceOf(this.paymaster)).to.eventually.be.lessThan(deposit); | CODE |
| CRITICAL | test/account/paymaster/Paymaster.behavior.js | 76 | await expect(this.ethers.predeploy.entrypoint.v09.handleOps([signedUserOp.packed], this.receiver)) | CODE |
| CRITICAL | test/account/paymaster/Paymaster.behavior.js | 105 | await expect(this.ethers.predeploy.entrypoint.v09.handleOps([signedUserOp.packed], this.receiver)) | CODE |
| CRITICAL | test/account/paymaster/Paymaster.behavior.js | 125 | await expect(this.ethers.predeploy.entrypoint.v09.handleOps([signedUserOp.packed], this.receiver)) | CODE |
| CRITICAL⚡ | test/account/paymaster/Paymaster.behavior.js | 152 | await expect(this.ethers.predeploy.entrypoint.v09.balanceOf(this.paymaster)).to.eventually.equal(0n); | CODE |
| CRITICAL⚡ | test/account/paymaster/Paymaster.behavior.js | 160 | await expect(this.ethers.predeploy.entrypoint.v09.balanceOf(this.paymaster)).to.eventually.equal(value); | CODE |
| CRITICAL⚡ | test/account/paymaster/Paymaster.behavior.js | 168 | await expect(this.ethers.predeploy.entrypoint.v09.balanceOf(this.paymaster)).to.eventually.equal(value - 1n); | CODE |
| CRITICAL | test/account/paymaster/Paymaster.behavior.js | 180 | await expect(this.ethers.predeploy.entrypoint.v09.getDepositInfo(this.paymaster)).to.eventually.deep.equal([ | CODE |
| CRITICAL | test/account/paymaster/Paymaster.behavior.js | 195 | await expect(this.ethers.predeploy.entrypoint.v09.getDepositInfo(this.paymaster)).to.eventually.deep.equal([ | CODE |
| CRITICAL | test/account/paymaster/Paymaster.behavior.js | 207 | await expect(this.ethers.predeploy.entrypoint.v09.getDepositInfo(this.paymaster)).to.eventually.deep.equal([ | CODE |
| CRITICAL | test/account/paymaster/Paymaster.behavior.js | 224 | await expect(this.ethers.predeploy.entrypoint.v09.getDepositInfo(this.paymaster)).to.eventually.deep.equal([ | CODE |
| CRITICAL | test/helpers/governance.js | 170 | return this.connection.helpers.time.increaseTo.timestamp(timestamp + offset); | CODE |
| CRITICAL | hardhat/hardhat-transpiler/tasks/transpile.ts | 57 | const mainSources = hre.config.paths.sources.solidity.at(0)!; | CODE |
| CRITICAL | hardhat/hardhat-exposed/tasks/build.ts | 22 | if (!hre.config.paths.sources.solidity.includes(hre.config.exposed.outDir)) { | CODE |
| CRITICAL | hardhat/hardhat-exposed/tasks/build.ts | 23 | hre.config.paths.sources.solidity.push(hre.config.exposed.outDir); | CODE |
| CRITICAL | …hat/hardhat-oz-contracts-helpers/hook-handlers/test.ts | 21 | const hasProxies = fs.existsSync(path.join(context.config.paths.sources.solidity.at(0)!, 'proxy/Proxy.sol')); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/token/ERC1155/ERC1155.behavior.js | 516 | function batchTransferWasSuccessful() { | CODE |
| LOW | …y/transparent/TransparentUpgradeableProxy.behaviour.js | 6 | export function shouldBehaveLikeTransparentUpgradeableProxy() { | CODE |
| LOW | test/access/AccessControl.behavior.js | 11 | export function shouldBehaveLikeAccessControl() { | CODE |
| LOW | test/access/AccessControl.behavior.js | 226 | export function shouldBehaveLikeAccessControlEnumerable() { | CODE |
| LOW | test/access/AccessControl.behavior.js | 263 | export function shouldBehaveLikeAccessControlDefaultAdminRules() { | CODE |
| LOW | test/access/manager/AccessManager.predicate.js | 168 | export function testAsSchedulableOperation({ scheduled: { before, after, expired }, notScheduled }) { | CODE |
| LOW | test/access/manager/AccessManager.predicate.js | 230 | export function testAsRestrictedOperation({ callerIsTheManager: { executing, notExecuting }, callerIsNotTheManager }) { | CODE |
| LOW | test/access/manager/AccessManager.behavior.js | 18 | export function shouldBehaveLikeDelayedAdminOperation() { | CODE |
| LOW | test/access/manager/AccessManager.behavior.js | 57 | export function shouldBehaveLikeNotDelayedAdminOperation() { | CODE |
| LOW | test/access/manager/AccessManager.behavior.js | 96 | export function shouldBehaveLikeRoleAdminOperation(roleAdmin) { | CODE |
| LOW | test/access/manager/AccessManager.behavior.js | 136 | export function shouldBehaveLikeAManagedRestrictedOperation() { | CODE |
| LOW | test/access/manager/AccessManager.behavior.js | 193 | export function shouldBehaveLikeASelfRestrictedOperation() { | CODE |
| LOW | test/utils/Context.behavior.js | 3 | export async function shouldBehaveLikeRegularContext() { | CODE |
| LOW | test/utils/Nonces.behavior.js | 69 | export function shouldBehaveLikeNoncesKeyed() { | CODE |
| LOW | test/account/Account.behavior.js | 6 | export function shouldBehaveLikeAccountCore() { | CODE |
| LOW | test/account/Account.behavior.js | 83 | export function shouldBehaveLikeAccountHolder() { | CODE |
| LOW | test/account/paymaster/Paymaster.behavior.js | 12 | export function shouldBehaveLikePaymaster({ postOp, timeRange }) { | CODE |
| LOW | …dhat/hardhat-solidity-docgen/internal/utils/natspec.ts | 141 | function cleanUpDocstringFromSource(text: string) { | CODE |
| LOW | hardhat/hardhat-exposed/internal/expose.ts | 52 | function getImportPathFromExposedContract( | CODE |
| LOW | hardhat/hardhat-exposed/internal/expose.ts | 300 | function areFunctionsFullyImplemented(contract: ContractDefinition, deref: ASTDereferencer): boolean { | CODE |
| LOW | hardhat/hardhat-exposed/internal/expose.ts | 319 | function getFunctionNameQualifiedFromArgs(fn: FunctionDefinition, args: Argument[], onlyConflicting: boolean): string { | CODE |
| LOW | hardhat/hardhat-exposed/internal/expose.ts | 513 | function getAllStorageArgumentsFromCache( | CODE |
| LOW | hardhat/hardhat-exposed/internal/expose.ts | 523 | function getFunctionReturnParameters( | CODE |
| LOW | hardhat/hardhat-exposed/internal/build-info.ts | 3 | export async function compilationJobToAstOnlyBuildInfo(compilationJob: CompilationJob): Promise<SolidityBuildInfo> { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | .github/workflows/release-cycle.yml | 4 | # ┌───────────┐ ┌─────────────┐ ┌────────────────┐ | COMMENT |
| MEDIUM⚡ | .github/workflows/release-cycle.yml | 6 | # └───────────┘ └─┬─────────▲─┘ │ └─┬────────────▲─┘ | COMMENT |
| MEDIUM⚡ | .github/workflows/release-cycle.yml | 10 | # ┌▼─────────┴┐ │ ┌▼────────────┴┐ | COMMENT |
| MEDIUM⚡ | .github/workflows/release-cycle.yml | 12 | # └───────────┘ └──────────────┘ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/utils/RLP.test.js | 214 | 'Lorem ipsum dolor sit amet, consectetur adipisicing elit', | CODE |
| LOW | test/utils/RLP.test.js | 214 | 'Lorem ipsum dolor sit amet, consectetur adipisicing elit', | CODE |
| LOW | test/utils/Bytes.test.js | 23 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna a | CODE |
| LOW | test/utils/Bytes.test.js | 23 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna a | CODE |
| LOW | test/utils/SlotDerivation.test.js | 50 | { type: 'string', key: 'lorem ipsum', isValueType: false }, | CODE |
| LOW | test/utils/StorageSlot.test.js | 20 | { name: 'String', type: 'string', value: 'lorem ipsum', isValueType: false, zero: '' }, | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | test/utils/cryptography/ERC1271.behavior.js | 102 | // Step 1: a malicious actor manages to get the user to sign a message that is not the one the app expects, bu | COMMENT |
| LOW⚡ | test/utils/cryptography/ERC1271.behavior.js | 111 | // Step 2: the malicious actor uses the signature with a contentsHash of its choosing. | COMMENT |
| LOW | test/utils/cryptography/ERC1271.behavior.js | 127 | // Step 3: the malicious actor submits the signature to the verifier, which must reject it. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | test/utils/cryptography/ERC1271.behavior.js | 102 | // Step 1: a malicious actor manages to get the user to sign a message that is not the one the app expects, bu | COMMENT |
| LOW⚡ | test/utils/cryptography/ERC1271.behavior.js | 111 | // Step 2: the malicious actor uses the signature with a contentsHash of its choosing. | COMMENT |
| LOW | test/utils/cryptography/ERC1271.behavior.js | 127 | // Step 3: the malicious actor submits the signature to the verifier, which must reject it. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | scripts/gen-nav.js | 76 | print( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/access/manager/AccessManager.test.js | 81 | user, | COMMENT |
| LOW | test/utils/cryptography/ERC1271.behavior.js | 101 | it('returns false for a malformed contents descriptor', async function () { | COMMENT |
| LOW | test/account/paymaster/PaymasterERC20Guarantor.test.js | 41 | const paymasterDomain = await getDomain(paymaster); | COMMENT |
| LOW | .github/workflows/release-cycle.yml | 1 | # D: Manual Dispatch | COMMENT |