Skip to content

Conversation

@0xlucian
Copy link
Collaborator

@0xlucian 0xlucian commented Jan 7, 2025

Close #209

@0xlucian 0xlucian added the v1.1.0 label Jan 7, 2025
@0xlucian 0xlucian requested a review from zajck January 7, 2025 12:22
@0xlucian 0xlucian self-assigned this Jan 7, 2025
) internal {
// Check the caller is the new custodian's assistant
address msgSender = _msgSender();
uint256 newCustodianId = EntityLib.getOrCreateBuyerId(msgSender, _pl);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is slightly non-intended way of using getOrCreateBuyerId. But, ok, you can keep it this way, since in #317 I replaced getOrCreateBuyerId with a more generic getOrCreateEntityId

function getOrCreateEntityId(
address _entityAddress,
FermionTypes.EntityRole _role,
FermionStorage.ProtocolLookups storage pl
) internal returns (uint256 entityId) {
entityId = pl.accountId[_entityAddress];
if (entityId == 0) {
FermionTypes.EntityRole[] memory _roles = new FermionTypes.EntityRole[](1);
_roles[0] = _role;
entityId = createEntity(_entityAddress, _roles, "", pl);
}
}

I suggest you either add TODO comment to replace this once #317 is merged or checkout this change from there and use it here.

@0xlucian
Copy link
Collaborator Author

@zajck I have addressed all your comments and made a major refactor of the implementation. Please re-review at your own convenience.

@0xlucian 0xlucian changed the title feat: initial implementation (WIP) Seamless Custodian Switch Jan 13, 2025
@0xlucian 0xlucian marked this pull request as ready for review January 14, 2025 08:55
Copy link
Contributor

@levalleux-ludo levalleux-ludo left a comment

Choose a reason for hiding this comment

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

2 suggestions left

Copy link
Contributor

@zajck zajck left a comment

Choose a reason for hiding this comment

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

LGTM 👍

function requestCustodianUpdate(
uint256 _offerId,
uint256 _newCustodianId,
FermionTypes.CustodianFee calldata _newCustodianFee,
Copy link
Contributor

Choose a reason for hiding this comment

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

In line with #394 please also add here a check to revert if _newCustodianFee.period == 0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added in commit

@0xlucian 0xlucian requested a review from zajck March 5, 2025 08:25
0xlucian and others added 2 commits March 6, 2025 15:05
zajck added a commit that referenced this pull request Mar 12, 2025
@0xlucian 0xlucian merged commit c968508 into develop-1.1.0 Mar 13, 2025
5 checks passed
@zajck zajck deleted the 209-seamless-custodian-switch branch March 14, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seamless custodian switch

3 participants