mirror of
https://github.com/lens-protocol/core.git
synced 2026-04-22 03:02:03 -04:00
feat: validateCallerIsOwnerOrDelegatedExecutor added
This commit is contained in:
@@ -178,6 +178,16 @@ library GeneralHelpers {
|
||||
}
|
||||
}
|
||||
|
||||
function validateCallerIsOwnerOrDelegatedExecutor(uint256 profileId) internal view {
|
||||
// It's safe to use the `unsafeOwnerOf()` function here because the sender cannot be
|
||||
// the zero address, the dispatcher is cleared on burn and the zero address cannot approve
|
||||
// a delegated executor.
|
||||
address owner = unsafeOwnerOf(profileId);
|
||||
if (msg.sender != owner) {
|
||||
validateDelegatedExecutor(owner, msg.sender);
|
||||
}
|
||||
}
|
||||
|
||||
function validateDelegatedExecutor(address onBehalfOf, address executor) internal view {
|
||||
bool invalidExecutor;
|
||||
assembly {
|
||||
|
||||
Reference in New Issue
Block a user