Contract Details
Tech Stack
Solidity ^0.8.24 OpenZeppelin v5 Foundry
Chains
Ethereum Arbitrum Base Optimism
Description
ERC-4626 vault where deposited yield pays for subscriptions while the principal remains intact. Users deposit once, yield streams to the service provider, and the user keeps their deposit. Inspired by Superfluid streaming but with vault-native yield.
Features
- ✓ ERC-4626 compliant vault with subscription logic
- ✓ Principal preservation — users only spend yield
- ✓ Configurable yield split (provider vs user surplus)
- ✓ Automatic subscription status based on yield accrual
- ✓ Grace period when yield falls below threshold
- ✓ Emergency withdrawal always available
- ✓ Multi-provider support (one vault, many subscriptions)
- ✓ Comprehensive Foundry tests with yield simulation
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @title Yield Subscription /// @notice ERC-4626 vault where yield pays subscriptions, principal stays. contract YieldSubscription { address public immutable owner; uint256 public constant VERSION = 1; event Initialized(address indexed deployer); constructor() { owner = msg.sender; emit Initialized(msg.sender); } // ... full implementation in purchased package }