kleros / kleros-v2

Kleros version 2
https://v2.kleros.builders
MIT License
62 stars 44 forks source link

Delayed stakes: transfer PNK immediately without waiting for the next Staking phase #990

Closed jaybuidl closed 11 months ago

jaybuidl commented 1 year ago

Rationale

Currently, if a juror changes his stake outside the Staking phase, this change is queued and executed at the next Staking phase. The corresponding PNK amount doesn't leave the user's account until execution of the delayed stake. This has raised a UX issue: when a users checks his account after staking outside the Staking phase, his account does not yet reflect the new PNK balance.

Previous attempt

Previously, we wanted to provide more visibility about this to the user via the court frontend: #942 but it has been abandonned to avoid exposing more complexity for the user, and instead make smart contract changes.

This solution

In case of:

Jovian-Dsouza commented 1 year ago

Hello, @jaybuidl. I would appreciate your assistance in clarifying which function in the SortitionModule.sol file is invoked by the juror when modifying their stake outside the staking phase. I am seeking a better understanding of this particular functionality. Thank you.

jaybuidl commented 1 year ago

Hey @Jovian-Dsouza

which function in the SortitionModule.sol file is invoked by the juror when modifying their stake outside the staking phase.

https://github.com/kleros/kleros-v2/blob/c91699e07a3d05e42e04309d9812a582bcca7568/contracts/src/arbitration/SortitionModule.sol#L178