Skip to content

Big refactor: Add router proxy and copy agent and new update flow#44

Open
spidemen2024 wants to merge 14 commits intomainfrom
copy_agent
Open

Big refactor: Add router proxy and copy agent and new update flow#44
spidemen2024 wants to merge 14 commits intomainfrom
copy_agent

Conversation

@spidemen2024
Copy link
Contributor

@spidemen2024 spidemen2024 commented Jun 23, 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

Add a new router proxy which does forward contract call based on function name to different contract like worker, agent, blueprintStorage, etc.

support copy agent feature

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

@spidemen2024 spidemen2024 requested review from Copilot and taiyangc and removed request for Copilot June 23, 2025 01:40

This comment was marked as outdated.

@spidemen2024 spidemen2024 requested a review from Copilot June 24, 2025 03:13
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 PR refactors core components to support a new update flow with a router proxy and a copy agent feature while upgrading Blueprint contracts to v7.

  • Introduces RouterV1 for routing calls to Agent and Blueprint contracts.
  • Refactors BlueprintCore and Blueprint contracts to support admin-controlled update flows and fee management.
  • Updates tests and deployment scripts to validate and deploy the new architecture.

Reviewed Changes

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

Show a summary per file
File Description
test/MockERC20.sol Added a custom error for insufficient allowance.
test/BlueprintV7.t.sol New tests for BlueprintV7 features and update flow.
test/BlueprintUpgradeTest.t.sol Added upgrade tests ensuring version change to 7.0.0.
src/RouterV1.sol New router proxy forwarding meta-transactions to Agent/Blueprint.
src/BlueprintCore.sol Major rework for admin-controlled update and fee storage mechanisms.
src/Blueprint.sol Added admin contract management and global platform fee support.
src/Agent.sol Updated copy agent request and fee management logic.
script/DeployRouter.s.sol Updated router and proxy deployment script with new forward contracts.
Comments suppressed due to low confidence (3)

src/BlueprintCore.sol:518

  • The function 'updateWorkerDeploymentConfigCommon' has been made public and payable with the onlyAdminContract modifier. Please confirm that exposing this function externally matches the intended access control and security requirements.
    ) public payable onlyAdminContract hasProject(projectId) {

src/Agent.sol:140

  • [nitpick] Consider adding inline comments to clarify the fee calculation formula in 'getCreateCopyAgentFee' so that its intent and computation are easier to understand for future maintainers.
        return (fee * platformFee) / Blueprint(blueprintStorageProxy).factor() + platformFee;

script/DeployRouter.s.sol:60

  • [nitpick] Verify that setting both the Agent and Worker contracts as admin contracts in BlueprintV7 is intentional, as this grants them privileged access. Clarify in documentation if they are expected to share admin-level rights.
        BlueprintV7(address(storageProxy)).setAdminContract(address(worker));

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