GaugeV2_NFT & GaugeFactoryV2_NFT
GaugeFactoryV2_NFT: 0x39A0bfF4Bd8de65e22b69f302d0805c60e7FD295
GaugeV2_NFT is the custom, net-new contract at the heart of BarkSwap's incentive design. It
takes custody of staked concentrated-liquidity position NFTs and streams BARK emissions to
their owners, delegating low-level reward accounting to the EternalFarming contract. One gauge is
deployed per incentivized pool by GaugeFactoryV2_NFT. Source:
bark_contracts/ve3/contracts/GaugeV2_NFT.sol.
Staking
| Function | Description |
|---|---|
deposit(uint256 tokenId) | Stake a position NFT. The gauge takes custody. Approve the gauge on the NPM first. |
withdraw(uint256 tokenId) | Unstake and return the NFT to the owner. |
getReward(address account) | Claim accrued BARK emissions for account. |
claimFees() → (uint256 claimed0, uint256 claimed1) | Claim the pool trading fees routed to the gauge. |
Resolving a gauge
A gauge is not called by address directly in most integrations — resolve it from the pool:
address gauge = IVoter(VOTER).gauges(pool);
Then deposit / withdraw / getReward against that address. See the
ve(3,3) staking guide.
Key events
Deposit(address indexed user, uint256 tokenId)Withdraw(address indexed user, uint256 tokenId)Harvest(address indexed user, uint256 reward)
While a position is staked the gauge owns the NFT. The original depositor is tracked internally
and is the only address allowed to withdraw it. This differs from staking-by-balance gauges used
for fungible LP tokens.