telos-decide icon indicating copy to clipboard operation
telos-decide copied to clipboard

Claiming worker rewards does not work as expected

Open villesundell opened this issue 6 years ago • 1 comments

Describe the bug Currently anyone can help anyone by claiming their worker rewards. This is a good feature, and is a good smart contract design convention (do not place unneeded restrains).

However, if the account is a new one, claiming would not be successful, since it tries to use claimant's RAM, which is not available if the action caller is not claimant.

Expected behavior Either:

  1. Only claimant can claim their rewards Or:
  2. Error should be raised Or:
  3. RAM ownership should be re-thought

Additional context Problematic line is this: https://github.com/telosnetwork/telos-decide/blob/b17261e830d2549dfc54e0f9a0e5eb357e5c8a95/contracts/decide/src/worker.cpp#L152

villesundell avatar Feb 16 '20 17:02 villesundell

Of these options, #2, Raising an error message for not enough RAM is probably the easiest and a sufficient fix. There are times when an account would want to claim for another.

DouglasHorn avatar Aug 17 '21 03:08 DouglasHorn