Skip to content

Impossible to re-register a previously whitelisted candidate #1605

Open

Description

@enlight

Once a whitelisted candidate is unwhitelisted & unregistered it's impossible to whitelist & re-register them again, the only way to get them back into the candidate list is to allow the DPOS contract to deduct the 1.25M LOOM registration requirement.

Reproduction steps:

  1. loom dpos3 whitelist-candidate A
  2. loom dpos3 register-candidate A
  3. Wait a couple of election cycles.
  4. loom dpos3 remove-whitelisted-candidate A
  5. loom dpos3 unregister-candidate A
  6. Wait a couple of election cycles.
  7. Now try re-registering A:
    • loom dpos3 whitelist-candidate A - nope, Cannot whitelist an already whitelisted candidate.
    • loom dpos3 change-whitelist-info A - no error, but doesn't actually do anything since this only works on registered candidates.
    • loom dpos3 register-candidate A - attempts to transfer 1.25M LOOM to DPOS contract since the whitelist amount is still zero.

Activity

  1. enlight commented on Jan 27, 2020

    @enlight
    ContributorAuthor

    We should fix a few things here:

    • DPOS.WhitelistCandidate should check that the candidate statistic has a zero WhitelistAmount & UpdateWhitelistAmount to determine if a candidate address is whitelisted rather than simply checking if the statistic is nil (because it won't be if the candidate is being re-whitelisted).
    • DPOS.RemoveWhitelistedCandidate should also check for a zero WhitelistAmount & UpdateWhitelistAmount to determine if a candidate address is whitelisted.
    • DPOS.ChangeWhitelistInfo should do the same thing WhitelistCandidate and RemoveWhitelistedCandidate do to check if a candidate address is whitelist or not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdpos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions