-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Closed
Milestone
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
approveorincreaseApprovalmethod and transaction is executed successfully - Alice sees that Bob is now allowed to transfer 100 of her tokens
- After some time, Alice uses
decreaseApprovalmethod 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
decreaseApprovalcall 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.
0xtruthfulmonkey
Metadata
Metadata
Assignees
Labels
No labels