hifi-finance / hifi-protocol

The Hifi fixed-rate, fixed-term lending protocol

Home Page:https://hifi.finance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check that the bond is listed before opening a vault

PaulRBerg opened this issue · comments

Without this check, ghost vaults can be created:

function openVault(FyTokenInterface fyToken) external override returns (bool) {
require(fyToken.isFyToken(), "ERR_OPEN_VAULT_FYTOKEN_INSPECTION");
require(vaults[address(fyToken)][msg.sender].isOpen == false, "ERR_VAULT_OPEN");
vaults[address(fyToken)][msg.sender].isOpen = true;
emit OpenVault(fyToken, msg.sender);
return true;
}

This may require a new function getBondListed in the Fintroller.

Implemented in e7ea749.

Added a new function isBondListed.