-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.toml
115 lines (98 loc) · 2.9 KB
/
template.toml
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
# filename somrthing like: "${PUBKEY} ACME Oracle Co.toml"
name = "Dan's Magic Oracle Co."
url ="https://zombo.com"
description_md = """
Some markdown describing the oracle provider.
Twitter: @FacesPics2
"""
[oracle]
type = "public_key | eth_address"
public_key = "69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f"
status = "UNKNOWN|GOOD|SUSPICIOUS|MALICIOUS|RETIRED|COMPROMISED"
status_reason = "Some proofs currently offline" # char limit, allow limited Markdown eg links
first_verified = 2022-01-01T00:00:00Z
last_verified = 2022-12-31T00:00:00Z
# Scenarios:
# - all verified proofs are now down: status = flagged
# - some verified proofs are now down: status = flagged?
# - verified proofs were down but now back: status = good
# - URL used to point to valid proof now points to something else or an invalid proof (because malicious or key change)
# - oralce provider changes their key - new file for v2, flag for v1, mark proofs unavailable if needed, update description
# - compromised key
[[proofs]]
type = "twitter"
format = "url"
url = "https://twitter.com/vegaprotocol/status/956833487230730241"
available = true
[[proofs]]
type = "web"
format = "url"
url = "https://acme.io/proof.txt"
available = true
[[proofs]]
type = "github"
format = "url"
url = "https://github.com/......."
available = true
[[proofs]]
type = "public_key"
format = "signed_message"
public_key= "69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f"
message = "SOMEHEX"
available = true
[[proofs]]
type = "eth_address"
format = "signed_message"
eth_address = "addressA"
message = "SOMEHEX"
available = true
[[proofs]]
type = "linkedin"
format = "url"
url = "https://linkedin.com/......."
available = true
# etc...
# note a new proof type can be added that isn't checkable by any system
# the PR approver should be checking manually and documenting in the PR
# comments should be used if the proof isn't self explanatory
[data]
# In future a section like this could allow specifying a filter templates plus some variables
# and parameters to allow a UI to be presented to set up a good oracle spec. for the oracle
VALID_TIMESTAMP_RANGE = 600 # allow data to be up to 10 mins after settlement date/time
SETTLEMENT_DATETIME = { input_type = "datetime" }
TICKER = { input_type = "list", values = ["LINK", "UNI", "ETH", "BTC"] }
# or TICKER = { input_type = "list", values_url = "https://acme.io/tickers.json" }
[[data.filters]]
template = """
{
"key": {
"name": "prices.${TICKER}.value",
"type": "TYPE_INTEGER"
},
"conditions": [
{
"value": "0",
"operator": "OPERATOR_GREATER_THAN"
}
]
}
"""
[[data.filters]]
template = """
{
"key": {
"name": "prices.${TICKER}.timestamp",
"type": "TYPE_TIMESTAMP"
},
"conditions": [
{
"value": "${SETTLEMENT_DATETIME}",
"operator": "OPERATOR_GREATER_THAN"
},
{
"value": "${SETTLEMENT_DATETIME + VALID_TIMESTAMP_RANGE}",
"operator": "OPERATOR_GREATER_THAN"
}
]
}
"""