PoolAddressesProvider

Git Source

Inherits: Adminable, IPoolAddressesProvider

State Variables

_marketId

string private _marketId;

_addresses

mapping(bytes32 => address) private _addresses;

POOL

bytes32 private constant POOL = "POOL";

POOL_CONFIGURATOR

bytes32 private constant POOL_CONFIGURATOR = "POOL_CONFIGURATOR";

ISLE_GLOBALS

bytes32 private constant ISLE_GLOBALS = "ISLE_GLOBALS";

LOAN_MANAGER

bytes32 private constant LOAN_MANAGER = "LOAN_MANAGER";

WITHDRAWAL_MANAGER

bytes32 private constant WITHDRAWAL_MANAGER = "WITHDRAWAL_MANAGER";

Functions

constructor

constructor(string memory marketId_, address initialAdmin_);

getMarketId

function getMarketId() external view returns (string memory);

setMarketId

function setMarketId(string memory newMarketId_) external onlyAdmin;

getPoolConfigurator

Returns the address of the PoolConfigurator proxy.

function getPoolConfigurator() external view override returns (address);

Returns

NameTypeDescription

<none>

address

The PoolConfigurator proxy address

setPoolConfiguratorImpl

Updates the implementation of the PoolConfigurator, or creates a proxy setting the new PoolConfigurator implementation when the function is called for the first time.

function setPoolConfiguratorImpl(address newPoolConfiguratorImpl, bytes calldata params) external override onlyAdmin;

Parameters

NameTypeDescription

newPoolConfiguratorImpl

address

The new PoolConfigurator implementation

params

bytes

getLoanManager

Returns the address of the LoanManager proxy.

function getLoanManager() external view override returns (address);

Returns

NameTypeDescription

<none>

address

The LoanManager proxy address

setLoanManagerImpl

Updates the implementation of the LoanManager, or creates a proxy setting the new LoanManager implementation when the function is called for the first time.

function setLoanManagerImpl(address newLoanManagerImpl) external override onlyAdmin;

Parameters

NameTypeDescription

newLoanManagerImpl

address

The new LoanManager implementation

getWithdrawalManager

Returns the address of the WithdrawalManager proxy.

function getWithdrawalManager() external view override returns (address);

Returns

NameTypeDescription

<none>

address

The WithdrawalManager proxy address

setWithdrawalManagerImpl

Updates the implementation of the WithdrawalManager, or creates a proxy setting the new WithdrawalManager implementation when the function is called for the first time.

function setWithdrawalManagerImpl(
    address newWithdrawalManagerImpl,
    bytes calldata params
)
    external
    override
    onlyAdmin;

Parameters

NameTypeDescription

newWithdrawalManagerImpl

address

The new WithdrawalManager implementation

params

bytes

setAddressAsProxy

General function to update the implementation of a proxy registered with certain id. If there is no proxy registered, it will instantiate one and set as implementation the newImplementationAddress.

IMPORTANT Use this function carefully, only for ids that don't have an explicit setter function, in order to avoid unexpected consequences

function setAddressAsProxy(
    bytes32 id,
    address newImplementationAddress,
    bytes calldata params
)
    external
    override
    onlyAdmin;

Parameters

NameTypeDescription

id

bytes32

The id

newImplementationAddress

address

The address of the new implementation

params

bytes

The intialization parameters for the proxied contract

getIsleGlobals

Returns the address of isle globals.

function getIsleGlobals() external view override returns (address);

Returns

NameTypeDescription

<none>

address

The IsleGlobals address

setIsleGlobals

Sets an address for IsleGlobals replacing the address saved in the addresses map

function setIsleGlobals(address newIsleGlobals) external override onlyAdmin;

Parameters

NameTypeDescription

newIsleGlobals

address

IsleGlobals address

getAddress

Returns an address by its identifier.

The returned address might be an EOA or a contract, potentially proxied

function getAddress(bytes32 id) public view override returns (address);

Parameters

NameTypeDescription

id

bytes32

The id

Returns

NameTypeDescription

<none>

address

The address of the registered for the specified id

setAddress

Sets an address for an id replacing the address saved in the addresses map.

IMPORTANT Use this function carefully, as it will do a hard replacement

function setAddress(bytes32 id, address newAddress) external override onlyAdmin;

Parameters

NameTypeDescription

id

bytes32

The id

newAddress

address

The address to set

_updateImpl

Internal function to update the implementation of a specific proxied component of the protocol.

If there is no proxy registered with the given identifier, it creates the proxy setting newAddress as implementation and calls the initialize() function on the proxy

If there is already a proxy registered, it just updates the implementation to newAddress and calls the initialize() function via upgradeToAndCall() in the proxy

function _updateImpl(bytes32 id, address newAddress) internal;

Parameters

NameTypeDescription

id

bytes32

The id of the proxy to be updated

newAddress

address

The address of the new implementation

_updateImpl

function _updateImpl(bytes32 id, address newAddress, bytes memory params) internal;

_setMarketId

Updates the identifier of the Isle market.

function _setMarketId(string memory newMarketId) internal;

Parameters

NameTypeDescription

newMarketId

string

The new id of the market

_getProxyImplementation

Returns the the implementation contract of the proxy contract by its identifier.

It returns ZERO if there is no registered address with the given id

It reverts if the registered address with the given id is not InitializableImmutableAdminUpgradeabilityProxy

function _getProxyImplementation(bytes32 id) internal view returns (address);

Parameters

NameTypeDescription

id

bytes32

The id

Returns

NameTypeDescription

<none>

address

The address of the implementation contract

Last updated