forked from runtimeverification/verified-smart-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec-tmpl.k
76 lines (76 loc) · 2.22 KB
/
spec-tmpl.k
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
// {RULENAME} {COMMENT}
rule
<kevm>
<k> {K} </k>
<mode> NORMAL </mode>
<schedule> {SCHEDULE} </schedule>
<ethereum>
<evm>
<output> {OUTPUT} </output>
<statusCode> {STATUS_CODE} </statusCode>
<touchedAccounts> _ => _ </touchedAccounts>
<callState>
<program> #parseByteStack({CODE}) </program>
<jumpDests> #computeValidJumpDests(#parseByteStack({CODE})) </jumpDests>
<id> {THIS} </id> // this
<caller> {MSG_SENDER} </caller> // msg.sender
<callData> {CALL_DATA} </callData> // msg.data
<callValue> {CALL_VALUE} </callValue> // msg.value
<wordStack> {WORD_STACK} </wordStack>
<localMem> {LOCAL_MEM} </localMem>
<pc> {PC} </pc>
<gas> {GAS} </gas>
<memoryUsed> {MEMORY_USED} </memoryUsed>
<callGas> _ => _ </callGas>
<static> false </static> // NOTE: non-static call
<callDepth> {CALL_DEPTH} </callDepth>
</callState>
<substate>
<log> {LOG} </log>
<refund> {REFUND} </refund>
...
</substate>
...
</evm>
<network>
<activeAccounts> {ACTIVE_ACCOUNTS} SetItem({THIS}) SetItem(2) SetItem(4) _:Set </activeAccounts>
<accounts>
<account>
<acctID> {THIS} </acctID>
<balance> {BALANCE} </balance>
<code> #parseByteStack({CODE}) </code>
<storage> {STORAGE} </storage>
<origStorage> {ORIG_STORAGE} </origStorage>
<nonce> {NONCE} </nonce>
</account>
<account>
// precompiled account for SHA256
<acctID> 2 </acctID>
<balance> 0 </balance>
<code> .WordStack </code>
<storage> .Map </storage>
<origStorage> .Map </origStorage>
<nonce> 0 </nonce>
</account>
<account>
// precompiled account for ID
<acctID> 4 </acctID>
<balance> 0 </balance>
<code> .WordStack </code>
<storage> .Map </storage>
<origStorage> .Map </origStorage>
<nonce> 0 </nonce>
</account>
{ACCOUNTS}
...
</accounts>
...
</network>
</ethereum>
...
</kevm>
requires true
{REQUIRES}
ensures true
{ENSURES}
{ATTRIBUTE}