Skip to main content

Registry

Overview

The Registry is an immutable contract that stores the addresses of important protocol entities. These addresses can only set and modified by protocol governance.

The Registry stores addresses to core protocol modules such as the Risk Engine, Pool, Position Manager, etc. These are stored using their respective registry key hashes which can be used to query them.

The Registry also stores addresses to interest rate models that can be used by Base Pools. When a new Base Pool is initialized, the creator must pass a registry key hash which corresponds to the interest rate model to be used by the new pool.

State Variables

addressFor

Fetch module address for a given key hash

mapping(bytes32 key => address addr) public addressFor;

rateModelFor

Fetch rate model address for a given key hash

mapping(bytes32 key => address rateModel) public rateModelFor;

Functions

setAddress

Update module address for a given key hash

function setAddress(bytes32 key, address addr) external onlyOwner;

Parameters

NameTypeDescription
keybytes32Registry key hash
addraddressUpdated module address for the key hash

setRateModel

Update rate model address for a given key hash

function setRateModel(bytes32 key, address rateModel) external onlyOwner;

Parameters

NameTypeDescription
keybytes32Registry key hash
rateModeladdressUpdated rate model address for the key hash

Events

AddressSet

Registry address for a given key hash updated

event AddressSet(bytes32 indexed key, address addr);

RateModelSet

Rate model address for a given key hash updated

event RateModelSet(bytes32 indexed key, address addr);