@@ -15,9 +15,9 @@ import { IGraphPayments } from "./IGraphPayments.sol";
1515 * collector contract which implements the {IPaymentsCollector} interface.
1616 */
1717interface IPaymentsEscrow {
18- /// @notice Escrow account for a payer-receiver pair
18+ /// @notice Escrow account for a payer-collector- receiver tuple
1919 struct EscrowAccount {
20- // Total token balance for the payer-receiver pair
20+ // Total token balance for the payer-collector- receiver tuple
2121 uint256 balance;
2222 // Amount of tokens currently being thawed
2323 uint256 tokensThawing;
@@ -70,12 +70,13 @@ interface IPaymentsEscrow {
7070 event RevokeCollector (address indexed payer , address indexed collector );
7171
7272 /**
73- * @notice Emitted when a payer deposits funds into the escrow for a payer-receiver pair
73+ * @notice Emitted when a payer deposits funds into the escrow for a payer-collector- receiver tuple
7474 * @param payer The address of the payer
75+ * @param collector The address of the collector
7576 * @param receiver The address of the receiver
7677 * @param tokens The amount of tokens deposited
7778 */
78- event Deposit (address indexed payer , address indexed receiver , uint256 tokens );
79+ event Deposit (address indexed payer , address indexed collector , address indexed receiver , uint256 tokens );
7980
8081 /**
8182 * @notice Emitted when a payer cancels an escrow thawing
@@ -85,29 +86,38 @@ interface IPaymentsEscrow {
8586 event CancelThaw (address indexed payer , address indexed receiver );
8687
8788 /**
88- * @notice Emitted when a payer thaws funds from the escrow for a payer-receiver pair
89+ * @notice Emitted when a payer thaws funds from the escrow for a payer-collector- receiver tuple
8990 * @param payer The address of the payer
91+ * @param collector The address of the collector
9092 * @param receiver The address of the receiver
9193 * @param tokens The amount of tokens being thawed
9294 * @param thawEndTimestamp The timestamp at which the thawing period ends
9395 */
94- event Thaw (address indexed payer , address indexed receiver , uint256 tokens , uint256 thawEndTimestamp );
96+ event Thaw (
97+ address indexed payer ,
98+ address indexed collector ,
99+ address indexed receiver ,
100+ uint256 tokens ,
101+ uint256 thawEndTimestamp
102+ );
95103
96104 /**
97- * @notice Emitted when a payer withdraws funds from the escrow for a payer-receiver pair
105+ * @notice Emitted when a payer withdraws funds from the escrow for a payer-collector- receiver tuple
98106 * @param payer The address of the payer
107+ * @param collector The address of the collector
99108 * @param receiver The address of the receiver
100109 * @param tokens The amount of tokens withdrawn
101110 */
102- event Withdraw (address indexed payer , address indexed receiver , uint256 tokens );
111+ event Withdraw (address indexed payer , address indexed collector , address indexed receiver , uint256 tokens );
103112
104113 /**
105- * @notice Emitted when a collector collects funds from the escrow for a payer-receiver pair
114+ * @notice Emitted when a collector collects funds from the escrow for a payer-collector- receiver tuple
106115 * @param payer The address of the payer
116+ * @param collector The address of the collector
107117 * @param receiver The address of the receiver
108118 * @param tokens The amount of tokens collected
109119 */
110- event EscrowCollected (address indexed payer , address indexed receiver , uint256 tokens );
120+ event EscrowCollected (address indexed payer , address indexed collector , address indexed receiver , uint256 tokens );
111121
112122 // -- Errors --
113123
@@ -211,26 +221,28 @@ interface IPaymentsEscrow {
211221 function revokeCollector (address collector ) external ;
212222
213223 /**
214- * @notice Deposits funds into the escrow for a payer-receiver pair , where
224+ * @notice Deposits funds into the escrow for a payer-collector- receiver tuple , where
215225 * the payer is the transaction caller.
216226 * @dev Emits a {Deposit} event
227+ * @param collector The address of the collector
217228 * @param receiver The address of the receiver
218229 * @param tokens The amount of tokens to deposit
219230 */
220- function deposit (address receiver , uint256 tokens ) external ;
231+ function deposit (address collector , address receiver , uint256 tokens ) external ;
221232
222233 /**
223- * @notice Deposits funds into the escrow for a payer-receiver pair , where
234+ * @notice Deposits funds into the escrow for a payer-collector- receiver tuple , where
224235 * the payer can be specified.
225236 * @dev Emits a {Deposit} event
226237 * @param payer The address of the payer
238+ * @param collector The address of the collector
227239 * @param receiver The address of the receiver
228240 * @param tokens The amount of tokens to deposit
229241 */
230- function depositTo (address payer , address receiver , uint256 tokens ) external ;
242+ function depositTo (address payer , address collector , address receiver , uint256 tokens ) external ;
231243
232244 /**
233- * @notice Thaw a specific amount of escrow from a payer-receiver's escrow account.
245+ * @notice Thaw a specific amount of escrow from a payer-collector- receiver's escrow account.
234246 * The payer is the transaction caller.
235247 * If `tokens` is zero and funds were already thawing it will cancel the thawing.
236248 * Note that repeated calls to this function will overwrite the previous thawing amount
@@ -240,13 +252,14 @@ interface IPaymentsEscrow {
240252 *
241253 * Emits a {Thaw} event. If `tokens` is zero it will emit a {CancelThaw} event.
242254 *
255+ * @param collector The address of the collector
243256 * @param receiver The address of the receiver
244257 * @param tokens The amount of tokens to thaw
245258 */
246- function thaw (address receiver , uint256 tokens ) external ;
259+ function thaw (address collector , address receiver , uint256 tokens ) external ;
247260
248261 /**
249- * @notice Withdraws all thawed escrow from a payer-receiver's escrow account.
262+ * @notice Withdraws all thawed escrow from a payer-collector- receiver's escrow account.
250263 * The payer is the transaction caller.
251264 * Note that the withdrawn funds might be less than the thawed amount if there were
252265 * payment collections in the meantime.
@@ -255,12 +268,13 @@ interface IPaymentsEscrow {
255268 *
256269 * Emits a {Withdraw} event
257270 *
271+ * @param collector The address of the collector
258272 * @param receiver The address of the receiver
259273 */
260- function withdraw (address receiver ) external ;
274+ function withdraw (address collector , address receiver ) external ;
261275
262276 /**
263- * @notice Collects funds from the payer-receiver's escrow and sends them to {GraphPayments} for
277+ * @notice Collects funds from the payer-collector- receiver's escrow and sends them to {GraphPayments} for
264278 * distribution using the Graph Horizon Payments protocol.
265279 * The function will revert if there are not enough funds in the escrow.
266280 * @dev Requirements:
@@ -272,22 +286,23 @@ interface IPaymentsEscrow {
272286 * @param payer The address of the payer
273287 * @param receiver The address of the receiver
274288 * @param tokens The amount of tokens to collect
275- * @param collector The address of the collector
289+ * @param dataService The address of the data service
276290 * @param tokensDataService The amount of tokens that {GraphPayments} should send to the data service
277291 */
278292 function collect (
279293 IGraphPayments.PaymentTypes paymentType ,
280294 address payer ,
281295 address receiver ,
282296 uint256 tokens ,
283- address collector ,
297+ address dataService ,
284298 uint256 tokensDataService
285299 ) external ;
286300
287301 /**
288- * @notice Get the balance of a payer-receiver pair
302+ * @notice Get the balance of a payer-collector- receiver tuple
289303 * @param payer The address of the payer
304+ * @param collector The address of the collector
290305 * @param receiver The address of the receiver
291306 */
292- function getBalance (address payer , address receiver ) external view returns (uint256 );
307+ function getBalance (address payer , address collector , address receiver ) external view returns (uint256 );
293308}
0 commit comments