Skip to content

bug: cannot directly move active stake to another pool #189

@gabririgo

Description

@gabririgo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontractsupdates contracts folderstaleStale issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions