-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIStreamEscrow.sol
79 lines (61 loc) · 3.01 KB
/
IStreamEscrow.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
// SPDX-License-Identifier: GPL-3.0
/// @title Interface for Stream Escrow
/*********************************
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
* ░░░░░░█████████░░█████████░░░ *
* ░░░░░░██░░░████░░██░░░████░░░ *
* ░░██████░░░████████░░░████░░░ *
* ░░██░░██░░░████░░██░░░████░░░ *
* ░░██░░██░░░████░░██░░░████░░░ *
* ░░░░░░█████████░░█████████░░░ *
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
*********************************/
pragma solidity ^0.8.19;
interface IStreamEscrow {
event ETHStreamedToDAO(uint256 amount);
event StreamCreated(
uint256 indexed nounId,
uint256 totalAmount,
uint16 streamLengthInTicks,
uint256 ethPerTick,
uint128 newEthStreamedPerTick,
uint32 lastTick
);
event StreamsForwarded(
uint256 currentTick,
uint256 ethPerTickStreamEnded,
uint256 nextEthStreamedPerTick,
uint256 lastForwardTimestamp
);
event StreamCanceled(uint256 indexed nounId, uint256 amountToRefund, uint128 ethStreamedPerTick);
event StreamFastForwarded(
uint256 indexed nounId,
uint256 ticksToForward,
uint256 newLastTick,
uint128 ethStreamedPerTick
);
event AllowedToCreateStreamChanged(address address_, bool allowed);
event DAOExecutorAddressSet(address newAddress);
event ETHRecipientSet(address newAddress);
event NounsRecipientSet(address newAddress);
struct Stream {
uint128 ethPerTick;
bool canceled;
uint32 lastTick;
}
function forwardAllAndCreateStream(uint256 nounId, uint16 streamLengthInTicks) external payable;
function createStream(uint256 nounId, uint16 streamLengthInTicks) external payable;
function forwardAll() external;
function cancelStreams(uint256[] calldata nounIds) external;
function cancelStream(uint256 nounId) external;
function fastForwardStream(uint256 nounId, uint32 ticksToForward) external;
function isStreamActive(uint256 nounId) external view returns (bool);
function getStream(uint256 nounId) external view returns (Stream memory);
function setAllowedToCreateStream(address address_, bool allowed) external;
function setDAOExecutorAddress(address newAddress) external;
function setETHRecipient(address newAddress) external;
function setNounsRecipient(address newAddress) external;
function currentTick() external view returns (uint32);
}