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.
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:
leavefunction 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
leavein case StakeManager owner disallowed the StakeVault class from interacting.