Skip to content

Commit f18d637

Browse files
committed
refactor: added to natspecs design decision
1 parent 3ea4308 commit f18d637

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/core/MultistrategyVault.sol

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ import { DebtManagementLib } from "src/core/libs/DebtManagementLib.sol";
3939
* and it is the responsibility of those that hold the corresponding roles to choose
4040
* and fund strategies that best fit their desired specifications.
4141
*
42+
* @custom:design-decisions
43+
* 1. Function Naming: External functions use snake_case (e.g., set_deposit_limit, process_report)
44+
* to maintain exact compatibility with the Vyper implementation, ensuring existing integrations
45+
* continue to work seamlessly.
46+
*
47+
* 2. Withdraw/Redeem Overloads: Due to Solidity contract size constraints, we implement only the
48+
* most essential function overloads:
49+
* - 3-parameter versions for ERC4626 compliance
50+
* - 5-parameter versions for advanced usage with maxLoss and custom strategies
51+
* The Vyper version includes additional 4-parameter overloads which were intentionally omitted
52+
* to keep the contract size manageable while maintaining full functionality.
53+
*
4254
* Those holding vault tokens are able to redeem the tokens for the corresponding
4355
* amount of underlying asset based on any reported profits or losses since their
4456
* initial deposit.

src/core/interfaces/IMultistrategyVault.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ pragma solidity ^0.8.25;
88
* @custom:ported-from https://github.com/yearn/yearn-vaults-v3/blob/master/contracts/interfaces/IVault.sol
99
* @notice Interface for MultistrategyVault ERC4626-compliant vault with multiple strategies
1010
* @dev Defines all external functions, events, errors, and types for the vault
11+
*
12+
* @custom:design-decisions
13+
* 1. Function Naming Convention: All external functions use snake_case to maintain 1:1 compatibility
14+
* with the original Vyper implementation. This ensures seamless integration for existing consumers.
15+
*
16+
* 2. Withdraw/Redeem Functions: The interface includes multiple overloads for withdraw/redeem operations:
17+
* - 3-parameter versions: Basic ERC4626 compliant functions with default parameters
18+
* - 5-parameter versions: Advanced functions with maxLoss and custom strategies parameters
19+
* Note: Additional overloads with loss parameters exist in Vyper but were omitted due to Solidity
20+
* contract size constraints. The 3 and 5 parameter versions provide equivalent functionality
21+
* while maintaining ERC4626 compliance.
1122
*/
1223
interface IMultistrategyVault {
1324
// ============================================

0 commit comments

Comments
 (0)