Skip to main content

Class: EvmPhysicalLayer

Defined in: evm-client/src/settlement-layer.ts:169

EVM's physical settlement layer: settlement happens in the option's own assets, so the layer carries no metadata and commits to the ExerciseMode.Full layer by default.

One contract exists per exercise mode, placed by PhysicalSettlementFactory — permissionless, and get-or-create, so createConfig is safe to submit for a mode that already has a layer.

Implements​

Constructors​

Constructor​

new EvmPhysicalLayer(client, factoryAddress): EvmPhysicalLayer;

Defined in: evm-client/src/settlement-layer.ts:186

Parameters​

ParameterTypeDescription
client{ }a viem public client on the chain the factory is deployed to. Only readContract is used, so an account-less transport is enough: a read-only app can still derive addresses and build a deployment.
factoryAddressstringthe deployed PhysicalSettlementFactory (see EvmConfig.physicalSettlementFactoryAddress).

Returns​

EvmPhysicalLayer

Properties​

factoryAddress​

readonly factoryAddress: `0x${string}`;

Defined in: evm-client/src/settlement-layer.ts:175

The deployed PhysicalSettlementFactory every derivation below goes through.


type​

type: SettlementKey<EvmLayer> = "physical";

Defined in: evm-client/src/settlement-layer.ts:172

This layer's type key — matches the on-chain discriminator and the registry key.

Implementation of​

OvercastSettlementLayer.type

Methods​

buildMetadata()?​

optional buildMetadata(_option): Promise<Metadata>;

Defined in: evm-client/src/settlement-layer.ts:221

Physical settlement reads no metadata: the option's own terms are the whole input.

Parameters​

ParameterType
_optionMarketOption

Returns​

Promise<Metadata>

Implementation of​

OvercastSettlementLayer.buildMetadata

configId()​

configId(config): Promise<Bytes32>;

Defined in: evm-client/src/settlement-layer.ts:238

The address the factory places the layer for config at, whether or not it has been deployed yet — so it can be pinned into an offer's details.settlementLayer before (or without) the layer existing.

Memoized per exercise mode, so a process derives each of the two at most once.

Parameters​

ParameterType
configPhysicalSettlementConfig

Returns​

Promise<Bytes32>

Implementation of​

OvercastSettlementLayer.configId

createConfig()​

createConfig(config): Promise<TransactionRequest & object>;

Defined in: evm-client/src/settlement-layer.ts:203

Build the transaction that deploys the layer for config.exerciseMode.

The factory's deploy is get-or-create rather than create-or-revert: a mode that already has a layer hands the existing one back instead of reverting, because a deployed layer is byte-identical to the one this call would have produced. So this needs no existence pre-check, and submitting it twice costs gas but changes nothing.

Permissionless, and the submitter gains no authority over the result: the configuration determines the address and the init code determines the behaviour, so whoever paid the gas is not recorded anywhere.

Parameters​

ParameterType
configPhysicalSettlementConfig

Returns​

Promise<TransactionRequest & object>

Implementation of​

OvercastSettlementLayer.createConfig

defaultConfig()​

defaultConfig(): Promise<PhysicalSettlementConfig>;

Defined in: evm-client/src/settlement-layer.ts:226

Full exercise (see DEFAULT_PHYSICAL_CONFIG).

Returns​

Promise<PhysicalSettlementConfig>

Implementation of​

OvercastSettlementLayer.defaultConfig

isDeployed()​

isDeployed(config): Promise<boolean>;

Defined in: evm-client/src/settlement-layer.ts:252

Whether the layer for config has been deployed yet.

Parameters​

ParameterType
configPhysicalSettlementConfig

Returns​

Promise<boolean>


read()​

read(id): Promise<PhysicalSettlementConfig>;

Defined in: evm-client/src/settlement-layer.ts:277

Read the layer contract at id and decode its configuration.

Two checks, and the second is the load-bearing one. layerType() is self-attested, so it is a diagnostic; what actually proves the code at id is this factory's physical layer for the mode it claims is that the address re-derives — a CREATE2 address is bound to the exact init code, so a layer with changed settlement logic necessarily lives somewhere else and cannot pass. The address is the attestation, which is the property the factory exists to provide.

The consequence worth knowing: a physical layer deployed by a different factory (an older deployment, or a fork's) is rejected here even though it answers every getter. That is the intended reading — this layer is the one factoryAddress names.

Parameters​

ParameterType
idBytes32

Returns​

Promise<PhysicalSettlementConfig>

Implementation of​

OvercastSettlementLayer.read