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

Lint: IPMetadata storage #50

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
83 changes: 46 additions & 37 deletions contracts/interfaces/registries/IIPAssetRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,27 @@ interface IIPAssetRegistry is IIPAccountRegistry {
/// @param tokenId The token identifier of the IP.
/// @param resolver The address of the resolver linked to the IP.
/// @param provider The address of the metadata provider linked to the IP.
/// @param metadata Canonical metadata that was linked to the IP.
event IPRegistered(
address ipId,
uint256 indexed chainId,
address indexed tokenContract,
uint256 indexed tokenId,
address resolver,
address provider
address provider,
bytes metadata
);

/// @notice Emits when an IP resolver is bound to an IP.
/// @param ipId The canonical identifier of the specified IP.
/// @param resolver The address of the new resolver bound to the IP.
event IPResolverSet(address ipId, address resolver);

/// @notice Emits when a metadata provider is set for an IP.
/// @notice Emits when metadata is set for an IP asset.
/// @param ipId The canonical identifier of the specified IP.
/// @param metadataProvider Address of the metadata provider associated with the IP.
event MetadataProviderSet(address ipId, address metadataProvider);

/// @notice Registers an NFT as IP, creating a corresponding IP asset.
/// @param chainId The chain identifier of where the IP resides.
/// @param tokenContract The address of the IP.
/// @param tokenId The token identifier of the IP.
/// @param resolverAddr The address of the resolver to associate with the IP.
/// @param createAccount Whether to create an IP account in the process.
function register(
uint256 chainId,
address tokenContract,
uint256 tokenId,
address resolverAddr,
bool createAccount
) external returns (address);

/// @notice Sets the resolver for an IP based on its NFT attributes.
/// @param chainId The chain identifier of where the IP resides.
/// @param tokenContract The address of the IP.
/// @param tokenId The token identifier of the IP.
function setResolver(uint256 chainId, address tokenContract, uint256 tokenId, address resolver) external;
/// @param metadata The canonical metadata in bytes associated with the IP.
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 All @@ -66,27 +49,53 @@ interface IIPAssetRegistry is IIPAccountRegistry {
/// @return Whether the IP was registered into the protocol.
function isRegistered(address id) external view returns (bool);

/// @notice Retrieves whether or not an IP was registered.
/// @param chainId The chain identifier of where the IP resides.
/// @param tokenContract The address of the IP.
/// @param tokenId The token identifier of the IP.
/// @return Whether the IP was registered into the protocol.
function isRegistered(uint256 chainId, address tokenContract, uint256 tokenId) external view returns (bool);

/// @notice Gets the resolver bound to an IP based on its ID.
/// @param id The canonical identifier for the IP.
/// @return The IP resolver address if registered, else the zero address.
function resolver(address id) external view returns (address);

/// @notice Gets the resolver bound to an IP based on its NFT attributes.
/// @param chainId The chain identifier of where the IP resides.
/// @param tokenContract The address of the IP.
/// @param tokenId The token identifier of the IP.
/// @return The IP resolver address if registered, else the zero address.
function resolver(uint256 chainId, address tokenContract, uint256 tokenId) external view returns (address);
/// @notice Gets the metadata provider currently used for metadata storage.
function metadataProvider() external view returns (address);

/// @notice Gets the metadata provider linked to an IP based on its ID.
/// @param id The canonical identifier for the IP.
/// @return The metadata that was bound to this IP at creation time.
/// @return The metadata provider that was bound to this IP at creation time.
function metadataProvider(address id) external view returns (address);

/// @notice Gets the metadata linked to an IP based on its ID.
/// @param id The canonical identifier for the IP.
/// @return The metadata that was bound to this IP at creation time.
function metadata(address id) external view returns (bytes memory);

/// @notice Upgrades the metadata for an IP asset, migrating to a new provider.
/// @param id The canonical ID of the IP.
/// @param metadataProvider Address of the new metadata provider hosting the data.
/// @param data Canonical metadata to associate with the IP.
function setMetadata(address id, address metadataProvider, bytes calldata data) external;

/// @notice Sets the metadata provider to use for new registrations.
/// @param metadataProvider The address of the new metadata provider to use.
function setMetadataProvider(address metadataProvider) external;

/// @notice Registers an NFT as IP, creating a corresponding IP record.
/// @dev This is only callable by an authorized registration module.
/// @param chainId The chain identifier of where the IP resides.
/// @param tokenContract The address of the IP.
/// @param tokenId The token identifier of the IP.
/// @param resolverAddr The address of the resolver to associate with the IP.
/// @param createAccount Whether to create an IP account in the process.
/// @param metadata Metadata in bytes to associate with the IP.
function register(
uint256 chainId,
address tokenContract,
uint256 tokenId,
address resolverAddr,
bool createAccount,
bytes calldata metadata
) external returns (address);

/// @notice Sets the resolver for an IP based on its canonical ID.
/// @param id The canonical ID of the IP.
/// @param resolverAddr The address of the resolver being set.
function setResolver(address id, address resolverAddr) external;
}
Loading
Loading