Expand description
Contract deployment logic for the Fuel O2 exchange.
This crate extracts the core deploy workflow from the api package,
making it reusable from both the API binary and the standalone o2-deploy CLI.
Structs§
- Deploy
Params - Parameters for a deploy invocation.
- Existing
Registry - An already-deployed shared trade-account registry to reuse for prop-account registration instead of deploying a dedicated one. The registry’s implementation is UPGRADED in place (new blob, same proxy) to carry the prop configurables, so the oracle ids it was deployed with must be repeated — the fresh implementation blob embeds them again.
- Margin
Config - Optional
marginsection of the deploy config: the prop margin pool, the prop account oracle, the price feed and the tier catalogue. - Margin
Ids - The margin stack’s resolved ids, echoed on the deploy output.
- Margin
Price Feed Config - The
price_feedsub-section: everything about the ORACLE the pool values against, kept apart from the pool’s own settings because it is a separate contract with its own lifecycle, ownership and roles. - Margin
Supported Asset - One asset the price feed must know the decimals of. Registering the decimals is what makes an asset SUPPORTED by the feed; publishing a price for it is a separate, later act. Declaring assets here therefore lets a freshly deployed feed be configured up front, before any publisher has produced a single quote.
- Margin
Tier Config - One tier of the margin catalogue. Mirrors the on-chain
TierParamsplus the tier id and the markets (order books) it covers.linefollows the config convention of u64 amounts as strings. - Markets
Config Output - Markets
Config Partial - Ownership
Transfer Options - Prop
Deploy Config - Deployment-time settings for the prop-account system.
- Prop
Deployment - Handles and implementation blob IDs produced by a complete deployment.
Functions§
- audit_
order_ book_ precision - Checks every pair against its precision budget, naming the first offender.
- deploy
- Deploy (or upgrade) the full set of O2 contracts.
- deploy_
prop_ system - Deploy the independent prop-account system.
- load_
config_ from_ file - Load a JSON config file, returning
T::default()when the path is empty.