Skip to content

Commit

Permalink
Detector now supports GetCFG() - Storage now supports DescribeLayout() (
Browse files Browse the repository at this point in the history
  • Loading branch information
0x19 authored Apr 20, 2024
1 parent 7e25c86 commit bf390a1
Show file tree
Hide file tree
Showing 22 changed files with 256 additions and 198 deletions.
2 changes: 1 addition & 1 deletion ast/if.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (i *IfStatement) Parse(
break
}

// There can be shorthand...
// There can be single-statement conditional...
body.parseStatements(unit, contractNode, fnNode, statementCtx.GetChild(0))

i.Body = body
Expand Down
4 changes: 2 additions & 2 deletions cfg/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type Builder struct {
// NewBuilder initializes a new CFG builder with the given context and IR builder.
// Returns an error if the provided IR builder is nil or if it does not have a root contract set.
func NewBuilder(ctx context.Context, builder *ir.Builder) (*Builder, error) {
if builder == nil || builder.GetRoot() == nil {
return nil, errors.New("builder is not set")
if builder == nil {
return nil, errors.New("builder is not set (at control flow graph builder)")
}

return &Builder{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"address": "0x1996a91d27202acc016e95c4a3e26c7e6562534a",
"type": "keystore",
"private_key": "",
"public_key": "",
"account": {
"address": "0x1996a91d27202acc016e95c4a3e26c7e6562534a",
"url": "keystore:///home/nevio/dev/unpack/solgo-orig/data/faucets/ethereum/UTC--2024-04-20T16-56-13.513324350Z--1996a91d27202acc016e95c4a3e26c7e6562534a"
},
"password": "c2ltdWxhdG9y",
"network": "ethereum",
"tags": [
"test"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"address": "0x6afe58c134e22a84262d2d59ad61677cddba57e2",
"type": "keystore",
"private_key": "",
"public_key": "",
"account": {
"address": "0x6afe58c134e22a84262d2d59ad61677cddba57e2",
"url": "keystore:///home/nevio/dev/unpack/solgo-orig/data/faucets/ethereum/UTC--2024-04-20T16-55-16.269061466Z--6afe58c134e22a84262d2d59ad61677cddba57e2"
},
"password": "c2ltdWxhdG9y",
"network": "ethereum",
"tags": [
"test"
]
}
2 changes: 1 addition & 1 deletion data/solc/releases/releases.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/tests/audits/ERC20.slither.raw.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/tests/audits/Lottery.slither.raw.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/tests/audits/SimpleStorage.slither.raw.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/tests/audits/TokenSale.slither.raw.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/tests/audits/VulnerableBank.slither.raw.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12018,14 +12018,14 @@
},
"member_name": "get",
"argument_types": [],
"referenced_declaration": 702,
"referenced_declaration": 518,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referenced_declaration": 702,
"referenced_declaration": 518,
"type_description": {
"type_identifier": "t_function_$_t_uint128$",
"type_string": "function(uint128)"
Expand Down Expand Up @@ -12675,14 +12675,14 @@
},
"member_name": "get",
"argument_types": [],
"referenced_declaration": 518,
"referenced_declaration": 543,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referenced_declaration": 518,
"referenced_declaration": 543,
"type_description": {
"type_identifier": "t_function_$_t_uint128$",
"type_string": "function(uint128)"
Expand Down Expand Up @@ -15590,14 +15590,14 @@
},
"member_name": "remove",
"argument_types": [],
"referenced_declaration": 772,
"referenced_declaration": 1233,
"type_description": {
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
"referenced_declaration": 772,
"referenced_declaration": 1233,
"type_description": {
"type_identifier": "t_function_$_t_uint128$",
"type_string": "function(uint128)"
Expand Down Expand Up @@ -16188,14 +16188,14 @@
},
"member_name": "get",
"argument_types": [],
"referenced_declaration": 1155,
"referenced_declaration": 913,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.get"
},
"referenced_declaration": 1155,
"referenced_declaration": 913,
"type_description": {
"type_identifier": "t_function_$_t_uint128$",
"type_string": "function(uint128)"
Expand Down Expand Up @@ -16926,14 +16926,14 @@
},
"member_name": "set",
"argument_types": [],
"referenced_declaration": 731,
"referenced_declaration": 1207,
"type_description": {
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$_t_struct$_IterableMapping_Order_$1130$",
"type_string": "function(struct IterableMapping.Map,uint128,struct IterableMapping.Order)"
},
"text": "tokenIdToOrder.set"
},
"referenced_declaration": 731,
"referenced_declaration": 1207,
"type_description": {
"type_identifier": "t_function_$_t_uint128$_t_address$",
"type_string": "function(uint128,address)"
Expand Down Expand Up @@ -17277,8 +17277,8 @@
"argument_types": [],
"referenced_declaration": 518,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
Expand Down Expand Up @@ -17581,8 +17581,8 @@
"argument_types": [],
"referenced_declaration": 672,
"type_description": {
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
Expand Down Expand Up @@ -17806,8 +17806,8 @@
"argument_types": [],
"referenced_declaration": 672,
"type_description": {
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
Expand Down Expand Up @@ -18092,14 +18092,14 @@
},
"member_name": "size",
"argument_types": [],
"referenced_declaration": 1190,
"referenced_declaration": 786,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$",
"type_string": "function(struct IterableMapping.Map)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.size"
},
"referenced_declaration": 1190,
"referenced_declaration": 786,
"type_description": {
"type_identifier": "t_function_$",
"type_string": "function()"
Expand Down Expand Up @@ -18651,8 +18651,8 @@
"argument_types": [],
"referenced_declaration": 518,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
Expand Down Expand Up @@ -18979,8 +18979,8 @@
"argument_types": [],
"referenced_declaration": 672,
"type_description": {
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
Expand Down Expand Up @@ -19228,8 +19228,8 @@
"argument_types": [],
"referenced_declaration": 786,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$",
"type_string": "function(struct IterableMapping.Map)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.size"
},
Expand Down Expand Up @@ -19704,8 +19704,8 @@
"argument_types": [],
"referenced_declaration": 672,
"type_description": {
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
Expand Down Expand Up @@ -19950,8 +19950,8 @@
"argument_types": [],
"referenced_declaration": 786,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$",
"type_string": "function(struct IterableMapping.Map)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.size"
},
Expand Down Expand Up @@ -20593,14 +20593,14 @@
},
"member_name": "getKeyAtIndex",
"argument_types": [],
"referenced_declaration": 1173,
"referenced_declaration": 803,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint32$",
"type_string": "function(struct IterableMapping.Map,uint32)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.getKeyAtIndex"
},
"referenced_declaration": 1173,
"referenced_declaration": 803,
"type_description": {
"type_identifier": "t_function_$_t_function_$",
"type_string": "function(function())"
Expand Down Expand Up @@ -20775,14 +20775,14 @@
},
"member_name": "get",
"argument_types": [],
"referenced_declaration": 518,
"referenced_declaration": 1155,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.get"
},
"referenced_declaration": 518,
"referenced_declaration": 1155,
"type_description": {
"type_identifier": "t_function_$_t_uint128$",
"type_string": "function(uint128)"
Expand Down Expand Up @@ -21581,14 +21581,14 @@
},
"member_name": "size",
"argument_types": [],
"referenced_declaration": 786,
"referenced_declaration": 839,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$",
"type_string": "function(struct IterableMapping.Map)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.size"
},
"referenced_declaration": 786,
"referenced_declaration": 839,
"type_description": {
"type_identifier": "t_function_$",
"type_string": "function()"
Expand Down Expand Up @@ -22410,8 +22410,8 @@
"argument_types": [],
"referenced_declaration": 518,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
Expand Down Expand Up @@ -23393,14 +23393,14 @@
},
"member_name": "get",
"argument_types": [],
"referenced_declaration": 518,
"referenced_declaration": 543,
"type_description": {
"type_identifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"type_string": "function(struct IterableMapping.Map,uint128)"
"type_identifier": "t_contract$_IterableMapping_$1121",
"type_string": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referenced_declaration": 518,
"referenced_declaration": 543,
"type_description": {
"type_identifier": "t_function_$_t_uint128$",
"type_string": "function(uint128)"
Expand Down
Loading

0 comments on commit bf390a1

Please sign in to comment.