IAvmFactory
Overview
Section titled “Overview”Deploys market proxies and market tokens, then registers them in the AVM directory.
IAvmFactory
Section titled “IAvmFactory”This interface does not require the factory itself to use a proxy model. It carries no separate factory-admin surface; the current implementation is constructor-bound to its directory.
Functions
Section titled “Functions”createMarket
Section titled “createMarket”Deploy a new market proxy and register it with the directory.
The proxy is created with CREATE2 using params.marketId as the salt; see predictMarketAddress for the derivation contract.
function createMarket(struct DataTypes.CreateMarketParams params) returns (address) nonpayableParameters
params— DataTypes.CreateMarketParams
Returns
market—address
directory
Section titled “directory”function directory() returns (address) viewReturns
address
predictMarketAddress
Section titled “predictMarketAddress”Compute the address createMarket would deploy for a given marketId.
Derivation: CREATE2 with deployer = factory address, salt = marketId, and initcode hash = keccak256(beaconProxyCreationCode || abi.encode(beacon, "")) where beacon is the single market beacon registered in the directory. The prediction is stable as long as (a) the factory address is stable, (b) IAvmDirectoryViews.marketBeacon() is stable, and (c) the BeaconProxy creation code is unchanged.
@marketId — Salt-equivalent market identifier.
@return predicted — Deterministic deployment address.
function predictMarketAddress(MarketId marketId) returns (address) viewParameters
marketId— MarketId
Returns
predicted—address