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

Unconventional log emittance confuses Etherscan #90

Open
code423n4 opened this issue Nov 23, 2021 · 0 comments
Open

Unconventional log emittance confuses Etherscan #90

code423n4 opened this issue Nov 23, 2021 · 0 comments
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Handle

kenzo

Vulnerability details

Unlock doesn't follow standard ERC721 log emittance.
This leads to wrong display values regarding to the lock NFT on Etherscan.

Impact

Etherscan does not show txs correctly, does not count token holders correctly in token page, does not count tokens correctly in user page.

Proof of Concept

A scenario:

  • Create a new lock
  • User 1 mints 1 token
  • User 1 uses shareKey and transfers some amount to User 2
    At this point Etherscan will show that 3 transfers have been made, under user 2's address page user 2 has 2 keys , and under lock's holders tab user 2 has 2 keys. All this is obviously wrong.
    This is probably because the transfer event is emitted twice during shareKey: here and here.

Additionally, if user 1 now calls Cancel And Refund, user 1 will still have a key under his tokens in his account, and the lock's token page will still list him as a holder, and the transaction won't get shown in Etherscan's token transfers (unlike contract transactions). Probably because it has not emitted any burn event. It just emits a CancelKey event.

Recommended Mitigation Steps

You can align the logs emittance to match regular ERC721 logs if you'd like Etherscan to show correct amounts. It might get confusing to keep it like this.

@code423n4 code423n4 added 0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working labels Nov 23, 2021
code423n4 added a commit that referenced this issue Nov 23, 2021
@julien51 julien51 added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

2 participants