Registry contract
Overview
The Registry contract is the central storage and routing system of the Vanna Protocol. It maps all critical contract addresses, VTokens, and user accounts. This contract acts as the single source of truth for verifying and referencing all active entities within the protocol
State Variables
initialized
bool
Ensures init() is only called once
keys
string[]
List of all registered contract identifiers
accounts
address[]
List of all user accounts
vTokens
address[]
List of all active VToken contracts
ownerFor
mapping(address => address)
Maps account addresses to their owners
VTokenFor
mapping(address => address)
Maps underlying tokens to their VToken
addressFor
mapping(string => address)
Maps identifier strings to contract addresses
Initialization
init
Initializes the Registry with the deployer as the admin.
function init() externalsetAddress
Registers or updates a contract address.
getAddress
Returns the address for a given identifier.
VToken Management
setVToken
Registers or updates the VToken contract for a specific underlying token.
getAllVTokens
Returns an array of all currently active VToken addresses in the system.
Account Management
addAccount
Registers a new account with its owner.
updateAccount
Updates ownership of an existing account.
closeAccount
Closes an account by removing its owner.
accountsOwnedBy
Returns all accounts owned by a given user.
getAllAccounts
Returns all protocol-managed accounts.
Last updated