Skip to content

Commit

Permalink
Fixed bug in test and added test for opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
merendamattia committed Dec 29, 2024
1 parent afdb6f3 commit 5a00323
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 325 deletions.
2 changes: 1 addition & 1 deletion evm-testcases/taint/example08/example08.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ PUSH1 0x10
ADDMOD
ORIGIN
MSTORE8
PUSH! 0x20
PUSH1 0x20
SSTORE
10 changes: 5 additions & 5 deletions evm-testcases/taint/example08/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"files" : [ "report.json", "untyped_program.evm-testcases_taint_example08_example08.sol().json" ],
"info" : {
"cfgs" : "1",
"duration" : "350ms",
"end" : "2024-12-17T12:09:41.339+01:00",
"expressions" : "4",
"duration" : "107ms",
"end" : "2024-12-29T10:31:09.534+01:00",
"expressions" : "5",
"files" : "1",
"globals" : "0",
"members" : "1",
"programs" : "1",
"start" : "2024-12-17T12:09:40.989+01:00",
"statements" : "11",
"start" : "2024-12-29T10:31:09.427+01:00",
"statements" : "12",
"units" : "0",
"version" : "0.1",
"warnings" : "0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,319 +1 @@
{
"name": "untyped program::evm-testcases/taint/example08/example08.sol()",
"description": null,
"nodes": [
{
"id": 0,
"subNodes": [
1
],
"text": "PUSH1 0x20"
},
{
"id": 1,
"text": "0x20"
},
{
"id": 2,
"subNodes": [
3
],
"text": "PUSH1 0x10"
},
{
"id": 3,
"text": "0x10"
},
{
"id": 4,
"text": "GAS"
},
{
"id": 5,
"text": "NOT"
},
{
"id": 6,
"subNodes": [
7
],
"text": "PUSH1 0x30"
},
{
"id": 7,
"text": "0x30"
},
{
"id": 8,
"subNodes": [
9
],
"text": "PUSH1 0x10"
},
{
"id": 9,
"text": "0x10"
},
{
"id": 10,
"text": "ADDMOD"
},
{
"id": 11,
"text": "ORIGIN"
},
{
"id": 12,
"text": "MSTORE8"
},
{
"id": 13,
"text": "SSTORE"
},
{
"id": 14,
"text": "ret"
}
],
"edges": [
{
"sourceId": 0,
"destId": 2,
"kind": "SequentialEdge"
},
{
"sourceId": 2,
"destId": 4,
"kind": "SequentialEdge"
},
{
"sourceId": 4,
"destId": 5,
"kind": "SequentialEdge"
},
{
"sourceId": 5,
"destId": 6,
"kind": "SequentialEdge"
},
{
"sourceId": 6,
"destId": 8,
"kind": "SequentialEdge"
},
{
"sourceId": 8,
"destId": 10,
"kind": "SequentialEdge"
},
{
"sourceId": 10,
"destId": 11,
"kind": "SequentialEdge"
},
{
"sourceId": 11,
"destId": 12,
"kind": "SequentialEdge"
},
{
"sourceId": 12,
"destId": 13,
"kind": "SequentialEdge"
},
{
"sourceId": 13,
"destId": 14,
"kind": "SequentialEdge"
}
],
"descriptions": [
{
"nodeId": 0,
"description": {
"expressions": [
"push \"0x20\""
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C]"
}
}
},
{
"nodeId": 1,
"description": {
"expressions": [
"\"0x20\""
],
"state": "#TOP#"
}
},
{
"nodeId": 2,
"description": {
"expressions": [
"push \"0x10\""
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C]"
}
}
},
{
"nodeId": 3,
"description": {
"expressions": [
"\"0x10\""
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C]"
}
}
},
{
"nodeId": 4,
"description": {
"expressions": [
"gas 1"
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"
}
}
},
{
"nodeId": 5,
"description": {
"expressions": [
"not 1"
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"
}
}
},
{
"nodeId": 6,
"description": {
"expressions": [
"push \"0x30\""
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C, C]"
}
}
},
{
"nodeId": 7,
"description": {
"expressions": [
"\"0x30\""
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"
}
}
},
{
"nodeId": 8,
"description": {
"expressions": [
"push \"0x10\""
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C, C, C]"
}
}
},
{
"nodeId": 9,
"description": {
"expressions": [
"\"0x10\""
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C, C]"
}
}
},
{
"nodeId": 10,
"description": {
"expressions": [
"addmod 1"
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"
}
}
},
{
"nodeId": 11,
"description": {
"expressions": [
"origin 1"
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C, T]"
}
}
},
{
"nodeId": 12,
"description": {
"expressions": [
"mstore8 1"
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C]"
}
}
},
{
"nodeId": 13,
"description": {
"expressions": [
"sstore 1"
],
"state": {
"heap": "monolith",
"type": "#TOP#",
"value": "[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_]"
}
}
},
{
"nodeId": 14,
"description": {
"expressions": [
"skip"
],
"state": "#TOP#"
}
}
]
}
{"name":"untyped program::evm-testcases/taint/example08/example08.sol()","description":null,"nodes":[{"id":0,"subNodes":[1],"text":"PUSH1 0x20"},{"id":1,"text":"0x20"},{"id":2,"subNodes":[3],"text":"PUSH1 0x10"},{"id":3,"text":"0x10"},{"id":4,"text":"GAS"},{"id":5,"text":"NOT"},{"id":6,"subNodes":[7],"text":"PUSH1 0x30"},{"id":7,"text":"0x30"},{"id":8,"subNodes":[9],"text":"PUSH1 0x10"},{"id":9,"text":"0x10"},{"id":10,"text":"ADDMOD"},{"id":11,"text":"ORIGIN"},{"id":12,"text":"MSTORE8"},{"id":13,"subNodes":[14],"text":"PUSH1 0x20"},{"id":14,"text":"0x20"},{"id":15,"text":"SSTORE"},{"id":16,"text":"ret"}],"edges":[{"sourceId":0,"destId":2,"kind":"SequentialEdge"},{"sourceId":2,"destId":4,"kind":"SequentialEdge"},{"sourceId":4,"destId":5,"kind":"SequentialEdge"},{"sourceId":5,"destId":6,"kind":"SequentialEdge"},{"sourceId":6,"destId":8,"kind":"SequentialEdge"},{"sourceId":8,"destId":10,"kind":"SequentialEdge"},{"sourceId":10,"destId":11,"kind":"SequentialEdge"},{"sourceId":11,"destId":12,"kind":"SequentialEdge"},{"sourceId":12,"destId":13,"kind":"SequentialEdge"},{"sourceId":13,"destId":15,"kind":"SequentialEdge"},{"sourceId":15,"destId":16,"kind":"SequentialEdge"}],"descriptions":[{"nodeId":0,"description":{"expressions":["push \"0x20\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C]"}}},{"nodeId":1,"description":{"expressions":["\"0x20\""],"state":"#TOP#"}},{"nodeId":2,"description":{"expressions":["push \"0x10\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C]"}}},{"nodeId":3,"description":{"expressions":["\"0x10\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C]"}}},{"nodeId":4,"description":{"expressions":["gas 1"],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"}}},{"nodeId":5,"description":{"expressions":["not 1"],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"}}},{"nodeId":6,"description":{"expressions":["push \"0x30\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C, C]"}}},{"nodeId":7,"description":{"expressions":["\"0x30\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"}}},{"nodeId":8,"description":{"expressions":["push \"0x10\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C, C, C]"}}},{"nodeId":9,"description":{"expressions":["\"0x10\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C, C]"}}},{"nodeId":10,"description":{"expressions":["addmod 1"],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"}}},{"nodeId":11,"description":{"expressions":["origin 1"],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C, T]"}}},{"nodeId":12,"description":{"expressions":["mstore8 1"],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C]"}}},{"nodeId":13,"description":{"expressions":["push \"0x20\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C, C]"}}},{"nodeId":14,"description":{"expressions":["\"0x20\""],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C, C]"}}},{"nodeId":15,"description":{"expressions":["sstore 1"],"state":{"heap":"monolith","type":"#TOP#","value":"[_|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, _|_, C]"}}},{"nodeId":16,"description":{"expressions":["skip"],"state":"#TOP#"}}]}
10 changes: 10 additions & 0 deletions evm-testcases/taint/example18/example18.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TIMESTAMP
PUSH1 0x20
BLOCKHASH
PUSH1 0x10
PUSH1 0x30
PC
PUSH1 0x20
CODECOPY
DUP1
DUP3
Loading

0 comments on commit 5a00323

Please sign in to comment.