Contract API
Resonance
Strategy registry and the seven-day USDG stream.
Loading…
Browse documentation
Contract API
Strategy registry and the seven-day USDG stream.
Loading…
Contract API
Strategy registry and the seven-day USDG 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/Resonance.sol
Artifact: out/Resonance.sol/Resonance.json
Streams USDG revenue to live Strategies in proportion to their SignalCoin weights.
A Strategy is an Auction, BribeRouter, and Bribe, identified by its Auction address. Uses a Synthetix-style seven-day stream and a global revenue-per-signal index. Only SignalCoin can change weights; each paired Bribe records its Strategy's account and total weights. Changes checkpoint prior weights. Killing a Strategy preserves its accrued claim, removes its weight from the active total, and stops future revenue accrual while allowing existing signal to exit. The index uses 1e36 precision for six-decimal USDG and eighteen-decimal SignalCoin, but all accounting uses raw units and does not enforce token decimals. USDG must be a standard, non-rebasing ERC-20; SafeERC20 does not verify balance deltas. Saved rate-division remainders join the next qualifying stream. Index and Strategy rounding leaves unallocated USDG surplus.
Public ABI: 45 functions, 12 events, 22 custom errors, 1 constructor, 0 receive entries, 0 fallback entries.
constructor(address,address,address,address,address,address,address)constructor(contract IERC20 signalCoin_, contract IERC20 usdg_, address fund_, contract BribeFactory bribeFactory_, contract AuctionFactory auctionFactory_, address initialOwner, address initialSignalManager);Creates the allocator with immutable token, Fund, factory, and initial governance dependencies. Every token, Fund, and factory dependency must be nonzero and have deployed code. OpenZeppelin Ownable rejects a zero initialOwner; later owner transfers take effect immediately. initialSignalManager may be any wallet or zero. The shared factories derive authority from this calling Resonance and retain no binding state; SignalCoin and ResonanceRouter are bound separately during canonical Launchpad assembly.
Parameters
auctionFactory_: Shared stateless factory for this Resonance's Auction and BribeRouter pairs.bribeFactory_: Shared stateless factory that deploys each Strategy's caller-controlled Bribe.fund_: Treasury receiving the non-Bribe share of Auction payments.initialOwner: Deployment-time governance address for the bounded administration surface.initialSignalManager: First approved signal-adding account, or zero to begin with community signaling.signalCoin_: Non-transferable signal receipt and sole signal coordinator.usdg_: ERC-20 revenue token; canonical deployments use USDG with six decimals, which is not enforced.BPS()function BPS() external view returns (uint256 arg0);Basis-point denominator used to split each Auction payment between Fund and its paired BribeRouter.
DEFAULT_BRIBE_BPS()function DEFAULT_BRIBE_BPS() external view returns (uint256 arg0);Initial community-mode Auction-payment share assigned to the paired BribeRouter, in basis points.
MAX_BRIBE_BPS()function MAX_BRIBE_BPS() external view returns (uint256 arg0);Maximum prospective Auction-payment share assignable to a paired BribeRouter, in basis points.
MAX_LIFETIME_REVENUE_AMOUNT()function MAX_LIFETIME_REVENUE_AMOUNT() external view returns (uint256 arg0);Maximum cumulative raw USDG units accepted over this contract's lifetime.
REWARD_DURATION()function REWARD_DURATION() external view returns (uint256 arg0);Fixed duration of every USDG revenue stream, in seconds.
REWARD_PRECISION()function REWARD_PRECISION() external view returns (uint256 arg0);Fixed-point precision used to allocate raw USDG units across raw SignalCoin units.
addBribeRewardToken(address,address)function addBribeRewardToken(address strategy, address rewardToken) external;Registers an additional independently funded reward token on a registered Strategy's Bribe. Callable only by the current owner. The Strategy may be live or killed. The reward token must be a deployed contract and cannot be SignalCoin. The paired Bribe enforces its append-only sixteen-token registry, duplicate rejection, and later notification rules.
Parameters
rewardToken: ERC-20 token to add to the paired Bribe's reward registry.strategy: Registered Strategy whose paired Bribe receives the token.addSignalFor(address,address,uint256)function addSignalFor(address account, address strategy, uint256 amount) external;Adds signal weight for an account to a live Strategy. Callable only by SignalCoin. Checkpoints prior Strategy weight before increasing the active total and paired-Bribe balances. Managed signaling requires account to be an approved manager.
Parameters
account: Nonzero SignalCoin holder whose paired-Bribe weight increases.amount: Nonzero raw SignalCoin units to add.strategy: Live registered Strategy receiving the weight.addStrategy(address,(uint256,uint256,uint256,uint256))function addStrategy(contract IERC20 paymentToken, struct Auction.Config config) external returns (address strategyAddress, address bribeAddress, address bribeRouterAddress);Creates an Auction, Bribe, and BribeRouter and registers them as one Strategy. Callable only by the current owner. paymentToken must be a deployed ERC-20-like contract and cannot be SignalCoin. The payment token becomes the paired Bribe's first reward token. The new Strategy starts at the stored global revenue index with zero signal weight, so it cannot claim historical revenue. A factory or constructor failure reverts the complete graph creation.
Parameters
config: Immutable Dutch-auction configuration for the new Auction.paymentToken: ERC-20 asset buyers must pay to fill the new Auction; also the Strategy's automatic Bribe reward token.Returns
bribeAddress: Newly deployed Bribe and canonical signal-weight ledger for the Strategy.bribeRouterAddress: Newly deployed buffer for the Strategy's automatic Bribe share.strategyAddress: Newly deployed Auction identifying the registered Strategy.auctionFactory()function auctionFactory() external view returns (contract AuctionFactory arg0);Immutable shared stateless factory used to deploy Auctions and BribeRouters for this Resonance.
bribeBps()function bribeBps() external view returns (uint256 arg0);Current prospective share of each Auction payment sent to its BribeRouter, in basis points.
bribeFactory()function bribeFactory() external view returns (contract BribeFactory arg0);Immutable shared stateless factory used to deploy one caller-controlled Bribe per Strategy.
bribeFor(address)function bribeFor(address strategy) external view returns (address bribe);Canonical Bribe virtual-weight and reward contract paired with each registered Strategy.
bribeRouterFor(address)function bribeRouterFor(address strategy) external view returns (address router);Bribe-only payment-token buffer paired with each registered Strategy.
claimBribeRewards(address[])function claimBribeRewards(address[] strategies) external;Claims every registered reward token from each selected Strategy's canonical Bribe for the caller. The beneficiary is always msg.sender; no caller may advance another account's reward checkpoint. Each Strategy must be registered but may be live or killed. Duplicate Strategies execute sequentially. The outer array is caller-controlled and each Bribe loops over at most sixteen reward tokens, so callers must split a batch that would exceed available gas. Any failed reward-token transfer reverts the complete batch; direct scalar Bribe.claimReward remains the broken-token and bounded-gas fallback.
Parameters
strategies: Registered Strategies whose canonical Bribes should pay the caller.communitySignaling()function communitySignaling() external view returns (bool arg0);Whether every Coin holder may add signal; once opened this cannot be disabled.
distributeRevenue(address)function distributeRevenue(address strategy) external returns (uint256 amount);Checkpoints a registered Strategy's accrued USDG and transfers it to that Strategy's Auction. Permissionless, including for killed Strategies. Index conversion rounds down to whole raw USDG units. A failed transfer reverts the checkpoint and claim reset.
Parameters
strategy: Auction address identifying the registered Strategy and receiving its USDG.Returns
amount: Whole raw USDG units transferred, or zero when no revenue is accrued.earnedRevenue(address)function earnedRevenue(address strategy) external view returns (uint256 revenue);Returns one Strategy's stored plus currently elapsed USDG entitlement. Only live Strategy weights receive elapsed allocation. A killed Strategy retains its checkpointed revenue. Conversion from the scaled index rounds down to whole raw USDG units.
Parameters
strategy: Strategy whose entitlement is queried.Returns
revenue: Whole raw USDG units currently transferable to the Strategy's Auction.forceRemoveSignal(address,address)function forceRemoveSignal(address account, address strategy) external;Clears a revoked manager's entire position in one Strategy and returns Coin to that account. Only the owner may force exits, and only in managed mode after revoking the account. Existing rewards remain claimable. SignalCoin guards the withdrawal and calls the guarded removeSignalFor hook; this forwarding function must allow that callback. No partial amount or alternate recipient is accepted.
Parameters
account: Revoked manager whose full Strategy position is withdrawn.strategy: Registered live or killed Strategy from which the account's signal is cleared.fund()function fund() external view returns (address arg0);Immutable treasury that receives the non-Bribe share of every Auction payment.
isSignalManager(address)function isSignalManager(address account) external view returns (bool enabled);Accounts approved to add their own signal while community signaling is closed.
isStrategyLive(address)function isStrategyLive(address strategy) external view returns (bool live);Whether a registered Strategy can receive new signal and accrue future Resonance revenue.
isStrategyRegistered(address)function isStrategyRegistered(address strategy) external view returns (bool registered);Returns whether this Resonance permanently registered a Strategy identified by its Auction address. Registration is derived from the append-only canonical Bribe mapping instead of duplicated storage.
Parameters
strategy: Strategy address to query.Returns
registered: True when strategy has a canonical Bribe.killStrategy(address)function killStrategy(address strategy) external;Disables new signal and future revenue for a registered Strategy permanently. Callable only by the current owner. Checkpoints the Strategy under its full prior weight, preserves that accrued USDG for later permissionless distribution, marks the Strategy dead, and removes its complete paired-Bribe weight from the active total. Existing signal and Bribe rewards remain recorded and removable. The final live Strategy cannot be killed.
Parameters
strategy: Live registered Strategy to kill irreversibly.lifetimeRevenueNotified()function lifetimeRevenueNotified() external view returns (uint256 arg0);Cumulative raw USDG units accepted through revenue notifications.
liveStrategyCount()function liveStrategyCount() external view returns (uint256 arg0);Number of registered Strategies that remain eligible for new signal and future Resonance revenue.
notifyRevenue(uint256)function notifyRevenue(uint256 amount) external;Pulls newly routed USDG and restarts the global seven-day revenue stream. Callable only by ResonanceRouter. Fresh funding must meet remainingRevenue() and fit the lifetime cap; these checks precede checkpointing and transfer. The new budget combines fresh funding, remaining scheduled revenue, and the saved rate-division remainder. Division by REWARD_DURATION sets the whole-unit rate and saves a new remainder for the next qualifying stream's Strategy weights. The remainder stays pending if no further funding qualifies. Only fresh funding increases the lifetime counter. ResonanceRouter also requires at least REWARD_DURATION fresh raw units to keep the rate nonzero. Transfers use nominal amounts without balance-delta checks under the standard-token assumption.
Parameters
amount: Nonzero fresh raw USDG to pull, excluding remaining scheduled revenue and the saved remainder.openToCommunity()function openToCommunity() external;Permanently opens signal additions to every Coin holder. Existing positions and the configured Bribe share are unchanged. Stored memberships become irrelevant.
owner()function owner() external view returns (address arg0);Returns the address of the current owner.
remainingRevenue()function remainingRevenue() external view returns (uint256 amount);Returns the USDG still scheduled at the active stream's stored whole-unit rate. Returns zero at or after periodFinish. This excludes already elapsed Strategy entitlements, the saved rate-division remainder, zero-weight emissions, and direct token donations.
Returns
amount: Whole raw USDG units scheduled between the current timestamp and periodFinish.removeSignalFor(address,address,uint256)function removeSignalFor(address account, address strategy, uint256 amount) external;Removes signal weight for an account from a registered Strategy. Callable only by SignalCoin. Checkpoints the Strategy's prior weight before decreasing paired-Bribe balances. Killed Strategies still allow exits; their weight was already removed from totalSignalWeight at kill time and is not subtracted again.
Parameters
account: Nonzero SignalCoin holder whose paired-Bribe weight decreases.amount: Nonzero raw SignalCoin units to remove, no greater than the account's paired-Bribe balance.strategy: Registered live or killed Strategy losing the weight.renounceOwnership()function renounceOwnership() external;Leaves the contract without owner. It will not be possible to call onlyOwner functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.
resonanceRouter()function resonanceRouter() external view returns (address arg0);Permanently bound ResonanceRouter authorized to fund revenue; zero before binding.
revenueData()function revenueData() external view returns (uint256 periodFinish, uint256 revenueRate, uint256 lastUpdateTime, uint256 revenuePerSignalStored);Current global stream timestamps, whole-unit rate, and checkpointed revenue-per-signal index.
revenuePerSignal()function revenuePerSignal() external view returns (uint256 accumulatedRevenue);Returns the current cumulative USDG allocation per raw unit of active SignalCoin weight. Includes elapsed time through the earlier of the current timestamp and periodFinish. If active weight is zero, the index does not increase and elapsed revenue becomes unallocated surplus. Index increments round down at REWARD_PRECISION.
Returns
accumulatedRevenue: Cumulative raw USDG units multiplied by REWARD_PRECISION per raw signal unit.setBribeBps(uint256)function setBribeBps(uint256 newBribeBps) external;Sets the prospective paired-Bribe share for every later Auction purchase. Callable only by the current owner. Both signaling modes accept zero through MAX_BRIBE_BPS. Each Auction snapshots this value before token interaction, so earlier and in-flight purchases and active Bribe reward streams are not repriced.
Parameters
newBribeBps: New global share in basis points, independently of signaling permissions.setResonanceRouter(address)function setResonanceRouter(address resonanceRouter_) external;Binds a permanent ResonanceRouter for USDG revenue notifications. Callable only by the current owner and only before a Router is bound. The candidate must be a nonzero deployed contract. The binding cannot be replaced or cleared.
Parameters
resonanceRouter_: Router contract to bind.setSignalManager(address,bool)function setSignalManager(address manager, bool enabled) external;Adds or removes an account's permission to make future managed signal additions. Only the owner may change membership, and only while community signaling is closed. Existing positions, rewards and exits remain with their holders. Empty membership stays managed.
Parameters
enabled: Whether to approve this account.manager: Nonzero account whose membership is set.signalCoin()function signalCoin() external view returns (contract IERC20 arg0);Immutable non-transferable receipt and sole coordinator allowed to change Strategy signal weights.
strategyCount()function strategyCount() external view returns (uint256 arg0);Monotonic number of Strategies ever registered by this Resonance, including later-killed Strategies.
strategyRevenue(address)function strategyRevenue(address strategy) external view returns (uint256 revenue);Stored whole raw USDG units accrued and not yet transferred to each registered Strategy.
strategyRevenuePerSignalPaid(address)function strategyRevenuePerSignalPaid(address strategy) external view returns (uint256 paid);Per-Strategy checkpoint of the scaled global revenue-per-signal index already incorporated into accrual.
totalSignalWeight()function totalSignalWeight() external view returns (uint256 arg0);Total raw SignalCoin weight across live Strategies currently eligible for Resonance revenue.
transferOwnership(address)function transferOwnership(address newOwner) external;Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.
usdg()function usdg() external view returns (contract IERC20 arg0);Immutable USDG revenue token streamed to Strategies and accounted for only in raw token units.
BribeBpsSet(uint256,uint256)event BribeBpsSet(uint256 previousBribeBps, uint256 newBribeBps);Emitted when governance changes the prospective automatic-Bribe share.
Parameters
newBribeBps: New global payment share in basis points, applied only to later purchases.previousBribeBps: Prior global payment share in basis points.BribeRewardTokenAdded(address,address,address)event BribeRewardTokenAdded(address indexed strategy, address indexed bribe, address indexed rewardToken);Emitted when governance registers another independently fundable reward token on a paired Bribe.
Parameters
bribe: Paired Bribe on which the token was registered.rewardToken: ERC-20 reward token added to the Bribe's append-only registry.strategy: Registered Strategy whose Bribe received the token.CommunitySignalOpened()event CommunitySignalOpened();Emitted when managed signaling is irreversibly opened to every Coin holder.
OwnershipTransferred(address,address)event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);No additional NatSpec notice is present in the compiled artifact.
ResonanceRouterSet(address)event ResonanceRouterSet(address indexed resonanceRouter);Emitted when the sole ResonanceRouter is permanently bound.
Parameters
resonanceRouter: Router that was bound.RevenueDistributed(address,address,uint256)event RevenueDistributed(address indexed caller, address indexed strategy, uint256 amount);Emitted when nonzero accrued USDG is transferred to its entitled Strategy.
Parameters
amount: Whole raw USDG units transferred.caller: Account that permissionlessly triggered distribution.strategy: Registered Strategy's Auction that received the USDG.RevenueNotified(address,uint256)event RevenueNotified(address indexed resonanceRouter, uint256 amount);Emitted when ResonanceRouter funds and restarts the global USDG stream.
Parameters
amount: Fresh raw USDG pulled, excluding remaining scheduled revenue and the saved remainder.resonanceRouter: Bound Router that supplied the tokens.SignalAdded(address,address,uint256)event SignalAdded(address indexed account, address indexed strategy, uint256 amount);Emitted when SignalCoin adds weight for an account to a live Strategy.
Parameters
account: SignalCoin holder whose paired-Bribe virtual balance increased.amount: Raw SignalCoin units added.strategy: Live Strategy whose aggregate signal weight increased.SignalManagerSet(address,bool)event SignalManagerSet(address indexed manager, bool enabled);Emitted when governance changes an account's permission to add managed signal.
Parameters
enabled: Whether the account is approved.manager: Account whose membership changed.SignalRemoved(address,address,uint256)event SignalRemoved(address indexed account, address indexed strategy, uint256 amount);Emitted when SignalCoin removes weight for an account from a Strategy.
Parameters
account: SignalCoin holder whose paired-Bribe virtual balance decreased.amount: Raw SignalCoin units removed.strategy: Registered live or killed Strategy whose signal weight decreased.StrategyAdded(address,address,address,address)event StrategyAdded(address indexed strategy, address indexed bribe, address indexed bribeRouter, address paymentToken);Emitted when governance atomically registers an Auction, BribeRouter, and Bribe as one Strategy.
Parameters
bribe: Newly deployed Bribe and canonical signal-weight ledger for the Strategy.bribeRouter: Newly deployed buffer for the automatic payment-token Bribe share.paymentToken: ERC-20 buyers must pay to fill the Auction.strategy: Newly deployed Auction identifying the registered Strategy.StrategyKilled(address)event StrategyKilled(address indexed strategy);Emitted when governance permanently kills a Strategy after checkpointing its accrued revenue.
Parameters
strategy: Strategy excluded from new signal and all later Resonance revenue.BribeBpsAboveMaximum(uint256)error BribeBpsAboveMaximum(uint256 requested);No additional NatSpec notice is present in the compiled artifact.
CommunitySignalAlreadyOpen()error CommunitySignalAlreadyOpen();No additional NatSpec notice is present in the compiled artifact.
EmptyClaimBatch()error EmptyClaimBatch();No additional NatSpec notice is present in the compiled artifact.
FinalLiveStrategy(address)error FinalLiveStrategy(address strategy);No additional NatSpec notice is present in the compiled artifact.
ForbiddenPaymentToken(address)error ForbiddenPaymentToken(address token);No additional NatSpec notice is present in the compiled artifact.
ForbiddenRewardToken(address)error ForbiddenRewardToken(address token);No additional NatSpec notice is present in the compiled artifact.
InsufficientSignal(address,uint256,uint256)error InsufficientSignal(address strategy, uint256 available, uint256 requested);No additional NatSpec notice is present in the compiled artifact.
OwnableInvalidOwner(address)error OwnableInvalidOwner(address owner);No additional NatSpec notice is present in the compiled artifact.
OwnableUnauthorizedAccount(address)error OwnableUnauthorizedAccount(address account);No additional NatSpec notice is present in the compiled artifact.
ReentrancyGuardReentrantCall()error ReentrancyGuardReentrantCall();No additional NatSpec notice is present in the compiled artifact.
ResonanceRouterAlreadySet(address)error ResonanceRouterAlreadySet(address resonanceRouter);No additional NatSpec notice is present in the compiled artifact.
RevenueBelowRemaining(uint256,uint256)error RevenueBelowRemaining(uint256 amount, uint256 remaining);No additional NatSpec notice is present in the compiled artifact.
RevenueLifetimeCapExceeded(uint256,uint256,uint256)error RevenueLifetimeCapExceeded(uint256 notified, uint256 requested, uint256 maximum);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.
SignalManagerStillAuthorized(address)error SignalManagerStillAuthorized(address account);No additional NatSpec notice is present in the compiled artifact.
StrategyAlreadyDead(address)error StrategyAlreadyDead(address strategy);No additional NatSpec notice is present in the compiled artifact.
StrategyNotFound(address)error StrategyNotFound(address strategy);No additional NatSpec notice is present in the compiled artifact.
UnauthorizedRevenueSource(address)error UnauthorizedRevenueSource(address caller);No additional NatSpec notice is present in the compiled artifact.
UnauthorizedSignalSource(address)error UnauthorizedSignalSource(address caller);No additional NatSpec notice is present in the compiled artifact.
UnauthorizedSignaler(address)error UnauthorizedSignaler(address account);No additional NatSpec notice is present in the compiled artifact.
ZeroAddress()error ZeroAddress();No additional NatSpec notice is present in the compiled artifact.
ZeroAmount()error ZeroAmount();No additional NatSpec notice is present in the compiled artifact.