Contract API
ResonanceRouter
A buffer permanently bound to one Resonance; the Mine destination is configurable.
Loading…
Browse documentation
Contract API
A buffer permanently bound to one Resonance; the Mine destination is configurable.
Loading…
Contract API
A buffer permanently bound to one Resonance; the Mine destination is configurable.
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/ResonanceRouter.sol
Artifact: out/ResonanceRouter.sol/ResonanceRouter.json
Buffers USDG revenue and permissionlessly forwards each qualifying full balance into Resonance.
Requires live signal before routing; an active stream continues if signal later falls to zero. The balance must meet both Resonance's remaining scheduled revenue and REWARD_DURATION raw units to start a nonzero whole-unit rate. Smaller balances stay buffered. The full balance must also fit Resonance's lifetime funding cap, which never resets. Mine does not depend on successful routing, and routing pays no bounty. USDG must be standard and non-rebasing; SafeERC20 calls do not verify transfer balance deltas.
Public ABI: 3 functions, 2 events, 5 custom errors, 1 constructor, 0 receive entries, 0 fallback entries.
constructor(address,address)constructor(contract IERC20 usdg_, address resonance_);Creates an immutable USDG route into a single Resonance receiver. Both dependencies must be nonzero deployed contracts. Launchpad later binds this Router to Resonance during the same atomic launch transaction.
Parameters
resonance_: Resonance contract that receives and schedules routed USDG.usdg_: USDG token forwarded by the Router.resonance()function resonance() external view returns (address arg0);Immutable Resonance receiver that schedules and indexes routed USDG.
route()function route() external returns (uint256 amount);Routes the Router's complete USDG balance when live signal exists and the current threshold is met. Permissionless. Reverts when the balance is zero or total live signal is zero. The threshold is the greater of Resonance's remaining scheduled revenue and REWARD_DURATION raw units. A nonzero balance below this threshold returns zero and emits RevenueHeld. Qualifying funding is approved and transferred atomically; downstream failure preserves the buffer, including when the lifetime cap prevents further funding.
Returns
amount: Nominal raw USDG units routed under the standard-token assumption, or zero below the threshold.usdg()function usdg() external view returns (contract IERC20 arg0);Immutable USDG revenue token forwarded by this Router, accounted for in raw token units.
RevenueHeld(address,uint256,uint256)event RevenueHeld(address indexed caller, uint256 pending, uint256 minimum);Emitted when a nonzero USDG balance remains below Resonance's current routing threshold.
Parameters
caller: Account that attempted routing.minimum: Whole raw USDG units required to qualify at this timestamp.pending: Whole raw USDG units retained by the Router.RevenueRouted(address,uint256)event RevenueRouted(address indexed caller, uint256 amount);Emitted after the Router forwards its complete qualifying USDG balance to Resonance.
Parameters
amount: Nominal raw USDG units routed under the standard-token assumption.caller: Account that triggered routing.NoActiveSignal()error NoActiveSignal();No additional NatSpec notice is present in the compiled artifact.
NoRevenue()error NoRevenue();No additional NatSpec notice is present in the compiled artifact.
ReentrancyGuardReentrantCall()error ReentrancyGuardReentrantCall();No additional NatSpec notice is present in the compiled artifact.
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.