Copy
Ask AI
import * as EntryPoint from 'voltaire-effect/EntryPoint'
import { Effect } from 'effect'
// Canonical addresses
EntryPoint.V06 // '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789'
EntryPoint.V07 // '0x0000000071727De22E5E9d8BAf0edAc6f37da032'
// Create and validate
const ep = await Effect.runPromise(EntryPoint.from(EntryPoint.V07))
// Convert to hex
const hex = await Effect.runPromise(EntryPoint.toHex(ep))
// Compare
const same = await Effect.runPromise(EntryPoint.equals(ep1, ep2))
Version Detection
Copy
Ask AI
const detectVersion = (address: string) =>
Effect.gen(function* () {
const ep = yield* EntryPoint.from(address)
const v06 = yield* EntryPoint.from(EntryPoint.V06)
const v07 = yield* EntryPoint.from(EntryPoint.V07)
if (yield* EntryPoint.equals(ep, v06)) return 'v0.6'
if (yield* EntryPoint.equals(ep, v07)) return 'v0.7'
return 'unknown'
})

