-
Notifications
You must be signed in to change notification settings - Fork 189
/
IERC1400TokensValidator.sol
52 lines (47 loc) · 1.51 KB
/
IERC1400TokensValidator.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
// SPDX-License-Identifier: Apache-2.0
/*
* This code has not been reviewed.
* Do not use or deploy this code before reviewing it personally first.
*/
pragma solidity ^0.8.0;
/**
* @title IERC1400TokensValidator
* @dev ERC1400TokensValidator interface
*/
interface IERC1400TokensValidator {
/**
* @dev Verify if a token transfer can be executed or not, on the validator's perspective.
* @param token Token address.
* @param payload Payload of the initial transaction.
* @param partition Name of the partition (left empty for ERC20 transfer).
* @param operator Address which triggered the balance decrease (through transfer or redemption).
* @param from Token holder.
* @param to Token recipient for a transfer and 0x for a redemption.
* @param value Number of tokens the token holder balance is decreased by.
* @param data Extra information.
* @param operatorData Extra information, attached by the operator (if any).
* @return 'true' if the token transfer can be validated, 'false' if not.
*/
struct ValidateData {
address token;
bytes payload;
bytes32 partition;
address operator;
address from;
address to;
uint value;
bytes data;
bytes operatorData;
}
function canValidate(ValidateData calldata data) external view returns(bool);
function tokensToValidate(
bytes calldata payload,
bytes32 partition,
address operator,
address from,
address to,
uint value,
bytes calldata data,
bytes calldata operatorData
) external;
}