Elektro Contracts

All business logic and registry contracts of Elektro Protocol

Contracts:

Functionality module responsible for settling trades. Can ONLY be called by the Java Backend bearing Utility Account role.

Consists of Initializer, Registry, EventEmitter, Ledger and Utilities contracts.

Elektro Initialize

Initializes storage used by ElektroLedger contracts that is tied to ElektroRouter by accepting a call from ElektroRegistry upon the deployment of a new Market (ElektroRouter). Calls other validation contracts like TokenValidator to whitelist an asset pair for a new market.

Elektro Registry Module

This is the registry of the elektro-protocol. Despite it's name it does not only provide registry functionality for the multiple options markets but also features the core functionality to keep track of the base contracts of the system. It’s storage also holds addresses of some of the auxiliary contracts in the system (TokenManager, TokenValidator, etc.).

Contracts

Proxy Pattern Contracts

  • ElektroRegistryRouter - main address for all incoming calls and storage holder of the module

  • ElektroRegistryResolver - resolver contract holding information about all external functionality to help ElektroRegistryRouter to route calls to implementation contracts

Implementation Contracts

  • RegistryBaseAdmin - Provides the basic functions of the registry for the general contracts such as the TokenManager, initializes the RegistryBaseStorage of the module at construction of the ElektroRegistryRouter and is a base contract inherited by ElektroRegistryAdmin.

  • RegistryBaseSetters - Allows accounts bearing the Governor role to update the addresses for contracts of the system and other state variables. Inherited by ElektroRegistrySetters.

  • ElektroRegistryAdmin - Provides the functions of the registry for the Elektro specific contracts such as the FundLock or options market. Allows accounts bearing the Admin role to deploy, initialize and register new option markets into the system and initialize Registry Storage.

  • ElektroRegistrySetters - Allows accounts bearing the Governor role to update the addresses of the Elektro contracts.

  • ElektroRegistryStorage extends the RegistryBaseStorage and outlines the storage of the whole module which is tied to the ElektroRegistryRouter.

All RegistryBase contracts are a part of elektro-protocol-aux repository and are not being deployed directly, but inherited by ElektroRegistry implementation contracts.

Elektro Event Emitter Module

Module responsible for all trade settlement related events.

ElektroEventEmitter does NOT include events of FundLock!

Contracts

  • ElektroEventEmitterRouter – router of the module

  • ElektroEventEmitterResolver – resolver of the module

  • ElektroEventEmitter – implementation contract that fires all events related to Elektro trade settlements

  • IElektroEventEmitterEvents – interface declaring all Elektro trading settlement related events.

The Elektro Markets

For each options market (asset pair) a separate ElektroRouter contract is deployed which uses the same implementation contracts as other ElektroRouters (markets). All ElektroRouter contracts share one ElektroResolver contract to resolve function signatures to the addresses of their respective implementation contracts. All on-chain options market functionality is to be called by the backend only.

Implementation Contracts

  • ElektroLedgerUpdate – settlement logic for trading.

  • ElektroSetters - This is a contract with only one setter function setElektroEventEmitter.

  • ElektroInitialize - One function contract with Elektro market initialization logic. See "Elektro Initialize" section.

Additionally some Elektro utility contracts are deployed:

  • ElektroMultiplierAware – utility contract to get whitelisted token precisions and token denomination multipliers.

Last updated