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

[ETHEREUM-CONTRACTS] add missing batch call operations #1967

Merged
merged 38 commits into from
Jul 2, 2024
Merged

Conversation

d10r
Copy link
Collaborator

@d10r d10r commented Jun 24, 2024

Adds missing batch call operations, see #1895

@d10r d10r changed the title [ETHEREUM-CONTRACTS] added batch call operations for upgradeTo and downgradeTo [ETHEREUM-CONTRACTS] add missing batch call operations Jun 24, 2024
Copy link

github-actions bot commented Jun 24, 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 marked this pull request as ready for review June 28, 2024 16:18
@kasparkallas
Copy link
Contributor

@d10r Is the main idea to delegate non-SuperApp and non-Superfluid batch operations through the new DMZForwarder contract?

@d10r
Copy link
Collaborator Author

d10r commented Jul 1, 2024

@d10r Is the main idea to delegate non-SuperApp and non-Superfluid batch operations through the new DMZForwarder contract?

For the Generic Call Proxies (see #1895) yes.

returns(bool success, bytes memory returnData)
{
// solhint-disable-next-line avoid-low-level-calls
(success, returnData) = target.call{value: msg.value}(data);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any merit to using address(this).balance here or trying to return the leftover? (Probably not.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there any merit to using address(this).balance here

I don't think so

trying to return the leftover

No, but I added a function for withdrawing stuck native tokens.

@hellwolf hellwolf requested a review from a team as a code owner July 1, 2024 18:30
@@ -882,6 +882,20 @@ contract SuperToken is
_downgrade(msg.sender, account, account, amount, "", "");
}

function operationUpgradeTo(address account, address to, uint256 amount)
Copy link
Contributor

Choose a reason for hiding this comment

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

this will require Token upgrades

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right. Also we may later consider deprecating the variants without to argument.

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 88.53%. Comparing base (31453f8) to head (84bb8ba).

Current head 84bb8ba differs from pull request most recent head 524ae94

Please upload reports for the commit 524ae94 to get more accurate results.

Files Patch % Lines
...reum-contracts/contracts/superfluid/SuperToken.sol 33.33% 4 Missing ⚠️
...thereum-contracts/contracts/utils/DMZForwarder.sol 42.85% 4 Missing ⚠️
...m-contracts/contracts/apps/SuperTokenV1Library.sol 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1967      +/-   ##
==========================================
- Coverage   88.60%   88.53%   -0.07%     
==========================================
  Files         118      119       +1     
  Lines        7361     7388      +27     
  Branches      967      975       +8     
==========================================
+ Hits         6522     6541      +19     
- Misses        837      845       +8     
  Partials        2        2              
Flag Coverage Δ
ethereum-contracts 94.04% <75.00%> (-0.18%) ⬇️
sdk-core 88.53% <75.00%> (-0.07%) ⬇️

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.

* @dev DMZForwarder.forward2771Call batch operation type
*
* Call spec:
* forward2771Call(
Copy link
Contributor

Choose a reason for hiding this comment

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

to be in sync with the rest, use typed signature, and call "data" "callData" to be more specific.

@hellwolf hellwolf enabled auto-merge July 2, 2024 10:53
@hellwolf hellwolf linked an issue Jul 2, 2024 that may be closed by this pull request
13 tasks
@hellwolf hellwolf added this pull request to the merge queue Jul 2, 2024
Merged via the queue into dev with commit 7e943b7 Jul 2, 2024
18 checks passed
@hellwolf hellwolf deleted the batch-ops branch July 2, 2024 12:50
Copy link

github-actions bot commented Jul 2, 2024

XKCD Comic Relif

Link: https://xkcd.com/1967
https://xkcd.com/1967

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.

[ETHEREUM-CONTRACTS] Complete the Superfluid batch operation set
3 participants