Skip to content

Commit 53f7c97

Browse files
fix: remove excessive comments
1 parent 2d42f8c commit 53f7c97

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/contracts/DonationHandler.sol

+2-16
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,12 @@ contract DonationHandler is OwnableUpgradeable, ReentrancyGuardUpgradeable {
7373
revert InsufficientAllowance();
7474
}
7575
}
76-
// ETH Donations
77-
// Donate multiple ETH donations at once
76+
7877
/// @notice Donate multiple ETH donations at once
7978
/// @param totalAmount The total amount of the donation
8079
/// @param recipientAddresses The addresses of the recipients of the donation
8180
/// @param amounts The amounts of the donation to each recipient
8281
/// @param data The data of the donation to each recipient
83-
8482
function donateManyETH(
8583
uint256 totalAmount,
8684
address[] calldata recipientAddresses,
@@ -100,7 +98,6 @@ contract DonationHandler is OwnableUpgradeable, ReentrancyGuardUpgradeable {
10098
}
10199
}
102100

103-
// Donate a single ETH donation
104101
/// @notice Donate a single ETH donation
105102
/// @param recipientAddress The address of the recipient of the donation
106103
/// @param amount The amount of the donation
@@ -110,7 +107,6 @@ contract DonationHandler is OwnableUpgradeable, ReentrancyGuardUpgradeable {
110107
_handleETH(amount, recipientAddress, data);
111108
}
112109

113-
// Donate a single ERC20 donation
114110
/// @notice Donate a single ERC20 donation
115111
/// @param tokenAddress The address of the token being donated
116112
/// @param recipientAddress The address of the recipient of the donation
@@ -126,8 +122,6 @@ contract DonationHandler is OwnableUpgradeable, ReentrancyGuardUpgradeable {
126122
_handleERC20(tokenAddress, amount, recipientAddress, data);
127123
}
128124

129-
// ERC20 Donations
130-
// Donate multiple ERC20 donations at once
131125
/// @notice Donate multiple ERC20 donations at once
132126
/// @param tokenAddress The address of the token being donated
133127
/// @param totalAmount The total amount of the donation
@@ -155,13 +149,12 @@ contract DonationHandler is OwnableUpgradeable, ReentrancyGuardUpgradeable {
155149
}
156150
}
157151
}
158-
// Donate multiple ERC20 & ETH donations at once
152+
159153
/// @notice Donate multiple ERC20 & ETH donations at once
160154
/// @param tokenAddresses The addresses of the tokens being donated
161155
/// @param amounts The amounts of the donation to each recipient
162156
/// @param recipientAddresses The addresses of the recipients of the donation
163157
/// @param data The data of the donation to each recipient
164-
165158
function donateManyMultipleTokens(
166159
address[] calldata tokenAddresses,
167160
uint256[] calldata amounts,
@@ -201,18 +194,14 @@ contract DonationHandler is OwnableUpgradeable, ReentrancyGuardUpgradeable {
201194
}
202195
}
203196

204-
// Internal functions
205197
/// @notice Handle a single ETH donation
206198
/// @param amount The amount of the donation
207199
/// @param recipientAddress The address of the recipient of the donation
208200
function _handleETH(uint256 amount, address recipientAddress, bytes memory data) internal {
209-
// Interactions
210-
211201
if (recipientAddress == ETH_TOKEN_ADDRESS) revert InvalidInput();
212202
if (amount == 0) revert InvalidInput();
213203
(bool success,) = recipientAddress.call{value: amount}('');
214204
require(success, 'ETH transfer failed');
215-
// Effects
216205
emit DonationMade(recipientAddress, amount, ETH_TOKEN_ADDRESS, data);
217206
}
218207

@@ -225,13 +214,10 @@ contract DonationHandler is OwnableUpgradeable, ReentrancyGuardUpgradeable {
225214
if (amount == 0) revert InvalidInput();
226215
bool success = IERC20(token).transferFrom(msg.sender, recipientAddress, amount);
227216
require(success, 'ERC20 transfer failed');
228-
229217
emit DonationMade(recipientAddress, amount, token, data);
230218
}
231219

232-
// Receive function to accept ETH
233220
receive() external payable {
234-
// Only accept ETH through allocateETH function
235221
revert('Use allocateETH function to send ETH');
236222
}
237223
}

0 commit comments

Comments
 (0)