-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCollateralFilter.sol
60 lines (52 loc) · 1.76 KB
/
CollateralFilter.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title Collateral Filter API
* @author MetaStreet Labs
*/
abstract contract CollateralFilter {
/**************************************************************************/
/* Errors */
/**************************************************************************/
/**
* @notice Invalid parameters
*/
error InvalidCollateralFilterParameters();
/**************************************************************************/
/* API */
/**************************************************************************/
/**
* @notice Get collateral filter name
* @return Collateral filter name
*/
function COLLATERAL_FILTER_NAME() external view virtual returns (string memory);
/**
* @notice Get collateral filter version
* @return Collateral filter version
*/
function COLLATERAL_FILTER_VERSION() external view virtual returns (string memory);
/**
* @notice Get collateral token
* @return Collateral token contract
*/
function collateralToken() public view virtual returns (address);
/**
* @notice Get collateral tokens
* @return Collateral token contract
*/
function collateralTokens() external view virtual returns (address[] memory);
/**
* Query if collateral token is supported
* @param token Collateral token contract
* @param tokenId Collateral Token ID
* @param index Collateral Token ID index
* @param context ABI-encoded context
* @return True if supported, otherwise false
*/
function _collateralSupported(
address token,
uint256 tokenId,
uint256 index,
bytes calldata context
) internal view virtual returns (bool);
}