CORIONplatform / solidity

GNU General Public License v3.0
12 stars 9 forks source link

exchangeLight.sol questions #157

Open gundas opened 7 years ago

gundas commented 7 years ago

Hello,

I've started looking at exchangeLight.sol. I see that in receiveToken(...) there is a check that the Ether balance of the receiver is less than 0.2 ETC. What is the point? If I really wanted, I could create automated scripts which would empty Ether from the account every time before transferring the COR to the exchange?

Another thing:

        uint256 _amount = amount;
        if ( _max > _amount ) {
            _amount = _max;
        }

will always make sure that _amount is more or equals to amount (and _max). Then this will result in negative value:

return ( true, safeSub(amount, _amount) );
iFA88 commented 7 years ago

Yeah you can write scripts for this to buy and buy it again, but that will consume so much gas that not worth it. We want this for covering gas consume and not for sell tokens.

In the if is a typo! This should be, if the amount is greater than the max, then should be max.

gundas commented 7 years ago

How much gas does the Token.transfer(...) consume? 1.000.000 gas could cost around 0.30 USD on ETC. 0.2 ETC = 3 USD.

I still think it will be viable for someone to use this light exchange to convert all of his COR to ETC.

iFA88 commented 7 years ago

COR transaction cost 150k - 400k GAS.

We will discus about that.