Skip to content

[BOOST-5436] differentiate between V1/V2 variable criteria incentives#449

Open
mmackz wants to merge 6 commits intomainfrom
matthew/boost-5436-variablecriteriaincentivev2-being-typed-and-treated-as-v1-in
Open

[BOOST-5436] differentiate between V1/V2 variable criteria incentives#449
mmackz wants to merge 6 commits intomainfrom
matthew/boost-5436-variablecriteriaincentivev2-being-typed-and-treated-as-v1-in

Conversation

@mmackz
Copy link
Contributor

@mmackz mmackz commented May 11, 2025

Description

V1 and V2 variable criteria incentives share the same interfaceId. This previously led to misidentification issues, for instance, when an incentive was retrieved (e.g., via getBoost or similar mechanisms relying on incentiveFromAddress).

As a result, a V2 incentive might have been incorrectly identified as V1, causing checks like incentive instanceof ERC20VariableCriteriaIncentiveV2 to return false even for a true V2 instance.

This change resolves the ambiguity by introducing a V2-specific read operation when an incentive with the shared interfaceId is encountered. This read is designed to succeed exclusively for V2 contracts. Based on the outcome of this operation (success for V2, failure for V1), the appropriate SDK class for the incentive is now reliably instantiated.

Tests have been added to verify that each incentive type is correctly identified and instantiated by incentiveFromAddress.

@changeset-bot
Copy link

changeset-bot bot commented May 11, 2025

🦋 Changeset detected

Latest commit: 60fd09a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@boostxyz/test" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@mmackz mmackz changed the title [BOOST-5436] add way to differentiate between V1/V2 variable criteria incentives [BOOST-5436] differentiate between V1/V2 variable criteria incentives May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant