ExamplePostFillHook functions¶
Illustrative four-slot market-maker hook. Direct deployment with immutable book/maker configuration and local owner.
This page lists every ABI-exposed function: 22 total, comprising 1 user functions, 8 state-changing, and 14 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 22 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.
postFill((uint40,uint8,uint64,uint40,uint32,uint96,uint96,uint32,bool))¶¶
Return a bounded post-fill plan.
Parameters and behavior
Inputs
ctx—struct IPostFillHook.PostFillContext. Structured struct IPostFillHook.PostFillContext; field-level units are defined in the type catalog and tuple metadata.
Returns
header—uint256. Packed post-fill-hook control/quote word; bit layout is defined by the hook codec constants and integration documentation.replenishWord—uint256. Packed post-fill-hook control/quote word; bit layout is defined by the hook codec constants and integration documentation.replacementWord—uint256. Packed post-fill-hook control/quote word; bit layout is defined by the hook codec constants and integration documentation.
Access and behavior
- Who can call: Configured Spot order book; other callers receive a no-op result rather than a revert.
- Requirements: Returns no action if paused, wrong caller/maker/slot/side, disabled lane, missing anchor, or invalid quote; otherwise encodes allowed replenishment/replacement.
- State effects: Purely returns a hook decision; OrderBook later revalidates and applies it fail-open.
- Units and rounding: Packed hook quote contains price, size, and min-size-after-block; header action constants identify requote/replenish/replace.
- Event families: No event from
postFill; an accepted decision later emitsBookUpdatesPackedand AccountCoreSpotReserveUpdatedwhen applied by the OrderBook. - Expected errors: Designed to return no-op for routine invalid context; unexpected arithmetic/ABI errors are caught by the OrderBook.
Exact call data
postFill((uint40,uint8,uint64,uint40,uint32,uint96,uint96,uint32,bool))
- Selector:
0xf7aa45d8 - Mutability:
nonpayable - Semantic rule:
example-hook.post-fill - Call path:
spot-order-book
pushPriceAndRequote(uint32)¶¶
Accepts a new fair price only when needed, then repairs or requotes maker slots.
Parameters and behavior
Inputs
fairPrice—uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
Returns
reason—enum ExamplePostFillHook.UpdateReason. Numeric Solidity enum enum ExamplePostFillHook.UpdateReason; member values are listed in types and constants.missingMask—uint8. Unsigned bitmask; named bit definitions are in types and constants.
Access and behavior
- Who can call: Owner or allowlisted price publisher.
- Requirements: Hook not paused; nonzero fair price; update required by dislocation/missing slot; generated quotes valid for tick/market and executor trade authorization.
- State effects: Accepts a fair-price anchor when required and invokes packed replacements to repair/requote enabled maker slots.
- Units and rounding: Fair price book price units; spread basis points; sizes book size units.
- Event families: If ALO replacement ops are produced, possible first-use OrderBook
MakerRegisteredprecedes AccountCoreSpotReserveUpdatedsnapshots and OrderBookBookUpdatesPacked; this path produces no fill orTradesPacked. Next the hook emits fourSlotSynclogs in slot order 0..3, optionalPriceAccepted, thenRequoted. A no-op preview emits nothing. - Expected errors:
NotPricePublisher,Paused,PriceError, lane/quote/tick/slot/order ID, downstream authorization/balance/book errors.
Exact call data
pushPriceAndRequote(uint32)
- Selector:
0x3affe4ea - Mutability:
nonpayable - Semantic rule:
example-hook.price-push - Call path:
price-publisher
setLaneConfig(uint8,uint16,uint96,bool)¶¶
Replaces exactly one tight/wide bid/ask lane configuration.
Parameters and behavior
Inputs
slot—uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.spreadBps—uint16. Basis points with denominator 10,000.size—uint96. Integer base-token/base-size units; human base quantity = value / market sizePrecision.enabled—bool. Boolean flag namedenabled.
Returns
- No return value.
Access and behavior
- Who can call: ExamplePostFillHook owner.
- Requirements: Slot must be 0..3; spread below 10,000 bps; enabled lane must have nonzero size.
- State effects: Replaces exactly one tight/wide bid/ask lane configuration.
- Units and rounding: Slot is lane index; spread is bps; size is OrderBook base-size units; enabled is boolean.
- Event families:
LaneConfigUpdatedwith the complete resulting lane values. - Expected errors:
Unauthorized,InvalidSlot,InvalidSpread,ZeroAmount.
Exact call data
setLaneConfig(uint8,uint16,uint96,bool)
- Selector:
0x90a0b4b7 - Mutability:
nonpayable - Semantic rule:
example-hook.config.set-lane-config - Call path:
owner
setPaused(bool)¶¶
Sets whether price pushes/requotes are blocked and post-fill callbacks return no action.
Parameters and behavior
Inputs
value—bool. Boolean flag namedvalue.
Returns
- No return value.
Access and behavior
- Who can call: ExamplePostFillHook owner.
- Requirements: No state-change requirement: writing the current value is allowed.
- State effects: Sets whether price pushes/requotes are blocked and post-fill callbacks return no action.
- Units and rounding: Boolean; no arithmetic.
- Event families:
PausedUpdated. - Expected errors:
Unauthorized.
Exact call data
setPaused(bool)
- Selector:
0x16c38b3c - Mutability:
nonpayable - Semantic rule:
example-hook.config.set-paused - Call path:
owner
setPriceDislocationBps(uint16)¶¶
Replaces the fair-price dislocation threshold that forces acceptance/requote.
Parameters and behavior
Inputs
newValue—uint16. Basis points with denominator 10,000.
Returns
- No return value.
Access and behavior
- Who can call: ExamplePostFillHook owner.
- Requirements: New threshold must be nonzero and at most 10,000 bps.
- State effects: Replaces the fair-price dislocation threshold that forces acceptance/requote.
- Units and rounding: Basis points with denominator 10,000.
- Event families:
PriceDislocationBpsUpdatedwith old and new threshold. - Expected errors:
Unauthorized,SizeError.
Exact call data
setPriceDislocationBps(uint16)
- Selector:
0x948a0665 - Mutability:
nonpayable - Semantic rule:
example-hook.config.set-price-dislocation-bps - Call path:
owner
setPricePublisher(address,bool)¶¶
Adds or removes one address from the price-publisher allowlist.
Parameters and behavior
Inputs
publisher—address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.enabled—bool. Boolean flag namedenabled.
Returns
- No return value.
Access and behavior
- Who can call: ExamplePostFillHook owner.
- Requirements: Publisher address must be nonzero; enabled is stored exactly.
- State effects: Adds or removes one address from the price-publisher allowlist.
- Units and rounding: EVM address plus boolean.
- Event families:
PricePublisherUpdated. - Expected errors:
Unauthorized,ZeroAddress.
Exact call data
setPricePublisher(address,bool)
- Selector:
0x3d996ae8 - Mutability:
nonpayable - Semantic rule:
example-hook.config.set-price-publisher - Call path:
owner
setQuoteFreshnessBlocks(uint32)¶¶
Replaces the maximum block age used when deciding whether the stored fair-price anchor needs refresh.
Parameters and behavior
Inputs
newValue—uint32. Block-count freshness duration compared againstblock.number.
Returns
- No return value.
Access and behavior
- Who can call: ExamplePostFillHook owner.
- Requirements: New freshness window must be nonzero.
- State effects: Replaces the maximum block age used when deciding whether the stored fair-price anchor needs refresh.
- Units and rounding: Block-count duration.
- Event families:
QuoteFreshnessBlocksUpdatedwith old and new window. - Expected errors:
Unauthorized,InvalidFreshness.
Exact call data
setQuoteFreshnessBlocks(uint32)
- Selector:
0xde675eca - Mutability:
nonpayable - Semantic rule:
example-hook.config.set-quote-freshness-blocks - 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:
nonpayable - Semantic rule:
ownership.transfer - Call path:
owner
Read-only functions¶
These view and pure calls expose configuration or protocol state without mutating it.
expectedOrderId(uint8)¶¶
Returns the order ID currently expected for a hook lane.
Parameters and behavior
Inputs
slot—uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.
Returns
orderId—uint64. Order ID (uint64); zero is empty, anduint64.maxisANY_ORDER_IDonly in the trading wallet.
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
orderId:uint64— Order ID (uint64); zero is empty, anduint64.maxisANY_ORDER_IDonly in the trading wallet. - 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
expectedOrderId(uint8)
- Selector:
0x950ccc8f - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
laneConfig(uint8)¶¶
Returns the configured quoting parameters for a hook lane.
Parameters and behavior
Inputs
slot—uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.
Returns
config—struct ExamplePostFillHook.LaneConfig. Structured struct ExamplePostFillHook.LaneConfig; 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 ExamplePostFillHook.LaneConfig— Structured struct ExamplePostFillHook.LaneConfig; field-level units are defined in the type catalog and tuple metadata. - 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
laneConfig(uint8)
- Selector:
0x39ffd575 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
lastAcceptedPrice()¶¶
Returns the most recent price accepted by the hook.
Parameters and behavior
Inputs
- None.
Returns
result0—uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
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
_:uint32— Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required. - 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
lastAcceptedPrice()
- Selector:
0x0f57b41d - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
maker()¶¶
Returns the configured market-maker address.
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
maker()
- Selector:
0x50655d8c - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
makerId()¶¶
Returns the configured market-maker account ID.
Parameters and behavior
Inputs
- None.
Returns
result0—uint40. AccountCore account ID (uint40in protocol state); zero denotes missing/unregistered unless explicitly allowed.
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
_:uint40— AccountCore account ID (uint40in protocol state); zero denotes missing/unregistered unless explicitly allowed. - 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
makerId()
- Selector:
0x68d49020 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
orderBook()¶¶
Returns the configured order-book contract.
Parameters and behavior
Inputs
- None.
Returns
result0—contract ISpotOrderBook. 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
_:contract ISpotOrderBook— 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
orderBook()
- Selector:
0x776af5ba - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
owner()¶¶
Returns the contract owner.
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
owner()
- Selector:
0x8da5cb5b - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
paused()¶¶
Returns whether this contract is paused.
Parameters and behavior
Inputs
- None.
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. - 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
paused()
- Selector:
0x5c975abb - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
previewPriceUpdate(uint32)¶¶
Returns whether a publisher call would mutate and the missing-slot bitmap.
Parameters and behavior
Inputs
fairPrice—uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
Returns
reason—enum ExamplePostFillHook.UpdateReason. Numeric Solidity enum enum ExamplePostFillHook.UpdateReason; member values are listed in types and constants.missingMask—uint8. Unsigned bitmask; named bit definitions are in types and constants.
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
reason:enum ExamplePostFillHook.UpdateReason— Numeric Solidity enum enum ExamplePostFillHook.UpdateReason; member values are listed in types and constants.;missingMask:uint8— Unsigned bitmask; named bit definitions are in types and constants. Returns whether a publisher call would mutate and the missing-slot bitmap. - 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
previewPriceUpdate(uint32)
- Selector:
0x236b5fd5 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
priceDislocationBps()¶¶
Returns the hook's maximum permitted price dislocation in basis points.
Parameters and behavior
Inputs
- None.
Returns
result0—uint16. Basis points with denominator 10,000.
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
_:uint16— Basis points with denominator 10,000. - 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
priceDislocationBps()
- Selector:
0x592d222a - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
pricePrecision()¶¶
Returns the denominator used to scale integer prices.
Parameters and behavior
Inputs
- None.
Returns
result0—uint32. Price scaling denominator; human quote/base price = integer price / pricePrecision.
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
_:uint32— Price scaling denominator; human quote/base price = integer price / pricePrecision. - 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
pricePrecision()
- Selector:
0xad5c6ec5 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
pricePublishers(address)¶¶
Returns whether an address is authorized to publish prices to the hook.
Parameters and behavior
Inputs
arg0—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. - 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
pricePublishers(address)
- Selector:
0x4ba2ed35 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
quoteFreshnessBlocks()¶¶
Returns the maximum accepted quote age in blocks.
Parameters and behavior
Inputs
- None.
Returns
result0—uint32. Block-count freshness duration compared againstblock.number.
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
_:uint32— Block-count freshness duration compared againstblock.number. - 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
quoteFreshnessBlocks()
- Selector:
0xf73d6789 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read
tickSize()¶¶
Returns the minimum valid price increment.
Parameters and behavior
Inputs
- None.
Returns
result0—uint32. Minimum price increment in integer price units; valid order prices are multiples of this value.
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
_:uint32— Minimum price increment in integer price units; valid order prices are multiples of this value. - 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
tickSize()
- Selector:
0xf210d087 - Mutability:
view - Semantic rule:
read.public - Call path:
public-read