Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b11b841
Add crosschain options for ERC721, ERC1155, and Governor using Contra…
ericglau Jul 17, 2026
8d46403
Add upgradeable cross-chain bridging to the compile matrix and fix Au…
ericglau Jul 17, 2026
30a82a8
Simplify changeset
ericglau Jul 17, 2026
9cad247
Fix downloaded Foundry and Hardhat projects to compile when construct…
ericglau Jul 17, 2026
706abb8
Update downstream snapshots and formatting for Contracts 5.7.0-rc.0, …
ericglau Jul 17, 2026
140135b
Simplify cross-chain bridging tooltips for ERC721 and ERC1155
ericglau Jul 17, 2026
e260622
Clarify cross-chain bridging is restricted to registered counterparts…
ericglau Jul 17, 2026
ac49dc3
Align cross-chain bridging schema descriptions with tooltip wording
ericglau Jul 17, 2026
ab40a8b
Update OpenZeppelin Contracts to 5.7.0
ericglau Jul 29, 2026
8e01a9a
Avoid unrelated dependency churn in generated Hardhat project lockfiles
ericglau Jul 29, 2026
5774a9a
Note Account IERC4337 import path change in changeset
ericglau Jul 30, 2026
0c9caa4
Import types for non-address constructor arguments in generated Found…
ericglau Jul 30, 2026
ad947bd
Mark Contracts 5.7.0 update as potentially breaking in changeset
ericglau Jul 30, 2026
0876209
Deduplicate crosschain builders and zip generator helpers
claude Jul 30, 2026
4a733b5
Restore the exhaustiveness guard on crossChainBridging dispatch
claude Jul 30, 2026
adca3b6
Keep the named helpers in the Foundry variable generation
claude Jul 30, 2026
812be8a
Apply suggestion from code review
ericglau Jul 31, 2026
8d1ffd7
Update packages/ui/src/solidity/manual-notice-tooltip.ts
ericglau Jul 31, 2026
e418e66
Share the address type check between the zip generators
ericglau Jul 31, 2026
dd3e36d
Merge branch 'master' of https://github.com/OpenZeppelin/contracts-wi…
ericglau Jul 31, 2026
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
13 changes: 13 additions & 0 deletions .changeset/solidity-57-crosschain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@openzeppelin/wizard': patch
'@openzeppelin/wizard-common': patch
'@openzeppelin/contracts-mcp': patch
'@openzeppelin/contracts-cli': patch
---

Add Solidity cross-chain options for ERC721, ERC1155, and Governor using OpenZeppelin Contracts 5.7.
- ERC721/ERC1155: Add `crossChainBridging` and `crossChainLinkAllowOverride` options, using `ERC721Crosschain`/`ERC1155Crosschain`.
- Governor: Add `crossChainExecution` option, using `GovernorCrosschain`.
- Account: Update the `IERC4337` import path, which dropped its `draft-` prefix in Contracts 5.7.
- Fix compile errors in upgradeable ERC20 `crossChainBridging` variants.
- **Potentially breaking change**: Update to OpenZeppelin Contracts 5.7.0.
5 changes: 5 additions & 0 deletions packages/cli/src/cli.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Generated by [AVA](https://avajs.dev).
--mintable Whether privileged accounts will be able to create more supply or emit more tokens␊
--incremental Whether new tokens will be automatically assigned an incremental id␊
--votes <blocknumber|timestamp> Whether to keep track of individual units for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps (defaulting to block number if not specified).␊
--crossChainBridging <erc7786native> Whether to embed an ERC-7786 based bridge directly in the token contract, making it natively crosschain. Cross-chain transfers with registered counterparts burn the token on the source chain and mint it on the destination chain. If also using incremental token ids, mint only on a single chain and link counterparts without minting, otherwise colliding ids can strand bridged tokens.␊
--crossChainLinkAllowOverride Whether to allow replacing a crosschain link that has already been registered. Only used if crossChainBridging is set to "erc7786native".␊
--access <ownable|roles|managed> The type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts. Managed enables a central contract to define a policy that allows certain callers to access certain functions.␊
--upgradeable <transparent|uups> Whether the smart contract is upgradeable. Transparent uses more complex proxy with higher overhead, requires less changes in your contract. Can also be used with beacons. UUPS uses simpler proxy with less overhead, requires including extra code in your contract. Allows flexibility for authorizing upgrades.␊
--info.securityContact <string> Email where people can contact you to report security issues. Will only be visible if contract source code is verified.␊
Expand All @@ -104,6 +106,8 @@ Generated by [AVA](https://avajs.dev).
--mintable Whether privileged accounts will be able to create more supply or emit more tokens␊
--supply Whether to keep track of total supply of tokens␊
--updatableUri Whether privileged accounts will be able to set a new URI for all token types␊
--crossChainBridging <erc7786native> Whether to embed an ERC-7786 based bridge directly in the token contract, making it natively crosschain. Cross-chain transfers with registered counterparts burn the tokens on the source chain and mint them on the destination chain.␊
--crossChainLinkAllowOverride Whether to allow replacing a crosschain link that has already been registered. Only used if crossChainBridging is set to "erc7786native".␊
--access <ownable|roles|managed> The type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts. Managed enables a central contract to define a policy that allows certain callers to access certain functions.␊
--upgradeable <transparent|uups> Whether the smart contract is upgradeable. Transparent uses more complex proxy with higher overhead, requires less changes in your contract. Can also be used with beacons. UUPS uses simpler proxy with less overhead, requires including extra code in your contract. Allows flexibility for authorizing upgrades.␊
--info.securityContact <string> Email where people can contact you to report security issues. Will only be visible if contract source code is verified.␊
Expand Down Expand Up @@ -223,6 +227,7 @@ Generated by [AVA](https://avajs.dev).
--quorumAbsolute <string> The absolute quorum required, in cases of quorumMode equals absolute␊
--storage Enable storage of proposal details and enumerability of proposals␊
--settings Allow governance to update voting settings (delay, period, proposal threshold)␊
--crossChainExecution Whether passed proposals can relay execution to other chains through ERC-7786 gateways. Requires a CrosschainRemoteExecutor contract, controlled by this governor, deployed on each target chain. The gateway and executor are chosen per proposal as arguments to the relayCrosschain function.␊
--upgradeable <transparent|uups> Whether the smart contract is upgradeable. Transparent uses more complex proxy with higher overhead, requires less changes in your contract. Can also be used with beacons. UUPS uses simpler proxy with less overhead, requires including extra code in your contract. Allows flexibility for authorizing upgrades.␊
--info.securityContact <string> Email where people can contact you to report security issues. Will only be visible if contract source code is verified.␊
--info.license <string> The license used by the contract, default is "MIT"␊
Expand Down
Binary file modified packages/cli/src/cli.test.ts.snap
Binary file not shown.
15 changes: 13 additions & 2 deletions packages/common/src/ai/descriptions/solidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export const solidityPrompts = {
Custom: 'Make a custom smart contract.',
};

// Shared by every token kind that supports ERC-7786 native bridging.
const crossChainLinkAllowOverrideDescription =
'Whether to allow replacing a crosschain link that has already been registered. Only used if crossChainBridging is set to "erc7786native".';

export const solidityCommonDescriptions = {
access:
'The type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts. Managed enables a central contract to define a policy that allows certain callers to access certain functions.',
Expand All @@ -33,8 +37,7 @@ export const solidityERC20Descriptions = {
"Whether to include built-in flash loans to allow lending tokens without requiring collateral as long as they're returned in the same transaction.",
crossChainBridging:
'Whether to allow authorized bridge contracts to mint and burn tokens for cross-chain transfers. Options are to use custom bridges on any chain, to embed an ERC-7786 based bridge directly in the token contract, or to use the SuperchainERC20 standard with the predeployed SuperchainTokenBridge. The SuperchainERC20 feature is only available on chains in the Superchain, and requires deploying your contract to the same address on every chain in the Superchain.',
crossChainLinkAllowOverride:
'Whether to allow replacing a crosschain link that has already been registered. Only used if crossChainBridging is set to "erc7786native".',
crossChainLinkAllowOverride: crossChainLinkAllowOverrideDescription,
premintChainId: 'The chain ID of the network on which to premint tokens.',
callback:
'Whether to include support for code execution after transfers and approvals on recipient contracts in a single transaction.',
Expand All @@ -48,12 +51,18 @@ export const solidityERC721Descriptions = {
incremental: 'Whether new tokens will be automatically assigned an incremental id',
votes:
'Whether to keep track of individual units for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps (defaulting to block number if not specified).',
crossChainBridging:
'Whether to embed an ERC-7786 based bridge directly in the token contract, making it natively crosschain. Cross-chain transfers with registered counterparts burn the token on the source chain and mint it on the destination chain. If also using incremental token ids, mint only on a single chain and link counterparts without minting, otherwise colliding ids can strand bridged tokens.',
crossChainLinkAllowOverride: crossChainLinkAllowOverrideDescription,
};

export const solidityERC1155Descriptions = {
uri: 'The location of the metadata for the token. Clients will replace any instance of {id} in this string with the tokenId.',
supply: 'Whether to keep track of total supply of tokens',
updatableUri: 'Whether privileged accounts will be able to set a new URI for all token types',
crossChainBridging:
'Whether to embed an ERC-7786 based bridge directly in the token contract, making it natively crosschain. Cross-chain transfers with registered counterparts burn the tokens on the source chain and mint them on the destination chain.',
crossChainLinkAllowOverride: crossChainLinkAllowOverrideDescription,
};

export const solidityStablecoinDescriptions = {
Expand Down Expand Up @@ -99,4 +108,6 @@ export const solidityGovernorDescriptions = {
timelock: 'The type of timelock to use',
storage: 'Enable storage of proposal details and enumerability of proposals',
settings: 'Allow governance to update voting settings (delay, period, proposal threshold)',
crossChainExecution:
'Whether passed proposals can relay execution to other chains through ERC-7786 gateways. Requires a CrosschainRemoteExecutor contract, controlled by this governor, deployed on each target chain. The gateway and executor are chosen per proposal as arguments to the relayCrosschain function.',
};
5 changes: 5 additions & 0 deletions packages/common/src/ai/schemas/solidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export const solidityERC721Schema = {
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
incremental: z.boolean().optional().describe(solidityERC721Descriptions.incremental),
votes: z.literal('blocknumber').or(z.literal('timestamp')).optional().describe(solidityERC721Descriptions.votes),
crossChainBridging: z.literal('erc7786native').optional().describe(solidityERC721Descriptions.crossChainBridging),
crossChainLinkAllowOverride: z.boolean().optional().describe(solidityERC721Descriptions.crossChainLinkAllowOverride),
...solidityCommonSchema,
namespacePrefix: z.string().optional().describe(solidityCommonDescriptions.namespacePrefix),
} as const satisfies z.ZodRawShape;
Expand All @@ -79,6 +81,8 @@ export const solidityERC1155Schema = {
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
supply: z.boolean().optional().describe(solidityERC1155Descriptions.supply),
updatableUri: z.boolean().optional().describe(solidityERC1155Descriptions.updatableUri),
crossChainBridging: z.literal('erc7786native').optional().describe(solidityERC1155Descriptions.crossChainBridging),
crossChainLinkAllowOverride: z.boolean().optional().describe(solidityERC1155Descriptions.crossChainLinkAllowOverride),
...solidityCommonSchema,
} as const satisfies z.ZodRawShape;

Expand Down Expand Up @@ -157,6 +161,7 @@ export const solidityGovernorSchema = {
quorumAbsolute: z.string().optional().describe(solidityGovernorDescriptions.quorumAbsolute),
storage: z.boolean().optional().describe(solidityGovernorDescriptions.storage),
settings: z.boolean().optional().describe(solidityGovernorDescriptions.settings),
crossChainExecution: z.boolean().optional().describe(solidityGovernorDescriptions.crossChainExecution),
upgradeable: solidityCommonSchema.upgradeable,
info: solidityCommonSchema.info,
} as const satisfies z.ZodRawShape;
Expand Down
20 changes: 10 additions & 10 deletions packages/core/confidential/src/erc7984.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand Down Expand Up @@ -120,7 +120,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand All @@ -146,7 +146,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand All @@ -168,7 +168,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand All @@ -190,7 +190,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand All @@ -212,7 +212,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand Down Expand Up @@ -253,7 +253,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand Down Expand Up @@ -316,7 +316,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand Down Expand Up @@ -388,7 +388,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand Down Expand Up @@ -463,7 +463,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

`// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand Down
Binary file modified packages/core/confidential/src/erc7984.test.ts.snap
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

[
'@openzeppelin/contracts/=@openzeppelin/contracts@5.6.0/',
'@openzeppelin/contracts/=@openzeppelin/contracts@5.7.0/',
'@openzeppelin/confidential-contracts/=@openzeppelin/confidential-contracts@0.3.1/',
'@fhevm/solidity/=@fhevm/solidity@0.9.1/',
]
Binary file not shown.
14 changes: 7 additions & 7 deletions packages/core/confidential/src/zip-hardhat.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Generated by [AVA](https://avajs.dev).

[
`// SPDX-License-Identifier: AGPL-3.0-only␊
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
// Compatible with OpenZeppelin Contracts ^5.7.0 and Confidential Contracts ^0.3.1␊
pragma solidity ^0.8.27;␊
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
Expand Down Expand Up @@ -224,14 +224,14 @@ Generated by [AVA](https://avajs.dev).
it("Test contract", async function () {␊
const ContractFactory = await ethers.getContractFactory("MyToken");␊
// TODO: Set the following constructor argument␊
// const underlying = ...;␊
// TODO: Set values for the variables below, then uncomment the following section:␊
/*␊
const underlying = ...;␊
const defaultAdmin = (await ethers.getSigners())[1].address;␊
const handleViewer = (await ethers.getSigners())[2].address;␊
// TODO: Uncomment the below when the missing constructor arguments are set above␊
// const instance = await ContractFactory.deploy(underlying, defaultAdmin, handleViewer);␊
// await instance.waitForDeployment();␊
const instance = await ContractFactory.deploy(underlying, defaultAdmin, handleViewer);␊
await instance.waitForDeployment();␊
*/␊
});␊
});␊
`,
Expand Down
Binary file modified packages/core/confidential/src/zip-hardhat.test.ts.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/core/solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
},
"devDependencies": {
"@openzeppelin/community-contracts": "git+https://github.com/OpenZeppelin/openzeppelin-community-contracts.git#b0ddd27",
"@openzeppelin/contracts": "^5.6.0",
"@openzeppelin/contracts-upgradeable": "^5.6.0",
"@openzeppelin/contracts": "^5.7.0",
"@openzeppelin/contracts-upgradeable": "^5.7.0",
"@types/node": "^20.0.0",
"@types/semver": "^7.5.7",
"ava": "^6.0.0",
Expand Down
Loading
Loading