Skip to content

Commit 5e439c5

Browse files
authored
Merge pull request #1286 from thesandboxgame/feat/marketplace-getters
feat: add a getter in the marketplace to get deductibles
2 parents 3a8883f + 7b9ad08 commit 5e439c5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/marketplace/contracts/Exchange.sol

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,19 @@ contract Exchange is
151151
_unpause();
152152
}
153153

154+
/// @notice Return all the information to calculate how much will be deduced from an exchange
155+
/// @param token collection token address
156+
/// @param tokenId tokenId for this collection
157+
/// @return feePrimary fees for the primary market
158+
/// @return feeSecondary fees for the secondary market
159+
/// @return royalties royalties taken (receiver, valuePercent)
160+
function getDeductibles(
161+
address token,
162+
uint256 tokenId
163+
) external view returns (uint256 feePrimary, uint256 feeSecondary, IRoyaltiesProvider.Part[] memory royalties) {
164+
return (protocolFeePrimary, protocolFeeSecondary, royaltiesRegistry.getRoyalties(token, tokenId));
165+
}
166+
154167
/// @dev Check if fees & royalties should be skipped for users with the EXCHANGE_ADMIN_ROLE.
155168
/// @param from Address to check.
156169
/// @return True if fees should be skipped, false otherwise.

0 commit comments

Comments
 (0)