Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-impose locks on StakingVault #979

Open
wants to merge 1 commit into
base: feat/vaults
Choose a base branch
from

Conversation

failingtwice
Copy link
Contributor

Shifts the responsibility of locking amount on the vault from VaultHub to the vault owner (outside of reports).

Problem

Prevents the VaultHub from locking arbitrary amount on the vault

Solution

Locked amount is controlled by the owner. Now minting only checks (instead of locking) that there is a sufficient locked amount on the vault.

TODO: VaultHub can still lock an arbitrary amount in report. Think about sanity checks (max lock increase during report)

@failingtwice failingtwice added enhancement New feature or request vaults labels Mar 11, 2025
@failingtwice failingtwice requested a review from a team as a code owner March 11, 2025 12:26
@failingtwice failingtwice reopened this Mar 19, 2025
function lock(uint256 _locked) external {
if (msg.sender != address(VAULT_HUB)) revert NotAuthorized("lock", msg.sender);

function lock(uint256 _locked) external onlyOwner {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this configuration, it's possible to enforce _locked <= valuation, but it means that we should prefund 1 ETH in vault factory for deposit, which is fine tbh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vaults
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants