-
Notifications
You must be signed in to change notification settings - Fork 48
/
cancel.tree
55 lines (55 loc) · 3.32 KB
/
cancel.tree
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
cancel.t.sol
├── when delegate called
│ └── it should revert
└── when not delegate called
├── given the ID references a null stream
│ └── it should revert
└── given the ID does not reference a null stream
├── given the stream is cold
│ ├── given the stream's status is "DEPLETED"
│ │ └── it should revert
│ ├── given the stream's status is "CANCELED"
│ │ └── it should revert
│ └── given the stream's status is "SETTLED"
│ └── it should revert
└── given the stream is warm
├── when the caller is unauthorized
│ ├── when the caller is a malicious third party
│ │ └── it should revert
│ └── when the caller is the recipient
│ └── it should revert
└── when the caller is authorized
├── given the stream is not cancelable
│ └── it should revert
└── given the stream is cancelable
├── given the stream's status is "PENDING"
│ ├── it should cancel the stream
│ ├── it should mark the stream as depleted
│ └── it should make the stream not cancelable
└── given the stream's status is "STREAMING"
├── given the recipient is not allowed to hook
│ ├── it should cancel the stream
│ ├── it should mark the stream as canceled
│ └── it should not make Sablier run the recipient hook
└── given the recipient is allowed to hook
├── when the recipient reverts
│ └── it should revert the entire transaction
└── when the recipient does not revert
├── when the recipient hook does not return a valid selector
│ └── it should revert
└── when the recipient hook returns a valid selector
├── when there is reentrancy
│ ├── it should cancel the stream
│ ├── it should mark the stream as canceled
│ ├── it should make Sablier run the recipient hook
│ ├── it should perform a reentrancy call to the Lockup contract
│ └── it should make the withdrawal via the reentrancy
└── when there is no reentrancy
├── it should cancel the stream
├── it should mark the stream as canceled
├── it should make the stream not cancelable
├── it should update the refunded amount
├── it should refund the sender
├── it should make Sablier run the recipient hook
├── it should emit a {MetadataUpdate} event
└── it should emit a {CancelLockupStream} event