Closed
Description
Method decreaseApproval
in StandardToken.sol
is unsafe. Here is the scenario.
- Bob is allowed to transfer zero Alice's tokens
- Alice allows Bob to transfer 100 of here tokens via
approve
orincreaseApproval
method and transaction is executed successfully - Alice sees that Bob is now allowed to transfer 100 of her tokens
- 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 - Alice sees that Bob is allowed to transfer 0 of her tokens
- 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
Labels
No labels