Big refactor: Add router proxy and copy agent and new update flow#44
Open
spidemen2024 wants to merge 14 commits intomainfrom
Open
Big refactor: Add router proxy and copy agent and new update flow#44spidemen2024 wants to merge 14 commits intomainfrom
spidemen2024 wants to merge 14 commits intomainfrom
Conversation
There was a problem hiding this comment.
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));
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Changes
What kind of change does this PR introduce?
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
New Behavior
Breaking Changes
Requirements
Please check if the PR fulfills these requirements
Other information