Skip to content
Open
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
b808c2b
init hooks wizard
gonzaotc Aug 11, 2025
1e007d7
add hook utilities
gonzaotc Aug 12, 2025
faba830
add initial hooks controls
gonzaotc Aug 12, 2025
b03c350
remove readme
gonzaotc Aug 12, 2025
e078e95
up generation
gonzaotc Aug 13, 2025
b6115c1
up
gonzaotc Aug 13, 2025
e0f654e
add reliable hooks organization and utilities tooltips
gonzaotc Aug 13, 2025
db952de
add initial tooltips
gonzaotc Aug 13, 2025
0b5ae64
add uniswap deps
gonzaotc Aug 13, 2025
5dfb647
fix prepare error
gonzaotc Aug 13, 2025
45d7d64
add uniswap hooks hyperlinks
gonzaotc Aug 13, 2025
194b355
iterate hooks tooltips
gonzaotc Aug 13, 2025
b7be91c
fix kind sanitization
gonzaotc Aug 14, 2025
c650954
up tooltip
gonzaotc Aug 14, 2025
762b5a1
update remappings
gonzaotc Aug 18, 2025
20c07d8
fix addUsing compilation via addImportOnly addition
gonzaotc Aug 19, 2025
4de46d6
add erc1155 shares
gonzaotc Aug 19, 2025
0b02d69
add optional override "compatibleSemver" to printContract
gonzaotc Aug 19, 2025
6d9ff54
add a hooks folder containing each hook static data
gonzaotc Aug 19, 2025
d1b7b51
fix BaseHook compilation
gonzaotc Aug 19, 2025
c061c4f
add base hook function overrides
gonzaotc Aug 19, 2025
004965c
add required overrides
gonzaotc Aug 20, 2025
a0c05c5
merge with origin, add printContract option for additional libraries
gonzaotc Aug 20, 2025
0580129
solve conflicts with origin
gonzaotc Aug 20, 2025
71f3786
lint ui
gonzaotc Aug 20, 2025
e2784c3
update hooks snapshots
gonzaotc Aug 20, 2025
88d1d53
update snapshots
gonzaotc Aug 20, 2025
1546b24
add permissions component
gonzaotc Aug 21, 2025
344e8c4
up hooks permissions
gonzaotc Aug 21, 2025
8feecce
up
gonzaotc Aug 21, 2025
2dbe171
reorder perms
gonzaotc Aug 21, 2025
79c3b8a
up snapshots
gonzaotc Aug 21, 2025
3962a18
up pausability construction
gonzaotc Aug 22, 2025
5a287ff
fix pausability conficting overrides on custom functions
gonzaotc Aug 22, 2025
b7e605e
add automatic types importing
gonzaotc Aug 22, 2025
0d436ef
fix double import bug
gonzaotc Aug 22, 2025
7b06a4d
add required import paths
gonzaotc Aug 22, 2025
48582fd
fix compilation
gonzaotc Aug 22, 2025
041d6d8
lint
gonzaotc Aug 22, 2025
4163fee
up
gonzaotc Aug 22, 2025
bf1ff20
reorder controls
gonzaotc Aug 22, 2025
c0881ae
up tooltips & normalize hook names in UI
gonzaotc Aug 25, 2025
af17f95
lint
gonzaotc Aug 25, 2025
43fe35f
update uniswap-hooks package commit reference
gonzaotc Aug 25, 2025
dedffd8
update uniswap-hooks package commit reference
gonzaotc Aug 25, 2025
34f020e
up ava snapshots for basedynamicfee
gonzaotc Aug 25, 2025
96f25f7
up tooltips & shortcut permissions in ui
gonzaotc Aug 25, 2025
5c1c8ed
add lateral size to the hooks wizard selector panel
gonzaotc Aug 25, 2025
8cf50c9
Merge branch 'master' of github.com:OpenZeppelin/contracts-wizard int…
gonzaotc Aug 25, 2025
d0652cf
add try the ui builder component to hooks html
gonzaotc Aug 25, 2025
59e99dc
Add simple download button
gonzaotc Aug 25, 2025
302ef9d
download foundry project wip
gonzaotc Aug 25, 2025
305d7be
empty changelog
gonzaotc Aug 25, 2025
4adb616
removed openzeppelin community from inject hyperlinks
gonzaotc Aug 25, 2025
8b947af
up version tag
gonzaotc Aug 25, 2025
4fade89
refactor addUsing towards addLibrary
gonzaotc Aug 25, 2025
5b348a2
simplify get imports
gonzaotc Aug 25, 2025
f1ee4f9
print hooks functions if permissions are enabled
gonzaotc Aug 26, 2025
7e5cb2f
add permission depency auto-selection and permission function additio…
gonzaotc Aug 27, 2025
1f2ab4c
solve conflicting override
gonzaotc Aug 27, 2025
ae40d10
Add ExpandableSection and use in Hook Permissions
gonzaotc Aug 27, 2025
4e5ea07
up ava snapshots
gonzaotc Aug 27, 2025
38da7e1
modularize SharesControlsSection and make Utilities collapsable
gonzaotc Aug 27, 2025
75fda2f
up remappings in uniswap hooks repo
gonzaotc Aug 27, 2025
a89a016
reorganize shares tab
gonzaotc Aug 28, 2025
9b83ef6
make shares required in BaseCustomAccounting and CustomCurve
gonzaotc Aug 28, 2025
222a421
up base override fee permissions
gonzaotc Aug 28, 2025
c61b0e2
fix a state bug in permission selection
gonzaotc Aug 28, 2025
23f8c21
remove log
gonzaotc Aug 28, 2025
7c20743
simplify hook names
gonzaotc Aug 29, 2025
960ae35
Merge branch 'master' of github.com:OpenZeppelin/contracts-wizard int…
gonzaotc Aug 29, 2025
c637945
update imports
gonzaotc Aug 29, 2025
af18d7f
up tests
gonzaotc Aug 29, 2025
054bce0
enhance tooltips
gonzaotc Aug 29, 2025
ca4d391
merge with origin
gonzaotc Sep 24, 2025
4b39243
Merge branch 'master' of github.com:OpenZeppelin/contracts-wizard int…
gonzaotc Oct 1, 2025
dda3ca4
add rehypothecation hook and hookfee
gonzaotc Oct 2, 2025
30352d8
implemented better shares config handling in core and ui
gonzaotc Oct 3, 2025
4b2815d
remove pool manager construction param
gonzaotc Oct 3, 2025
8310cb5
add dynamic inputs for hooks
gonzaotc Oct 6, 2025
5fb4631
Merge branch 'master' of github.com:OpenZeppelin/contracts-wizard int…
gonzaotc Oct 6, 2025
decdf20
add hooks input tooltip, improve wizard output comments
gonzaotc Oct 6, 2025
97441fb
add constructionOnly contracts directive
gonzaotc Oct 8, 2025
015a66f
Merge branch 'master' of github.com:OpenZeppelin/contracts-wizard int…
gonzaotc Oct 8, 2025
81e7a8d
remove foundry dependency
gonzaotc Oct 8, 2025
3e515d4
lint
gonzaotc Oct 8, 2025
f638f7c
Merge branch 'master' of github.com:OpenZeppelin/contracts-wizard int…
gonzaotc Oct 13, 2025
3e9b8a9
apply fixes from pr review
gonzaotc Oct 13, 2025
1659ac1
Merge pull request #2 from gonzaotc/pr-fixes
gonzaotc Oct 13, 2025
641a7f2
Update CHANGELOG.md
gonzaotc Oct 13, 2025
ce382af
add uniswap hooks to github test workflow matrix
gonzaotc Oct 13, 2025
6e1dc62
import solidity version from solidity package and bump compatible semver
gonzaotc Oct 13, 2025
ad391c7
Remove package-lock, update yarn.lock
ericglau Oct 14, 2025
fadfa59
Restore deno lock
ericglau Oct 14, 2025
d213d32
Update git dependency format
ericglau Oct 14, 2025
16f4a19
Merge remote-tracking branch 'upstream/master' into hooks-wizard
ericglau Oct 14, 2025
5450636
add oracles
gonzaotc Oct 14, 2025
5c87881
Merge branch 'master' of github.com:OpenZeppelin/contracts-wizard int…
gonzaotc Oct 14, 2025
5380d2f
merge with origin
gonzaotc Oct 14, 2025
8c88661
Add Wizard AI assistant for uniswap hooks
CoveMB Oct 15, 2025
76c4ea3
Merge branch 'master' into hooks-wizard
ericglau Oct 15, 2025
296e973
only reset hooks permission upon changing selected hook
gonzaotc Oct 15, 2025
42c9c3a
Merge branch 'hooks-wizard' of https://github.com/gonzaotc/contracts-…
gonzaotc Oct 15, 2025
b120cd7
add input validations
gonzaotc Oct 15, 2025
c2fa828
Add MCP config
CoveMB Oct 16, 2025
5fa1adc
add input validations
gonzaotc Oct 15, 2025
6bdf770
Addjust MCP schema
CoveMB Oct 16, 2025
aeb606a
Addjust MCP schema
CoveMB Oct 16, 2025
e9dd205
Merge branch 'hooks-wizard' of https://github.com/gonzaotc/contracts-…
CoveMB Oct 16, 2025
f569fe5
Add mcp tests
CoveMB Oct 16, 2025
2912157
Remove unecessary fields
CoveMB Oct 16, 2025
d913b50
Use consts
CoveMB Oct 16, 2025
9d96139
revert const
CoveMB Oct 16, 2025
5201e1b
Adjust types
CoveMB Oct 16, 2025
2013585
Adjust types
CoveMB Oct 16, 2025
1e95301
merge with origin
gonzaotc Oct 17, 2025
6bf1ddd
up
gonzaotc Oct 17, 2025
d024591
add natspec comments for better hook building guidance
gonzaotc Oct 17, 2025
ac764ac
up comments
gonzaotc Oct 17, 2025
3194d5c
rename natspec comments to top level comments
gonzaotc Oct 17, 2025
5b405a4
up comments
gonzaotc Oct 17, 2025
a7fd4db
require access controls on baseDynamicFee and update snapshots
gonzaotc Oct 17, 2025
55aaca9
apply fixes from pr
gonzaotc Oct 20, 2025
fe3f732
apply fixes from pr
gonzaotc Oct 20, 2025
8760936
apply fixes from pr
gonzaotc Oct 20, 2025
d7c6a6b
before refactor
CoveMB Oct 20, 2025
17a96d5
regenerate yarn.lock
gonzaotc Oct 20, 2025
068357c
simplifyed types
CoveMB Oct 20, 2025
10e245b
lint
gonzaotc Oct 20, 2025
2ef6fd7
use helper
CoveMB Oct 20, 2025
077ced3
rollback yarn.lock with master version
gonzaotc Oct 20, 2025
a7d435e
Use helper other languages
CoveMB Oct 20, 2025
3861aa8
Add extract string enum helper
CoveMB Oct 21, 2025
cd40989
Merge master
CoveMB Oct 21, 2025
7f9d2d3
Adjust import
CoveMB Oct 21, 2025
2a120e5
Fix type issue
CoveMB Oct 21, 2025
0a214b7
Add type check for required keys, add each hook description
CoveMB Oct 21, 2025
890ecb1
Fix UI type upgradable
CoveMB Oct 21, 2025
f47e500
Lint
CoveMB Oct 21, 2025
0daf90d
Fix snapshots
ericglau Oct 21, 2025
d13fe09
Add changeset
ericglau Oct 21, 2025
9795986
Fix tooltip URLs for Contracts
ericglau Oct 21, 2025
a0ddd00
apply fixes from pr
gonzaotc Oct 22, 2025
5390441
divide addHook into specific hook functions for modularity
gonzaotc Oct 22, 2025
9732a0b
up
gonzaotc Oct 22, 2025
c2b4506
up
gonzaotc Oct 22, 2025
b22adde
refactor addTopLevelComment
gonzaotc Oct 22, 2025
6b2b81d
patch topLevelComment issue
gonzaotc Oct 22, 2025
a7d5cdd
Merge branch 'master' into hooks-wizard
ericglau Oct 22, 2025
15488b9
Update minor version for hooks wizard
ericglau Oct 23, 2025
21487ba
merge with origin and update uniswap-hooks library
gonzaotc Oct 28, 2025
8d0fee2
update constructor param
gonzaotc Oct 28, 2025
8396cde
add uniswap-hooks-solidity to languages
gonzaotc Oct 29, 2025
a43ff4b
Merge branch 'hooks-wizard' of https://github.com/gonzaotc/contracts-…
gonzaotc Oct 29, 2025
c56afaa
Merge pull request #3 from gonzaotc/update-constructor-param
gonzaotc Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions packages/core/solidity/src/contract.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -21,7 +21,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Footec {␊
Expand All @@ -33,7 +33,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
import {Bar} from "./Bar.sol";␊
Expand All @@ -47,7 +47,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
import {Bar} from "./Bar.sol";␊
Expand All @@ -62,7 +62,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
import {Bar} from "./Bar.sol";␊
Expand All @@ -77,7 +77,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
import {Bar} from "./Bar.sol";␊
Expand All @@ -93,7 +93,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -105,7 +105,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -125,7 +125,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -149,7 +149,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -162,7 +162,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -177,7 +177,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -192,7 +192,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
import {Bar} from "./Bar.sol";␊
Expand All @@ -209,7 +209,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -224,7 +224,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -240,7 +240,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -253,7 +253,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Foo {␊
Expand All @@ -267,7 +267,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract FooBarBaz {␊
Expand All @@ -279,7 +279,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
/// @custom:security-contact security@example.com␊
Expand Down
Binary file modified packages/core/solidity/src/contract.test.ts.snap
Binary file not shown.
12 changes: 11 additions & 1 deletion packages/core/solidity/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface Contract {
license: string;
parents: Parent[];
natspecTags: NatspecTag[];
using: Using[];
imports: ImportContract[];
functions: ContractFunction[];
constructorCode: string[];
Expand Down Expand Up @@ -52,7 +53,7 @@ export interface ContractFunction extends BaseFunction {
comments: string[];
}

export type FunctionKind = 'internal' | 'public';
export type FunctionKind = 'private' | 'internal' | 'public' | 'external';
export type FunctionMutability = (typeof mutabilityRank)[number];

// Order is important
Expand Down Expand Up @@ -133,6 +134,15 @@ export class ContractBuilder implements Contract {
return !present;
}

addUsing(library: ImportContract, usingFor: string): boolean {
const exists = this.using.some(u => u.library.name === library.name && u.usingFor === usingFor);
if (!exists) {
this.using.push({ library, usingFor });
return true;
}
return false;
}

addOverride(parent: ReferencedContract, baseFn: BaseFunction, mutability?: FunctionMutability) {
const fn = this.addFunction(baseFn);
fn.override.add(parent);
Expand Down
6 changes: 3 additions & 3 deletions packages/core/solidity/src/custom.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract MyContract {␊
Expand All @@ -21,7 +21,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract Contract {␊
Expand Down Expand Up @@ -106,7 +106,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract MyContract {␊
Expand Down
Binary file modified packages/core/solidity/src/custom.test.ts.snap
Binary file not shown.
5 changes: 5 additions & 0 deletions packages/core/solidity/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const upgradeableImport = (p: ImportContract): ImportContract => {

export interface Options {
transformImport?: (parent: ImportContract) => ImportContract;
/**
* Add additional libraries to the compatibility banner printed at the top of the contract.
*/
additionalCompatibleLibraries?: { name: string; path: string; version: string }[];
}

export interface Helpers extends Required<Options> {
Expand All @@ -45,5 +49,6 @@ export function withHelpers(contract: Contract, opts: Options = {}): Helpers {
const p2 = contractUpgradeable && inferTranspiled(p1) ? upgradeableImport(p1) : p1;
return opts.transformImport?.(p2) ?? p2;
},
additionalCompatibleLibraries: opts.additionalCompatibleLibraries ?? [],
};
}
45 changes: 38 additions & 7 deletions packages/core/solidity/src/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SOLIDITY_VERSION from './solidity-version.json';
import { inferTranspiled } from './infer-transpiled';
import { compatibleContractsSemver } from './utils/version';
import { stringifyUnicodeSafe } from './utils/sanitize';
import { importsCommunityContracts } from './utils/imports-libraries';
import { importsLibrary } from './utils/imports-libraries';
import { getCommunityContractsGitCommit } from './utils/community-contracts-git-commit';

export function printContract(contract: Contract, opts?: Options): string {
Expand All @@ -31,7 +31,7 @@ export function printContract(contract: Contract, opts?: Options): string {
...spaceBetween(
[
`// SPDX-License-Identifier: ${contract.license}`,
printCompatibleLibraryVersions(contract),
printCompatibleLibraryVersions(contract, opts),
`pragma solidity ^${SOLIDITY_VERSION};`,
],

Expand All @@ -42,6 +42,7 @@ export function printContract(contract: Contract, opts?: Options): string {
[`contract ${contract.name}`, ...printInheritance(contract, helpers), '{'].join(' '),

spaceBetween(
printUsing(contract, helpers),
contract.variables,
printConstructor(contract, helpers),
...fns.code,
Expand All @@ -56,17 +57,30 @@ export function printContract(contract: Contract, opts?: Options): string {
);
}

function printCompatibleLibraryVersions(contract: Contract): string {
let result = `// Compatible with OpenZeppelin Contracts ${compatibleContractsSemver}`;
if (importsCommunityContracts(contract)) {
function printCompatibleLibraryVersions(contract: Contract, opts?: Options): string {
const libraries: string[] = [];
if (importsLibrary(contract, '@openzeppelin/contracts')) {
libraries.push(`OpenZeppelin Contracts ${compatibleContractsSemver}`);
}
if (importsLibrary(contract, '@openzeppelin/community-contracts')) {
try {
const commit = getCommunityContractsGitCommit();
result += ` and Community Contracts commit ${commit}`;
libraries.push(`Community Contracts commit ${commit}`);
} catch (e) {
console.error(e);
}
}
return result;
if (opts?.additionalCompatibleLibraries) {
for (const library of opts.additionalCompatibleLibraries) {
if (importsLibrary(contract, library.path)) {
libraries.push(`${library.name} ${library.version}`);
}
}
}

if (libraries.length === 0) return '';
if (libraries.length === 1) return `// Compatible with ${libraries[0]}`;
return `// Compatible with ${libraries.slice(0, -1).join(', ')} and ${libraries.slice(-1)}`;
}

function printInheritance(contract: Contract, { transformName }: Helpers): [] | [string] {
Expand Down Expand Up @@ -275,3 +289,20 @@ function printImports(imports: ImportContract[], helpers: Helpers): string[] {

return lines;
}

function printUsing(contract: Contract, { transformName }: Helpers): string[] {
if (!contract.using || contract.using.length === 0) {
return [];
}

// Emit in stable order by library then type to keep output deterministic
const entries = [...contract.using].sort((a, b) => {
if (a.library.name < b.library.name) return -1;
if (a.library.name > b.library.name) return 1;
if (a.usingFor < b.usingFor) return -1;
if (a.usingFor > b.usingFor) return 1;
return 0;
});

return entries.map(u => `using ${transformName(u.library)} for ${u.usingFor};`);
}
4 changes: 2 additions & 2 deletions packages/core/solidity/src/utils/imports-libraries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Contract } from '../contract';

export function importsCommunityContracts(contract: Contract) {
return contract.imports.some(i => i.path.startsWith('@openzeppelin/community-contracts/'));
export function importsLibrary(contract: Contract, library: string) {
return contract.imports.some(i => i.path.startsWith(library));
}
2 changes: 1 addition & 1 deletion packages/core/solidity/src/zip-foundry.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ Generated by [AVA](https://avajs.dev).
}␊
`,
`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract MyContract {␊
Expand Down
Binary file modified packages/core/solidity/src/zip-foundry.test.ts.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/core/solidity/src/zip-hardhat.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ Generated by [AVA](https://avajs.dev).

[
`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.4.0
pragma solidity ^0.8.27;␊
contract MyContract {␊
Expand Down
Binary file modified packages/core/solidity/src/zip-hardhat.test.ts.snap
Binary file not shown.
4 changes: 4 additions & 0 deletions packages/core/uniswap-hooks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/cache
/artifacts
/contracts/generated
/openzeppelin-contracts.json
6 changes: 6 additions & 0 deletions packages/core/uniswap-hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog


## 0.0.1 (2025-08-11)

- Initial version. (PR link)
Loading
Loading