mirror of
https://github.com/lens-protocol/core.git
synced 2026-04-22 03:02:03 -04:00
misc: Removed unnecessary function and scoping.
This commit is contained in:
@@ -649,13 +649,6 @@ contract LensHub is
|
||||
super._beforeTokenTransfer(from, to, tokenId);
|
||||
}
|
||||
|
||||
function _validateCallerIsProfileOwnerOrDispatcher(uint256 profileId) internal view {
|
||||
if (msg.sender == ownerOf(profileId) || msg.sender == _dispatcherByProfile[profileId]) {
|
||||
return;
|
||||
}
|
||||
revert Errors.NotProfileOwnerOrDispatcher();
|
||||
}
|
||||
|
||||
function _validateCallerIsProfileOwner(uint256 profileId) internal view {
|
||||
if (msg.sender != ownerOf(profileId)) revert Errors.NotProfileOwner();
|
||||
}
|
||||
|
||||
@@ -86,31 +86,28 @@ library InteractionHelpers {
|
||||
.getPointedIfMirrorWithCollectModule(profileId, pubId);
|
||||
|
||||
uint256 tokenId;
|
||||
// Avoids stack too deep
|
||||
{
|
||||
uint256 collectNFTSlot;
|
||||
address collectNFT;
|
||||
assembly {
|
||||
mstore(0, rootProfileId)
|
||||
mstore(32, PUB_BY_ID_BY_PROFILE_MAPPING_SLOT)
|
||||
mstore(32, keccak256(0, 64))
|
||||
mstore(0, rootPubId)
|
||||
collectNFTSlot := add(keccak256(0, 64), PUBLICATION_COLLECT_NFT_OFFSET)
|
||||
collectNFT := sload(collectNFTSlot)
|
||||
}
|
||||
if (collectNFT == address(0)) {
|
||||
collectNFT = _deployCollectNFT(
|
||||
rootProfileId,
|
||||
rootPubId,
|
||||
_handle(rootProfileId),
|
||||
collectNFTImpl
|
||||
);
|
||||
assembly {
|
||||
sstore(collectNFTSlot, collectNFT)
|
||||
}
|
||||
}
|
||||
tokenId = ICollectNFT(collectNFT).mint(collector);
|
||||
uint256 collectNFTSlot;
|
||||
address collectNFT;
|
||||
assembly {
|
||||
mstore(0, rootProfileId)
|
||||
mstore(32, PUB_BY_ID_BY_PROFILE_MAPPING_SLOT)
|
||||
mstore(32, keccak256(0, 64))
|
||||
mstore(0, rootPubId)
|
||||
collectNFTSlot := add(keccak256(0, 64), PUBLICATION_COLLECT_NFT_OFFSET)
|
||||
collectNFT := sload(collectNFTSlot)
|
||||
}
|
||||
if (collectNFT == address(0)) {
|
||||
collectNFT = _deployCollectNFT(
|
||||
rootProfileId,
|
||||
rootPubId,
|
||||
_handle(rootProfileId),
|
||||
collectNFTImpl
|
||||
);
|
||||
assembly {
|
||||
sstore(collectNFTSlot, collectNFT)
|
||||
}
|
||||
}
|
||||
tokenId = ICollectNFT(collectNFT).mint(collector);
|
||||
|
||||
ICollectModule(rootCollectModule).processCollect(
|
||||
profileId,
|
||||
|
||||
Reference in New Issue
Block a user