Skip to content

Commit 13916e3

Browse files
committedMar 13, 2025·
feat: purchase tracker logs currency
1 parent 6d05b52 commit 13916e3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎src/IPurchaseTracker.sol

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
pragma solidity ^0.8.20;
33

44
interface IPurchaseTracker {
5-
function recordPurchase(bytes32 paymentId, address seller, address buyer, uint256 amount) external;
5+
function recordPurchase(bytes32 paymentId, address seller, address buyer, uint256 amount, address currency) external;
66
function getPurchaseCount(address recipient) external view returns (uint256);
77
function getPurchaseAmount(address recipient) external view returns (uint256);
88
function getSalesCount(address recipient) external view returns (uint256);
99
function getSalesAmount(address recipient) external view returns (uint256);
10+
function getPurchaseAmountByCurrency(address recipient, address currency) external view returns (uint256);
11+
function getSalesAmountByCurrency(address recipient, address currency) external view returns (uint256);
1012
}

‎src/PaymentEscrow.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ contract PaymentEscrow is PaymentEscrowAdmins, HasSecurityContext, IEscrowContra
8282
* @notice Constructor.
8383
* @param securityContext Contract which will define & manage secure access for this contract.
8484
* @param settings_ Address of contract that holds system settings.
85-
* @param autoRelease Determines whether new payments automatically have the receivers assent.
85+
* @param autoRelease Determines whether new payments automatically have the receiver's assent.
8686
* @param _purchaseTracker Address of the PurchaseTracker singleton.
8787
*/
8888
constructor(
@@ -317,7 +317,7 @@ contract PaymentEscrow is PaymentEscrowAdmins, HasSecurityContext, IEscrowContra
317317
emit EscrowReleased(paymentId, amountToPay, fee);
318318

319319
if (address(purchaseTracker) != address(0)) {
320-
purchaseTracker.recordPurchase(paymentId, payment.receiver, payment.payer, amountToPay);
320+
purchaseTracker.recordPurchase(paymentId, payment.receiver, payment.payer, amountToPay, payment.currency);
321321
}
322322
}
323323
}

0 commit comments

Comments
 (0)
Please sign in to comment.