forked from storyprotocol/protocol-core-v1
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace 0xSplits with new ERC20 Royalty Vault (storyprotocol#26)
* add oppenzeppelin v4 contracts * update total token supply comments * remove ancestors vault contract * remove liquid split related interfaces and test adjustments * Add ip pool and LAP royalty policy contract and tests adjustments * rename to IpRoyaltyVault * change oppenzeppellin v4 contracts to upgradeable * add beacon upgradeability to IpRoyaltyVault * add amount to event and adjust claimed event --------- Co-authored-by: Jongwon Park <[email protected]>
- Loading branch information
Showing
27 changed files
with
1,021 additions
and
1,405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/contracts/modules/royalty/policies/oppenzeppelin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
contracts/interfaces/modules/royalty/policies/IAncestorsVaultLAP.sol
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
contracts/interfaces/modules/royalty/policies/IIpRoyaltyVault.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
/// @title Ip royalty vault interface | ||
interface IIpRoyaltyVault { | ||
/// @notice Event emitted when royalty tokens are collected | ||
/// @param ancestorIpId The ancestor ipId address | ||
/// @param royaltyTokensCollected The amount of royalty tokens collected | ||
event RoyaltyTokensCollected(address ancestorIpId, uint256 royaltyTokensCollected); | ||
|
||
/// @notice Event emitted when a snapshot is taken | ||
/// @param snapshotId The snapshot id | ||
/// @param snapshotTimestamp The timestamp of the snapshot | ||
/// @param unclaimedTokens The amount of unclaimed tokens at the snapshot | ||
event SnapshotCompleted(uint256 snapshotId, uint256 snapshotTimestamp, uint32 unclaimedTokens); | ||
|
||
/// @notice initializer for this implementation contract | ||
/// @param name The name of the royalty token | ||
/// @param symbol The symbol of the royalty token | ||
/// @param supply The total supply of the royalty token | ||
/// @param unclaimedTokens The amount of unclaimed royalty tokens reserved for ancestors | ||
/// @param ipIdAddress The ip id the royalty vault belongs to | ||
function initialize( | ||
string memory name, | ||
string memory symbol, | ||
uint32 supply, | ||
uint32 unclaimedTokens, | ||
address ipIdAddress | ||
) external; | ||
|
||
/// @notice Adds a new revenue token to the vault | ||
/// @param token The address of the revenue token | ||
/// @dev Only callable by the royalty policy LAP | ||
function addIpRoyaltyVaultTokens(address token) external; | ||
|
||
/// @notice A function to snapshot the claimable revenue and royalty token amounts | ||
/// @return The snapshot id | ||
function snapshot() external returns (uint256); | ||
|
||
/// @notice A function to calculate the amount of revenue token claimable by a token holder at certain snapshot | ||
/// @param account The address of the token holder | ||
/// @param snapshotId The snapshot id | ||
/// @param token The revenue token to claim | ||
/// @return The amount of revenue token claimable | ||
function claimableRevenue(address account, uint256 snapshotId, address token) external view returns (uint256); | ||
|
||
/// @notice Allows token holders to claim revenue token based on the token balance at certain snapshot | ||
/// @param snapshotId The snapshot id | ||
/// @param tokens The list of revenue tokens to claim | ||
function claimRevenueByTokenBatch(uint256 snapshotId, address[] calldata tokens) external; | ||
|
||
/// @notice Allows token holders to claim by a list of snapshot ids based on the token balance at certain snapshot | ||
/// @param snapshotIds The list of snapshot ids | ||
/// @param token The revenue token to claim | ||
function claimRevenueBySnapshotBatch(uint256[] memory snapshotIds, address token) external; | ||
|
||
/// @notice Allows ancestors to claim the royalty tokens and any accrued revenue tokens | ||
/// @param ancestorIpId The ip id of the ancestor to whom the royalty tokens belong to | ||
function collectRoyaltyTokens(address ancestorIpId) external; | ||
|
||
/// @notice Returns the list of revenue tokens in the vault | ||
/// @return The list of revenue tokens | ||
function getVaultTokens() external view returns (address[] memory); | ||
} |
25 changes: 0 additions & 25 deletions
25
contracts/interfaces/modules/royalty/policies/ILiquidSplitClone.sol
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
contracts/interfaces/modules/royalty/policies/ILiquidSplitFactory.sol
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
contracts/interfaces/modules/royalty/policies/ILiquidSplitMain.sol
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.