bancorprotocol / contracts_eos

Bancor Protocol Contracts for EOS
Other
113 stars 45 forks source link

fixed fund issue #43

Closed ricktobacco closed 4 years ago

Velua commented 4 years ago

At https://github.com/bancorprotocol/contracts_eos/blob/cde5c2d482c956a223c6f514a89da9e1d4949969/contracts/eos/MultiConverter/MultiConverter.cpp#L270 We're going to run into bugs by dividing the variables smart_amount balance current_smart_supply by their precisions into a uint64_t as it will cut off numbers past the decimal point.

One possibility is multiplying them into integers instead but then smart_amount * balance could result in an overflow if the asset or their symbols precision is large enough.

I've added a recent commit to my PR #42 which calculates the percentage of smart tokens being asked for and then spends the reserve balance by that percentage.

yudilevi commented 4 years ago

fixed in https://github.com/bancorprotocol/contracts_eos/pull/44