FreeosDAO / freeoscontracts

Freeos Smart Contract Code
0 stars 1 forks source link

Rounding in bad times for liquid and vested tokens in claim is swapped - vested should be rounded first #25

Open shahidnz opened 3 years ago

shahidnz commented 3 years ago

"currentprice": "0.00810000000000000", "targetprice": "0.01670000000000000" v=0.00810000000000000

x=v/t;x;1-x 0.48502994011976047 0.5149700598802396 0.5149700598802396 * 700 360.4790419161677 0.48502994011976047 700 339.52095808383234 1968 + 361 2329

So vested value must be 2329. But it is voctoriavezs: After claim: vested=2328.0000 OPTION, liquid=12697.0000 OPTION Same issue: rounding is not happening on vested, but on liquid Unvest also allowed, as counter = 0 Initial: vested=2328.0000 OPTION, liquid=12697.0000 OPTION

Calling Unvest: After unvest(), vested=1978.0000 OPTION, liquid=13047.0000 OPTION

2328.85 1978.8 2328*.15 349.2

2328 - 1978 = 350 so rounding is happening on liquid while doc says it should happen on vested