Skip to content

[ETHEREUM-CONTRACTS] allow connecting pools on behalf of members (with some constraints)#2093

Merged
hellwolf merged 65 commits intodevfrom
2025-07-autoconnect
Aug 7, 2025
Merged

[ETHEREUM-CONTRACTS] allow connecting pools on behalf of members (with some constraints)#2093
hellwolf merged 65 commits intodevfrom
2025-07-autoconnect

Conversation

@d10r
Copy link
Collaborator

@d10r d10r commented Jul 17, 2025

What & Why

Onboarding new users to SuperTokens via GDA distributions is tainted if they have to do a claim transaction before seeing Super Tokens being sent to them.
This can be mitigated by allowing to connect pools on behalf of members.
At the same time this power shall be constraint in order to keep the "spam protection" aspect - 3rd parties shall not be able to use up all slots, and they shall also not be able to increase gas costs for that account due to more expensive balance calculation. Thus autoconnect won't be allowed to use all slots, and a mechanism for accounts to fully opt out will be added.

In short:

  • 3rd party can connect pool members using a subset of the slots
  • member can disable autoconnect

How

Add a function to the GDA which allows to connect pools on behalf of members.
Add a mechanism which allows members to opt out of autoconnect.

This can also be viewed as a kind of ACL: by default permission is given, but it can be withdrawn.

Implementation detail:
The pre-existing connectPool will revert if all slots are occupied.
The newly added tryConnectPoolFor does not revert, but returns a bool signalling if the attempt succeeded.

Why not using try/catch: because the gas estimation algorithm of RPC nodes uses binary search to find the smallest gas limit for which the transaction still succeeds, not caring about failing nested calls in try/catch.

TBD

  • implement a mechanism which lets members disable autoconnect
  • (maybe) implement a mechanism for a subset of contracts to opt-out of autoconnect by default
  • change evm version to "shanghai" for all packages
  • add support for new method to SuperTokenV1Library

@d10r d10r requested a review from hellwolf as a code owner July 17, 2025 08:53
@d10r d10r changed the base branch from dev to 2025-06-fix-claimable July 17, 2025 08:53
@github-actions
Copy link

github-actions bot commented Jul 17, 2025

Changelog Reminder

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

  • CHANGELOG.md modified
  • Double check before merge

Base automatically changed from 2025-06-fix-claimable to dev July 18, 2025 07:34
@hellwolf hellwolf marked this pull request as draft July 18, 2025 07:39
cache_path = 'packages/solidity-semantic-money/out/default.cache'
solc_version = '0.8.26'
evm_version = 'paris' # no PUSH0 for now
evm_version = 'paris'
Copy link
Contributor

Choose a reason for hiding this comment

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

I will check in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should make a separate PR for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh, did I commit this?
Apparently it broke only one line, which I fixed in c5fd4d5. Should it be undone anyway?

// check/set ACL role admins
const simpleAcl = await SimpleACL.at(simpleAclAddress);

const aclSuperappRegistrationRoleAdmin = web3.utils.sha3("ACL_SUPERAPP_REGISTRATION_ROLE_ADMIN");
Copy link
Contributor

Choose a reason for hiding this comment

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

any comment worth having?

@hellwolf
Copy link
Contributor

hellwolf commented Aug 6, 2025

Suggest for a new PR: Make SimpleACL upgrade robust, by checking if it gets accidentally overriden durign the upgrade process.

@hellwolf hellwolf merged commit 2081c49 into dev Aug 7, 2025
22 checks passed
@hellwolf hellwolf deleted the 2025-07-autoconnect branch August 7, 2025 07:35
@github-actions
Copy link

github-actions bot commented Aug 7, 2025

XKCD Comic Relif

Link: https://xkcd.com/2093
https://xkcd.com/2093

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.

4 participants