RegistryBaseAdmin

View Source: @nomisma/elektro-protocol-aux/contracts/registry/RegistryBaseAdmin.sol

↗ Extends: RegistryBaseStorage, IRegistryBaseAdmin ↘ Derived Contracts: RegistryBaseAdminProxy

RegistryBaseAdmin

Contract is used to register contracts used in our systems and set/initialize storage of the module. Some methods can be only called by registered contracts. It prevents unwanted external method call by third party client Initialization contract for Registry.

Functions

  • initRegistryBase(address _elektroResolver, address _tokenManager, address _tokenValidator)

  • verify(address contractToVerify)

  • isValidContract(address _contract)

  • isValidContractOrUtilityBase(address _contract)

  • contractsLength()

  • getContractByIdx(uint256 idx)

  • _isValidContract(address _contract)

initRegistryBase

Initialization function that can be called only once during initial contract setup initalized state variable ensures that this function cannot be called again. Initializes the storage of the Registry module. Notice the _elektroResolver arg that will save this address to storage to point to the ElektroResolver contract for all Elektro markets.

function initRegistryBase(address _elektroResolver, address _tokenManager, address _tokenValidator) external nonpayable onlyRouterAccess 

Arguments

Name
Type
Description

_elektroResolver

address

address of Resolver contract to be set in

_tokenManager

address

address of TokenManager contract to be set in

_tokenValidator

address

address of TokenValidator contract to be set in

verify

Adding new contract to list of registered contracts.

function verify(address contractToVerify) external nonpayable onlyRouterAccess onlySelf 
returns(instanceId uint256)

Arguments

Name
Type
Description

contractToVerify

address

address of contract to add to the Registry

isValidContract

View that checks if contract is present in Registry storage

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

Arguments

Name
Type
Description

_contract

address

address of contract to validate

isValidContractOrUtilityBase

View that checks if contract is present in Registry storage. This provides an access point to a higher level function from ElektroRegistryAdmin.

function isValidContractOrUtilityBase(address _contract) public view
returns(bool)

Arguments

Name
Type
Description

_contract

address

address of contract to validate

contractsLength

View that returns amount of registered contracts

function contractsLength() public view
returns(uint256)

Arguments

getContractByIdx

Returning registered contract by idx

function getContractByIdx(uint256 idx) public view
returns(address)

Arguments

Name
Type
Description

idx

uint256

address of registered contract

_isValidContract

function _isValidContract(address _contract) internal view
returns(bool)

Arguments

Name
Type
Description

_contract

address

Last updated

Was this helpful?