JoinSEEDS / seeds-smart-contracts

Smart contracts for SEEDS - A Regenerative Civilization Building Game.
https://docs.google.com/document/d/1C4w9Ol8VGabCIcQDVPDrwcTRoJXBqhrb7VjslwQbUGU/edit#heading=h.6f4sxygso816
MIT License
20 stars 6 forks source link

Vote Delegation Fails #413

Open n13 opened 2 years ago

n13 commented 2 years ago

Vote delegation failed

Reason: There's a reputation multiplier for delegated votes, it's set to 0.8. Unfortunately, that rounds to 0, and we're not allowed to add 0 reputation. So when we check whether or not a user has already voted, we try to enter 0.8 reputation to their rep, and this rounds to 0, and then there's a check that does not allow adding 0 to reputation (which is good - it showed us this error in this case).

Suggested fix: Add minimum 1 rep for adding into the votes table.

Error replayed:

 cleosm push action funds.seeds mimicvote '{
        "delegatee": "gradinagruiu",
        "delegator": "illumination",
        "scope": "milestone",
        "proposal_id": 244,
        "percentage_used": "0.49494949494949497",
        "option": "trust",
        "chunksize": 200
}' -p funds.seeds@active

Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: amount must be > 0