Closed tanZiWen closed 6 years ago
private static ulong CurrentSwapToken(byte[] sender, ulong value, ulong swap_rate) { ulong token = value / neo_decimals * swap_rate; BigInteger total_supply = Storage.Get(Storage.CurrentContext, "totalSupply").AsBigInteger(); BigInteger balance_token = total_amount - total_supply; if (balance_token <= 0) { Refund(sender, value); return 0; } *else if (balance_token < (tokenfactor))* { Refund(sender, (token - balance_token) / swap_rate neo_decimals); token = (ulong)balance_token; } return token; }
hi, you can see the parameter basic_rate has been multiplied factor.
split some logic of mintToken function to three function, change now time equal previous block time add 15 seconds, remove some redundant code, fix some bug.