diff --git a/contracts/FeralfileArtworkV4.sol b/contracts/FeralfileArtworkV4.sol index be58f1f..6517c39 100644 --- a/contracts/FeralfileArtworkV4.sol +++ b/contracts/FeralfileArtworkV4.sol @@ -429,6 +429,7 @@ contract FeralfileExhibitionV4 is } uint256 distributedRevenue; + uint256 platformRevenue; for (uint256 i = 0; i < saleData_.tokenIds.length; i++) { // send NFT _safeTransfer( @@ -449,6 +450,7 @@ contract FeralfileExhibitionV4 is if ( saleData_.revenueShares[i][j].recipient == costReceiver ) { + platformRevenue += rev; continue; } distributedRevenue += rev; @@ -462,7 +464,8 @@ contract FeralfileExhibitionV4 is } require( - saleData_.price - saleData_.cost >= distributedRevenue, + saleData_.price - saleData_.cost >= + distributedRevenue + platformRevenue, "FeralfileExhibitionV4: total bps over 10,000" ); diff --git a/test/feralfile_exhibition_v4.js b/test/feralfile_exhibition_v4.js index c4e2645..9b37293 100644 --- a/test/feralfile_exhibition_v4.js +++ b/test/feralfile_exhibition_v4.js @@ -616,23 +616,23 @@ contract("FeralfileExhibitionV4_0", async (accounts) => { [ [ [accounts[3], 8001], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], [ [accounts[3], 8001], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], [ [accounts[3], 9000], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], [ [accounts[3], 9000], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], [ [accounts[3], 8500], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], ], false, @@ -662,23 +662,23 @@ contract("FeralfileExhibitionV4_0", async (accounts) => { [ [ [accounts[3], 8001], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], [ [accounts[3], 8001], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], [ [accounts[3], 9000], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], [ [accounts[3], 9000], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], [ [accounts[3], 8500], - [accounts[4], 2000], + [COST_RECEIVER, 2000], ], ], false,