-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Severity: Informational
Files Affected
solidity/src/FlowYieldVaultsRequests.sol
Description
createYieldVault() and depositToYieldVault() let users specify the deposited asset via tokenAddress, and this value is persisted in Request.tokenAddress.
In contrast, both exit entrypoints hardcode tokenAddress to NATIVE_FLOW when creating the request: withdrawFromYieldVault() and closeYieldVault() call _createRequest(..., NATIVE_FLOW, ...). As a result, from the EVM request data perspective, all withdrawals/closures are represented as "native FLOW exits", regardless of the original deposit asset.
This may be an intentional design decision (e.g., the Cadence side always settles exits in FlowToken / native FLOW, even if the position was funded via ERC20 on the EVM side). If so, this is fine, but the behavior is not enforced or made explicit at request creation, and it can be confusing for integrators/users who assume exit requests can specify the asset being returned.
Recommendation
Consider:
- Documenting explicitly that withdrawals/closures are always requested/settled as native FLOW (
NATIVE_FLOW) if that is the intended design - If exits are not intended to be native-only, adding a
tokenAddressparameter towithdrawFromYieldVault/closeYieldVault, or persisting an "exit asset" per yieldVaultId at registration
Parent Issue: #15