Skip to main content

Perspectives

Directory: src/Perspectives

Collection of contracts that encode validity criteria for the EVK credit vaults.

Since the EVK is a kit, it attempts to be maximally flexible and doesn't enforce policy decisions on vault creators. This means that it is possible to create vaults with insecure or malicious configurations. Furthermore, an otherwise secure vault may be insecure because it accepts an insecure collateral as collateral (or a collateral vault itself accepts insecure collateral, etc, recursively).

Perspectives provide a mechanism for validating properties of a vault using on-chain verifiable logic. A perspective is a contract that implements the following interface:

interface IPerspective {
function perspectiveVerify(address vault, bool failEarly) external;

function isVerified(address vault) external view returns (bool);

function verifiedLength() external view returns (uint256);

function verifiedArray() external view returns (address[] memory);
}

perspectiveVerify will inspect the configuration of the provided vault and determine whether it meets the desired properties of this particular perspective and, if so, will record this fact in its storage. This recorded fact can be thought of as a cached or memoised value, so the gas-expensive verification only needs to happen once. Afterwards, isVerified and verifiedArray can be used to cheaply read this cached result.

Note that there is not necessarily any mechanism to invalidate the cache, so most perspectives should reject vaults that have a governor installed who could change the configuration to something not suitable. Alternatively, perspectives may check that the governor is a trusted entity, or perhaps that the governor is a limited contract and the verified values be changed by the governor.

Token (Vault) Lists

The primary use-case of perspectives is to provide a permissionless, on-chain approximation of Token Lists. Perspectives do not replace Token Lists, and user interfaces may choose to use both of these systems. A vault can be matched by many perspectives, and there is nothing stopping anybody from making a new perspective for any purpose.

Just like with Token Lists, user interfaces will allow users to import which perspectives they would like to use to filter vaults that don't meet their trust criteria. Advanced UIs may support special filtering features, such as "all vaults that meet 2 or more of the configured perspectives", or "all vaults on this perspective but not on this perspective".

Although any contract that conforms to IPerspective can be used as a perspective, we have created a flexible reference implementation that users or projects can adapt to fit their requirements.

If your UI would like to display vaults that conform to specific criteria, you can rely on the verifiedArray function of the already deployed perspective(s) or deploy your own.

For more details, including perspective types see whitepaper.