-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The staking system should allow a staker to change staking pool for a given amount. Currently, this line reverts on one such transaction, as the pointers of both inputs are the same when trying to move stake from delegated status from one staking pool to another. The current flow requires a staker to move stake to undelegated, wait for the epoch to end, and stake again, thus missing 1 epoch worth of rewards.
The possible solution is to return instead of revert. The code should be changed from:
require(!_arePointersEqual(fromPtr, toPtr), "STAKING_POINTERS_EQUAL_ERROR");
to the following:
if (_arePointersEqual(fromPtr, toPtr)) return;
Notice: moving stake is possible using the batchExecute(...args) method and encoding 2 moveStake(from, to) calls, with a minor gas overhead.