Skip to content

[ETHEREUM-CONTRACTS] GDA storage layout refactoring#2086

Merged
d10r merged 17 commits intodevfrom
GDA-storagey-layout-refactoring
Jul 15, 2025
Merged

[ETHEREUM-CONTRACTS] GDA storage layout refactoring#2086
d10r merged 17 commits intodevfrom
GDA-storagey-layout-refactoring

Conversation

@hellwolf
Copy link
Contributor

@hellwolf hellwolf commented Jun 30, 2025

  1. Move all token storage operations (grep -E 'AgreementStateSlot|createAgreement|terminateAgreement|updateAgreementData' packages/ethereum-contracts/contracts/agreements/gdav1/ packages/ethereum-contracts/test/foundry/agreements/gdav1/) to GDAv1StorageLayout.sol, which has GDAv1StorageLib, GDAv1StorageReader, GDAv1StorageWriter.
  2. SuperfluidPool to use GDAv1StorageReader for isPool & isPoolMemberConnected.
  3. Code cleanup of GeneralDistributionAgreementV1

@github-actions
Copy link

github-actions bot commented Jun 30, 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

@hellwolf hellwolf force-pushed the GDA-storagey-layout-refactoring branch from 3208bfc to d24a9ee Compare July 3, 2025 07:44
@hellwolf
Copy link
Contributor Author

hellwolf commented Jul 4, 2025

All token storage operations are now in the GDAv1StorageLayout file:

nix-shell$ git grep -E 'AgreementStateSlot|createAgreement|terminateAgreement|updateAgreementData' packages/ethereum-contracts/contracts/agreements/gdav1/ packages/ethereum-contracts/test/foundry/agreements/gdav1/
packages/ethereum-contracts/contracts/agreements/gdav1/GDAv1StorageLayout.sol:        return GDAv1StorageLib.decodeAccountData(token.getAgreementStateSlot
packages/ethereum-contracts/contracts/agreements/gdav1/GDAv1StorageLayout.sol:        uint256 a = uint256(token.getAgreementStateSlot
packages/ethereum-contracts/contracts/agreements/gdav1/GDAv1StorageLayout.sol:        token.updateAgreementStateSlot(
packages/ethereum-contracts/contracts/agreements/gdav1/GDAv1StorageLayout.sol:        token.updateAgreementStateSlot(address(pool), GDAv1StorageLib.ACCOUNT_DATA_STATE_SLOT_ID, data);
packages/ethereum-contracts/contracts/agreements/gdav1/GDAv1StorageLayout.sol:        token.updateAgreementStateSlot(
packages/ethereum-contracts/contracts/agreements/gdav1/GDAv1StorageLayout.sol:        token.updateAgreementData(flowHash, GDAv1StorageLib.encodeFlowInfo(flowInfo));
packages/ethereum-contracts/contracts/agreements/gdav1/GDAv1StorageLayout.sol:        token.createAgreement
packages/ethereum-contracts/contracts/agreements/gdav1/GDAv1StorageLayout.sol:        token.terminateAgreement(GDAv1StorageLib.getPoolMemberHash(poolMember, pool), 1);

@hellwolf hellwolf marked this pull request as ready for review July 8, 2025 08:31
@hellwolf hellwolf requested a review from d10r as a code owner July 8, 2025 08:31
@hellwolf hellwolf changed the title GDA storage layout refactoring [ETHEREUM-CONTRACTS] GDA storage layout refactoring Jul 8, 2025
@hellwolf
Copy link
Contributor Author

hellwolf commented Jul 8, 2025

@d10r, shouldn't _getPoolAdminNFTAddress also have been removed?

Copy link
Collaborator

@d10r d10r left a comment

Choose a reason for hiding this comment

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

See comments. If you agree, I can do the changes.

@d10r
Copy link
Collaborator

d10r commented Jul 14, 2025

@d10r, shouldn't _getPoolAdminNFTAddress also have been removed?

the admin NFT wasn't removed, only the member NFT.

@hellwolf
Copy link
Contributor Author

Please also help to update CHANGELOG.md, then merge.

@d10r d10r merged commit 6aa8849 into dev Jul 15, 2025
37 of 39 checks passed
@d10r d10r deleted the GDA-storagey-layout-refactoring branch July 15, 2025 15:38
@github-actions
Copy link

XKCD Comic Relif

Link: https://xkcd.com/2086
https://xkcd.com/2086

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.

2 participants