Contract API
BribeRouter
Buffers a strategy’s allocation reward share until it can stream.
Loading…
Browse documentation
Contract API
Buffers a strategy’s allocation reward share until it can stream.
Loading…
Contract API
Buffers a strategy’s allocation reward share until it can stream.
This reference is generated from the repository contracts. Check the deployed version before using a signature or constant. The audit covers a specific source revision.
Source: src/core/BribeRouter.sol
Artifact: out/BribeRouter.sol/BribeRouter.json
Buffers one Auction's payment-token Bribe share until its reward stream can accept it.
The Auction performs the Fund/Bribe split and transfers only the Bribe share here. Any account may attempt to route the complete buffer, but the balance remains in place until it can sustain a nonzero seven-day rate and, during an active stream, matches or exceeds the reward still scheduled. Direct token donations join the next successful route. No signal-weight check applies: a stream can start with zero signal. The payment token and Bribe are immutable; transfers assume a standard, non-rebasing token.
Public ABI: 3 functions, 1 event, 2 custom errors, 1 constructor, 0 receive entries, 0 fallback entries.
constructor(address,address)constructor(contract IBribe bribe_, contract IERC20 paymentToken_);Creates the fixed route between one payment token and its paired Bribe. Requires nonzero, deployed dependencies. Does not check whether the Bribe has registered the payment token.
Parameters
bribe_: Bribe paired with the Auction and authorized to pull routed tokens.paymentToken_: Auction payment token held by this Router before distribution.bribe()function bribe() external view returns (contract IBribe arg0);Immutable Bribe that pulls and streams the buffered payment token.
paymentToken()function paymentToken() external view returns (contract IERC20 arg0);Immutable Auction payment token buffered for automatic Bribe rewards.
route()function route() external returns (uint256 amount);Routes the complete payment-token balance into the paired Bribe when funding qualifies. Permissionless. Returns zero without changing state when the balance is zero, below REWARD_DURATION raw units, or below the Bribe's remaining scheduled reward. Otherwise, approves the exact balance for the Bribe to pull and restart its stream. A failure preserves the buffer. The full balance must fit the Bribe's remaining lifetime capacity; the cap never resets and exhaustion permanently prevents new funding for that token. Routing failure does not revert previously completed Auction purchases.
Returns
amount: Raw payment-token units routed, or zero when the buffer must continue accumulating.RewardRouted(address,address,uint256)event RewardRouted(address indexed bribe, address indexed rewardToken, uint256 amount);Emitted after the Router's complete buffered balance is accepted by the paired Bribe.
Parameters
amount: Complete pre-route Router balance transferred, in raw token units.bribe: Immutable Bribe that received and scheduled the reward.rewardToken: Immutable payment token transferred to the Bribe.SafeERC20FailedOperation(address)error SafeERC20FailedOperation(address token);No additional NatSpec notice is present in the compiled artifact.
ZeroAddress()error ZeroAddress();No additional NatSpec notice is present in the compiled artifact.