Contract reference
Functions, events and custom errors of DawnScheduler, ForgeFactory, PulseVault, OrbitIndex and the strategy templates.
#DawnScheduler
| Function | Who | Notes |
|---|---|---|
propose(bytes32 templateId, uint256[] params, string metadataURI) payable | anyone | Propose window; msg.value must equal the bond |
withdrawProposal(uint256 id) | proposer | Propose window; bond credited back |
flag(uint256 id, string reason) | guardian / owner | Before settle; slashes the bond to PulseVault |
vote(uint256 id) | anyone | Propose or auction window; once per dawn per address |
bid(uint256 id) payable | anyone | Auction window; adds to your bid (minBid applies) |
cancelBid(uint256 id) | bidder | Auction window; full refund credited |
settle(uint64 dawnId) | anyone, once | After the auction; ranks, deploys winners, starts the Pulse epoch |
settleBid(uint256 id, address bidder) | anyone | LP shares to winning bidders, refunds to losers |
withdraw() | anyone | Pull your HYPE credits (refunds, bonds) |
queueConfig / applyConfig / cancelQueuedConfig | owner (timelock) | Economic config changes, delayed one full period |
phase(), dawnTimes(dawnId), config() | view | On-chain phases: Evolve, Propose, Auction |
getProposal, dawnProposals, biddersOf, scoreOf, previewWinners | view | Read state and the would-win set |
#ForgeFactory
| Function | Who | Notes |
|---|---|---|
registerTemplate(…), setTemplateActive, setCodehashAllowed | owner | Template implementation, parameter bounds, mutable selectors |
validateParams(templateId, params), checkParam(templateId, i, v) | view | Revert unless within bounds |
deploy(templateId, params, owner, dawnId, proposalId) payable | scheduler | Clone, initialise with the seed, list in OrbitIndex |
mutate(address strategy, bytes data) | strategy owner or registered agent | Forwards a mutable selector; rate-limited for agents |
setAgent(strategy, agent, callsPerHour, bytes4[] selectors) | strategy owner | Register an agent with a rate and selector allow-list |
setAgentSelector, revokeAgent | strategy owner | Adjust or remove an agent |
sunset(address strategy) | strategy owner | Stops trading and deposits; LPs can still exit |
setFeeConfig(FeeConfig) | owner | LP fee share, creator / Pulse / protocol bps of the take, treasury |
isStrategy, strategyInfo, strategiesCount, strategyAt, templateIds, getTemplate, agentOf, predictStrategy | view |
#PulseVault
| Function | Who | Notes |
|---|---|---|
seedNextDawn() payable | anyone | Adds HYPE to the next epoch's budget |
startEpoch(dawnId, strategies, weights, window, halfLife) | scheduler | Opens a dawn's epoch; returns the budget |
checkpoint(a, b) | strategies | Settles accrual before LP balances change (transfer hook) |
claim(address[] strategies) | LP | Claims accrued Pulse |
rollover(uint64 dawnId) | anyone | Moves an epoch's unallocated remainder forward |
claimable(strategy, account), emittedAt(dawnId, ts), epochOf(dawnId) | view |
#OrbitIndex
| Function | Who | Notes |
|---|---|---|
list(strategy, templateId, owner, dawnId) | factory | At activation |
report(tvl, volumeDelta, feesDelta) | strategies | Metrics update |
recordMutation(strategy), delist(strategy) | factory | On mutate / sunset |
metricsOf(strategy), count, strategyAt, page, livePage | view | Metrics { templateId, owner, dawnId, listedAt, updatedAt, live, mutations, tvl, volume, fees } |
#Strategies
Every strategy is an EIP-1167 clone of a template implementation inheriting StrategyBase, and is itself the ERC-20 LP-share token (transfer, approve, balanceOf, totalSupply). Common surface: initialize, sunset (factory only), flushFees, claimCreatorFees (owner), tvl, owner, templateId, dawnId, proposalId, isSunset.
| Template | Trading / liquidity | Mutable (via factory) |
|---|---|---|
DynamicFeeAMM | swapHypeForQuote(minOut, to) payable, swapQuoteForHype(amountIn, minOut, to), addLiquidity(maxQuote, minShares) payable, removeLiquidity(shares, minHype, minQuote), quote, currentFeeBps | setFeeBounds(base, max), setSensitivity(x10), setRange(pct) |
OptionsVault (interface only) | deposit(minShares) payable, withdraw(shares), roll() | setStrikeOtm(x10), setImpliedVol(pct) |
FeeCurveModule (interface only) | feeBps(utilisationBps) | setCurve(minFee, preKinkRise, kinkPct, slopeX10) |
AgentRebalancer (interface only) | rebalance(newCentre, minOut), setBand(x10) | |
BinaryMarket | buy(outcome, minShares) payable, redeem(), removeLiquidity(shares, minOut), priceYes(), resolve(outcome) | setFee(bps) |
x10 fixed-point). The app's template signatures (e.g. setFeeBounds(uint16,uint16)) map onto these. Template ids are bytes32 strings; see parameter order.#Events
// DawnScheduler
event Proposed(uint64 indexed dawnId, uint256 indexed proposalId, address indexed proposer,
bytes32 templateId, uint256[] params, uint256 bond, string metadataURI);
event ProposalWithdrawn(uint64 indexed dawnId, uint256 indexed proposalId, address indexed proposer);
event ProposalFlagged(uint64 indexed dawnId, uint256 indexed proposalId, address indexed guardian, string reason);
event BondReturned(uint256 indexed proposalId, address indexed proposer, uint256 amount);
event BondSlashed(uint256 indexed proposalId, address indexed proposer, uint256 amount);
event Voted(uint64 indexed dawnId, uint256 indexed proposalId, address indexed voter, uint256 votes);
event BidPlaced(uint64 indexed dawnId, uint256 indexed proposalId, address indexed bidder,
uint256 added, uint256 bidderTotal, uint256 proposalTotal);
event BidCancelled(uint64 indexed dawnId, uint256 indexed proposalId, address indexed bidder,
uint256 amount, uint256 proposalTotal);
event DawnSettled(uint64 indexed dawnId, uint256 proposals, uint256 winners, uint256 seeded);
event ProposalWon(uint64 indexed dawnId, uint256 indexed proposalId, address indexed strategy,
uint256 rank, uint256 score, uint256 seed, uint256 shares);
event ProposalLost(uint64 indexed dawnId, uint256 indexed proposalId, uint256 score);
event LpClaimed(uint256 indexed proposalId, address indexed bidder, address indexed strategy, uint256 shares);
event BidRefunded(uint256 indexed proposalId, address indexed bidder, uint256 amount);
// ForgeFactory
event StrategyDeployed(bytes32 indexed templateId, address indexed strategy, address indexed owner,
uint64 dawnId, uint256 proposalId, uint256 seed);
event AgentSet(address indexed strategy, address indexed agent, uint32 callsPerHour);
event Mutated(address indexed strategy, address indexed caller, bool indexed byAgent, bytes4 selector, bytes data);
event StrategySunset(address indexed strategy, address indexed caller);
event FeeConfigSet(uint16 creatorBps, uint16 pulseBps, uint16 protocolBps, address treasury);
// PulseVault
event EpochStarted(uint64 indexed dawnId, uint256 budget, uint64 start, uint32 window, uint32 halfLife, uint256 strategies);
event PulseClaimed(address indexed account, address indexed strategy, uint256 amount);
// Strategies
event FeesAccrued(uint256 creator, uint256 pulse, uint256 protocol);
event Swap(address indexed trader, address indexed to, uint256 hypeIn, uint256 quoteIn,
uint256 hypeOut, uint256 quoteOut, uint256 feeHype, uint256 feeBps);#Errors
| Group | Custom errors |
|---|---|
| Generic | Unauthorized ZeroAddress ZeroAmount InvalidConfig TransferFailed Reentrancy Slippage Paused |
| Schedule | NotProposalWindow(dawnId) NotAuctionWindow(dawnId) NotVotingWindow(dawnId) AuctionNotOver(dawnId) AlreadySettled(dawnId) TimelockNotReady(eta) |
| Proposals & bids | WrongBond(sent, required) ProposerCapReached(cap) DawnFull(cap) UnknownProposal(id) ProposalNotActive(id) AlreadyVoted(dawnId) BidTooSmall(amount, minBid) NoBid NothingToClaim |
| Factory | UnknownTemplate TemplateInactive ParamCount(got, expected) ParamOutOfBounds(index, value, min, max) SelectorNotMutable(selector) SelectorNotAllowedForAgent(selector) RateLimited(calls, limit) UnknownStrategy StrategySunset MutationFailed(reason) |
| Strategies | InsufficientLiquidity InsufficientShares PriceMoveTooLarge(moveBps, maxBps) InvalidFeeBounds(base, max) MarketResolved MarketNotResolved TooEarly(at) |
| Pulse | EpochExists EpochNotOver EpochRolled UnknownEpoch LengthMismatch |
contracts/src/libraries/Errors.sol so clients decode reverts from one ABI fragment.#Roles
| Role | Intended holder | Can | Cannot |
|---|---|---|---|
| Owner (each core contract) | TimelockController ≥ 48 h behind a multisig; two-step transfer | Register templates and bounds; allow-list implementation codehashes; set fee config for new strategies (LP share 50–95%); queue economic config; set guardian; emergency-sunset; resolve pm-binary; set the Pulse budget cap | Move user funds; change live strategies' fee split; change dawn timing; mint LP shares |
| Guardian | Fast multisig | Pause / unpause proposals, votes, bids, swaps, deposits, buys; flag a pending proposal | Block exits; touch bids or LP funds |
| Strategy owner | The proposal author | mutate within bounds; authorise / revoke agents; sunset; claim the creator share; two-step ownership transfer | Exceed bounds; call non-mutable functions; withdraw LP funds |
| Agent | Address authorised per strategy | mutate allowed selectors, ≤ 120 calls/h token bucket | Anything else |
| Anyone | settle, settleBid for others, flushFees, rollover |
contracts/SECURITY.md. The holders above are the intended end state: at deployment, the owner and guardian are both the deployer account.#Gas
| Call | Typical | Max seen |
|---|---|---|
propose | 358k | 412k |
bid (first / raise) | 156k / 29k+ | 156k |
settle (3 winners) | 1.15M | 2.94M; 3.83M for a full dawn of 32 proposals |
settleBid (LP claim) | 85k | 154k |
swapHypeForQuote / swapQuoteForHype | 118k / 140k | 156k / 336k |
addLiquidity / removeLiquidity | 113k / 97k | 113k / 153k |
mutate (agent) | 79k | 90k |
PulseVault.claim (1 strategy) | 135k | 218k |
forge test --gas-report (solc 0.8.28, via-IR, optimizer 1000 runs). Paid in HYPE on Elysium.#Defaults (Config.sol)
- Period
- 1 day (dawn slot 12:00 UTC)
- Proposal lead / auction
- 60 min / 10 min
- Pulse window / half-life
- 360 min from settlement / 45 min
- Pulse budget cap
- min(pending, 500 HYPE) per dawn; excess rolls over
- Proposal caps
- 2 per proposer, 32 per dawn
- Bond / vote weight
- 25 HYPE / 1 HYPE
- Winners
- 3
- LP fee share
- lpFeeShareBps = 7000 (70% stays in the pool)
- Protocol take split
- 4000 / 3500 / 2500 bps of the remaining 30%
Something unclear or wrong on this page? Report it.Updated Dec 1, 2026 · v1.0