nTokenERC20Proxy emits events even when not success
The nTokenERC20Proxy contract emits Transfer and Approval events regardless of whether the underlying token operation succeeded. An attacker could exploit this to mislead off-chain systems that rely on these events into treating failed transfers or approvals as successful.
Submitted by cmichel
The nTokenERC20Proxy functions emit events all the time, even if the return value from the inner call returns false, indicating an unsuccessful action.
An off-chain script scanning for Transfer or Approval events can be tricked into believing that an unsuccessful transfer was indeed successful. This happens in the approve, transfer and transferFrom functions.
Recommend only emitting events on success.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An off-chain script scanning for Transfer or Approval events could be tricked into believing that an unsuccessful transfer was successful.
What the attacker needed
None
The fix
The contract should only emit events when the inner call returns true.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Smart contracts can emit 'events' to signal that something happened, like a transfer of tokens. Here, the contract announces success even when the actual transfer failed, which could confuse programs that watch these announcements.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.