Skip to main content

SparkStrategy

Git Source

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

NameTypeDescription
_targetVaultaddressAddress of the Spark ERC4626 vault this strategy deposits into
_assetaddressAddress of the underlying asset (must match target vault's asset)
_namestringStrategy display name (e.g., "Spark USDC Strategy")
_symbolstringStrategy token symbol (e.g., "osSparkUSDC")
_managementaddressAddress with management permissions
_keeperaddressAddress authorized to call report() and tend()
_emergencyAdminaddressAddress authorized for emergency shutdown
_donationAddressaddressAddress receiving minted profit shares
_enableBurningboolTrue to enable loss protection via share burning
_tokenizedStrategyAddressaddressAddress 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 keeper is a YieldForwarder, this function cannot be invoked by the keeper role (YieldForwarder exposes no strategy-API proxy). In that configuration management must retain a separate operational channel to call sweepAirdrop. If dragonRouter is also a YieldForwarder, follow the sweep with YieldForwarder.forwardToken(_token) so the swept balance is forwarded to the hardcoded receiver (see YieldForwarder NatSpec).

function sweepAirdrop(address _token) external onlyKeepers;

Parameters

NameTypeDescription
_tokenaddressAddress 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

NameTypeDescription
tokenaddressAddress of the token that was swept
amountuint256Amount of tokens swept
recipientaddressAddress that received the swept tokens