Protocol
Treasury
The contract that holds Motion's capital on Elysium, its roles and its spending limits.
The Treasury (0x8e30…10Aa) holds the protocol's capital on Elysium. It is built on OpenZeppelin AccessControl, Pausable and ReentrancyGuard. It receives half of every fee split, and it is where the engine's Montra trades are paid from and back to.
Roles
| Role | Intended holder | Can |
|---|---|---|
DEFAULT_ADMIN_ROLE | a Safe multisig (an ordinary wallet today) | allow-list calls, set limits, approve spenders, withdraw, unpause, manage roles |
OPERATOR_ROLE | the keeper bot | run allow-listed calls within the HYPE limits; burn tokens marked burnable |
GUARDIAN_ROLE | a trusted guardian | pause() only. Cannot move funds |
How the keeper spends
The keeper never calls arbitrary contracts. It calls:
execute(address target, uint256 value, bytes data)which only succeeds if:
- the Treasury is not paused;
- the pair
(target, selector)is allow-listed by the admin, whereselectoris the first 4 bytes ofdata(allowedCall[target][selector]); valuefits the HYPE limits (below).
It then calls the target, reverts CallFailed(reason) if the call fails, and emits Executed(target, selector, value, result).
Warning
execute checks the target and the function, not the arguments. If a router were allow-listed directly, a stolen keeper key could encode a swap that pays someone else. That is why live Montra trading goes through the MontraSwapAdapter, which has no recipient argument and always pays the Treasury.
Spending limits
Every execute with a non-zero value goes through _spend(value):
- reverts
PerCallLimitifvalue > maxHypePerCall; - the day is a rolling window: once
block.timestamp >= dayStart + 1 days,dayStartmoves to now andspentTodayresets to 0; - reverts
DailyLimitifspentToday + value > dailyHypeLimit.
The current values are read live by GET /api/v1/onchain (treasury.maxHypePerCall, dailyHypeLimit, spentToday). The engine's Montra strategy reads them every 5 minutes and applies them to its own trades, in paper mode too (falling back to 2 HYPE per call / 10 HYPE per day until the first read succeeds).
Functions
| Function | Access | What |
|---|---|---|
receive() | anyone | Accepts HYPE, adds it to totalHypeReceived, emits HypeReceived |
execute(target, value, data) | operator | Allow-listed call within limits |
burn(token, amount) | operator | Sends a burnable token to 0x…dEaD, updates totalBurned(token) |
pause() | guardian or admin | Stops execute |
unpause() | admin | |
setAllowedCall(target, selector, allowed) | admin | Allow-list management |
setBurnable(token, bool) | admin | |
setLimits(maxHypePerCall, dailyHypeLimit) | admin | |
approveToken(token, spender, amount) | admin | Approvals are admin-only so the bot can't approve arbitrary addresses |
withdraw(token, to, amount) | admin | token = 0x0 for native HYPE |
Errors: CallNotAllowed, PerCallLimit, DailyLimit, NotBurnable, CallFailed, ZeroAddress.
Note
totalHypeReceived counts all incoming HYPE, including the proceeds of the adapter's token sales and buy refunds, not only fee revenue. Use the FeeSplitter's totalToTreasury for revenue.
Capital on HyperCore
The Treasury lives on Elysium. Capital used on HyperCore sits in the protocol's HyperCore account (HL_ACCOUNT). Moving capital between the two is done only by the Safe; the engine writes suggested transfers and never bridges on its own. See Accounting.