ElektroRegistryAdmin

View Source: contracts/elektro/init/ElektroRegistryAdmin.sol

↗ Extends: ElektroRegistryStorage, Delegator, IElektroRegistryAdmin

ElektroRegistryAdmin

Registry contract of Elektro Protocol. Provides contract registration and verification if contract has been registered. Is responsible for deployment of each Elektro market ({ElektroRouter}).

Contract Members

Constants & Variables

bytes32 private constant ADMIN_ROLE_NAME;

Signature of the {RegistryBase.initRegistryBase} which will initialize {RegistryBaseStorage} which is a part (inherited) of the {ElektroRegistryStorage} Is needed for delegate calls.

bytes4 private constant BASE_INIT_SIG;

Functions

  • deployElektro(address _underlyingCurrency, address _strikeCurrency, uint256 _precisionUnderlyingCurrency, uint256 _precisionStrikeCurrency)

  • initElektroRegistry(address _tokenManager, address _fundLock, address _elektroResolver, address _tokenValidator)

  • isValidContractOrUtility(address _contract)

deployElektro

Deployment of each Elektro market ({ElektroRouter}). First Router contract is deployed, next - Router is added as verified contract. Finally deployment of Elektro contract is executed.

function deployElektro(address _underlyingCurrency, address _strikeCurrency, uint256 _precisionUnderlyingCurrency, uint256 _precisionStrikeCurrency) external nonpayable onlyRole onlyRouterAccess 
returns(address)

Arguments

NameTypeDescription

_underlyingCurrency

address

address of underlyingCurrency asset used in Elektro contract

_strikeCurrency

address

address of strikeCurrency asset used in Elektro contract

_precisionUnderlyingCurrency

uint256

min precision of base token

_precisionStrikeCurrency

uint256

min precision of underlying token

initElektroRegistry

function that sets crucial contracts addresses used by Registry

function initElektroRegistry(address _tokenManager, address _fundLock, address _elektroResolver, address _tokenValidator) external nonpayable onlyRouterAccess 
returns(bool)

Arguments

NameTypeDescription

_tokenManager

address

address of TokenManager contract to be set in

_fundLock

address

address of FundLock contract to be set in

_elektroResolver

address

address of ElektroResolver contract to be set in

_tokenValidator

address

isValidContractOrUtility

Function used by some modifiers or to just check if the a certain contract is registered as a part of Elektro Protocol. Protects from unauthorized calls from external contracts outside of our domain.

function isValidContractOrUtility(address _contract) external view
returns(bool)

Arguments

NameTypeDescription

_contract

address

- address of the contract to check

Last updated