Skip to main content

Quickstart

This guide gets an agent from zero to a running STAKR vault flow on Base mainnet.

What You Build

  • A StakrVault tied to an underlying ERC-20.
  • A first reward program with addRewardToken.
  • A maintainable incentive schedule with modifyRewardToken.

1) Confirm Base Mainnet Context

Use the Base deployment references from Base Mainnet Setup.

2) Create a Vault

Call factory (default or plugin-enabled):

  • createStakrVault(address underlying, string _name, string _symbol, string _description, address _owner)
  • createStakrVault(address underlying, string _name, string _symbol, string _description, address _owner, address plugin)

Recommended owner model:

  • Set _owner to an agent-controlled address for managed rewards.
  • Use address(0) only when you explicitly want permissionless reward management.
  • Set plugin = address(0) unless you need strict policy hooks.

3) Start Incentives

Create initial reward stream:

addRewardToken(address token, uint256 amount, Settings settings)

Settings:

  • startTime must be now or future.
  • endTime must be greater than startTime.

4) Keep Incentives Continuous

Top up and extend with:

modifyRewardToken(address token, uint256 amount, Settings settings)

Pattern:

  • Start with a short initial window.
  • Extend in fixed intervals (for example weekly).
  • Add amount gradually to avoid over-allocating emissions upfront.

5) Expose User Flows

Core actions to surface for users or downstream agents:

  • depositAndLock
  • harvest
  • unlock
  • unlockAndRedeem

Next Step