-
Couldn't load subscription status.
- Fork 0
Seamless Custodian Switch #350
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
Conversation
| ) internal { | ||
| // Check the caller is the new custodian's assistant | ||
| address msgSender = _msgSender(); | ||
| uint256 newCustodianId = EntityLib.getOrCreateBuyerId(msgSender, _pl); |
There was a problem hiding this comment.
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
contracts/contracts/protocol/libs/EntityLib.sol
Lines 331 to 343 in c59ca4b
| 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.
|
@zajck I have addressed all your comments and made a major refactor of the implementation. Please re-review at your own convenience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 suggestions left
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in commit
Co-authored-by: Klemen <64400885+zajck@users.noreply.github.com>
Close #209