Skip to content

Commit

Permalink
fix royalty module storage layout for upgradeable (storyprotocol#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster-will authored Sep 18, 2024
1 parent 7b50f5a commit fed581a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/modules/royalty/RoyaltyModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ contract RoyaltyModule is IRoyaltyModule, VaultController, ReentrancyGuardUpgrad
IGroupIPAssetRegistry public immutable IP_ASSET_REGISTRY;

/// @dev Storage structure for the RoyaltyModule
/// @param treasury The treasury address
/// @param royaltyFeePercent The royalty fee percentage
/// @param maxParents The maximum number of parents an IP asset can have
/// @param maxAncestors The maximum number of ancestors an IP asset can have
/// @param maxAccumulatedRoyaltyPolicies The maximum number of accumulated royalty policies an IP asset can have
Expand All @@ -65,10 +63,10 @@ contract RoyaltyModule is IRoyaltyModule, VaultController, ReentrancyGuardUpgrad
/// @param globalRoyaltyStack Sum of royalty stack from each whitelisted royalty policy for a given IP asset
/// @param accumulatedRoyaltyPolicies The accumulated royalty policies for a given IP asset
/// @param totalRevenueTokensReceived The total lifetime revenue tokens received for a given IP asset
/// @param treasury The treasury address
/// @param royaltyFeePercent The royalty fee percentage
/// @custom:storage-location erc7201:story-protocol.RoyaltyModule
struct RoyaltyModuleStorage {
address treasury;
uint32 royaltyFeePercent;
uint256 maxParents;
uint256 maxAncestors;
uint256 maxAccumulatedRoyaltyPolicies;
Expand All @@ -79,6 +77,8 @@ contract RoyaltyModule is IRoyaltyModule, VaultController, ReentrancyGuardUpgrad
mapping(address ipId => uint32) globalRoyaltyStack;
mapping(address ipId => EnumerableSet.AddressSet) accumulatedRoyaltyPolicies;
mapping(address ipId => mapping(address token => uint256)) totalRevenueTokensReceived;
address treasury;
uint32 royaltyFeePercent;
}

// keccak256(abi.encode(uint256(keccak256("story-protocol.RoyaltyModule")) - 1)) & ~bytes32(uint256(0xff));
Expand Down

0 comments on commit fed581a

Please sign in to comment.