@@ -78,11 +78,11 @@ contract Escrow is Owned, IEscrow {
7878 require (_whitelistedTokens.contains (address (param.token)), Errors.INVALID_TOKEN);
7979
8080 uint feeAmount;
81- uint amountToEscrow = param.amount;
81+ uint netAmount = param.amount;
8282 if (protocolFeeBps > 0 ) {
83- feeAmount = param.amount.mulDivUp (protocolFeeBps, 10_000 );
84- amountToEscrow = param.amount - feeAmount;
85- require (amountToEscrow > 0 , Errors.INVALID_AMOUNT_AFTER_FEE);
83+ feeAmount = param.amount.mulDivUp (protocolFeeBps, 10_000 );
84+ netAmount = param.amount - feeAmount;
85+ require (netAmount > 0 , Errors.INVALID_AMOUNT_AFTER_FEE);
8686 }
8787
8888 param.token.safeTransferFrom (msg .sender , address (this ), param.amount);
@@ -92,7 +92,7 @@ contract Escrow is Owned, IEscrow {
9292 }
9393
9494 deposits[depositCount] = Deposit ({
95- amount: amountToEscrow ,
95+ amount: netAmount ,
9696 token: param.token,
9797 recipient: param.recipient,
9898 sender: param.sender,
@@ -108,7 +108,8 @@ contract Escrow is Owned, IEscrow {
108108 address (param.token),
109109 param.recipient,
110110 param.sender,
111- amountToEscrow,
111+ netAmount,
112+ feeAmount,
112113 block .timestamp + param.claimPeriod
113114 );
114115
@@ -124,15 +125,13 @@ contract Escrow is Owned, IEscrow {
124125 external
125126 returns (uint [] memory depositIds )
126127 {
127- uint totalGrossAmount;
128128 depositIds = new uint [](params.length );
129129
130130 for (uint256 i = 0 ; i < params.length ; i++ ) {
131131 depositIds[i] = deposit (params[i]);
132- totalGrossAmount += params[i].amount;
133132 }
134133
135- emit BatchDeposited (batchCount++ , repoId, timestamp, depositIds, totalGrossAmount );
134+ emit BatchDeposited (batchCount++ , repoId, timestamp, depositIds);
136135 }
137136
138137 /*//////////////////////////////////////////////////////////////
0 commit comments