@@ -22,7 +22,7 @@ contract BatchConversionPayments is BatchNoConversionPayments {
22
22
using SafeERC20 for IERC20 ;
23
23
24
24
IERC20ConversionProxy public paymentErc20ConversionProxy;
25
- IEthConversionProxy public paymentEthConversionProxy ;
25
+ IEthConversionProxy public paymentNativeConversionProxy ;
26
26
27
27
/**
28
28
* @dev Used by the batchPayment to handle information for heterogeneous batches, grouped by payment network:
@@ -36,29 +36,29 @@ contract BatchConversionPayments is BatchNoConversionPayments {
36
36
37
37
/**
38
38
* @param _paymentErc20Proxy The ERC20 payment proxy address to use.
39
- * @param _paymentEthProxy The ETH payment proxy address to use.
39
+ * @param _paymentNativeProxy The native payment proxy address to use.
40
40
* @param _paymentErc20ConversionProxy The ERC20 Conversion payment proxy address to use.
41
- * @param _paymentEthConversionFeeProxy The ETH Conversion payment proxy address to use.
41
+ * @param _paymentNativeConversionFeeProxy The native Conversion payment proxy address to use.
42
42
* @param _chainlinkConversionPathAddress The address of the conversion path contract.
43
43
* @param _owner Owner of the contract.
44
44
*/
45
45
constructor (
46
46
address _paymentErc20Proxy ,
47
- address _paymentEthProxy ,
47
+ address _paymentNativeProxy ,
48
48
address _paymentErc20ConversionProxy ,
49
- address _paymentEthConversionFeeProxy ,
49
+ address _paymentNativeConversionFeeProxy ,
50
50
address _chainlinkConversionPathAddress ,
51
51
address _owner
52
52
)
53
53
BatchNoConversionPayments (
54
54
_paymentErc20Proxy,
55
- _paymentEthProxy ,
55
+ _paymentNativeProxy ,
56
56
_chainlinkConversionPathAddress,
57
57
_owner
58
58
)
59
59
{
60
60
paymentErc20ConversionProxy = IERC20ConversionProxy (_paymentErc20ConversionProxy);
61
- paymentEthConversionProxy = IEthConversionProxy (_paymentEthConversionFeeProxy );
61
+ paymentNativeConversionProxy = IEthConversionProxy (_paymentNativeConversionFeeProxy );
62
62
}
63
63
64
64
/**
@@ -67,12 +67,12 @@ contract BatchConversionPayments is BatchNoConversionPayments {
67
67
* - batchMultiERC20ConversionPayments, paymentNetworkId=0
68
68
* - batchERC20Payments, paymentNetworkId=1
69
69
* - batchMultiERC20Payments, paymentNetworkId=2
70
- * - batchEthPayments , paymentNetworkId=3
71
- * - batchEthConversionPayments , paymentNetworkId=4
70
+ * - batchNativePayments , paymentNetworkId=3
71
+ * - batchNativeConversionPayments , paymentNetworkId=4
72
72
* If metaDetails use paymentNetworkId = 4, it must be at the end of the list, or the transaction can be reverted.
73
73
* @param pathsToUSD The list of paths into USD for every token, used to limit the batch fees.
74
- * For batchEth , mock an array of array to apply the limit, e.g: [[]]
75
- * Without paths, there is not limitation, neither for the batchEth functions.
74
+ * For batch native , mock an array of array to apply the limit, e.g: [[]]
75
+ * Without paths, there is not limitation, neither for the batch native functions.
76
76
* @param feeAddress The address where fees should be paid.
77
77
* @dev Use pathsToUSD only if you are pretty sure the batch fees will higher than the
78
78
* USD limit batchFeeAmountUSDLimit, because it increase gas consumption.
@@ -112,20 +112,20 @@ contract BatchConversionPayments is BatchNoConversionPayments {
112
112
);
113
113
} else if (metaDetail.paymentNetworkId == 3 ) {
114
114
if (metaDetails[metaDetails.length - 1 ].paymentNetworkId == 4 ) {
115
- // Set to false only if batchEthConversionPayments is called after this function
116
- transferBackRemainingEth = false ;
115
+ // Set to false only if batchNativeConversionPayments is called after this function
116
+ transferBackRemainingNativeTokens = false ;
117
117
}
118
- batchFeeAmountUSD += _batchEthPayments (
118
+ batchFeeAmountUSD += _batchNativePayments (
119
119
metaDetail.requestDetails,
120
120
pathsToUSD.length == 0 ,
121
121
batchFeeAmountUSD,
122
122
payable (feeAddress)
123
123
);
124
124
if (metaDetails[metaDetails.length - 1 ].paymentNetworkId == 4 ) {
125
- transferBackRemainingEth = true ;
125
+ transferBackRemainingNativeTokens = true ;
126
126
}
127
127
} else if (metaDetail.paymentNetworkId == 4 ) {
128
- batchFeeAmountUSD += _batchEthConversionPayments (
128
+ batchFeeAmountUSD += _batchNativeConversionPayments (
129
129
metaDetail.requestDetails,
130
130
pathsToUSD.length == 0 ,
131
131
batchFeeAmountUSD,
@@ -154,23 +154,22 @@ contract BatchConversionPayments is BatchNoConversionPayments {
154
154
}
155
155
156
156
/**
157
- * @notice Send a batch of ETH conversion payments with fees and paymentReferences to multiple accounts.
157
+ * @notice Send a batch of Native conversion payments with fees and paymentReferences to multiple accounts.
158
158
* If one payment fails, the whole batch is reverted.
159
- * @param requestDetails List of ETH requests denominated in fiat to pay.
159
+ * @param requestDetails List of native requests denominated in fiat to pay.
160
160
* @param skipFeeUSDLimit Setting the value to true skips the USD fee limit, and reduce gas consumption.
161
161
* @param feeAddress The fee recipient.
162
- * @dev It uses EthereumConversionProxy to pay an invoice and fees.
162
+ * @dev It uses NativeConversionProxy ( EthereumConversionProxy) to pay an invoice and fees.
163
163
* Please:
164
- * Note that if there is not enough ether attached to the function call,
164
+ * Note that if there is not enough Native token attached to the function call,
165
165
* the following error is thrown: "revert paymentProxy transferExactEthWithReferenceAndFee failed"
166
- * This choice reduces the gas significantly, by delegating the whole conversion to the payment proxy.
167
166
*/
168
- function batchEthConversionPayments (
167
+ function batchNativeConversionPayments (
169
168
RequestDetail[] calldata requestDetails ,
170
169
bool skipFeeUSDLimit ,
171
170
address payable feeAddress
172
171
) public payable returns (uint256 ) {
173
- return _batchEthConversionPayments (requestDetails, skipFeeUSDLimit, 0 , feeAddress);
172
+ return _batchNativeConversionPayments (requestDetails, skipFeeUSDLimit, 0 , feeAddress);
174
173
}
175
174
176
175
/**
@@ -250,19 +249,18 @@ contract BatchConversionPayments is BatchNoConversionPayments {
250
249
}
251
250
252
251
/**
253
- * @notice Send a batch of ETH conversion payments with fees and paymentReferences to multiple accounts.
252
+ * @notice Send a batch of Native conversion payments with fees and paymentReferences to multiple accounts.
254
253
* If one payment fails, the whole batch is reverted.
255
- * @param requestDetails List of ETH requests denominated in fiat to pay.
254
+ * @param requestDetails List of native requests denominated in fiat to pay.
256
255
* @param skipFeeUSDLimit Setting the value to true skips the USD fee limit, and reduce gas consumption.
257
256
* @param batchFeeAmountUSD The batch fee amount in USD already paid.
258
257
* @param feeAddress The fee recipient.
259
- * @dev It uses EthereumConversionProxy to pay an invoice and fees.
258
+ * @dev It uses NativeConversionProxy ( EthereumConversionProxy) to pay an invoice and fees.
260
259
* Please:
261
- * Note that if there is not enough ether attached to the function call,
260
+ * Note that if there is not enough Native token attached to the function call,
262
261
* the following error is thrown: "revert paymentProxy transferExactEthWithReferenceAndFee failed"
263
- * This choice reduces the gas significantly, by delegating the whole conversion to the payment proxy.
264
262
*/
265
- function _batchEthConversionPayments (
263
+ function _batchNativeConversionPayments (
266
264
RequestDetail[] calldata requestDetails ,
267
265
bool skipFeeUSDLimit ,
268
266
uint256 batchFeeAmountUSD ,
@@ -271,10 +269,10 @@ contract BatchConversionPayments is BatchNoConversionPayments {
271
269
uint256 contractBalance = address (this ).balance;
272
270
payerAuthorized = true ;
273
271
274
- // Batch contract pays the requests through EthConversionProxy
272
+ // Batch contract pays the requests through nativeConversionProxy
275
273
for (uint256 i = 0 ; i < requestDetails.length ; i++ ) {
276
274
RequestDetail memory rD = requestDetails[i];
277
- paymentEthConversionProxy .transferWithReferenceAndFee {value: address (this ).balance}(
275
+ paymentNativeConversionProxy .transferWithReferenceAndFee {value: address (this ).balance}(
278
276
payable (rD.recipient),
279
277
rD.requestAmount,
280
278
rD.path,
@@ -292,16 +290,16 @@ contract BatchConversionPayments is BatchNoConversionPayments {
292
290
if (skipFeeUSDLimit == false ) {
293
291
(batchFeeToPay, batchFeeAmountUSD) = calculateBatchFeeToPay (
294
292
batchFeeToPay,
295
- pathsEthToUSD [0 ][0 ],
293
+ pathsNativeToUSD [0 ][0 ],
296
294
batchFeeAmountUSD,
297
- pathsEthToUSD
295
+ pathsNativeToUSD
298
296
);
299
297
}
300
298
301
299
require (address (this ).balance >= batchFeeToPay, 'Not enough funds for batch conversion fees ' );
302
300
feeAddress.transfer (batchFeeToPay);
303
301
304
- // Batch contract transfers the remaining ethers to the payer
302
+ // Batch contract transfers the remaining native tokens to the payer
305
303
(bool sendBackSuccess , ) = payable (msg .sender ).call {value: address (this ).balance}('' );
306
304
require (sendBackSuccess, 'Could not send remaining funds to the payer ' );
307
305
payerAuthorized = false ;
@@ -322,10 +320,13 @@ contract BatchConversionPayments is BatchNoConversionPayments {
322
320
}
323
321
324
322
/**
325
- * @param _paymentEthConversionProxy The address of the Ethereum Conversion payment proxy to use.
323
+ * @param _paymentNativeConversionProxy The address of the native Conversion payment proxy to use.
326
324
* Update cautiously, the proxy has to match the invoice proxy.
327
325
*/
328
- function setPaymentEthConversionProxy (address _paymentEthConversionProxy ) external onlyOwner {
329
- paymentEthConversionProxy = IEthConversionProxy (_paymentEthConversionProxy);
326
+ function setPaymentNativeConversionProxy (address _paymentNativeConversionProxy )
327
+ external
328
+ onlyOwner
329
+ {
330
+ paymentNativeConversionProxy = IEthConversionProxy (_paymentNativeConversionProxy);
330
331
}
331
332
}
0 commit comments