SpotEngine functions¶
Immutable Spot market-configuration registry. ERC-1967/UUPS proxy; implementation disables direct initialization.
This page lists every ABI-exposed function: 15 total, comprising 0 user functions, 9 state-changing, and 6 read-only calls.
User functions are state-changing calls expected from wallets, SDKs, traders, market makers, builders, or relayers. Internal settlement, deployment, governance, keeper, proxy, and maintenance calls remain available under the other filters.
About public and external visibility
The ABI proves that every function below is externally callable. It does not retain whether Solidity declared an individual function public or external, so the page does not invent a per-function visibility label.
Showing all 15 functions
State-changing functions¶
These payable and nonpayable calls can change protocol or contract state. Check the caller, requirements, effects, events, and errors before integrating one.
addMarket(address,address,address,uint96,uint32,uint32,uint32,uint96,uint96,uint256,uint256)¶¶
Registers a spot orderbook and its risk parameters.
Parameters and behavior
Inputs
orderBook—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.baseToken—address. EVM asset address;address(0)denotes native MON only on explicitly native-aware AccountCore/periphery paths.quoteToken—address. EVM asset address;address(0)denotes native MON only on explicitly native-aware AccountCore/periphery paths.sizePrecision—uint96. Base-size scaling denominator; human base quantity = integer base size or lots / sizePrecision.pricePrecision—uint32. Price scaling denominator; human quote/base price = integer price / pricePrecision.tickSize—uint32. Minimum price increment in integer price units; valid order prices are multiples of this value.passiveSpreadTicks—uint32. Count of discrete market ticks (unitless integer count).minQuoteNotional—uint96. Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale.maxQuoteNotional—uint96. Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale.takerFeePps—uint256. Parts per 10,000,000 (PPS); 1 bp = 1,000 PPS and 1% = 100,000 PPS.makerFeePps—uint256. Parts per 10,000,000 (PPS); 1 bp = 1,000 PPS and 1% = 100,000 PPS.
Returns
- No return value.
Access and behavior
- Who can call: Engine owner (normally SpotRouter) or governance role.
- Requirements: Unique nonzero order book, distinct tokens, positive precisions/tick/passive spread, valid notional range, maker fee not above taker fee, both fees within cap.
- State effects: Stores immutable-in-practice market configuration and existence flag.
- Units and rounding: Precisions/tick integer scales; notionals raw quote units; fees parts-per-
10,000,000. - Event families:
SpotMarketAdded(addresses only; indexer must read full config at the same block). - Expected errors:
Unauthorized,InvalidAuthority,ZeroAddress,InvalidCollateral,MarketAlreadyExists,InvalidMarketConfig,MarketSizeError,MarketFeeError.
Exact call data
addMarket(address,address,address,uint96,uint32,uint32,uint32,uint96,uint96,uint256,uint256)
- Selector:
0xf87530a5 - Mutability:
nonpayable - Semantic rule:
spot-engine.add-market - Call path:
owner/governance
cancelOwnershipHandover()¶¶
Sets the caller's handover-request expiry to zero, including when no request existed.
Parameters and behavior
Inputs
- None.
Returns
- No return value.
Access and behavior
- Who can call: Any requester, for its own pending request.
- Requirements: No current-owner requirement and no request-existence requirement.
- State effects: Sets the caller's handover-request expiry to zero, including when no request existed.
- Units and rounding: No protocol arithmetic.
- Event families:
OwnershipHandoverCanceled. - Expected errors: No contract-defined revert path.
Exact call data
cancelOwnershipHandover()
- Selector:
0x54d1f13d - Mutability:
payable - Semantic rule:
ownership.handover-cancel - Call path:
ownership-candidate
completeOwnershipHandover(address)¶¶
Transfers ownership to the requesting address and consumes the request.
Parameters and behavior
Inputs
pendingOwner—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Returns
- No return value.
Access and behavior
- Who can call: Current owner.
- Requirements: The nominated pending owner must have an unexpired request.
- State effects: Transfers ownership to the requesting address and consumes the request.
- Units and rounding: Request validity is timestamp-based.
- Event families:
OwnershipTransferredonly; clearing the request emits noOwnershipHandoverCanceled. - Expected errors:
Unauthorized,NoHandoverRequest.
Exact call data
completeOwnershipHandover(address)
- Selector:
0xf04e283e - Mutability:
payable - Semantic rule:
ownership.handover-complete - Call path:
owner
initialize(address)¶¶
Initializes ownership for a proxy deployment.
Parameters and behavior
Inputs
_owner—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Returns
- No return value.
Access and behavior
- Who can call: Any caller only while the proxy is uninitialized; deployers must initialize atomically.
- Requirements: Owner nonzero; initializer guard.
- State effects: Initializes proxy ownership; no market is registered.
- Units and rounding: EVM address; no arithmetic.
- Event families:
OwnershipTransferred, thenInitialized. - Expected errors:
AlreadyInitialized,ZeroAddress.
Exact call data
initialize(address)
- Selector:
0xc4d66de8 - Mutability:
nonpayable - Semantic rule:
lifecycle.initialize - Call path:
proxy-initialization
renounceOwnership()¶¶
Sets the owner to the zero address; owner-gated paths then become unreachable.
Parameters and behavior
Inputs
- None.
Returns
- No return value.
Access and behavior
- Who can call: Current owner.
- Requirements: Owner authorization.
- State effects: Sets the owner to the zero address; owner-gated paths then become unreachable.
- Units and rounding: No numeric units.
- Event families:
OwnershipTransferred. - Expected errors:
Unauthorized.
Exact call data
renounceOwnership()
- Selector:
0x715018a6 - Mutability:
payable - Semantic rule:
ownership.renounce - Call path:
owner
requestOwnershipHandover()¶¶
Creates or refreshes the caller's ownership handover request to expire at block.timestamp + 172800.
Parameters and behavior
Inputs
- None.
Returns
- No return value.
Access and behavior
- Who can call: Any prospective owner, for its own address.
- Requirements: No current-owner requirement; always succeeds absent an EVM-level failure.
- State effects: Creates or refreshes the caller's ownership handover request to expire at
block.timestamp + 172800. - Units and rounding: Expiry is a Unix timestamp in seconds; validity is exactly 48 hours (172,800 seconds).
- Event families:
OwnershipHandoverRequested. - Expected errors: No contract-defined revert path.
Exact call data
requestOwnershipHandover()
- Selector:
0x25692962 - Mutability:
payable - Semantic rule:
ownership.handover-request - Call path:
ownership-candidate
setAuthority(address)¶¶
Sets the shared authority contract used for governance and ops checks.
Parameters and behavior
Inputs
newAuthority—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Returns
- No return value.
Access and behavior
- Who can call: Contract owner.
- Requirements: New authority must be nonzero and expose nonzero governance, ops, and emergency roles.
- State effects: Replaces this contract's authority pointer; does not propagate the pointer to already deployed children.
- Units and rounding: Address only; no rounding.
- Event families:
AuthorityUpdated. - Expected errors:
Unauthorized,ZeroAddress,InvalidAuthority.
Exact call data
setAuthority(address)
- Selector:
0x7a9e5e4b - Mutability:
nonpayable - Semantic rule:
access.authority - Call path:
owner
transferOwnership(address)¶¶
Transfers direct upgrade/administrative ownership.
Parameters and behavior
Inputs
newOwner—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Returns
- No return value.
Access and behavior
- Who can call: Current owner.
- Requirements: New owner must be nonzero.
- State effects: Transfers direct upgrade/administrative ownership.
- Units and rounding: Address only; no rounding.
- Event families:
OwnershipTransferred. - Expected errors:
Unauthorizedand zero/new-owner errors.
Exact call data
transferOwnership(address)
- Selector:
0xf2fde38b - Mutability:
payable - Semantic rule:
ownership.transfer - Call path:
owner
upgradeToAndCall(address,bytes)¶¶
Changes the proxy implementation and optionally delegatecalls migration data.
Parameters and behavior
Inputs
newImplementation—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.data—bytes. Opaque ABI or protocol-packed bytes; the function/type-specific codec defines its fields.
Returns
- No return value.
Access and behavior
- Who can call: Contract owner through the active ERC-1967 proxy.
- Requirements: UUPS proxy context, compatible
proxiableUUID, owner authorization; migration calldata executes atomically. - State effects: Changes the proxy implementation and optionally delegatecalls migration data.
- Units and rounding: Raw calldata; no protocol arithmetic.
- Event families: ERC-1967
Upgraded; optional migrationdatamay emit any events of the explicitly invoked implementation selector, which cannot be statically narrowed from arbitrary bytes. - Expected errors:
Unauthorized, UUPS call-context/UUID errors, zero-code/invalid implementation, and delegated migration errors.
Exact call data
upgradeToAndCall(address,bytes)
- Selector:
0x4f1ef286 - Mutability:
payable - Semantic rule:
upgrade.uups - Call path:
owner-upgrade
Read-only functions¶
These view and pure calls expose configuration or protocol state without mutating it.
authority()¶¶
Returns the shared protocol-authority contract.
Parameters and behavior
Inputs
- None.
Returns
result0—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Access and behavior
- Who can call: Any caller; no state mutation.
- Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
- State effects: Returns
_:address— EVM address; zero-address allowance/sentinel meaning is stated by the function semantics. - Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
- Event families: None;
view/purecall. - Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.
Exact call data
authority()
- Selector:
0xbf7e214f - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
getMarketConfig(address)¶¶
Returns the stored market config or reverts if the market is unknown.
Parameters and behavior
Inputs
orderBook—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Returns
config—struct ISpotEngine.SpotMarketConfig. Structured struct ISpotEngine.SpotMarketConfig; field-level units are defined in the type catalog and tuple metadata.
Access and behavior
- Who can call: Any caller; no state mutation.
- Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
- State effects: Returns
config:struct ISpotEngine.SpotMarketConfig— Structured struct ISpotEngine.SpotMarketConfig; field-level units are defined in the type catalog and tuple metadata. Returns the stored market config or reverts if the market is unknown. - Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
- Event families: None;
view/purecall. - Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.
Exact call data
getMarketConfig(address)
- Selector:
0xc7bfd2fd - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
marketExists(address)¶¶
Returns whether an orderbook has been registered as a spot market.
Parameters and behavior
Inputs
orderBook—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Returns
result0—bool. Boolean flag namedvalue.
Access and behavior
- Who can call: Any caller; no state mutation.
- Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
- State effects: Returns
_:bool— Boolean flag namedvalue. Returns whether an orderbook has been registered as a spot market. - Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
- Event families: None;
view/purecall. - Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.
Exact call data
marketExists(address)
- Selector:
0x712ca018 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
owner()¶¶
Returns the contract owner.
Parameters and behavior
Inputs
- None.
Returns
result—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Access and behavior
- Who can call: Any caller; no state mutation.
- Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
- State effects: Returns
result:address— EVM address; zero-address allowance/sentinel meaning is stated by the function semantics. Returns the owner of the contract. - Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
- Event families: None;
view/purecall. - Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.
Exact call data
owner()
- Selector:
0x8da5cb5b - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
ownershipHandoverExpiresAt(address)¶¶
Returns when a pending ownership handover expires.
Parameters and behavior
Inputs
pendingOwner—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
Returns
result—uint256. Unix timestamp in seconds; zero-sentinel behavior is function-specific.
Access and behavior
- Who can call: Any caller; no state mutation.
- Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
- State effects: Returns
result:uint256— Unix timestamp in seconds; zero-sentinel behavior is function-specific. Returns the expiry timestamp for the two-step ownership handover topendingOwner. - Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
- Event families: None;
view/purecall. - Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.
Exact call data
ownershipHandoverExpiresAt(address)
- Selector:
0xfee81cf4 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
proxiableUUID()¶¶
Returns the ERC-1822 implementation-slot identifier.
Parameters and behavior
Inputs
- None.
Returns
result0—bytes32. bytes32 opaque binary value.
Access and behavior
- Who can call: Any caller on the implementation contract, not through the active proxy.
- Requirements: UUPS
notDelegated; intentionally reverts when delegatecalled through a proxy. - State effects: No state mutation. Returns the ERC-1967 implementation storage slot UUID. Returns the storage slot used by the implementation, as specified in ERC1822. Note: The
notDelegatedmodifier prevents accidental upgrades to an implementation that is a proxy contract. - Units and rounding: Return/input units follow the ABI names, tuple definitions, constants, and NatSpec in this reference.
- Event families: None;
view/purecall. - Expected errors: Input/existence/configuration errors declared by the contract may still revert.
Exact call data
proxiableUUID()
- Selector:
0x52d1902d - Mutability:
view - Semantic rule:
read.SpotEngine.proxiableUUID - Call path:
implementation-read