Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
lint: all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubpark committed Jan 31, 2024
1 parent d654938 commit 4d39c75
Show file tree
Hide file tree
Showing 44 changed files with 122 additions and 166 deletions.
2 changes: 1 addition & 1 deletion contracts/AccessController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ contract AccessController is IAccessController, Governable {
if (IIPAccount(payable(ipAccount_)).owner() == signer_) {
return true;
}
uint functionPermission = getPermission(ipAccount_, signer_, to_, func_);
uint8 functionPermission = getPermission(ipAccount_, signer_, to_, func_);
// Specific function permission overrides wildcard/general permission
if (functionPermission == AccessPermission.ALLOW) {
return true;
Expand Down
1 change: 0 additions & 1 deletion contracts/IPAccountImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { IAccessController } from "contracts/interfaces/IAccessController.sol";
import { IERC6551Account } from "lib/reference/src/interfaces/IERC6551Account.sol";
import { IIPAccount } from "contracts/interfaces/IIPAccount.sol";
import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import { AccessPermission } from "contracts/lib/AccessPermission.sol";
import { MessageHashUtils } from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import { MetaTx } from "contracts/lib/MetaTx.sol";
import { Errors } from "contracts/lib/Errors.sol";
Expand Down
5 changes: 3 additions & 2 deletions contracts/interfaces/governance/IGovernable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf
pragma solidity ^0.8.23;


/// @title IGovernable
/// @notice This is the interface for the Lens Protocol main governance functions.
interface IGovernable {
/// @notice Emitted when the governance is updated
/// @param newGovernance The address of the new governance
event GovernanceUpdated(address indexed newGovernance);

/// @notice Sets the governance address
/// @param newGovernance The address of the new governance
function setGovernance(address newGovernance) external;

/// @notice Returns the current governance address
/// @return The address of the current governance
/// @return The address of the current governance
function getGovernance() external view returns (address);
}
2 changes: 1 addition & 1 deletion contracts/interfaces/licensing/ILinkParamVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ interface ILinkParamVerifier is IPolicyVerifier {
address parentIpId,
bytes calldata policyData
) external returns (bool);
}
}
2 changes: 1 addition & 1 deletion contracts/interfaces/licensing/IMintParamVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ interface IMintParamVerifier is IPolicyVerifier {
uint256 mintAmount,
bytes memory policyData
) external returns (bool);
}
}
4 changes: 2 additions & 2 deletions contracts/interfaces/licensing/IPolicyFrameworkManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

pragma solidity ^0.8.23;

import { Licensing } from "contracts/lib/Licensing.sol";
import { IPolicyVerifier } from "contracts/interfaces/licensing/IPolicyVerifier.sol";

/// @title IPolicyFrameworkManager
/// @notice Interface to define a policy framework contract, that will
/// register itself into the LicenseRegistry to format policy into the LicenseRegistry
interface IPolicyFrameworkManager is IPolicyVerifier {
function licenseRegistry() external view returns (address);

function policyToJson(bytes memory policyData) external view returns (string memory);
}
}
4 changes: 1 addition & 3 deletions contracts/interfaces/licensing/IPolicyVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ import { IERC165 } from "@openzeppelin/contracts/interfaces/IERC165.sol";

/// @title IPolicyVerifier
/// @notice Placeholder interface for verifying policy parameters.
interface IPolicyVerifier is IERC165 {

}
interface IPolicyVerifier is IERC165 {}
2 changes: 1 addition & 1 deletion contracts/interfaces/licensing/ITransferParamVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ interface ITransferParamVerifier is IPolicyVerifier {
uint256 amount,
bytes memory policyData
) external returns (bool);
}
}
6 changes: 2 additions & 4 deletions contracts/interfaces/licensing/IUMLPolicyFrameworkManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

pragma solidity ^0.8.23;

import { Licensing } from "contracts/lib/Licensing.sol";
import { IPolicyFrameworkManager } from "contracts/interfaces/licensing/IPolicyFrameworkManager.sol";

/// @notice Licensing parameters for the UML standard
Expand Down Expand Up @@ -37,20 +36,19 @@ struct UMLPolicy {
string[] distributionChannels;
}


/// @title IUMLPolicyFrameworkManager
/// @notice Defines the interface for a Policy Framework Manager compliant with the UML standard
interface IUMLPolicyFrameworkManager is IPolicyFrameworkManager {

/// @notice Emitted when a new policy is added to the registry
event UMLPolicyAdded(uint256 indexed policyId, UMLPolicy policy);

/// @notice Adds a new policy to the registry
/// @dev Must encode the policy into bytes to be stored in the LicenseRegistry
/// @param umlPolicy UMLPolicy compliant licensing term values
function addPolicy(UMLPolicy calldata umlPolicy) external returns (uint256 policyId);

/// @notice Fetchs a policy from the registry, decoding the raw bytes into a UMLPolicy struct
/// @param policyId The ID of the policy to fetch
/// @return policy The UMLPolicy struct
function getPolicy(uint256 policyId) external view returns (UMLPolicy memory policy);
}
}
1 change: 0 additions & 1 deletion contracts/interfaces/modules/base/IModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity ^0.8.23;

/// @notice Module Interface
interface IModule {

/// @notice Returns the string identifier associated with the module.
function name() external returns (string memory);
}
8 changes: 5 additions & 3 deletions contracts/interfaces/modules/dispute/IDisputeModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface IDisputeModule {
/// @param arbitrationRelayer The address of the arbitration relayer
/// @param allowed Indicates if the arbitration relayer is whitelisted
event ArbitrationRelayerWhitelistUpdated(address arbitrationPolicy, address arbitrationRelayer, bool allowed);

/// @notice Event emitted when a dispute is raised
/// @param disputeId The dispute id
/// @param targetIpId The ipId that is the target of the dispute
Expand Down Expand Up @@ -99,7 +99,9 @@ interface IDisputeModule {
function resolveDispute(uint256 disputeId) external;

/// @notice Gets the dispute struct characteristics
function disputes(uint256 disputeId)
function disputes(
uint256 disputeId
)
external
view
returns (
Expand All @@ -110,4 +112,4 @@ interface IDisputeModule {
bytes32 targetTag, // The target tag of the dispute
bytes32 currentTag // The current tag of the dispute
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.23;
/// @title ArbitrationPolicy interface
interface IArbitrationPolicy {
/// @notice Executes custom logic on raise dispute
/// @param caller Address of the caller
/// @param caller Address of the caller
function onRaiseDispute(address caller, bytes calldata data) external;

/// @notice Executes custom logic on dispute judgement
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/modules/royalty/IRoyaltyModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ interface IRoyaltyModule {

/// @notice Gets the royalty policy for a given ipId
function royaltyPolicies(address ipId) external view returns (address royaltyPolicy);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ interface ILiquidSplitClone {
/// @notice Distributes funds to the accounts in the LiquidSplitClone contract
/// @param token The token to distribute
/// @param accounts The accounts to distribute to
/// @param distributorAddress The distributor address
/// @param distributorAddress The distributor address
function distributeFunds(address token, address[] calldata accounts, address distributorAddress) external;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ pragma solidity ^0.8.23;
interface ILiquidSplitFactory {
/// @notice Creates a new LiquidSplitClone contract
/// @param accounts The accounts to initialize the LiquidSplitClone contract with
/// @param initAllocations The initial allocations
/// @param initAllocations The initial allocations
/// @param _distributorFee The distributor fee
/// @param owner The owner of the LiquidSplitClone contract
/// @param owner The owner of the LiquidSplitClone contract
function createLiquidSplitClone(
address[] calldata accounts,
uint32[] calldata initAllocations,
uint32 _distributorFee,
address owner
) external returns (address);
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.23;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

/// @title LiquidSplitMain interface
interface ILiquidSplitMain {
/// @notice Allows an account to withdraw their accrued and distributed pending amount
/// @param account The account to withdraw from
/// @param withdrawETH The amount of ETH to withdraw
/// @param tokens The tokens to withdraw
function withdraw(
address account,
uint256 withdrawETH,
ERC20[] calldata tokens
) external;
}
function withdraw(address account, uint256 withdrawETH, ERC20[] calldata tokens) external;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
pragma solidity ^0.8.23;

/// @title RoyaltyPolicy interface
interface IRoyaltyPolicy {
interface IRoyaltyPolicy {
/// @notice Initializes the royalty policy
/// @param ipId The ipId
/// @param data The data to initialize the policy
/// @param data The data to initialize the policy
function initPolicy(address ipId, bytes calldata data) external;

/// @notice Allows to pay a royalty
Expand All @@ -14,4 +14,4 @@ interface IRoyaltyPolicy {
/// @param token The token to pay
/// @param amount The amount to pay
function onRoyaltyPayment(address caller, address ipId, address token, uint256 amount) external;
}
}
15 changes: 3 additions & 12 deletions contracts/interfaces/registries/IIPAccountRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,15 @@ interface IIPAccountRegistry {
/// @param chainId_ The chain ID where the token contract deployed
/// @param tokenContract_ The address of the token contract to be associated with the IP Account
/// @param tokenId_ The ID of the token to be associated with the IP Account
/// @return The address of the newly created IP Account
function registerIpAccount(
uint256 chainId_,
address tokenContract_,
uint256 tokenId_
) external returns (address);
/// @return The address of the newly created IP Account
function registerIpAccount(uint256 chainId_, address tokenContract_, uint256 tokenId_) external returns (address);

/// @notice Returns the IPAccount address for the given NFT token
/// @param chainId_ The chain ID where the token contract deployed
/// @param tokenContract_ The address of the token contract associated with the IP Account
/// @param tokenId_ The ID of the token associated with the IP Account
/// @return The address of the IP Account associated with the given NFT token
function ipAccount(
uint256 chainId_,
address tokenContract_,
uint256 tokenId_
) external view returns (address);

function ipAccount(uint256 chainId_, address tokenContract_, uint256 tokenId_) external view returns (address);

/// @notice Returns the IPAccount implementation address
/// @return The address of the IPAccount implementation
Expand Down
8 changes: 1 addition & 7 deletions contracts/interfaces/registries/IIPAssetRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pragma solidity ^0.8.23;

import { IIPAccountRegistry } from "contracts/interfaces/registries/IIPAccountRegistry.sol";
import { IMetadataProvider } from "contracts/interfaces/registries/metadata/IMetadataProvider.sol";

/// @title Interface for IP Account Registry
/// @notice This interface manages the registration and tracking of IP Accounts
Expand Down Expand Up @@ -35,11 +34,7 @@ interface IIPAssetRegistry is IIPAccountRegistry {
/// @param ipId The canonical identifier of the specified IP.
/// @param metadataProvider Address of the metadata provider associated with the IP.
/// @param metadata The canonical metadata in bytes associated with the IP.
event MetadataSet(
address indexed ipId,
address indexed metadataProvider,
bytes metadata
);
event MetadataSet(address indexed ipId, address indexed metadataProvider, bytes metadata);

/// @notice Gets the canonical IP identifier associated with an IP (NFT).
/// @dev This is the same as the address of the IP account bound to the IP.
Expand Down Expand Up @@ -103,5 +98,4 @@ interface IIPAssetRegistry is IIPAccountRegistry {
/// @param id The canonical ID of the IP.
/// @param resolverAddr The address of the resolver being set.
function setResolver(address id, address resolverAddr) external;

}
29 changes: 23 additions & 6 deletions contracts/interfaces/registries/ILicenseRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import { Licensing } from "contracts/lib/Licensing.sol";
/// - Registering policies
/// - Minting licenses
/// - Linking IP to its parent
/// - Verifying transfer parameters (through the ITransferParamVerifier interface implementation by the policy framework)
/// - Verifying linking parameters (through the ILinkParamVerifier interface implementation by the policy framework)
/// - Verifying policy parameters (through the IPolicyVerifier interface implementation by the policy framework)
/// - Verifying transfer parameters (through the ITransferParamVerifier interface implementation by policy framework)
/// - Verifying linking parameters (through the ILinkParamVerifier interface implementation by policy framework)
/// - Verifying policy parameters (through the IPolicyVerifier interface implementation by policy framework)
interface ILicenseRegistry {

/// @notice Emitted when a policy framework is created by registering a policy framework manager
/// @param creator The address that created the policy framework
/// @param frameworkId The id of the policy framework
Expand Down Expand Up @@ -66,7 +65,7 @@ interface ILicenseRegistry {

/// @notice registers a policy framework into the contract
/// @param fw The policy framework data
/// @return frameworkId The id of the policy framework
/// @return frameworkId The id of the policy framework
function addPolicyFramework(Licensing.PolicyFramework calldata fw) external returns (uint256 frameworkId);

/// @notice registers a policy into the contract
Expand Down Expand Up @@ -104,41 +103,59 @@ interface ILicenseRegistry {

/// @notice gets total number of policy frameworks in the contract
function totalFrameworks() external view returns (uint256);

/// @notice gets policy framework data by id
function framework(uint256 frameworkId) external view returns (Licensing.PolicyFramework memory);

/// @notice gets policy framework license template URL by id
function frameworkUrl(uint256 frameworkId) external view returns (string memory);

/// @notice gets total number of policies (framework parameter configurations) in the contract
function totalPolicies() external view returns (uint256);

/// @notice gets policy data by id
function policy(uint256 policyId) external view returns (Licensing.Policy memory pol);

/// @notice true if policy is defined in the contract
function isPolicyDefined(uint256 policyId) external view returns (bool);

/// @notice gets the policy ids for an IP
function policyIdsForIp(address ipId) external view returns (uint256[] memory policyIds);

/// @notice gets total number of policies for an IP
function totalPoliciesForIp(address ipId) external view returns (uint256);

/// @notice true if policy is part of an IP's policy list
function isPolicyIdSetForIp(address ipId, uint256 policyId) external view returns (bool);

/// @notice gets the policy ID for an IP by index on the IP's policy list
function policyIdForIpAtIndex(address ipId, uint256 index) external view returns (uint256 policyId);

/// @notice gets the policy for an IP by index on the IP's policy list
function policyForIpAtIndex(address ipId, uint256 index) external view returns (Licensing.Policy memory);

/// @notice gets the index of a policy in an IP's policy list
function indexOfPolicyForIp(address ipId, uint256 policyId) external view returns (uint256 index);

/// @notice true if the license was added to the IP by linking (burning a license)
function isPolicyInherited(address ipId, uint256 policyId) external view returns (bool);

/// @notice true if holder is the licensee for the license (owner of the license NFT), or derivative IP owner if
/// the license was added to the IP by linking (burning a license)
function isLicensee(uint256 licenseId, address holder) external view returns (bool);

/// @notice IP ID of the licensor for the license (parent IP)
function licensorIpId(uint256 licenseId) external view returns (address);

/// @notice license data (licensor, policy...) for the license id
function license(uint256 licenseId) external view returns (Licensing.License memory);

/// @notice true if an IP is a derivative of another IP
function isParent(address parentIpId, address childIpId) external view returns (bool);

/// @notice returns the parent IP IDs for an IP ID
function parentIpIds(address ipId) external view returns (address[] memory);

/// @notice total number of parents for an IP ID
function totalParentsForIpId(address ipId) external view returns (uint256);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IMetadataProvider } from "contracts/interfaces/registries/metadata/IMet
interface IMetadataProviderUpgradeable is IMetadataProvider {
/// @notice Returns the new metadata provider IP assets may migrate to.
/// @return Address of the new metadata provider if set, else the zero address.
function upgradeProvider() external returns(IMetadataProvider);
function upgradeProvider() external returns (IMetadataProvider);

/// @notice Sets a new metadata provider that IP assets may migrate to.
/// @param provider The address of the new metadata provider.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { IMetadataProvider } from "contracts/interfaces/registries/metadata/IMet

/// @title Metadata Provider v1 Interface
interface IMetadataProviderV1 is IMetadataProvider {

/// @notice Gets the name associated with the IP asset.
/// @param ipId The address identifier of the IP asset.
function name(address ipId) external view returns (string memory);
Expand Down
Loading

0 comments on commit 4d39c75

Please sign in to comment.