Skip to content

Commit

Permalink
Removal of graphviz as it requires CGO
Browse files Browse the repository at this point in the history
  • Loading branch information
0x19 committed May 7, 2024
1 parent e475a9a commit a8f1853
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 163 deletions.
9 changes: 3 additions & 6 deletions cfg/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ import (
"context"
"errors"

"github.com/goccy/go-graphviz"
"github.com/unpackdev/solgo/ir"
)

// Builder is responsible for constructing the control flow graph (CFG) of Solidity contracts.
// It utilizes the Intermediate Representation (IR) provided by solgo and Graphviz for graph operations.
type Builder struct {
ctx context.Context // Context for the builder operations.
builder *ir.Builder // IR builder from solgo, used for generating the IR of the contracts.
viz *graphviz.Graphviz // Graphviz instance for visualizing the CFG.
graph *Graph // Internal representation of the CFG.
ctx context.Context // Context for the builder operations.
builder *ir.Builder // IR builder from solgo, used for generating the IR of the contracts.
graph *Graph // Internal representation of the CFG.
}

// NewBuilder initializes a new CFG builder with the given context and IR builder.
Expand All @@ -27,7 +25,6 @@ func NewBuilder(ctx context.Context, builder *ir.Builder) (*Builder, error) {
return &Builder{
ctx: ctx,
builder: builder,
viz: graphviz.New(),
graph: NewGraph(),
}, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"7fd57c4c7e6939f51984bdba674b753faa22f103","crypto":{"cipher":"aes-128-ctr","ciphertext":"599886ff30cfb90adc17aa3721ecdbb385bd6668295ac811c57722744865e3a4","cipherparams":{"iv":"18cbd176fcb20e8b5e8dff3f9cab8b18"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"6a9e417bb94b0a7e55ee3f3d73ca057fb1b6a2b83a1a8fddbd7ac7aa199fcb93"},"mac":"0f186098c6cb515b81fa39ccc88c5a5c55d9df637227328f3bfbfe9686df4ee4"},"id":"51db1626-f54c-4fee-b310-1727df5a476d","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"address": "0x30e3dd25fefb75f7a72c3a891ba64f2232d8c69b",
"type": "keystore",
"private_key": "",
"public_key": "",
"account": {
"address": "0x30e3dd25fefb75f7a72c3a891ba64f2232d8c69b",
"url": "keystore:///home/nevio/dev/unpack/solgo-orig/data/faucets/ethereum/UTC--2024-05-07T18-52-44.644622000Z--30e3dd25fefb75f7a72c3a891ba64f2232d8c69b"
},
"password": "c2ltdWxhdG9y",
"network": "ethereum",
"tags": [
"test"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"address": "0xa6cd0a3f561e45dd82456116623d72f44f28c0df",
"type": "keystore",
"private_key": "",
"public_key": "",
"account": {
"address": "0xa6cd0a3f561e45dd82456116623d72f44f28c0df",
"url": "keystore:///home/nevio/dev/unpack/solgo-orig/data/faucets/ethereum/UTC--2024-05-07T18-51-30.345504099Z--a6cd0a3f561e45dd82456116623d72f44f28c0df"
},
"password": "c2ltdWxhdG9y",
"network": "ethereum",
"tags": [
"test"
]
}
2 changes: 1 addition & 1 deletion data/solc/releases/releases.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12018,14 +12018,14 @@
},
"memberName": "get",
"argumentTypes": [],
"referencedDeclaration": 543,
"referencedDeclaration": 995,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referencedDeclaration": 543,
"referencedDeclaration": 995,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$",
"typeString": "function(uint128)"
Expand Down Expand Up @@ -12675,14 +12675,14 @@
},
"memberName": "get",
"argumentTypes": [],
"referencedDeclaration": 702,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referencedDeclaration": 702,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$",
"typeString": "function(uint128)"
Expand Down Expand Up @@ -15590,14 +15590,14 @@
},
"memberName": "remove",
"argumentTypes": [],
"referencedDeclaration": 672,
"referencedDeclaration": 1233,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
"typeIdentifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"typeString": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
"referencedDeclaration": 672,
"referencedDeclaration": 1233,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$",
"typeString": "function(uint128)"
Expand Down Expand Up @@ -16188,14 +16188,14 @@
},
"memberName": "get",
"argumentTypes": [],
"referencedDeclaration": 702,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referencedDeclaration": 702,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$",
"typeString": "function(uint128)"
Expand Down Expand Up @@ -16926,14 +16926,14 @@
},
"memberName": "set",
"argumentTypes": [],
"referencedDeclaration": 731,
"referencedDeclaration": 1207,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
"typeIdentifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$_t_struct$_IterableMapping_Order_$1130$",
"typeString": "function(struct IterableMapping.Map,uint128,struct IterableMapping.Order)"
},
"text": "tokenIdToOrder.set"
},
"referencedDeclaration": 731,
"referencedDeclaration": 1207,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$_t_address$",
"typeString": "function(uint128,address)"
Expand Down Expand Up @@ -17275,14 +17275,14 @@
},
"memberName": "get",
"argumentTypes": [],
"referencedDeclaration": 543,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referencedDeclaration": 543,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$",
"typeString": "function(uint128)"
Expand Down Expand Up @@ -17581,8 +17581,8 @@
"argumentTypes": [],
"referencedDeclaration": 672,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
"typeIdentifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"typeString": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
Expand Down Expand Up @@ -17806,8 +17806,8 @@
"argumentTypes": [],
"referencedDeclaration": 672,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
"typeIdentifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"typeString": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
Expand Down Expand Up @@ -18092,14 +18092,14 @@
},
"memberName": "size",
"argumentTypes": [],
"referencedDeclaration": 839,
"referencedDeclaration": 786,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
},
"text": "tokenIdToOrder.size"
},
"referencedDeclaration": 839,
"referencedDeclaration": 786,
"typeDescription": {
"typeIdentifier": "t_function_$",
"typeString": "function()"
Expand Down Expand Up @@ -18979,8 +18979,8 @@
"argumentTypes": [],
"referencedDeclaration": 672,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
"typeIdentifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"typeString": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
Expand Down Expand Up @@ -19226,14 +19226,14 @@
},
"memberName": "size",
"argumentTypes": [],
"referencedDeclaration": 786,
"referencedDeclaration": 839,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
},
"text": "tokenIdToOrder.size"
},
"referencedDeclaration": 786,
"referencedDeclaration": 839,
"typeDescription": {
"typeIdentifier": "t_function_$",
"typeString": "function()"
Expand Down Expand Up @@ -19702,14 +19702,14 @@
},
"memberName": "remove",
"argumentTypes": [],
"referencedDeclaration": 825,
"referencedDeclaration": 672,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
"typeIdentifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"typeString": "function(struct IterableMapping.Map,uint128)"
},
"text": "tokenIdToOrder.remove"
},
"referencedDeclaration": 825,
"referencedDeclaration": 672,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$",
"typeString": "function(uint128)"
Expand Down Expand Up @@ -20775,14 +20775,14 @@
},
"memberName": "get",
"argumentTypes": [],
"referencedDeclaration": 543,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referencedDeclaration": 543,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$",
"typeString": "function(uint128)"
Expand Down Expand Up @@ -23393,14 +23393,14 @@
},
"memberName": "get",
"argumentTypes": [],
"referencedDeclaration": 1155,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_function_$_t_struct$_IterableMapping_Map_$1144$_t_uint128$",
"typeString": "function(struct IterableMapping.Map,uint128)"
"typeIdentifier": "t_contract$_IterableMapping_$1121",
"typeString": "contract IterableMapping"
},
"text": "tokenIdToOrder.get"
},
"referencedDeclaration": 1155,
"referencedDeclaration": 518,
"typeDescription": {
"typeIdentifier": "t_function_$_t_uint128$",
"typeString": "function(uint128)"
Expand Down
Loading

0 comments on commit a8f1853

Please sign in to comment.