Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEMO] how we could replace specific token operations with the generic 2771 call proxy #2035

Draft
wants to merge 26 commits into
base: dev
Choose a base branch
from

Conversation

d10r
Copy link
Collaborator

@d10r d10r commented Nov 5, 2024

Needed changes:

  • Make SuperToken an IRelayRecipient, trusting the DMZForwarder
  • Replace occurances of msg.sender with _msgSender() (which uses the 2771-encoded sender if present)

Here only SuperToken.increaseAllowance() was changed that way, with a new test case using it.

In order to do this, we'd need to

  • use _msgSender() in all SuperToken methods
  • mark the operationX methods as deprecated
  • update SuperToken contracts

As long as there's SuperTokens not updated to this logic, we can't easily remove the then legacy operations types from batch call.
However we could remove the code from SuperToken if we conditionally re-map legacy operations in Superfluid.sol to use 2771Forwarder if the target token contract supports it.

Copy link

github-actions bot commented Nov 5, 2024

Changelog Reminder

Reminder to update the CHANGELOG.md for any of the modified packages in this PR.

  • CHANGELOG.md modified
  • Double check before merge

@d10r d10r changed the base branch from dev to supertokenlib-iteration November 5, 2024 17:53
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.99%. Comparing base (0b33f76) to head (8e6a20a).

Files with missing lines Patch % Lines
...reum-contracts/contracts/superfluid/SuperToken.sol 80.00% 2 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                     @@
##           supertokenlib-iteration    #2035      +/-   ##
===========================================================
- Coverage                    88.00%   87.99%   -0.02%     
===========================================================
  Files                          108      108              
  Lines                         6768     6779      +11     
  Branches                       974      974              
===========================================================
+ Hits                          5956     5965       +9     
- Misses                         810      812       +2     
  Partials                         2        2              
Flag Coverage Δ
ethereum-contracts 94.15% <83.33%> (-0.05%) ⬇️
sdk-core 87.99% <83.33%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@d10r
Copy link
Collaborator Author

d10r commented Nov 6, 2024

note: BaseRelayRecipient._getTransactionSigner() does not do what it's natspec claims.

Base automatically changed from supertokenlib-iteration to dev November 22, 2024 20:09
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