@@ -28,26 +28,26 @@ contract BatchNoConversionPayments is Ownable {
28
28
IEthereumFeeProxy public paymentEthProxy;
29
29
ChainlinkConversionPath public chainlinkConversionPath;
30
30
31
+ /** Used to calculate batch fees: batchFee = 30 represent 0.30% of fee */
31
32
uint256 public batchFee;
32
- /** Used to to calculate batch fees */
33
+ /** Used to calculate batch fees: divide batchFee by feeDenominator */
33
34
uint256 internal feeDenominator = 10000 ;
35
+ /** The amount of the batch fee cannot exceed a predefined amount in USD */
36
+ uint256 public batchFeeAmountUSDLimit;
34
37
35
38
/** payerAuthorized is set to true only when needed for batch Eth conversion */
36
39
bool internal payerAuthorized = false ;
37
40
/** batchPayment function is the caller */
38
41
bool internal batchPaymentOrigin = false ;
39
-
40
42
/** transferBackRemainingEth is set to false only if the payer use batchPayment
41
43
and call both batchEthPayments and batchConversionEthPaymentsWithReference */
42
44
bool internal transferBackRemainingEth = true ;
43
45
44
- /** The amount of the batch fee cannot exceed a predefined amount in USD */
45
- uint256 public batchFeeAmountUSDLimit;
46
46
address public USDAddress;
47
47
address public ETHAddress;
48
48
address [][] public pathsEthToUSD;
49
49
50
- /** Contain the address of a token, the sum of the amount and fees paid with it, and the batch fee amount */
50
+ /** Contains the address of a token, the sum of the amount and fees paid with it, and the batch fee amount */
51
51
struct Token {
52
52
address tokenAddress;
53
53
uint256 amountAndFee;
@@ -80,7 +80,7 @@ contract BatchNoConversionPayments is Ownable {
80
80
/**
81
81
* @param _paymentErc20Proxy The address to the ERC20 fee payment proxy to use.
82
82
* @param _paymentEthProxy The address to the Ethereum fee payment proxy to use.
83
- * @param _chainlinkConversionPathAddress The address of the conversion path contract
83
+ * @param _chainlinkConversionPathAddress The address of the conversion path contract.
84
84
* @param _owner Owner of the contract.
85
85
*/
86
86
constructor (
@@ -499,9 +499,11 @@ contract BatchNoConversionPayments is Ownable {
499
499
500
500
/**
501
501
* @notice Fees added when using Erc20/Eth batch functions
502
- * @param _batchFee Between 0 and 10000 , i.e: batchFee = 50 represent 0.50 % of fee
502
+ * @param _batchFee Between 0 and 200 , i.e: batchFee = 30 represent 0.30 % of fee
503
503
*/
504
504
function setBatchFee (uint256 _batchFee ) external onlyOwner {
505
+ // safety to avoid wrong setting
506
+ require (_batchFee <= 200 , 'The batch fee value is too high: > 2% ' );
505
507
batchFee = _batchFee;
506
508
}
507
509
@@ -519,9 +521,17 @@ contract BatchNoConversionPayments is Ownable {
519
521
paymentEthProxy = IEthereumFeeProxy (_paymentEthProxy);
520
522
}
521
523
524
+ /**
525
+ * @notice Update the conversion path contract used to fetch conversions.
526
+ * @param _chainlinkConversionPathAddress The address of the conversion path contract.
527
+ */
528
+ function setConversionPathAddress (address _chainlinkConversionPathAddress ) external onlyOwner {
529
+ chainlinkConversionPath = ChainlinkConversionPath (_chainlinkConversionPathAddress);
530
+ }
531
+
522
532
/**
523
533
* This function define variables allowing to limit the fees:
524
- * ETHAddress, USDAddress, and pathsEthToUSD
534
+ * ETHAddress, USDAddress, and pathsEthToUSD.
525
535
* @param _ETHAddress The address representing the Ethereum currency.
526
536
* @param _USDAddress The address representing the USD currency.
527
537
*/
0 commit comments