KyberNetwork / smart-contracts

Main smart contracts for Kyber Network, including the main platform contract, reserve contracts etc.
https://kyber.network
MIT License
378 stars 340 forks source link

proxy - check sufficient token src amount before calling transfer #1057

Open ilanDoron opened 4 years ago

ilanDoron commented 4 years ago

Its a valid scenarios that use doesn't have sufficient source amount. happens when a few trades from same account are called and are being mined.

problem: with current code. transferFrom will fail and consume all gas. solution: check srcAmount before calling transfer