mradkov / aeternity-fungible-token

Aeternity blockchain Fungible Token reference implementation. The implementation is based on the proposed AEX9 standard for creating and usage of Sophia smart contract-based fungible tokens.
ISC License
6 stars 13 forks source link

check if current allowance implementation works around known erc20 frontrunning issues #10

Closed thepiwo closed 5 years ago

thepiwo commented 5 years ago

https://blog.smartdec.net/erc20-approve-issue-in-simple-words-a41aaf47bca6

thepiwo commented 5 years ago

should be solved by having change_allowance instead of overwriting it. Do you agree @mradkov, then feel free to close the issue?

mradkov commented 5 years ago

This should be solved using the current implementation in the change_allowance entrypoint we currently have.

https://github.com/mradkov/aeternity-fungible-token/blob/b45e3a80c8334147e0c68dffab8d9367b4b4b3bd/contracts/extensions/allowances.aes#L113-L118

We are changing the allowance by the value being passed as an argument from the user.

So in this case, we won't have this issue.