mirror of
https://github.com/lens-protocol/core.git
synced 2026-01-08 21:58:06 -05:00
misc: SPDX License set in each file
Co-authored-by: Victor Naumik <vicnaum@gmail.com>
This commit is contained in:
@@ -208,10 +208,8 @@ contract SeaDropMintPublicationAction is VersionedInitializable, HubRestricted,
|
||||
|
||||
function rescaleFees(uint256 profileId, uint256 pubId) public {
|
||||
uint16 lensTreasuryFeeBps = MODULE_GLOBALS.getTreasuryFee();
|
||||
PublicDrop memory publicDrop = SEADROP.getPublicDrop(
|
||||
_collectionDataByPub[profileId][pubId].nftCollectionAddress
|
||||
);
|
||||
_rescaleFees(profileId, pubId, lensTreasuryFeeBps, publicDrop);
|
||||
PublicDrop memory publicDrop = SEADROP.getPublicDrop(_collectionDataByPub[0][pubId].nftCollectionAddress);
|
||||
_rescaleFees(0, pubId, lensTreasuryFeeBps, publicDrop);
|
||||
}
|
||||
|
||||
function _rescaleFees(
|
||||
|
||||
@@ -66,7 +66,7 @@ library ActionLib {
|
||||
return actionModuleReturnData;
|
||||
}
|
||||
|
||||
function _isActionAllowed(Types.Publication storage _publication, uint256 actionId) internal view returns (bool) {
|
||||
function _isActionAllowed(Types.Publication storage _publication, uint256 actionId) private view returns (bool) {
|
||||
uint256 actionIdBitmapMask = 1 << (actionId - 1);
|
||||
return actionIdBitmapMask & _publication.actionModulesBitmap != 0;
|
||||
}
|
||||
|
||||
@@ -65,4 +65,25 @@ library GovernanceLib {
|
||||
emit Events.StateSet(msg.sender, prevState, newState, block.timestamp);
|
||||
return prevState;
|
||||
}
|
||||
|
||||
function whitelistProfileCreator(address profileCreator, bool whitelist) external {
|
||||
StorageLib.profileCreatorWhitelisted()[profileCreator] = whitelist;
|
||||
emit Events.ProfileCreatorWhitelisted(profileCreator, whitelist, block.timestamp);
|
||||
}
|
||||
|
||||
function whitelistFollowModule(address followModule, bool whitelist) external {
|
||||
StorageLib.followModuleWhitelisted()[followModule] = whitelist;
|
||||
emit Events.FollowModuleWhitelisted(followModule, whitelist, block.timestamp);
|
||||
}
|
||||
|
||||
function whitelistReferenceModule(address referenceModule, bool whitelist) external {
|
||||
StorageLib.referenceModuleWhitelisted()[referenceModule] = whitelist;
|
||||
emit Events.ReferenceModuleWhitelisted(referenceModule, whitelist, block.timestamp);
|
||||
}
|
||||
|
||||
function whitelistActionModuleId(address actionModule, uint256 whitelistId) external {
|
||||
StorageLib.actionModuleWhitelistedId()[actionModule] = whitelistId;
|
||||
StorageLib.actionModuleById()[whitelistId] = actionModule;
|
||||
emit Events.ActionModuleWhitelistedId(actionModule, whitelistId, block.timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ library MetaTxLib {
|
||||
}
|
||||
|
||||
// TODO: Check if this is how you do encoding of bytes[] array in ERC721
|
||||
function _prepareActionModulesInitDatas(bytes[] memory actionModulesInitDatas) internal pure returns (bytes32) {
|
||||
function _prepareActionModulesInitDatas(bytes[] memory actionModulesInitDatas) private pure returns (bytes32) {
|
||||
bytes32[] memory actionModulesInitDatasBytes = new bytes32[](actionModulesInitDatas.length);
|
||||
for (uint256 i = 0; i < actionModulesInitDatas.length; i++) {
|
||||
actionModulesInitDatasBytes[i] = keccak256(abi.encode(actionModulesInitDatas[i]));
|
||||
@@ -206,9 +206,9 @@ library MetaTxLib {
|
||||
uint256 deadline;
|
||||
}
|
||||
|
||||
function abiEncode(
|
||||
function _abiEncode(
|
||||
ReferenceParamsForAbiEncode memory referenceParamsForAbiEncode
|
||||
) internal pure returns (bytes memory) {
|
||||
) private pure returns (bytes memory) {
|
||||
return
|
||||
abi.encode(
|
||||
referenceParamsForAbiEncode.typehash,
|
||||
@@ -238,7 +238,7 @@ library MetaTxLib {
|
||||
bytes32 referenceModuleInitDataHash = keccak256(commentParams.referenceModuleInitData);
|
||||
uint256 nonce = _getAndIncrementNonce(signature.signer);
|
||||
uint256 deadline = signature.deadline;
|
||||
bytes memory encodedAbi = abiEncode(
|
||||
bytes memory encodedAbi = _abiEncode(
|
||||
ReferenceParamsForAbiEncode(
|
||||
Typehash.COMMENT,
|
||||
commentParams.profileId,
|
||||
@@ -269,7 +269,7 @@ library MetaTxLib {
|
||||
bytes32 referenceModuleInitDataHash = keccak256(quoteParams.referenceModuleInitData);
|
||||
uint256 nonce = _getAndIncrementNonce(signature.signer);
|
||||
uint256 deadline = signature.deadline;
|
||||
bytes memory encodedAbi = abiEncode(
|
||||
bytes memory encodedAbi = _abiEncode(
|
||||
ReferenceParamsForAbiEncode(
|
||||
Typehash.QUOTE,
|
||||
quoteParams.profileId,
|
||||
@@ -494,7 +494,7 @@ library MetaTxLib {
|
||||
/**
|
||||
* @dev Wrapper for ecrecover to reduce code size, used in meta-tx specific functions.
|
||||
*/
|
||||
function _validateRecoveredAddress(bytes32 digest, Types.EIP712Signature calldata signature) internal view {
|
||||
function _validateRecoveredAddress(bytes32 digest, Types.EIP712Signature calldata signature) private view {
|
||||
if (signature.deadline < block.timestamp) revert Errors.SignatureExpired();
|
||||
// If the expected address is a contract, check the signature there.
|
||||
if (signature.signer.code.length != 0) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import {IFollowNFT} from 'contracts/interfaces/IFollowNFT.sol';
|
||||
library ProfileLib {
|
||||
uint16 constant MAX_PROFILE_IMAGE_URI_LENGTH = 6000;
|
||||
|
||||
function ownerOf(uint256 profileId) external view returns (address) {
|
||||
function ownerOf(uint256 profileId) internal view returns (address) {
|
||||
address profileOwner = StorageLib.getTokenData(profileId).owner;
|
||||
if (profileOwner == address(0)) {
|
||||
revert Errors.TokenDoesNotExist();
|
||||
|
||||
@@ -69,11 +69,10 @@ library ProfileTokenURILib {
|
||||
*
|
||||
* @return string The profile token image as a base64-encoded SVG.
|
||||
*/
|
||||
function _getSVGImageBase64Encoded(string memory handleWithAtSymbol, string memory imageURI)
|
||||
internal
|
||||
pure
|
||||
returns (string memory)
|
||||
{
|
||||
function _getSVGImageBase64Encoded(
|
||||
string memory handleWithAtSymbol,
|
||||
string memory imageURI
|
||||
) private pure returns (string memory) {
|
||||
return
|
||||
Base64.encode(
|
||||
abi.encodePacked(
|
||||
@@ -98,7 +97,7 @@ library ProfileTokenURILib {
|
||||
*
|
||||
* @return string The fragment of the SVG token's image correspondending to the profile picture.
|
||||
*/
|
||||
function _getSVGProfilePicture(string memory imageURI) internal pure returns (string memory) {
|
||||
function _getSVGProfilePicture(string memory imageURI) private pure returns (string memory) {
|
||||
if (_shouldUseCustomPicture(imageURI)) {
|
||||
return
|
||||
string(
|
||||
@@ -125,7 +124,7 @@ library ProfileTokenURILib {
|
||||
* @param handleLength The profile's handle length.
|
||||
* @return uint256 The font size.
|
||||
*/
|
||||
function _handleLengthToFontSize(uint256 handleLength) internal pure returns (uint256) {
|
||||
function _handleLengthToFontSize(uint256 handleLength) private pure returns (uint256) {
|
||||
return
|
||||
handleLength <= MAX_HANDLE_LENGTH_WITH_DEFAULT_FONT_SIZE
|
||||
? DEFAULT_FONT_SIZE
|
||||
@@ -142,7 +141,7 @@ library ProfileTokenURILib {
|
||||
*
|
||||
* @return bool A boolean indicating whether custom profile picture should be used or not.
|
||||
*/
|
||||
function _shouldUseCustomPicture(string memory imageURI) internal pure returns (bool) {
|
||||
function _shouldUseCustomPicture(string memory imageURI) private pure returns (bool) {
|
||||
bytes memory imageURIBytes = bytes(imageURI);
|
||||
if (imageURIBytes.length == 0) {
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'forge-std/Script.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
uint256 constant FIRST_PROFILE_ID = 1;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
// File modified from https://github.com/transmissions11/solmate/blob/main/src/test/ERC721.t.sol
|
||||
// License should stay as `AGPL-3.0-only` as it was modified from:
|
||||
// https://github.com/transmissions11/solmate/blob/main/src/test/ERC721.t.sol
|
||||
pragma solidity ^0.8.15;
|
||||
|
||||
import 'forge-std/Test.sol';
|
||||
@@ -29,23 +30,13 @@ contract ERC721Recipient is IERC721Receiver {
|
||||
}
|
||||
|
||||
contract RevertingERC721Recipient is IERC721Receiver {
|
||||
function onERC721Received(
|
||||
address,
|
||||
address,
|
||||
uint256,
|
||||
bytes calldata
|
||||
) public virtual override returns (bytes4) {
|
||||
function onERC721Received(address, address, uint256, bytes calldata) public virtual override returns (bytes4) {
|
||||
revert(string(abi.encodePacked(IERC721Receiver.onERC721Received.selector)));
|
||||
}
|
||||
}
|
||||
|
||||
contract WrongReturnDataERC721Recipient is IERC721Receiver {
|
||||
function onERC721Received(
|
||||
address,
|
||||
address,
|
||||
uint256,
|
||||
bytes calldata
|
||||
) public virtual override returns (bytes4) {
|
||||
function onERC721Received(address, address, uint256, bytes calldata) public virtual override returns (bytes4) {
|
||||
return 0xCAFEBEEF;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
@@ -18,11 +18,7 @@ abstract contract MetaTxNegatives is BaseTest {
|
||||
|
||||
// Functions to mandatorily override.
|
||||
|
||||
function _executeMetaTx(
|
||||
uint256 signerPk,
|
||||
uint256 nonce,
|
||||
uint256 deadline
|
||||
) internal virtual;
|
||||
function _executeMetaTx(uint256 signerPk, uint256 nonce, uint256 deadline) internal virtual;
|
||||
|
||||
function _getDefaultMetaTxSignerPk() internal virtual returns (uint256);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
@@ -280,11 +280,7 @@ contract SetBlockStatusMetaTxTest is SetBlockStatusTest, MetaTxNegatives {
|
||||
});
|
||||
}
|
||||
|
||||
function _executeMetaTx(
|
||||
uint256 signerPk,
|
||||
uint256 nonce,
|
||||
uint256 deadline
|
||||
) internal override {
|
||||
function _executeMetaTx(uint256 signerPk, uint256 nonce, uint256 deadline) internal override {
|
||||
hub.setBlockStatusWithSig({
|
||||
byProfileId: statusSetterProfileId,
|
||||
idsOfProfilesToSetBlockStatus: _toUint256Array(blockeeProfileId),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/BaseTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/TestSetup.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'forge-std/Test.sol';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This test should upgrade the forked Polygon deployment, and run a series of tests.
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
contract ArrayHelpers {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/base/TestSetup.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'forge-std/Script.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'forge-std/Test.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'contracts/libraries/constants/Types.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'test/foundry/FollowNFTTest.t.sol';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import 'forge-std/Test.sol';
|
||||
@@ -75,6 +75,9 @@ contract MigrationsTest is Test, ForkManagement {
|
||||
address lensHandlesAddress = computeCreateAddress(deployer, 0);
|
||||
address tokenHandleRegistryAddress = computeCreateAddress(deployer, 1);
|
||||
|
||||
console.log('lensHandlesAddress:', lensHandlesAddress);
|
||||
console.log('tokenHandleRegistryAddress:', tokenHandleRegistryAddress);
|
||||
|
||||
vm.startPrank(deployer);
|
||||
|
||||
lensHandles = new LensHandles(owner, address(hub));
|
||||
|
||||
Reference in New Issue
Block a user