Skip to content

feat: upgrade mainnet land contract to V4 #1692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 20, 2025
Merged

Conversation

adjisb
Copy link
Contributor

@adjisb adjisb commented May 6, 2025

Description

https://internal-jira.atlassian.net/browse/LR-41

Summary by CodeRabbit

  • New Features
    • Added deployment details for new upgradeable proxy contracts on mainnet, including TransparentUpgradeableProxy, LandMetadataRegistry, and RoyaltyManager, supporting secure admin-controlled upgrades.
    • Expanded and refined the Land contract proxy interface with enhanced error handling, new events, and extended functionality for improved asset management and user interactions.
    • Introduced comprehensive upgradeable proxy patterns and access control utilities to enhance contract upgradeability and security.

@adjisb adjisb requested a review from a team as a code owner May 6, 2025 14:11
@adjisb adjisb force-pushed the feat/mainnet_land_upgrade_v4 branch from 9e7beea to 7ec72de Compare June 18, 2025 11:04
Copy link

coderabbitai bot commented Jun 18, 2025

"""

Walkthrough

A new deployment artifact for the TransparentUpgradeableProxy smart contract has been added for the mainnet environment. The artifact details the proxy's address, ABI, deployment metadata, and references the implementation contract. It documents the proxy's upgrade and admin functions, events, and includes bytecode and deployment receipt information. Additionally, the Land contract proxy ABI on mainnet was extensively expanded with new events, errors, and refined function signatures, including an updated implementation address. New upgradeable proxy artifacts for LandMetadataRegistry and LandMetadataRegistry_Proxy were also added. A comprehensive Solidity compiler input JSON was introduced, containing OpenZeppelin upgradeable proxy contracts and utilities source code and configuration. Furthermore, new deployment artifacts for RoyaltyManager and its proxy were added, detailing upgradeable proxy patterns with role-based access control and royalty management features. Also included are additional proxy artifacts for earlier Land versions and a Sepolia network proxy deployment.

Changes

File(s) Change Summary
packages/deploy/deployments/mainnet/Land_V3.json Added deployment artifact for TransparentUpgradeableProxy including ABI, metadata, and deployment receipt.
packages/deploy/deployments/mainnet/Land.json Expanded and refined Land contract proxy ABI with new events, errors, detailed function signatures, and updated implementation address.
packages/deploy/deployments/mainnet/LandMetadataRegistry.json Added deployment artifact for LandMetadataRegistry upgradeable proxy contract with full metadata and deployment details.
packages/deploy/deployments/mainnet/LandMetadataRegistry_Proxy.json Added deployment artifact for LandMetadataRegistry_Proxy upgradeable proxy contract with ABI, metadata, and deployment receipt.
packages/deploy/deployments/mainnet/RoyaltyManager.json Added deployment artifact for RoyaltyManager upgradeable proxy contract with role-based access control and royalty management functions.
packages/deploy/deployments/mainnet/RoyaltyManager_Proxy.json Added deployment artifact for RoyaltyManager_Proxy transparent upgradeable proxy contract with ABI, metadata, and deployment receipt.
packages/deploy/deployments/mainnet/solcInputs/0e89febeebc7444140de8e67c9067d2c.json Added Solidity compiler input JSON containing OpenZeppelin upgradeable proxy contracts, utilities, and compilation configuration.
packages/deploy/deployments/mainnet/Land_V1.json Added deployment artifact for TransparentUpgradeableProxy contract for Land V1 with ABI, metadata, and deployment receipt.
packages/deploy/deployments/mainnet/Land_V2.json Added deployment artifact for TransparentUpgradeableProxy contract for Land V2 with ABI, metadata, and deployment receipt.
packages/deploy/deployments/sepolia/Land_V3.json Added deployment artifact for TransparentUpgradeableProxy contract on Sepolia network with ABI, metadata, and deployment receipt.

Poem

In the warren of code, a proxy appears,
Upgrading with care through the blockchain's gears.
Admins may change, implementations too,
With EIP slots, collisions are few.
On mainnet it hops, bytecode in tow—
A rabbit's delight to see smart contracts grow!
🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6284df8 and ab88188.

📒 Files selected for processing (3)
  • packages/deploy/deployments/mainnet/Land_V1.json (1 hunks)
  • packages/deploy/deployments/mainnet/Land_V2.json (1 hunks)
  • packages/deploy/deployments/sepolia/Land_V3.json (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • packages/deploy/deployments/mainnet/Land_V2.json
  • packages/deploy/deployments/sepolia/Land_V3.json
  • packages/deploy/deployments/mainnet/Land_V1.json
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: coverage
  • GitHub Check: deploy
  • GitHub Check: test
  • GitHub Check: analyze
  • GitHub Check: lint
  • GitHub Check: format

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@adjisb adjisb closed this Jun 18, 2025
@adjisb
Copy link
Contributor Author

adjisb commented Jun 18, 2025

Closed the wrong PR by mistake, reopen it

@adjisb adjisb reopened this Jun 18, 2025
@adjisb adjisb force-pushed the feat/mainnet_land_upgrade_v4 branch from 7ec72de to 6a4a0e1 Compare June 18, 2025 12:27
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/deploy/deployments/mainnet/Land_V3.json (1)

1232-1235: Missing storage layout details.
The storageLayout section is empty (storage: [], types: null). While the proxy itself doesn’t introduce new slots, embedding the implementation contract’s storage layout aids upgrade safety audits and tooling.

Consider generating and including the storage layout JSON for the new logic contract.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 745c998 and e31d4f1.

📒 Files selected for processing (1)
  • packages/deploy/deployments/mainnet/Land_V3.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: format
  • GitHub Check: analyze
  • GitHub Check: deploy
  • GitHub Check: coverage
  • GitHub Check: lint
  • GitHub Check: test
🔇 Additional comments (2)
packages/deploy/deployments/mainnet/Land_V3.json (2)

1181-1185: Verify constructor arguments for V4 initialization.
The args array encodes the proxy’s constructor, including a bytes payload for initialization:

"args": [
  "0x1fC6479Bdc7511C6803aFF2f477E0fD3171606E0",
  "0x46Ac83D74091Dd54B503D89fa92b5C788Bcd3886",
  "0x485cc9550000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d0000000000000000000000000e19ae8f9b36ca43d12741288d0e311396140df6f"
]

Ensure the third element correctly encodes the new initialize(...) signature and parameters for the V4 logic contract. An incorrect selector or padding here will render the proxy unusable.


1186-1187: Validate numDeployments counter.
The numDeployments field is set to 3. If this is the fourth deployment for this contract, it may need to be incremented to 4 to maintain accurate deployment history in hardhat-deploy.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/deploy/deployments/mainnet/Land.json (2)

57-61: Remove trailing underscores in output parameter names.
The outputs of admin() and implementation() are named admin_ and implementation_. This breaks tooling that expects unnamed returns or conventional names. Consider reverting to unnamed outputs or using cleaner identifiers.

Also applies to: 83-87


314-515: Validate new event declarations.
An extended set of events (e.g., Approval, ApprovalForAll, ContractRegistered, …, Transfer) has been added. Verify that each:

  • Correctly indexes parameters per ERC-721 standards.
  • Matches the on-chain event signatures and ordering.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e31d4f1 and 5725620.

📒 Files selected for processing (1)
  • packages/deploy/deployments/mainnet/Land.json (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: deploy
  • GitHub Check: analyze
  • GitHub Check: coverage
  • GitHub Check: lint
  • GitHub Check: format
  • GitHub Check: test
🔇 Additional comments (5)
packages/deploy/deployments/mainnet/Land.json (5)

23-35: Verify BeaconUpgraded event usage in proxy ABI.
The BeaconUpgraded(address indexed beacon) event is typical of beacon proxies, not the OpenZeppelin transparent proxy. Confirm this event is actually emitted by your deployed Land proxy or remove it if it’s not part of the on-chain artifact.


129-312: Review bulk addition of custom errors.
You’ve added numerous custom errors (AlreadyMinted, ERC721IncorrectOwner, …, OperatorNotAllowed). Please ensure:

  • Names adhere to your style guide and don’t collide with OpenZeppelin errors.
  • Each error is actually thrown in the implementation to save bytecode (vs. require strings).

517-1444: Verify added function signatures.
The ABI now lists many new functions (approve, batchTransferFrom, mintQuad, supportsInterface, etc.). Cross-check each against the upgraded contract source to confirm:

  • Parameter order and internalType are accurate.
  • State mutability flags (view, payable, etc.) align with the implementation.

1501-1501: Confirm numDeployments increment.
You’ve updated numDeployments to 4. Double-check that this correctly reflects the total mainnet deployments of the Land proxy.


1506-1506: Verify new implementation address.
The proxy’s implementation address changed to 0x7f2cAd7d2ad6FD2b6cE281d40ae5434AC776BDfB. Ensure this is the intended V4 contract and that the upgrade transaction targeted this address.

@adjisb adjisb merged commit 0e3494c into master Jun 20, 2025
7 checks passed
@adjisb adjisb deleted the feat/mainnet_land_upgrade_v4 branch June 20, 2025 11:20
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.

3 participants