Skip to content

Predeploys should be proxies#119

Merged
RogerPodacter merged 1 commit into
evm-backend-demofrom
predeploy_proxies
Oct 14, 2025
Merged

Predeploys should be proxies#119
RogerPodacter merged 1 commit into
evm-backend-demofrom
predeploy_proxies

Conversation

@RogerPodacter

@RogerPodacter RogerPodacter commented Oct 14, 2025

Copy link
Copy Markdown
Member

Note

Moves Ethscriptions to proxied 0x330… predeploys, wires implementations via code-namespace, and updates template/constants and tooling accordingly.

  • Genesis/Predeploy Setup:
    • Switch Ethscriptions to proxied predeploys across 0x3300… with EIP-1967 admin set to Predeploys.PROXY_ADMIN and implementations in code-namespace via setImplementation.
    • Create genesis Ethscriptions by etching GenesisEthscriptions to the implementation address, calling via proxy, then swapping in real Ethscriptions implementation without resetting nonce.
    • Add _setImplementationCodeNamed and _setCodeAt helpers; templates (ERC20, ERC721) etched at implementation addresses (not proxied).
  • Predeploys Library:
    • Update ETHSCRIPTIONS to 0x3300…0001; add ERC20_TEMPLATE_PROXY/IMPLEMENTATION and ERC721_TEMPLATE_PROXY/IMPLEMENTATION constants.
    • Introduce isOPPredeployNamespace, isEthscriptionsPredeployNamespace, and broaden isPredeployNamespace; keep predeployToCodeNamespace for both namespaces.
  • Contracts:
    • CollectionsManager and TokenManager: point erc721Template/erc20Template to *_TEMPLATE_IMPLEMENTATION constants.
  • Ruby Tooling:
    • SysConfig: set ETHSCRIPTIONS_ADDRESS to 0x3300…0001.
    • event_decoder.rb and storage_reader.rb: use SysConfig::ETHSCRIPTIONS_ADDRESS instead of hardcoded address.

Written by Cursor Bugbot for commit 232e539. This will update automatically on new commits. Configure here.

@RogerPodacter RogerPodacter requested a review from Copilot October 14, 2025 14:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates Ethscriptions predeploy contracts to use a proxy pattern, aligning with OP Stack architecture. The main change is moving the ETHSCRIPTIONS address from 0xEeee... to 0x3300...0001 to match the Ethscriptions namespace, and introducing proxy/implementation separation for system contracts.

Key changes:

  • Updated ETHSCRIPTIONS_ADDRESS constant from 0xEeee... to 0x3300...0001 across the codebase
  • Introduced proxy/implementation separation for predeploy contracts with distinct addresses
  • Refactored genesis deployment script to create proxies across the full 0x3300... namespace

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/sys_config.rb Updated ETHSCRIPTIONS_ADDRESS to new namespace
lib/storage_reader.rb Changed to use centralized SysConfig constant
lib/event_decoder.rb Changed to use centralized SysConfig constant
contracts/src/libraries/Predeploys.sol Added proxy/implementation address pairs and namespace helper functions
contracts/src/TokenManager.sol Updated to reference ERC20_TEMPLATE_IMPLEMENTATION instead of ERC20_TEMPLATE
contracts/src/CollectionsManager.sol Updated to reference ERC721_TEMPLATE_IMPLEMENTATION instead of ERC721_TEMPLATE
contracts/script/L2Genesis.s.sol Refactored to deploy proxies across namespace and wire up implementations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

address constant ERC721_TEMPLATE_PROXY = 0x3300000000000000000000000000000000000005;

/// @notice Implementation address for the ERC721 template (actual logic contract)
address constant ERC721_TEMPLATE_IMPLEMENTATION = 0xc0d3C0d3c0D3c0d3C0D3C0D3c0D3C0D3c0d30005;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: ERC20/721 Template Address Casing Mismatch

The ERC20_TEMPLATE_IMPLEMENTATION and ERC721_TEMPLATE_IMPLEMENTATION addresses have inconsistent hex casing compared to the pattern derived by the predeployToCodeNamespace function. While the underlying address values are functionally equivalent in the EVM, this casing mismatch creates an inconsistency in the addressing scheme, which could lead to confusion or issues with string comparisons and checksum validations.

Fix in Cursor Fix in Web

@RogerPodacter RogerPodacter merged commit 30bf95c into evm-backend-demo Oct 14, 2025
2 checks passed
@RogerPodacter RogerPodacter deleted the predeploy_proxies branch October 14, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants