Skip to content

Commit ce934f2

Browse files
committed
typo corrections
1 parent aec302c commit ce934f2

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

packages/smart-contracts/src/contracts/BatchConversionPayments.sol

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ contract BatchConversionPayments is BatchNoConversionPayments {
2525
IEthConversionProxy public paymentEthConversionProxy;
2626

2727
/**
28-
* @dev Used by the batchPayment to handle information for heterogeneous batches, grouped by payment network.
29-
* - paymentNetworkId: from 0 to 4, cf. `batchPayment()` method.
28+
* @dev Used by the batchPayment to handle information for heterogeneous batches, grouped by payment network:
29+
* - paymentNetworkId: from 0 to 4, cf. `batchPayment()` method
3030
* - requestDetails all the data required for conversion and no conversion requests to be paid
3131
*/
3232
struct MetaDetail {
@@ -39,7 +39,7 @@ contract BatchConversionPayments is BatchNoConversionPayments {
3939
* @param _paymentEthProxy The ETH payment proxy address to use.
4040
* @param _paymentErc20ConversionProxy The ERC20 Conversion payment proxy address to use.
4141
* @param _paymentEthConversionFeeProxy The ETH Conversion payment proxy address to use.
42-
* @param _chainlinkConversionPathAddress The address of the conversion path contract
42+
* @param _chainlinkConversionPathAddress The address of the conversion path contract.
4343
* @param _owner Owner of the contract.
4444
*/
4545
constructor(
@@ -85,7 +85,7 @@ contract BatchConversionPayments is BatchNoConversionPayments {
8585

8686
// Check that there are paths to USD, and more than one paymentNetworkId
8787
if (pathsToUSD.length > 0 && metaDetails.length > 1) {
88-
// Set to true to limit the batch fee to pay
88+
// Set to true to avoid batchFeeAmountUSD to be reset by each batch function
8989
batchPaymentOrigin = true;
9090
}
9191

@@ -137,6 +137,7 @@ contract BatchConversionPayments is BatchNoConversionPayments {
137137
}
138138
}
139139
if (pathsToUSD.length > 0 && metaDetails.length > 1) {
140+
// Set back to false, its default value
140141
batchPaymentOrigin = false;
141142
}
142143
}
@@ -148,7 +149,7 @@ contract BatchConversionPayments is BatchNoConversionPayments {
148149
* @param batchFeeAmountUSD The batch fee amount in USD already paid.
149150
* @param pathsToUSD The list of paths into USD for every token, used to limit the batch fees.
150151
* Without paths, there is not limitation.
151-
* @param feeAddress The fee recipient
152+
* @param feeAddress The fee recipient.
152153
*/
153154
function batchMultiERC20ConversionPayments(
154155
RequestDetail[] calldata requestDetails,
@@ -299,12 +300,4 @@ contract BatchConversionPayments is BatchNoConversionPayments {
299300
function setPaymentEthConversionProxy(address _paymentEthConversionProxy) external onlyOwner {
300301
paymentEthConversionProxy = IEthConversionProxy(_paymentEthConversionProxy);
301302
}
302-
303-
/**
304-
* @notice Update the conversion path contract used to fetch conversions.
305-
* @param _chainlinkConversionPathAddress The address of the conversion path contract.
306-
*/
307-
function setConversionPathAddress(address _chainlinkConversionPathAddress) external onlyOwner {
308-
chainlinkConversionPath = ChainlinkConversionPath(_chainlinkConversionPathAddress);
309-
}
310303
}

packages/smart-contracts/src/contracts/BatchNoConversionPayments.sol

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,26 @@ contract BatchNoConversionPayments is Ownable {
2828
IEthereumFeeProxy public paymentEthProxy;
2929
ChainlinkConversionPath public chainlinkConversionPath;
3030

31+
/** Used to calculate batch fees: batchFee = 30 represent 0.30% of fee */
3132
uint256 public batchFee;
32-
/** Used to to calculate batch fees */
33+
/** Used to calculate batch fees: divide batchFee by feeDenominator */
3334
uint256 internal feeDenominator = 10000;
35+
/** The amount of the batch fee cannot exceed a predefined amount in USD */
36+
uint256 public batchFeeAmountUSDLimit;
3437

3538
/** payerAuthorized is set to true only when needed for batch Eth conversion */
3639
bool internal payerAuthorized = false;
3740
/** batchPayment function is the caller */
3841
bool internal batchPaymentOrigin = false;
39-
4042
/** transferBackRemainingEth is set to false only if the payer use batchPayment
4143
and call both batchEthPayments and batchConversionEthPaymentsWithReference */
4244
bool internal transferBackRemainingEth = true;
4345

44-
/** The amount of the batch fee cannot exceed a predefined amount in USD */
45-
uint256 public batchFeeAmountUSDLimit;
4646
address public USDAddress;
4747
address public ETHAddress;
4848
address[][] public pathsEthToUSD;
4949

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 */
5151
struct Token {
5252
address tokenAddress;
5353
uint256 amountAndFee;
@@ -80,7 +80,7 @@ contract BatchNoConversionPayments is Ownable {
8080
/**
8181
* @param _paymentErc20Proxy The address to the ERC20 fee payment proxy to use.
8282
* @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.
8484
* @param _owner Owner of the contract.
8585
*/
8686
constructor(
@@ -499,9 +499,11 @@ contract BatchNoConversionPayments is Ownable {
499499

500500
/**
501501
* @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
503503
*/
504504
function setBatchFee(uint256 _batchFee) external onlyOwner {
505+
// safety to avoid wrong setting
506+
require(_batchFee <= 200, 'The batch fee value is too high: > 2%');
505507
batchFee = _batchFee;
506508
}
507509

@@ -519,9 +521,17 @@ contract BatchNoConversionPayments is Ownable {
519521
paymentEthProxy = IEthereumFeeProxy(_paymentEthProxy);
520522
}
521523

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+
522532
/**
523533
* This function define variables allowing to limit the fees:
524-
* ETHAddress, USDAddress, and pathsEthToUSD
534+
* ETHAddress, USDAddress, and pathsEthToUSD.
525535
* @param _ETHAddress The address representing the Ethereum currency.
526536
* @param _USDAddress The address representing the USD currency.
527537
*/

0 commit comments

Comments
 (0)