misc: Removed unnecessary function and scoping.

This commit is contained in:
Peter Michael
2022-06-23 11:35:10 -04:00
parent fe8d57f1aa
commit 6f3a8ded27
2 changed files with 21 additions and 31 deletions

View File

@@ -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();
}

View File

@@ -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,