Add cross-chain options for ERC721, ERC1155, and Governor (Contracts 5.7)#825
Add cross-chain options for ERC721, ERC1155, and Governor (Contracts 5.7)#825ericglau wants to merge 8 commits into
Conversation
…thorityUtils import transpilation
…ors have non-address arguments
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. It is recommended to resolve "Warn" alerts too. Learn more about Socket for GitHub.
|
…and fix import hyperlink version
Adds Wizard support for the new cross-chain contracts in OpenZeppelin Contracts 5.7.
Note
Draft until Contracts 5.7 final is released. Currently built against
5.7.0-rc.0.New options
crossChainBridging(ERC-7786 Native) embeds a bridge directly in the token viaERC721Crosschain/ERC1155Crosschain— outbound transfers burn, inbound transfers mint. Adds aCrosschainLinked.Link[]constructor argument and an access-controlledsetLinkfunction, with thecrossChainLinkAllowOverridesub-option. Mirrors the existing ERC20erc7786nativeoption.crossChainExecutionadds theGovernorCrosschainextension, letting passed proposals relay execution to other chains through ERC-7786 gateways. TheCrosschainRemoteExecutoron target chains is deployed by the user (not generated); gateway and executor are per-proposal arguments torelayCrosschain.Combining ERC721 auto-increment IDs with bridging is allowed but shows a warning (IDs increment independently per chain; mint on a single chain and link non-minting counterparts to avoid collisions that strand bridged tokens).
Covers core codegen, UI, AI assistant descriptions/schemas/function definitions, MCP tools, and CLI.
Fixes
Upgradeable
crossChainBridgingcombinations were previously excluded from the exhaustive compile matrix; they are now covered via reduced blueprints, which surfaced two existing compile errors in upgradeable ERC20 bridging variants (fixed here):erc7786nativereferenced the untranspiledCrosschainLinked.Link[]in the initializer.customwith managed access transpiled theAuthorityUtilslibrary import to a nonexistent file.Additionally, downloaded Foundry and Hardhat projects now compile when constructors have non-address arguments (e.g. cross-chain links, or Governor's token and timelock): the generated test and script files declare typed placeholders and comment out the deployment with a TODO, instead of calling the constructor with missing arguments.
Before merging
@openzeppelin/contractsand@openzeppelin/contracts-upgradeableto^5.7.0(core devDependencies and both Hardhat environments) and regenerate lockfiles/snapshot viaprepareandupdate-envcompatibleContractsSemverto^5.7.0ERC721Crosschain,ERC1155Crosschain, andGovernorCrosschainresolve🤖 Generated with Claude Code