Skip to content

feat: erc7540 vault deposit flow#440

Merged
bekauz merged 18 commits into
mainfrom
benskey/erc-7540-deposit
Oct 1, 2025
Merged

feat: erc7540 vault deposit flow#440
bekauz merged 18 commits into
mainfrom
benskey/erc-7540-deposit

Conversation

@bekauz

@bekauz bekauz commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Description

This is an intermediate pr for the updated two-way vault design that focuses on the deposit flow.
The follow-up pr will implement the withdraw flow as well as any leftover logic relating to owner operations, storage optimizations, proxy, etc.
Putting this out here now so that it's easier to review the core logic.

new additions/changes from the previous vaults:

  • notion of operator: vault now implements IERC7540Operator, which describes the logic for users to approve other addresses (operators) to issue requests on their behalf
  • pausing due to stale redemption rate/share price is now implicit: when calling deposit, onlyWhenSharePriceNotStale modifier will check for the last update timestamp and revert in case the price is stale (to be discussed)
    • this way if the vault stops accepting deposits due to stale price, the only thing needed to resume the normal operations will be to run the strategist and update the share price

@bekauz bekauz requested a review from keyleu September 30, 2025 18:37
Comment thread solidity/src/vaults/ValenceXCV.sol Outdated
Comment thread solidity/src/vaults/ValenceXCV.sol Outdated
}

constructor() {
// _disableInitializers();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should not be commented so that initialization is only through the proxy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, enabled proxy in tests as well

Comment thread solidity/src/vaults/ValenceXCV.sol Outdated
Comment thread solidity/src/vaults/ValenceXCV.sol Outdated
Comment on lines +136 to +145
/// Checks whether a given address is an approved operator for a controller
/// @param controller The address of the controller
/// @param operator The address of the operator to check
/// @return A boolean indicating whether the operator is approved
function isOperator(
address controller,
address operator
) external view returns (bool) {
return operators[controller][operator];
}

@keyleu keyleu Oct 1, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not used right? Also the mapping is already public so there is a getter method to get values from the mapping created automatically.

If you are using it as a helper method internally should be set as internal instead of external as we are just duplicating.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's just for erc7540 compliance, but i just realized i didn't add tests for it so doing that now

@bekauz bekauz marked this pull request as ready for review October 1, 2025 14:08
@bekauz bekauz merged commit 0c05fe5 into main Oct 1, 2025
37 of 38 checks passed
@bekauz bekauz deleted the benskey/erc-7540-deposit branch October 1, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants