mirror of
https://github.com/lens-protocol/core.git
synced 2026-04-22 03:02:03 -04:00
fix: add profile owner check - now all tests passing
This commit is contained in:
@@ -196,6 +196,15 @@ library GeneralHelpers {
|
||||
}
|
||||
}
|
||||
|
||||
function validateAddressIsOwnerOrDelegatedExecutor(
|
||||
address transactionExecutor,
|
||||
address profileOwner
|
||||
) internal view {
|
||||
if (transactionExecutor != profileOwner) {
|
||||
validateDelegatedExecutor(profileOwner, transactionExecutor);
|
||||
}
|
||||
}
|
||||
|
||||
function validateDelegatedExecutor(address onBehalfOf, address executor) internal view {
|
||||
if (!isExecutorApproved(onBehalfOf, executor)) {
|
||||
revert Errors.ExecutorInvalid();
|
||||
|
||||
@@ -184,6 +184,11 @@ library InteractionHelpers {
|
||||
address collectorProfileOwnerCached = collectorProfileOwner;
|
||||
address transactionExecutorCached = transactionExecutor;
|
||||
|
||||
GeneralHelpers.validateAddressIsOwnerOrDelegatedExecutor({
|
||||
transactionExecutor: transactionExecutor,
|
||||
profileOwner: collectorProfileOwner
|
||||
});
|
||||
|
||||
(uint256 rootProfileId, uint256 rootPubId, address rootCollectModule) = GeneralHelpers
|
||||
.getPointedIfMirrorWithCollectModule(publisherProfileIdCached, pubIdCached);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user