Skip to content

StakeManager owner can disallow Vaults from unstaking arbitraryly #145

Description

@3esmit

After the implementation of #139 the function that authorized codehashes now become generic, allowing inherited contracts to disallow previously allowed codehashes from interacting with the contract.

This new feature is actually useful in case the StakeManager owner wants to disable a problematic contract from interacting with it. However, if the StakeManager mistakenly (or malicously) disable StakeVaults from interacting with it, the StakeVaults would have their funds locked indefenetly.

Proposed fixes:

  • Override setTrustedCodehash(bytes32 _codehash, bool _trusted) to disallow using _trusted = false
  • Implement logic to allow leave function being called in StakeVault in case StakeManager no longer allows it from interacting.

Both approaches are easy to implement, but I believe that the most correct would be to allow StakeVault owner to call leave in case StakeManager owner disallowed the StakeVault class from interacting.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions