Back to Upgrades

January 2026 Vault Upgrade

January 19, 2026

Summary

Adds getImplementation() function to retrieve the proxy implementation address, improving transparency for vault contract upgrades and verification.

Code Changes

contracts/YoVault_V2.sol
+17
@@ -33,6 +33,14 @@
3333 using Address for address;
3434 using SafeERC20 for IERC20;
3535
36+ /// @dev A slot for storing an address value.
37+ struct AddressSlot {
38+ address value;
39+ }
40+
41+ /// @dev The slot for the implementation contract.
42+ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
43+
3644 /// @dev Assume requests are non-fungible and all have ID = 0, so we can differentiate between a request ID and the
3745 /// assets amount.
3846 uint256 internal constant REQUEST_ID = 0;
@@ -288,6 +296,15 @@
288296 return shares.mulDiv(pricePerShare, 10 ** decimals(), rounding);
289297 }
290298
299+ /// @notice Get the implementation contract address of a proxy.
300+ function getImplementation() external view returns (address) {
301+ AddressSlot storage r;
302+ assembly ("memory-safe") {
303+ r.slot := _IMPLEMENTATION_SLOT
304+ }
305+ return r.value;
306+ }
307+
291308 /// @dev Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.
292309 function previewDeposit(uint256 assets) public view virtual override returns (uint256) {
293310 uint256 fee = _feeOnTotal(assets, feeOnDeposit);