-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinterface.json
168 lines (168 loc) · 4.72 KB
/
interface.json
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
"name": "Fiat Swap",
"address": {
"ropsten": "0xF95A3a86E680f9AC3e56875fbf68BB370892ac3c",
"optimism": "0xad868E2048A73181163074944e8E12698F7BCFD1",
"arbitrum": "0xcB3420B31B75a938D937713C434d2379640E496F"
},
"descriptions": {
"contract": "This contract allows you to buy tokens from any person who uses the same digital payment service as you, even if you don't know or trust them. For now, only Venmo is supported. Every transaction has a unique offerID which can be computed from the off-chain payment details via the offerID function. As long as no third party knows (or guesses) the buyerSellerSecret, the offer ID does not reveral the off-chain payment details, so they stay private between buyer and seller.",
"buyTokens": "Accept an offer you received, by generating an enclave proof that you made the specific online payment identified by offerID.",
"offerID": "Compute the offerID from the payment details:\n handle (username) of the seller, the price in cents, the message you must use in the transaction, the payment service (must be 'Venmo' for now), and a secret known to both parties.",
"retractOffer": "Retract an offer you made, if its timelock has lapsed.",
"secondsLocked": "Check how many seconds are left for the buyer to verify the online payment for a specific offer, before the seller can retract it again.",
"amountOffered": "Check how much, if any, ETH you would get for accepting a specific offerID.",
"offerTokens": "Make an offer to a specific buyer, by locking ETH for some period of time in which only the buyer can withdraw it via an enclave proof that they performed the fiat transaction identified by offerID."
},
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "user",
"type": "address"
},
{
"internalType": "bytes32",
"name": "offerID",
"type": "bytes32"
}
],
"name": "buyTokens",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "sellerHandle",
"type": "string"
},
{
"internalType": "uint256",
"name": "priceInCent",
"type": "uint256"
},
{
"internalType": "string",
"name": "transactionMessage",
"type": "string"
},
{
"internalType": "string",
"name": "paymentService",
"type": "string"
},
{
"internalType": "string",
"name": "buyerSellerSecret",
"type": "string"
}
],
"name": "offerID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "offerID",
"type": "bytes32"
},
{
"internalType": "address",
"name": "buyerAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "lockForSeconds",
"type": "uint256"
}
],
"name": "offerTokens",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "offerID",
"type": "bytes32"
}
],
"name": "retractOffer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "offerID",
"type": "bytes32"
}
],
"name": "secondsLocked",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "offerID",
"type": "bytes32"
}
],
"name": "amountOffered",
"outputs": [
{
"internalType": "uint256",
"name": "ETH",
"type": "uint256",
"decimals": 18
}
],
"stateMutability": "view",
"type": "function"
}
]
}