Skip to content

Commit

Permalink
Merge pull request #1286 from thesandboxgame/feat/marketplace-getters
Browse files Browse the repository at this point in the history
feat: add a getter in the marketplace to get deductibles
  • Loading branch information
adjisb authored Aug 7, 2024
2 parents 3a8883f + 7b9ad08 commit 5e439c5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/marketplace/contracts/Exchange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@ contract Exchange is
_unpause();
}

/// @notice Return all the information to calculate how much will be deduced from an exchange
/// @param token collection token address
/// @param tokenId tokenId for this collection
/// @return feePrimary fees for the primary market
/// @return feeSecondary fees for the secondary market
/// @return royalties royalties taken (receiver, valuePercent)
function getDeductibles(
address token,
uint256 tokenId
) external view returns (uint256 feePrimary, uint256 feeSecondary, IRoyaltiesProvider.Part[] memory royalties) {
return (protocolFeePrimary, protocolFeeSecondary, royaltiesRegistry.getRoyalties(token, tokenId));
}

/// @dev Check if fees & royalties should be skipped for users with the EXCHANGE_ADMIN_ROLE.
/// @param from Address to check.
/// @return True if fees should be skipped, false otherwise.
Expand Down

1 comment on commit 5e439c5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

96.59%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/marketplace/contracts
   Exchange.sol92.96%96.67%88.24%91.67%164, 186, 64
   ExchangeCore.sol98.84%96.67%100%100%80
   OrderValidator.sol97.87%95.45%100%100%35
   RoyaltiesRegistry.sol95.10%86.11%100%97.73%130–131, 181, 203–204, 250, 64
   TransferManager.sol95.97%90%100%98.61%152, 155, 248, 252, 79
   Whitelist.sol69.35%50%78.57%78.57%103, 107, 110, 118, 121, 124, 140–141, 53, 65, 65–66, 70, 70–71, 75
packages/marketplace/contracts/interfaces
   IOrderValidator.sol100%100%100%100%
   IRoyaltiesProvider.sol100%100%100%100%
   ITransferManager.sol100%100%100%100%
   IWhitelist.sol100%100%100%100%
packages/marketplace/contracts/libraries
   LibAsset.sol100%100%100%100%
   LibMath.sol100%100%100%100%
   LibOrder.sol100%100%100%100%

Please sign in to comment.