FreeosDAO / freeoscontracts

Freeos Smart Contract Code
0 stars 1 forks source link

Bad to good - nobody can unvest although could claim #24

Open shahidnz opened 3 years ago

shahidnz commented 3 years ago

AFter continuous bad times, when unvesting happened for 15% after that good time was set. Now the investing is failing for all the accounts: e,d,v

      "usercount": 10,
      "claimevents": 51,
      "unvestpercent": 12810,
      "unvestpercentiteration": 39,
      "iteration": 39,
      "failsafecounter": 0
    }
  ],
  "more": false,
  "next_key": ""

Please observe the unvestpercent parameter above.

07:04:26 28/05/2021 ~/eosio-wallet$ /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd freeosd statistics;/usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeoscfgd freeoscfgd exchangerate;proton get table freeosd $acc accounts;proton get table freeosd $acc vestaccounts;echo $acc;/usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeoscfgd freeoscfgd iterations --limit 2000
{
  "rows": [{
      "usercount": 10,
      "claimevents": 50,
      "unvestpercent": 15,
      "unvestpercentiteration": 38,
      "iteration": 38,
      "failsafecounter": 0
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "currentprice": "0.00810000000000000",
      "targetprice": "0.01670000000000000"
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "balance": "13047.0000 OPTION"
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "balance": "1978.0000 OPTION"
    }
  ],
  "more": false,
  "next_key": ""
}
voctoriavezs
{
  "rows": [{
      "iteration_number": 2,
      "start": "2021-05-28T03:29:11.000",
      "end": "2021-05-28T06:29:10.000",
      "claim_amount": 125,
      "tokens_required": 0
    },{
      "iteration_number": 23,
      "start": "2021-05-28T05:08:30.000",
      "end": "2021-05-28T05:13:27.000",
      "claim_amount": 675,
      "tokens_required": 4313
    },{
      "iteration_number": 24,
      "start": "2021-05-28T05:13:28.000",
      "end": "2021-05-28T05:19:08.000",
      "claim_amount": 675,
      "tokens_required": 4313
    },{
      "iteration_number": 38,
      "start": "2021-05-28T07:00:32.000",
      "end": "2021-05-28T10:00:31.000",
      "claim_amount": 700,
      "tokens_required": 4650
    }
  ],
  "more": false,
  "next_key": ""
}
07:04:38 28/05/2021 ~/eosio-wallet$ /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd freeosd statistics;/usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeoscfgd freeoscfgd exchangerate;proton get table freeosd $acc accounts;proton get table freeosd $acc vestaccounts;echo $acc;/usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeoscfgd freeoscfgd iterations --limit 2000
{
  "rows": [{
      "usercount": 10,
      "claimevents": 50,
      "unvestpercent": 15,
      "unvestpercentiteration": 38,
      "iteration": 38,
      "failsafecounter": 0
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "currentprice": "0.00810000000000000",
      "targetprice": "0.01670000000000000"
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "balance": "13047.0000 OPTION"
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "balance": "1978.0000 OPTION"
    }
  ],
  "more": false,
  "next_key": ""
}
voctoriavezs
{
  "rows": [{
      "iteration_number": 2,
      "start": "2021-05-28T03:29:11.000",
      "end": "2021-05-28T06:29:10.000",
      "claim_amount": 125,
      "tokens_required": 0
    },{
      "iteration_number": 23,
      "start": "2021-05-28T05:08:30.000",
      "end": "2021-05-28T05:13:27.000",
      "claim_amount": 675,
      "tokens_required": 4313
    },{
      "iteration_number": 24,
      "start": "2021-05-28T05:13:28.000",
      "end": "2021-05-28T05:19:08.000",
      "claim_amount": 675,
      "tokens_required": 4313
    },{
      "iteration_number": 38,
      "start": "2021-05-28T07:00:32.000",
      "end": "2021-05-28T10:00:31.000",
      "claim_amount": 700,
      "tokens_required": 4650
    }
  ],
  "more": false,
  "next_key": ""
}
07:10:15 28/05/2021 ~/eosio-wallet$ 
07:19:07 28/05/2021 ~/eosio-wallet$ 
07:19:07 28/05/2021 ~/eosio-wallet$ 
07:19:07 28/05/2021 ~/eosio-wallet$ /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd freeosd statistics;/usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeoscfgd freeoscfgd exchangerate;proton get table freeosd $acc accounts;proton get table freeosd $acc vestaccounts;echo $acc;/usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeoscfgd freeoscfgd iterations --limit 2000
{
  "rows": [{
      "usercount": 10,
      "claimevents": 50,
      "unvestpercent": 15,
      "unvestpercentiteration": 38,
      "iteration": 38,
      "failsafecounter": 0
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "currentprice": "0.20999999999999999",
      "targetprice": "0.01670000000000000"
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "balance": "13047.0000 OPTION"
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "balance": "1978.0000 OPTION"
    }
  ],
  "more": false,
  "next_key": ""
}
voctoriavezs
{
  "rows": [{
      "iteration_number": 2,
      "start": "2021-05-28T03:29:11.000",
      "end": "2021-05-28T06:29:10.000",
      "claim_amount": 125,
      "tokens_required": 0
    },{
      "iteration_number": 23,
      "start": "2021-05-28T05:08:30.000",
      "end": "2021-05-28T05:13:27.000",
      "claim_amount": 675,
      "tokens_required": 4313
    },{
      "iteration_number": 24,
      "start": "2021-05-28T05:13:28.000",
      "end": "2021-05-28T05:19:08.000",
      "claim_amount": 675,
      "tokens_required": 4313
    },{
      "iteration_number": 38,
      "start": "2021-05-28T07:00:32.000",
      "end": "2021-05-28T07:16:11.000",
      "claim_amount": 700,
      "tokens_required": 4650
    },{
      "iteration_number": 39,
      "start": "2021-05-28T07:16:12.000",
      "end": "2021-05-28T10:16:11.000",
      "claim_amount": 700,
      "tokens_required": 4650
    }
  ],
  "more": false,
  "next_key": ""
}
07:19:19 28/05/2021 ~/eosio-wallet$ 
07:21:55 28/05/2021 ~/eosio-wallet$ 
07:21:55 28/05/2021 ~/eosio-wallet$ /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd freeosd statistics;/usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeoscfgd freeoscfgd exchangerate;proton get table freeosd $acc accounts;proton get table freeosd $acc vestaccounts;echo $acc;/usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeoscfgd freeoscfgd iterations --limit 2000
{
  "rows": [{
      "usercount": 10,
      "claimevents": 51,
      "unvestpercent": 12810,
      "unvestpercentiteration": 39,
      "iteration": 39,
      "failsafecounter": 0
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "currentprice": "0.20999999999999999",
      "targetprice": "0.01670000000000000"
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "balance": "13747.0000 OPTION"
    }
  ],
  "more": false,
  "next_key": ""
}
{
  "rows": [{
      "balance": "1978.0000 OPTION"
    }
  ],
  "more": false,
  "next_key": ""
}
voctoriavezs
{
  "rows": [{
      "iteration_number": 2,
      "start": "2021-05-28T03:29:11.000",
      "end": "2021-05-28T06:29:10.000",
      "claim_amount": 125,
      "tokens_required": 0
    },{
      "iteration_number": 23,
      "start": "2021-05-28T05:08:30.000",
      "end": "2021-05-28T05:13:27.000",
      "claim_amount": 675,
      "tokens_required": 4313
    },{
      "iteration_number": 24,
      "start": "2021-05-28T05:13:28.000",
      "end": "2021-05-28T05:19:08.000",
      "claim_amount": 675,
      "tokens_required": 4313
    },{
      "iteration_number": 39,
      "start": "2021-05-28T07:16:12.000",
      "end": "2021-05-28T10:16:11.000",
      "claim_amount": 700,
      "tokens_required": 4650
    }
  ],
  "more": false,
  "next_key": ""
}
07:22:08 28/05/2021 ~/eosio-wallet$ 

Execution logs:

2021-05-28 19:18:46 - claim(): /usr/local/bin/cleos -u https://protontestnet.greymass.com push action freeosd claim '["dopdfodrdes"]' -p dopdfodrdes@active
claim(): status:-1: output: : Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: user is not eligible to claim in this iteration
pending console output: 
claim(): user_claim_simulation(): -1::Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: user is not eligible to claim in this iteration
pending console output: 
user_claim_simulation(): dopdfodrdes: ReClaimed:-1,,Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: user is not eligible to claim in this iteration
pending console output: 
2021-05-28 19:18:53 - get_options_vested(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd dopdfodrdes vestaccounts
get_options_vested(): user_claim_simulation(): Vested OPTION(s) =32.0000 OPTION
2021-05-28 19:18:56 - get_options_account(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd dopdfodrdes accounts
get_options_account(): user_claim_simulation(): Liquid OPTION(s) =193.0000 OPTION
user_claim_simulation(): dopdfodrdes: After claim: vested=32.0000 OPTION, liquid=193.0000 OPTION
2021-05-28 19:18:58 - unvest(): /usr/local/bin/cleos -u https://protontestnet.greymass.com push action freeosd unvest '["dopdfodrdes"]' -p dopdfodrdes
unvest(): status:-1: output: : Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: vested OPTIONs cannot be unvested in this claim period. Please try during next claim period.
pending console output: 
user_claim_simulation(): dopdfodrdes: Unvest:-1,,Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: vested OPTIONs cannot be unvested in this claim period. Please try during next claim period.
pending console output: 
2021-05-28 19:19:07 - unvest(): /usr/local/bin/cleos -u https://protontestnet.greymass.com push action freeosd unvest '["dopdfodrdes"]' -p dopdfodrdes
unvest(): status:-1: output: : Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: vested OPTIONs cannot be unvested in this claim period. Please try during next claim period.
pending console output: 
user_claim_simulation(): dopdfodrdes: Second Unvest:-1,,Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: vested OPTIONs cannot be unvested in this claim period. Please try during next claim period.
pending console output: 
2021-05-28 19:19:18 - get_options_vested(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd dopdfodrdes vestaccounts
get_options_vested(): user_claim_simulation(): Vested OPTION(s) =32.0000 OPTION
2021-05-28 19:19:20 - get_options_account(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd dopdfodrdes accounts
get_options_account(): user_claim_simulation(): Liquid OPTION(s) =193.0000 OPTION
user_claim_simulation(): dopdfodrdes: After unvest(), vested=32.0000 OPTION, liquid=193.0000 OPTION
2021-05-28 19:19:24 - unlock_wallet(): /usr/local/bin/cleos -u https://protontestnet.greymass.com wallet unlock -n proton_voctoriavezs --password *****
user_claim_simulation(): [Iter #39] Proceesing for user: voctoriavezs [v]
2021-05-28 19:19:24 - get_options_vested(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd voctoriavezs vestaccounts
get_options_vested(): user_claim_simulation(): Vested OPTION(s) =1978.0000 OPTION
2021-05-28 19:19:27 - get_options_account(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd voctoriavezs accounts
get_options_account(): user_claim_simulation(): Liquid OPTION(s) =13047.0000 OPTION
user_claim_simulation(): voctoriavezs: Before claim: vested=1978.0000 OPTION, liquid=13047.0000 OPTION
2021-05-28 19:19:29 - claim(): /usr/local/bin/cleos -u https://protontestnet.greymass.com push action freeosd claim '["voctoriavezs"]' -p voctoriavezs@active
claim(): status:-1: output: #       freeosd <= freeosd::claim               {"user":"voctoriavezs"}
#    freeoscfgd <= freeoscfgd::iterclear        {"iteration_number":38}
#       freeosd <= freeosd::mint                {"minter":"freeosd","to":"freeosd","quantity":"4200.0000 OPTION","memo":"claim by voctoriavezs"}
#       freeosd <= freeosd::allocate            {"from":"freeosd","to":"voctoriavezs","quantity":"700.0000 OPTION","memo":"claim by voctoriavezs"}
#       freeosd <= freeosd::allocate            {"from":"freeosd","to":"freeosdiv","quantity":"3500.0000 OPTION","memo":"claim by voctoriavezs"}
#  voctoriavezs <= freeosd::allocate            {"from":"freeosd","to":"voctoriavezs","quantity":"700.0000 OPTION","memo":"claim by voctoriavezs"}
#     freeosdiv <= freeosd::allocate            {"from":"freeosd","to":"freeosdiv","quantity":"3500.0000 OPTION","memo":"claim by voctoriavezs"}: executed transaction: b104f5a5b7b409a26ccd171a556dfc4c3002198ef27d50a79488ab9f3c6c3fa1  104 bytes  1048 us
warn  2021-05-28T07:19:39.738 thread-0  main.cpp:513                  print_result         ] 
warning: transaction executed locally, but may not be confirmed by the network yet
claim(): user_claim_simulation(): -1:#       freeosd <= freeosd::claim               {"user":"voctoriavezs"}
#    freeoscfgd <= freeoscfgd::iterclear        {"iteration_number":38}
#       freeosd <= freeosd::mint                {"minter":"freeosd","to":"freeosd","quantity":"4200.0000 OPTION","memo":"claim by voctoriavezs"}
#       freeosd <= freeosd::allocate            {"from":"freeosd","to":"voctoriavezs","quantity":"700.0000 OPTION","memo":"claim by voctoriavezs"}
#       freeosd <= freeosd::allocate            {"from":"freeosd","to":"freeosdiv","quantity":"3500.0000 OPTION","memo":"claim by voctoriavezs"}
#  voctoriavezs <= freeosd::allocate            {"from":"freeosd","to":"voctoriavezs","quantity":"700.0000 OPTION","memo":"claim by voctoriavezs"}
#     freeosdiv <= freeosd::allocate            {"from":"freeosd","to":"freeosdiv","quantity":"3500.0000 OPTION","memo":"claim by voctoriavezs"}:executed transaction: b104f5a5b7b409a26ccd171a556dfc4c3002198ef27d50a79488ab9f3c6c3fa1  104 bytes  1048 us
warn  2021-05-28T07:19:39.738 thread-0  main.cpp:513                  print_result         ] 
warning: transaction executed locally, but may not be confirmed by the network yet
user_claim_simulation(): voctoriavezs: Claimed:-1,#       freeosd <= freeosd::claim               {"user":"voctoriavezs"}
#    freeoscfgd <= freeoscfgd::iterclear        {"iteration_number":38}
#       freeosd <= freeosd::mint                {"minter":"freeosd","to":"freeosd","quantity":"4200.0000 OPTION","memo":"claim by voctoriavezs"}
#       freeosd <= freeosd::allocate            {"from":"freeosd","to":"voctoriavezs","quantity":"700.0000 OPTION","memo":"claim by voctoriavezs"}
#       freeosd <= freeosd::allocate            {"from":"freeosd","to":"freeosdiv","quantity":"3500.0000 OPTION","memo":"claim by voctoriavezs"}
#  voctoriavezs <= freeosd::allocate            {"from":"freeosd","to":"voctoriavezs","quantity":"700.0000 OPTION","memo":"claim by voctoriavezs"}
#     freeosdiv <= freeosd::allocate            {"from":"freeosd","to":"freeosdiv","quantity":"3500.0000 OPTION","memo":"claim by voctoriavezs"},executed transaction: b104f5a5b7b409a26ccd171a556dfc4c3002198ef27d50a79488ab9f3c6c3fa1  104 bytes  1048 us
warn  2021-05-28T07:19:39.738 thread-0  main.cpp:513                  print_result         ] 
warning: transaction executed locally, but may not be confirmed by the network yet
2021-05-28 19:19:39 - claim(): /usr/local/bin/cleos -u https://protontestnet.greymass.com push action freeosd claim '["voctoriavezs"]' -p voctoriavezs@active
claim(): status:-1: output: : Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: user is not eligible to claim in this iteration
pending console output: 
claim(): user_claim_simulation(): -1::Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: user is not eligible to claim in this iteration
pending console output: 
user_claim_simulation(): voctoriavezs: ReClaimed:-1,,Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: user is not eligible to claim in this iteration
pending console output: 
2021-05-28 19:19:55 - get_options_vested(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd voctoriavezs vestaccounts
get_options_vested(): user_claim_simulation(): Vested OPTION(s) =1978.0000 OPTION
2021-05-28 19:20:00 - get_options_account(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd voctoriavezs accounts
get_options_account(): user_claim_simulation(): Liquid OPTION(s) =13747.0000 OPTION
user_claim_simulation(): voctoriavezs: After claim: vested=1978.0000 OPTION, liquid=13747.0000 OPTION
2021-05-28 19:20:01 - unvest(): /usr/local/bin/cleos -u https://protontestnet.greymass.com push action freeosd unvest '["voctoriavezs"]' -p voctoriavezs
unvest(): status:-1: output: : Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: vested OPTIONs cannot be unvested in this claim period. Please try during next claim period.
pending console output: 
user_claim_simulation(): voctoriavezs: Unvest:-1,,Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: vested OPTIONs cannot be unvested in this claim period. Please try during next claim period.
pending console output: 
2021-05-28 19:20:16 - unvest(): /usr/local/bin/cleos -u https://protontestnet.greymass.com push action freeosd unvest '["voctoriavezs"]' -p voctoriavezs
unvest(): status:-1: output: : Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: vested OPTIONs cannot be unvested in this claim period. Please try during next claim period.
pending console output: 
user_claim_simulation(): voctoriavezs: Second Unvest:-1,,Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: vested OPTIONs cannot be unvested in this claim period. Please try during next claim period.
pending console output: 
2021-05-28 19:20:27 - get_options_vested(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd voctoriavezs vestaccounts
get_options_vested(): user_claim_simulation(): Vested OPTION(s) =1978.0000 OPTION
2021-05-28 19:20:29 - get_options_account(): /usr/local/bin/cleos -u https://protontestnet.greymass.com get table freeosd voctoriavezs accounts
get_options_account(): user_claim_simulation(): Liquid OPTION(s) =13747.0000 OPTION
user_claim_simulation(): voctoriavezs: After unvest(), vested=1978.0000 OPTION, liquid=13747.0000 OPTION
user_claim_simulation(): Iter[40] -(logically) Is GoodTime=False: Rate=0.00167,
shahidnz commented 3 years ago

This price change should trigger: 977.01, 0.003, 0.001, 0, 0.0009, 0.0081, 0.21, 0.00167

tommccann777 commented 3 years ago

Thanks for the evidence trail. Unvesting fails because it is impossible to convert 12810% of the user's vested OPTIONs. A fix has been identified and will be ready for retest shortly.