-
Notifications
You must be signed in to change notification settings - Fork 2
/
IHoldable.sol
83 lines (78 loc) · 3.12 KB
/
IHoldable.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
pragma solidity ^0.5.0;
interface IHoldable {
enum HoldStatusCode {
Nonexistent,
Ordered,
Executed,
ExecutedAndKeptOpen,
ReleasedByNotary,
ReleasedByPayee,
ReleasedOnExpiration
}
function hold(
string calldata operationId,
address to,
address notary,
uint256 value,
uint256 timeToExpiration
) external returns (bool);
function holdFrom(
string calldata operationId,
address from,
address to,
address notary,
uint256 value,
uint256 timeToExpiration
) external returns (bool);
function holdWithExpirationDate(
string calldata operationId,
address to,
address notary,
uint256 value,
uint256 expiration
) external returns (bool);
function holdFromWithExpirationDate(
string calldata operationId,
address from,
address to,
address notary,
uint256 value,
uint256 expiration
) external returns (bool);
function releaseHold(string calldata operationId) external returns (bool);
function executeHold(string calldata operationId, uint256 value) external returns (bool);
function executeHoldAndKeepOpen(string calldata operationId, uint256 value) external returns (bool);
function renewHold(string calldata operationId, uint256 timeToExpiration) external returns (bool);
function renewHoldWithExpirationDate(string calldata operationId, uint256 expiration) external returns (bool);
function retrieveHoldData(string calldata operationId) external view returns (
address issuer,
address from,
address to,
address notary,
uint256 value,
uint256 expiration,
HoldStatusCode status
);
function balanceOnHold(address account) external view returns (uint256);
function netBalanceOf(address account) external view returns (uint256);
function totalSupplyOnHold() external view returns (uint256);
function authorizeHoldOperator(address operator) external returns (bool);
function revokeHoldOperator(address operator) external returns (bool);
function isHoldOperatorFor(address operator, address from) external view returns (bool);
event HoldCreated(
address indexed holdIssuer,
string operationId,
address from,
address to,
address indexed notary,
uint256 value,
uint256 expiration
);
event HoldExecuted(address indexed holdIssuer, string operationId, address indexed notary, uint256 heldValue, uint256 transferredValue);
event HoldExecutedAndKeptOpen(address indexed holdIssuer, string operationId, address indexed notary, uint256 heldValue,
uint256 transferredValue);
event HoldReleased(address indexed holdIssuer, string operationId, HoldStatusCode status);
event HoldRenewed(address indexed holdIssuer, string operationId, uint256 oldExpiration, uint256 newExpiration);
event HoldOperatorAuthorized(address indexed operator, address indexed account);
event RevokedHoldOperator(address indexed operator, address indexed account);
}