Skip to content

diamond pattern proxy#45

Open
spidemen2024 wants to merge 17 commits intomainfrom
delegate_call
Open

diamond pattern proxy#45
spidemen2024 wants to merge 17 commits intomainfrom
delegate_call

Conversation

@spidemen2024
Copy link
Contributor

@spidemen2024 spidemen2024 commented Jun 27, 2025

Type of Changes

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Tests
  • Other

Notion Task

Feature/Bugfix Details

Existing Behavior

What is the current behavior? (You can also link to an open issue here)

New Behavior

What is the new behavior (if this is a feature change)?

Breaking Changes

What changes might users need to make in their application due to this PR?

Requirements

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)

Other information

Copilot AI review requested due to automatic review settings June 27, 2025 03:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors and extends the upgradeable proxy system for the Blueprint/Agent contracts while adding comprehensive tests, deployment, and upgrade scripts. Key changes include:

  • Upgrading Blueprint implementation to V7 and introducing a new RouterV1 using delegatecall fallback to better support meta-transactions.
  • Refactoring of EIP712 digest generation and signature verification methods across contracts.
  • Updates to test suites and deployment scripts to support the new proxy “diamond pattern” and improve overall contract maintenance.

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/MockERC20.sol Added custom error types and commented-out legacy balance-check code.
test/BlueprintV6.t.sol Updated tests for deployment config update with BlueprintV6 changes.
test/BlueprintV7.t.sol Added tests to verify BlueprintV7 functionality and its initialize logic.
src/RouterV1.sol Introduced a new router contract with improved fallback delegation.
src/EIP712.sol Added new digest functions for copy agent fee and copy agent request.
script/DeployRouter.s.sol Deployment script to deploy and configure RouterV1 along with its selectors.
script/UpgradeRouter.s.sol Upgrade script for switching the proxy to a new RouterV1 implementation.
Others Various other changes across Blueprints, Agent, Payment, and Storage for upgrade compatibility.
Comments suppressed due to low confidence (1)

test/BlueprintV6.t.sol:63

  • [nitpick] Clarify the comment regarding setting cost to zero as 'less than 0' is misleading since 0 is not less than 0; consider rephrasing the comment for improved clarity.
        // verify user balance after top up

Comment on lines +43 to +46
// uint256 bal = _balances[msg.sender];
// if (bal < amount) {
// revert InsufficientBalance(msg.sender, bal, amount);
// }
Copy link

Copilot AI Jun 27, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider removing or clarifying the commented-out balance check code to improve readability and maintainability in tests.

Suggested change
// uint256 bal = _balances[msg.sender];
// if (bal < amount) {
// revert InsufficientBalance(msg.sender, bal, amount);
// }

Copilot uses AI. Check for mistakes.
@sherlock-ai-github-agent
Copy link

Sherlock AI Findings

The automated tool identified the following potential security issues in the codebase. Please review the details for each issue in the linked dashboard.

# Title Severity Details
2 Unrestricted Delegatecall Forwarding in Fallback/Receive Functions High View Details
1 Lack of NFT Ownership Verification Before State Changes Medium View Details
3 Unauthorized Worker Status Modification in submitDeploymentRequest Medium View Details
4 Insufficient Worker Authorization in submitProofOfDeployment Medium View Details

Next Steps: Review the linked issues in the dashboard and address high-severity bugs first. Contact the team if you need assistance.

Full report available at: https://ai.sherlock.xyz/runs/04fef9d2-275e-4303-8120-9a827cb30dc4

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