SparkStrategy
Inherits: ERC4626Strategy
Title: SparkStrategy
Author: Golem Foundation
Specialized yield-donating strategy for Spark Protocol ERC4626 vaults
Extends ERC4626Strategy with additional functionality to sweep airdropped tokens to the dragon router address. This is specifically designed for Spark Protocol which may airdrop governance tokens or other rewards to strategy addresses. ADDITIONAL FEATURES:
- Airdrop token sweep functionality for tokens sent to strategy
- Only allows sweeping tokens that are not the main asset or vault shares
- Swept tokens are sent to the dragon router (donation address)
- Callable by both keepers and management for operational flexibility
Notes:
-
security-contact: [email protected]
-
security: Only sweep tokens that are not critical to strategy operation
Quick Start - What Matters Most
Spark extends the generic ERC-4626 adapter and adds sweepAirdrop(token) for non-critical token balances. When a forwarder is the keeper, management still needs a direct operational path for keeper-gated sweep calls.
Functions
constructor
Initializes the Spark strategy
Inherits ERC4626Strategy's per-deposit approval flow, which clears target-vault allowance after each deploy.
constructor(
address _targetVault,
address _asset,
string memory _name,
string memory _symbol,
address _management,
address _keeper,
address _emergencyAdmin,
address _donationAddress,
bool _enableBurning,
address _tokenizedStrategyAddress
)
ERC4626Strategy(
_targetVault,
_asset,
_name,
_symbol,
_management,
_keeper,
_emergencyAdmin,
_donationAddress,
_enableBurning,
_tokenizedStrategyAddress
);
Parameters
| Name | Type | Description |
|---|---|---|
_targetVault | address | Address of the Spark ERC4626 vault this strategy deposits into |
_asset | address | Address of the underlying asset (must match target vault's asset) |
_name | string | Strategy display name (e.g., "Spark USDC Strategy") |
_symbol | string | Strategy token symbol (e.g., "osSparkUSDC") |
_management | address | Address with management permissions |
_keeper | address | Address authorized to call report() and tend() |
_emergencyAdmin | address | Address authorized for emergency shutdown |
_donationAddress | address | Address receiving minted profit shares |
_enableBurning | bool | True to enable loss protection via share burning |
_tokenizedStrategyAddress | address | Address of TokenizedStrategy implementation contract |
sweepAirdrop
Sweeps airdropped tokens to the dragon router address
Can only be called by keepers or management. Protects against sweeping critical tokens (asset and vault shares) that are needed for strategy operation.
Notes:
-
security: This function:
-
Only allows sweeping of non-critical tokens
-
Transfers entire balance to dragon router
-
Can be called by both keepers and management for operational flexibility
-
Emits event for transparency
-
operator-note: When
keeperis a YieldForwarder, this function cannot be invoked by the keeper role (YieldForwarder exposes no strategy-API proxy). In that configurationmanagementmust retain a separate operational channel to callsweepAirdrop. IfdragonRouteris also a YieldForwarder, follow the sweep withYieldForwarder.forwardToken(_token)so the swept balance is forwarded to the hardcoded receiver (see YieldForwarder NatSpec).
function sweepAirdrop(address _token) external onlyKeepers;
Parameters
| Name | Type | Description |
|---|---|---|
_token | address | Address of the token to sweep |
Events
TokenSwept
Emitted when tokens are swept from the strategy
event TokenSwept(address indexed token, uint256 amount, address indexed recipient);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | Address of the token that was swept |
amount | uint256 | Amount of tokens swept |
recipient | address | Address that received the swept tokens |