forked from JakubNer/gamified-citizen-toll-enforcement
-
Notifications
You must be signed in to change notification settings - Fork 0
/
toll-enforce-reconcile.json
84 lines (84 loc) · 9.22 KB
/
toll-enforce-reconcile.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
{
"$connections": {
"value": {
"blockchainethereum": {
"connectionId": "/subscriptions/02c27727-30e5-4ae2-b0a3-a42f80a73007/resourceGroups/test-rg/providers/Microsoft.Web/connections/blockchainethereum-3",
"connectionName": "blockchainethereum-3",
"id": "/subscriptions/02c27727-30e5-4ae2-b0a3-a42f80a73007/providers/Microsoft.Web/locations/eastus/managedApis/blockchainethereum"
}
}
},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Execute_smart_contract_function_(incurring_gas_cost)": {
"inputs": {
"body": {
"carAddress": "@triggerBody()['carAddress']",
"isGood": "@triggerBody()['isGood']"
},
"host": {
"connection": {
"name": "@parameters('$connections')['blockchainethereum']['connectionId']"
}
},
"method": "post",
"path": "/contract/functions/@{encodeURIComponent(encodeURIComponent('reconcileReport'))}/execute",
"queries": {
"abi": "[{\"constant\":true,\"inputs\":[{\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"isPermittedInZoneA\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"carToZoneBTimeoutUnixTime\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"rewardValue\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberCurrentCars\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"reports\",\"outputs\":[{\"name\":\"isPending\",\"type\":\"bool\"},{\"name\":\"bountyHunter\",\"type\":\"address\"},{\"name\":\"bountyExpirationUnixTime\",\"type\":\"uint256\"},{\"name\":\"carXCoordinate\",\"type\":\"uint256\"},{\"name\":\"carYCoordinate\",\"type\":\"uint256\"},{\"name\":\"stakedValue\",\"type\":\"uint256\"},{\"name\":\"rewardValue\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"isPermittedInZoneC\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"currentCars\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"getZoneCTimeout\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"carAddress\",\"type\":\"address\"},{\"name\":\"isGood\",\"type\":\"bool\"}],\"name\":\"reconcileReport\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"bountyTimePeriodSeconds\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"carToZoneCTimeoutUnixTime\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"forCar\",\"type\":\"address\"},{\"name\":\"byWhom\",\"type\":\"bytes32\"},{\"name\":\"newZoneTimeoutsBytes\",\"type\":\"bytes32\"},{\"name\":\"carSigHash\",\"type\":\"bytes32\"},{\"name\":\"carSigV\",\"type\":\"uint8\"},{\"name\":\"carSigR\",\"type\":\"bytes32\"},{\"name\":\"carSigS\",\"type\":\"bytes32\"}],\"name\":\"topup\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"getZoneATimeout\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"getZoneBTimeout\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"minStakeValue\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"carToZoneATimeoutUnixTime\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"carAddress\",\"type\":\"address\"},{\"name\":\"carXCoordinate\",\"type\":\"uint256\"},{\"name\":\"carYCoordinate\",\"type\":\"uint256\"},{\"name\":\"zoneIndex\",\"type\":\"uint256\"}],\"name\":\"doReport\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_rewardValue\",\"type\":\"uint256\"},{\"name\":\"_minStakeValue\",\"type\":\"uint256\"},{\"name\":\"_bountyTimePeriodSeconds\",\"type\":\"uint256\"}],\"name\":\"admin\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"expireReports\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"isPermittedInZoneB\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"payeeHashToLastPaymentUnixTime\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"currentReports\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberCurrentReports\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"purgeCars\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"forCar\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"byWhom\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"newZoneATimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"newZoneBTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"newZoneCTimeout\",\"type\":\"uint256\"}],\"name\":\"Topup\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"forCar\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"carXCoordinate\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"carYCoordinate\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"zoneIndex\",\"type\":\"uint256\"}],\"name\":\"NewReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"BadReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"GoodReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"forCar\",\"type\":\"address\"}],\"name\":\"ExpiredReport\",\"type\":\"event\"}]",
"contractAddress": "@triggerBody()['contractAddress']"
}
},
"runAfter": {},
"type": "ApiConnection"
},
"Response": {
"inputs": {
"statusCode": 200
},
"kind": "Http",
"runAfter": {
"Execute_smart_contract_function_(incurring_gas_cost)": [
"Succeeded"
]
},
"type": "Response"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"manual": {
"inputs": {
"schema": {
"properties": {
"carAddress": {
"type": "string"
},
"contractAddress": {
"type": "string"
},
"isGood": {
"type": "boolean"
}
},
"required": [
"contractAddress",
"carAddress",
"isGood"
],
"type": "object"
}
},
"kind": "Http",
"type": "Request"
}
}
}
}