DiodeClient.Contracts.Factory (Diode Client v1.4.12)
View SourceThis module is used to create and manage the factory contract. The factory is creating Proxy contracts for deployed implementations. Only the original transaction submitter can upgrade the implementation.
Summary
Functions
Detects the contract family behind address.
This initial identity creation is tricky on different chains because of the gas management. We cover three cases
Functions
Detects the contract family behind address.
Order:
- Match EIP-1967 implementation (or the address itself) against known factory
Drive / DriveMember targets — works for Moonbeam DriveMember v114 which has
no
Type()yet, and avoids a revertingType()eth_call. - On-chain
Type()("Drive","DriveMember", …). - Version heuristic: Drive ≥ 150, DriveMember otherwise when
Version()works.
This initial identity creation is tricky on different chains because of the gas management. We cover three cases:
- Diode L1: Gasless chain, anyone can submit their own transactions
- Moonbeam: Third parties can pay the gas for others using the native "Call Permit" PreCompile
- Sapphire: Normal gas payment is needed, after identity creation, we can use MetaTransactions against the identity