function approve(address _spender, uint256 _value) returns (bool success)
This is the ordinary
approval method. It's easy to figure out that we have a problem of front-running.
Alicegives allowance of 100 tokens to Bob.
Alicerethinks her choice, changing it to 50. When this happens, Bob watches the chain, transfers his 100 tokens immediatelly with a higher gas price.
As a result, Bob gains 150 tokens overal instead of 50.
How can we avoid the above situation ? can
commit-reveal help ? if yes,