Skip to content

Prefer BuyGDFactory V3 for swaphelper (goodprotocol 2.3.0)#531

Open
blueogin wants to merge 1 commit into
masterfrom
feat/buygd-factory-v3
Open

Prefer BuyGDFactory V3 for swaphelper (goodprotocol 2.3.0)#531
blueogin wants to merge 1 commit into
masterfrom
feat/buygd-factory-v3

Conversation

@blueogin

@blueogin blueogin commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Bump @gooddollar/goodprotocol to ^2.3.0 so BUYGDFactoryV3 (0xB1C87d…) is available in deployment addresses.
  • Resolve BuyGD factory as V3 → V2 → V1 so /verify/swaphelper targets the same helper clones as the Buy G$ UI.
  • Point the clone ABI at BuyGDCloneV2.min.json (V3 factory still deploys BuyGDCloneV2 clones; BuyGDClone.min.json was removed).

About # (link your issue here)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

Summary by Sourcery

Update GoodProtocol integration to prefer the BUYGDFactoryV3 deployment for swap helper resolution while maintaining backward compatibility with earlier factory versions.

New Features:

  • Support resolving BuyGD factory via BUYGDFactoryV3 so swaphelper uses the latest factory deployments.

Enhancements:

  • Adjust BuyGD factory resolution order to fall back from V3 to V2 to V1 for consistent helper clone targeting with the Buy G$ UI.
  • Switch BuyGD clone ABI reference to BuyGDCloneV2.min.json to match the contracts deployed by the latest factory.
  • Bump @gooddollar/goodprotocol dependency to version ^2.3.0 to access updated deployment addresses and artifacts.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The key used for the V3 factory in ContractsAddress is ${this.network}.BUYGDFactoryV3; double-check this matches the actual deployment.json property naming convention (it looks inconsistent with BuyGDFactoryV2/BuyGDFactory).
  • The nested get call for resolving the BuyGD factory address is a bit hard to read; consider extracting the V3 → V2 → V1 resolution into a small helper function or a clearer sequence of lookups to make the fallback logic more explicit.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The key used for the V3 factory in `ContractsAddress` is `${this.network}.BUYGDFactoryV3`; double-check this matches the actual deployment.json property naming convention (it looks inconsistent with `BuyGDFactoryV2`/`BuyGDFactory`).
- The nested `get` call for resolving the BuyGD factory address is a bit hard to read; consider extracting the V3 → V2 → V1 resolution into a small helper function or a clearer sequence of lookups to make the fallback logic more explicit.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant