Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

address audit feedback #120

Merged
merged 12 commits into from
Jan 30, 2024
Merged

Conversation

gianchandania
Copy link
Contributor

@gianchandania gianchandania commented Jan 23, 2024

Commit 1: fix BGB-03
Commit 2: fix RSC-02
Commit 3: fix BGB-02
Commit 4: fix GLOBAL-01 In this commit ERC1155Receiver contract was removed because it got depreciated in openzeppelin/contracts version 5.0.0. Instead ERC1155Holder contract is used for the same purpose. The visibility of onERC1155Received and onERC1155BatchReceived method is changed to public because ERC1155Holder contract has these methods with public visibility
Commit 5: fix WSG-03
Commit 6: fix BGB-01
Commit 7: fix WSG-02
Commit 8: fix WSG-01
Commit 9: fix BAT-02. This change reverts the transaction if the sent out amount is not equal to the received eth amount. Some tests which are not relevant anymore are removed
Commit 10: fix BAC-01. This change removes test to transfer ownership to address(0) as it is not relevant, because in the current flow ownership needs to be accepted by the new owner.
Commit 11: fix WSG-06. This change doesn't change abi.encodePacked in the sendMultiSigToken as it has not been highlighted as an issue.
Commit 12: update optimizer runs Update optimizer runs in hardhat config

WIN-1733

@gianchandania gianchandania force-pushed the WIN-1733-address-audit-review-comments branch from 08a3542 to 48aa44f Compare January 23, 2024 07:10
@gianchandania gianchandania force-pushed the WIN-1733-address-audit-review-comments branch from b01ce39 to 165b4be Compare January 23, 2024 07:18
Copy link

socket-security bot commented Jan 23, 2024

@@ -71,12 +71,12 @@ contract Batcher {
// Revert everything if any transfer fails
for (uint8 i = 0; i < recipients.length; i++) {
require(recipients[i] != address(0), 'Invalid recipient address');
emit BatchTransfer(msg.sender, recipients[i], values[i]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we even store a state in this function

* Gets called when a transaction is received with data that does not match any other method
*/
fallback() external payable {}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will impact erc20 or any other token transfers however I feel its a good safety net

Copy link
Contributor

@sachushaji sachushaji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Work !!!, Only one comment I saw

for (uint256 i = 0; i < recipients.length; i++) {
require(recipients[i] != address(0), 'Invalid recipient address');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this check added here, address zero might help you in confirming that your contract is handling uninitialised data correctly, But in this case since we are already checking recipients.length and only passing in if the value is there, this check seems redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the zero address validations

Copy link
Contributor

@sachushaji sachushaji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Nice work

@gianchandania gianchandania merged commit 407cd1d into master Jan 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants