RevestAddressRegistry

This contract is the router, it keeps track of all contracts and allows interchangeability among some of the contracts.

Code

Read-Only Functions

getAdmin

function getAdmin() external view override returns (address) {
    return _addresses[ADMIN];
}

Gets the admin address where ERC20s from the ERC20 fees are routed.

getLockManager

function getLockManager() external view override returns (address) {
    return getAddress(LOCK_MANAGER);
}

Gets the address of ILockManager that manages locks.

getTokenVault

function getTokenVault() external view override returns (address) {
    return getAddress(TOKEN_VAULT);
}

Gets the address of ITokenVault where ERC20 tokens should be stored.

getRevest

function getRevest() external view override returns (address) {
    return getAddress(REVEST);
}

Gets the address of IRevest where entries to contract writable methods should be made.

getRevestFNFT

function getRevestFNFT() external view override returns (address) {
    return _addresses[FNFT];
}

Gets the address of IFNFTHandler where the minter lives and where info about supply may be found.

getMetadataHandler

function getMetadataHandler() external view override returns (address) {
    return _addresses[METADATA];
}

Gets the address of IMetadataHandler that serves info about the tokenURI and may even deal in on-chain data in the future.

getDEX

function getDEX(uint index) external view override returns (address) {
    return _dex[index];
}

Gets the DEX stored at the given index in the dex array.

getRevestToken

function getRevestToken() external view override returns (address) {
    return _addresses[REVEST_TOKEN];
}

Gets the address for the RVST token.

getRewardsHandler

function getRewardsHandler() external view override returns(address) {
    return _addresses[ESCROW];
}

Gets the address for IRewardsHandler, which handles staking and fee distribution.

getLPs

function getLPs() external view override returns (address) {
    return _addresses[LIQUIDITY_TOKENS];
}

Gets the address for the RVST liquidity-pool tokens. Used to validate LP staking positions.

getAddress

function getAddress(bytes32 id) public view override returns (address) {
    return _addresses[id];
}

Allows more direct read access to the address array in IAddressRegistry with the bytes32 ID for each entry as an input.

State-Changing Functions

setAdmin

function setAdmin(address admin) external override onlyOwner {
    _addresses[ADMIN] = admin;
}

Sets the admin address.

setLockManager

function setLockManager(address manager) external override onlyOwner {
    _addresses[LOCK_MANAGER] = manager;
}

Sets the address of ILockManager used in production. Immutable, will not be used in production beyond initialization.

setTokenVault

function setTokenVault(address vault) external override onlyOwner {
    _addresses[TOKEN_VAULT] = vault;
}

Sets the address of ITokenVault used in production. Immutable, will not be used in production beyond initialization.

setRevest

function setRevest(address revest) external override onlyOwner {
    _addresses[REVEST] = revest;
}

Sets the address of IRevest which will handle inbound requests. Upgradeable, may be changed during production. Recommend that people use this registry as entry point to Revest.sol.

setRevestFNFT

function setRevestFNFT(address fnft) external override onlyOwner {
    _addresses[FNFT] = fnft;
}

Sets the address of IFNFTHandler used in production. Immutable, will not be used in production beyond initialization.

setMetadataHandler

function setMetadataHandler(address metadata) external override onlyOwner {
    _addresses[METADATA] = metadata;
}

Sets the address of IMetadataHandler to allow for total upgradeability of metadata storage as the protocol progresses.

setDex

function setDex(address dex) external override onlyOwner {
    _dex[next_dex] = dex;
    next_dex = next_dex + 1;
}

Adds a DEX to the dex array.

setRevestToken

function setRevestToken(address token) external override onlyOwner {
    _addresses[REVEST_TOKEN] = token;
}

Sets the address for the RVST token. Only used at launch.

setRewardsHandler

function setRewardsHandler(address esc) external override onlyOwner {
    _addresses[ESCROW] = esc;
}

Sets the address of IRewardsHandler, only used at launch.

setLPs

function setLPs(address liquidToken) external override onlyOwner {
    _addresses[LIQUIDITY_TOKENS] = liquidToken;
}

Sets the address for the RVST liquidity-pool tokens.

Interface

// SPDX-License-Identifier: GNU-GPL v3.0 or later

pragma solidity >=0.8.0;

/**
 * @title Provider interface for Revest FNFTs
 * @dev
 *
 */
interface IAddressRegistry {

    function initialize(
        address lock_manager_,
        address liquidity_,
        address revest_token_,
        address token_vault_,
        address revest_,
        address fnft_,
        address metadata_,
        address admin_,
        address rewards_
    ) external;

    function getAdmin() external view returns (address);

    function setAdmin(address admin) external;

    function getLockManager() external view returns (address);

    function setLockManager(address manager) external;

    function getTokenVault() external view returns (address);

    function setTokenVault(address vault) external;

    function getRevestFNFT() external view returns (address);

    function setRevestFNFT(address fnft) external;

    function getMetadataHandler() external view returns (address);

    function setMetadataHandler(address metadata) external;

    function getRevest() external view returns (address);

    function setRevest(address revest) external;

    function getDEX(uint index) external view returns (address);

    function setDex(address dex) external;

    function getRevestToken() external view returns (address);

    function setRevestToken(address token) external;

    function getRewardsHandler() external view returns(address);

    function setRewardsHandler(address esc) external;

    function getAddress(bytes32 id) external view returns (address);

    function getLPs() external view returns (address);

    function setLPs(address liquidToken) external;

}

ABI

Last updated