Skip to content

Conversation

acenolaza
Copy link
Collaborator

@acenolaza acenolaza commented Jul 8, 2025

Closes #24

Changes

  • Adds dappId immutable variable to all combinator contracts. These are set by reading the underlying proxy.dappId() (except for NormalizedApi3ReaderProxyV1)
  • Casts underlying proxies to IApi3ReaderProxyV1
  • NormalizedApi3ReaderProxyV1 now requires a dappId to be pass in the constructor
  • Validates that proxies dappId are equal in ProductApi3ReaderProxyV1
  • Replaces @api3/contracts imports with MockApi3ReaderProxyV1 test contract to make testing simpler

Notes

  • The dappId immutable variable is needed because dappId() in IApi3ReaderProxyV1 is not marked as view
  • The cast to IApi3ReaderProxyV1 still feels kind of wrong to me since the underlying proxies might be another combinator proxy which might not even expose a dapiName() function for example. I think it might be more accurate to create a IApi3ReaderProxyWithDappId or similar that inherints from IApi3ReaderProxyand adds a function dappId() external view returns (uint256);

@acenolaza acenolaza changed the title 24 proxy dappid Adds dappId to combinator contracts Jul 8, 2025
@Siegrift
Copy link
Contributor

Siegrift commented Aug 3, 2025

@acenolaza I'll be able to review this only after my vacation, but I've assigned the other guys for the preliminary review.

Copy link

@matejfalat matejfalat left a comment

Choose a reason for hiding this comment

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

I've checked the contract changes (didn't go over the tests) and IMO they're looking fine.

Copy link

@matejos matejos left a comment

Choose a reason for hiding this comment

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

Changes LGTM, but I would also see your suggestion as a good thing to do.

I think it might be more accurate to create a IApi3ReaderProxyWithDappId or similar that inherints from IApi3ReaderProxyand adds a function dappId() external view returns (uint256);

@acenolaza
Copy link
Collaborator Author

Changes LGTM, but I would also see your suggestion as a good thing to do.

I think it might be more accurate to create a IApi3ReaderProxyWithDappId or similar that inherints from IApi3ReaderProxyand adds a function dappId() external view returns (uint256);

abb3cf3 this should improve the cast of the proxies to a valid minimal interface that adheres to only what is needed on these combinator contracts.

Copy link
Contributor

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

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

I'm thinking whether it could be simplified if we used the IApi3ReaderProxyV1 instead of the new interface, but I'm thinking if there was another reason why we didn't do it like that initially.

Copy link
Contributor

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@acenolaza acenolaza merged commit 95345d4 into main Aug 27, 2025
2 checks passed
@acenolaza acenolaza deleted the 24-proxy-dappid branch August 27, 2025 17:48
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.

Expose or validate dAppID for of the underlying proxies

4 participants