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

refactor: events must emit addresses involved in the operation for better dApp indexing #186 #187

Closed
wants to merge 2 commits into from

Conversation

blackbeard002
Copy link
Contributor

Closes #186

Copy link
Contributor

@0xneves 0xneves left a comment

Choose a reason for hiding this comment

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

Finishing the review of the HotTask to provide adequate feedback!
You didn't win this round @blackbeard002 🏴‍☠️ so hoist the sails and meet you in the next round!

@@ -36,7 +36,9 @@ contract Swaplace is SwapFactory, ISwaplace, IERC165 {

_swaps[swapId] = swap;

emit SwapCreated(swapId);
(address allowed,) = parseData(swap.config);
Copy link
Contributor

Choose a reason for hiding this comment

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

There is supposed to be a spacing after the comma like "(address allowed, )"

emit SwapCreated(swapId);
(address allowed,) = parseData(swap.config);

emit SwapCreated(swapId, swap.owner, allowed);
Copy link
Contributor

Choose a reason for hiding this comment

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

We use msg.sender instead of the swap.owner, because the gas consumption will be lower.

@@ -107,7 +109,7 @@ contract Swaplace is SwapFactory, ISwaplace, IERC165 {

_swaps[swapId].config = 0;

emit SwapCanceled(swapId);
emit SwapCanceled(swapId, _swaps[swapId].owner);
Copy link
Contributor

Choose a reason for hiding this comment

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

The msg.sender is the one that canceled the swap, so we should use msg.sender instead of reading from memory the swap owner.

Copy link
Contributor

Choose a reason for hiding this comment

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

The prettierrc was not used in this file, making long lines instead of breaking them at 80 width

Copy link
Contributor

Choose a reason for hiding this comment

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

The acceptee variable was not renamed into allowed as specified in the issue

@0xneves 0xneves closed this Feb 2, 2024
@blackbeard002 blackbeard002 deleted the event branch May 19, 2024 12:23
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.

refactor: events must emit addresses involved in the operation for better dApp indexing
2 participants