Skip to content

adding tests and then deploy - #2

Merged
Robotron2 merged 1 commit into
YieldSafe:mainfrom
akprinciple:feat/test_depoyment
Apr 30, 2026
Merged

adding tests and then deploy#2
Robotron2 merged 1 commit into
YieldSafe:mainfrom
akprinciple:feat/test_depoyment

Conversation

@akprinciple

Copy link
Copy Markdown
Contributor

Description

This PR introduces the foundational Foundry test suite for the YieldSaveVault smart contract. It ensures the core functionality of the Phase 1 MVP operates securely and accurately integrates with Aave V3.

Key Changes

  • Test Environment Setup: Configured YieldSaveVault.t.sol to use a Base Sepolia fork environment for accurate, deterministic Aave V3 integration testing.
  • Constructor Validations: Added checks to ensure the vault reverts if initialized with zero addresses or if the fee rate exceeds the hard-coded cap (1000 BPS / 10%).
  • Deposit Flow Tests: Verified share minting math, state updates (userShares, userDeposits), and zero-amount deposit reverts.
  • Withdrawal Flow Tests: Verified net payout calculations, fee deductions, insufficient share reverts, and zero-amount withdrawal reverts.
  • View & Preview Function Tests: Added comprehensive coverage for getVaultBalance, getUserBalance, previewWithdraw, and previewWithdrawFor (including edge cases for zero shares and non-existent users).

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Test addition / enhancements

@Robotron2
Robotron2 merged commit 6dbdbd6 into YieldSafe:main Apr 30, 2026
2 checks passed
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