Skip to content

Method decreaseApproval in unsafe #437

Closed
@3sGgpQ8H

Description

@3sGgpQ8H

Method decreaseApproval in StandardToken.sol is unsafe. Here is the scenario.

  1. Bob is allowed to transfer zero Alice's tokens
  2. Alice allows Bob to transfer 100 of here tokens via approve or increaseApproval method and transaction is executed successfully
  3. Alice sees that Bob is now allowed to transfer 100 of her tokens
  4. After some time, Alice uses decreaseApproval method to decrease by 100 the number of her tokens Bob is allowed to transfer and transaction is executed successfully and proper Approval event was logged
  5. Alice sees that Bob is allowed to transfer 0 of her tokens
  6. Now Alice may think that once decreaseApproval call was executed successfully, then Bob didn't manage to transfer any of her tokens before the allowance was decreased, but this assumption is wrong.
    Actually, Bob may or may not had transferred Alice's tokens before allowance was decreased, and Alice has no easy way to know for sure whether Bob transferred her tokens or not

Method decreaseApproval should fail in case current allowance is lower than requested decrease.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions